- Timestamp:
- Jun 1, 2005, 12:50:07 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/p_node.cc
r4435 r4436 29 29 #include "vector.h" 30 30 #include "null_parent.h" 31 #include "load_param.h" 31 32 32 33 //#include "vector.h" … … 45 46 init(NULL); 46 47 47 NullParent* np = NullParent::getInstance(); 48 np->addChild(this); 49 } 50 48 NullParent::getInstance()->addChild(this); 49 } 50 51 PNode::PNode(const TiXmlElement* root) 52 { 53 this->init(NULL); 54 NullParent::getInstance()->addChild(this); 55 } 51 56 52 57 … … 87 92 } 88 93 89 90 94 void PNode::init(PNode* parent) 91 95 { … … 98 102 } 99 103 100 104 void PNode::loadParams(const TiXmlElement* root) 105 { 106 static_cast<BaseObject*>(this)->loadParams(root); 107 } 101 108 102 109 /** -
orxonox/trunk/src/lib/coord/p_node.h
r4435 r4436 29 29 //class Quaternion; 30 30 //class Vector; 31 class TiXmlElement; 31 32 template<class T> class tList; 32 33 … … 49 50 public: 50 51 PNode (); 52 PNode(const TiXmlElement* root); 51 53 PNode (const Vector& absCoordinate, PNode* pNode); 52 54 virtual ~PNode (); 55 56 void loadParams(const TiXmlElement* root); 57 53 58 54 59 PNode* parent; //!< a pointer to the parent node -
orxonox/trunk/src/lib/lang/base_object.cc
r4435 r4436 18 18 19 19 #include "base_object.h" 20 #include "stdincl.h" 21 20 #include "load_param.h" 22 21 23 22 using namespace std; … … 25 24 26 25 /** 27 \brief standard constructor 26 \brief sets the name from a LoadXML-Element 27 \param root the element to load from 28 28 */ 29 BaseObject::BaseObject ()29 BaseObject::BaseObject(const TiXmlElement* root) 30 30 { 31 31 this->className = NULL; … … 34 34 35 35 this->objectName = NULL; 36 37 if (root) 38 this->loadParams(root); 36 39 } 37 38 40 39 41 /** … … 47 49 } 48 50 51 /** 52 \brief loads parameters 53 \param root the element to load from 54 */ 55 void BaseObject::loadParams(const TiXmlElement* root) 56 { 57 // name setup 58 LoadParam<BaseObject>(root, "name", this, &BaseObject::setName) 59 .describe("the name of the Object at hand"); 60 } 49 61 50 62 /** -
orxonox/trunk/src/lib/lang/base_object.h
r4435 r4436 9 9 10 10 #include "class_list.h" 11 #ifndef NULL 12 #define NULL 0x0 13 #endif 14 15 class TiXmlElement; 11 16 12 17 //! A class all other classes are derived from … … 14 19 15 20 public: 16 BaseObject ( );21 BaseObject (const TiXmlElement* root = NULL); 17 22 virtual ~BaseObject (); 23 24 void loadParams(const TiXmlElement* root); 18 25 19 26 void setClassID(int id); -
orxonox/trunk/src/lib/particles/particle_system.cc
r4434 r4436 85 85 if (this->material) 86 86 delete this->material; 87 }88 89 /**90 \brief sets the Name of the Particle System91 \param name the Name of the System92 */93 void ParticleSystem::setName(const char* name)94 {95 if (this->name)96 delete this->name;97 this->name = new char[strlen(name)+1];98 strcpy(this->name, name);99 }100 101 /**102 \returns the Name of the ParticleSystem103 */104 const char* ParticleSystem::getName(void) const105 {106 return this->name;107 87 } 108 88 -
orxonox/trunk/src/lib/particles/particle_system.h
r4434 r4436 68 68 PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE); 69 69 virtual ~ParticleSystem(); 70 void setName(const char* name);71 const char* getName(void) const;72 70 73 71 void setType(PARTICLE_TYPE particleType, int count = 0); -
orxonox/trunk/src/world_entities/skybox.cc
r4357 r4436 45 45 } 46 46 47 SkyBox::SkyBox(const TiXmlElement* root) : WorldEntity(root)47 SkyBox::SkyBox(const TiXmlElement* root) 48 48 { 49 49 this->preInit(); … … 56 56 void SkyBox::loadParams(const TiXmlElement* root) 57 57 { 58 static_cast<WorldEntity*>(this)->loadParams(root); 59 58 60 LoadParam<SkyBox>(root, "Materialset", this, &SkyBox::setTexture) 59 61 .describe("Sets the material on the SkyBox. The string must be the path relative to the data-dir, and without a trailing .jpg"); -
orxonox/trunk/src/world_entities/world_entity.cc
r4435 r4436 39 39 } 40 40 41 void WorldEntity::loadParams(const TiXmlElement* root)42 {43 // name setup44 // LoadParam<WorldEntity>(root, "name", this, &BaseObject::setName)45 // .describe("the name of the Object at hand");46 47 // Model Loading48 LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel)49 .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)") ;50 }51 52 41 /** 53 42 \brief standard destructor … … 58 47 if (this->model) 59 48 ResourceManager::getInstance()->unload(this->model); 49 } 50 51 void WorldEntity::loadParams(const TiXmlElement* root) 52 { 53 static_cast<PNode*>(this)->loadParams(root); 54 // Model Loading 55 LoadParam<WorldEntity>(root, "model", this, &WorldEntity::loadModel) 56 .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)") ; 60 57 } 61 58
Note: See TracChangeset
for help on using the changeset viewer.