• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

src/ModelObject.hh

00001 /*
00002  * Copyright Staffan Gimåker 2006-2010.
00003  *
00004  * ---
00005  *
00006  * This file is part of peekabot.
00007  *
00008  * peekabot is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * peekabot is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 
00023 #ifndef PEEKABOT_MODEL_OBJECT_HH_INCLUDED
00024 #define PEEKABOT_MODEL_OBJECT_HH_INCLUDED
00025 
00026 
00027 #include "SceneObject.hh"
00028 #include "ScalableObject.hh"
00029 #include "ObjectVisitor.hh"
00030 #include "HandlerInformer.hh"
00031 #include "Path.hh"
00032 
00033 #include <string>
00034 
00035 
00036 namespace peekabot
00037 {
00038     class ScopedHandler;
00039 
00045     class ModelObject : public SceneObject, public ScalableObject
00046     {
00047     public:
00052         ModelObject(const Path &model_path);
00053 
00056         ModelObject(ScopedHandler *handler);
00057 
00062         //void set_texture(std::string texture_file_name) {}
00063 
00064         virtual void accept(ObjectVisitor* visitor) throw();
00065 
00066         virtual ObjectType get_object_type() const;
00067 
00068         const Path &get_model_path() const;
00069 
00070         void set_model_path(const Path &path);
00071 
00072     protected:
00073         virtual PropMap &get_prop_adapters();
00074 
00075     private:
00076         static void create_prop_adapters(PropMap &adapters);
00077 
00080 
00083         static void start_handler(
00084             const std::string & name,
00085             XMLHandler::AttributeMap &attributes,
00086             ScopedHandler *handler) throw();
00087 
00090         void file_start_handler(
00091             const std::string & name,
00092             XMLHandler::AttributeMap &attributes,
00093             ScopedHandler *handler) throw();
00094 
00097         void file_cdata_handler(
00098             const std::string &cdata,
00099             ScopedHandler *handler);
00100 
00102 
00103     private:
00104         Path m_model_path;
00105 
00106         static HandlerInformer ms_handler_informer;
00107     };
00108 }
00109 
00110 
00111 #endif // PEEKABOT_MODEL_OBJECT_HH_INCLUDED

Generated on Sun Jan 30 2011 for peekabot by  doxygen 1.7.1