Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4742 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 30, 2005, 4:38:33 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: BaseObject now only knows setClassID → standartisation

Location:
orxonox/trunk/src
Files:
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/class_id.h

    r4740 r4742  
    1717
    1818/*!
    19     \file class_list.h
    20     \brief list of orxonox classes
     19    \file class_id.h
     20    \brief list of orxonox classID's
    2121
    2222    this File is used to identify an Object with its class and also with its sub/super-classes.
     
    3131*/
    3232
    33 #ifndef _CLASS_LIST_H
    34 #define _CLASS_LIST_H
    35 
    36 
    37 #define ClassDefinition(CLASS_DEFINITION, CLASS_VALUE, CLASS_NAME) \
    38                   CLASS_DEFINITION
     33#ifndef _CLASS_ID_H
     34#define _CLASS_ID_H
    3935
    4036//! list of all classes to be loadable in via the ObjectManager
     
    130126  // Physics stuff (range from 0x00000600 to 0x000007ff)
    131127  CL_PHYSICS_CONNECTION   =    0x00000601,
     128  CL_FIELD_GRAVITY        =    0x00000610,
     129  CL_FIELD_POINT_GRAVITY  =    0x00000611,
     130  CL_FIELD_TWIRL          =    0x00000612,
     131
     132
    132133  // Collision
    133134  CL_COLLISION            =    0x00000611,
     
    177178
    178179
    179 #endif /* _CLASS_LIST_H */
     180#endif /* _CLASS_ID_H */
  • orxonox/trunk/src/lib/collision_detection/cd_engine.cc

    r4710 r4742  
    3131CDEngine::CDEngine ()
    3232{
    33    this->setClassName("CDEngine");
    3433   this->setClassID(CL_CD_ENGINE, "CDEngine");
    3534
  • orxonox/trunk/src/lib/coord/p_node.cc

    r4610 r4742  
    101101void PNode::init(PNode* parent)
    102102{
    103   this->setClassID(CL_PARENT_NODE);
     103  this->setClassID(CL_PARENT_NODE, "PNode");
    104104  this->children = new tList<PNode>();
    105105  this->bRelCoorChanged = true;
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4596 r4742  
    6868void BaseObject::setClassID(long classID, const char* className)
    6969{
    70   this->setClassID(classID);
    71   this->setClassName(className);
    72 }
    73 
    74 
    75 /**
    76    \brief sets the class identifier
    77    \param id a number for the class from class_list.h enumeration
    78 */
    79 void BaseObject::setClassID (long classID)
    80 {
    8170  this->classID |= classID;
    82 }
    83 
    84 
    85 /**
    86    \brief sets the class identifiers
    87    \param className the class name
    88 */
    89 void BaseObject::setClassName(const char* className)
    90 {
    9171  this->className = className;
    9272}
     
    9575  \brief set the name of the Object
    9676 */
    97              void BaseObject::setName (const char* objectName)
     77void BaseObject::setName (const char* objectName)
    9878{
    9979  if (this->objectName)
  • orxonox/trunk/src/lib/lang/base_object.h

    r4595 r4742  
    44
    55    This is a global handler for all classes.
    6 
    7     \todo isA()
    86*/
    97
     
    1210#define _BASE_OBJECT_H
    1311
    14 #include "class_list.h"
     12#include "class_id.h"
    1513#ifndef NULL
    1614#define NULL 0x0        //!< NULL
     
    4543
    4644 protected:
    47   void setClassID(long classID);
    48   void setClassName(const char* className);
    4945  void setClassID(long classID, const char* className);
    5046
     
    5248  void finalize(void) { this->finalized = true; };
    5349
    54  private:
    55   const char*    className;        //!< the name of the class
    56   long           classID;          //!< this is the id from the class_list.h enumeration
    57   char*          objectName;       //!< The name of this object
     50  private:
     51    static void addToClassList(BaseObject* object, ClassID id, const char* className);
    5852
    59   bool           finalized;        //!< is true if the object is ready to be garbage collected
     53  private:
     54    const char*        className;        //!< the name of the class
     55    long               classID;          //!< this is the id from the class_list.h enumeration
     56    char*              objectName;       //!< The name of this object
     57
     58    bool               finalized;        //!< is true if the object is ready to be garbage collected
     59
     60//    static ClassList*  classList;
    6061};
    6162
  • orxonox/trunk/src/lib/physics/fields/gravity.cc

    r4730 r4742  
    2525CREATE_FACTORY(Gravity);
    2626
    27 /**
    28    \brief standard constructor
    29    \todo this constructor is not jet implemented - do it
    30 */
    31 Gravity::Gravity ()
    32 {
    33    this->setClassName("Gravity");
    34 }
    35 
    3627Gravity::Gravity(const TiXmlElement* root)
    3728{
    38   this->setClassName("Gravity");
     29  this->setClassID(CL_FIELD_GRAVITY, "Gravity");
    3930
    40   this->loadParams(root);
     31  if (root != NULL)
     32    this->loadParams(root);
    4133}
    4234
  • orxonox/trunk/src/lib/physics/fields/gravity.h

    r4728 r4742  
    1818
    1919 public:
    20   Gravity();
    21   Gravity(const TiXmlElement* root);
     20  Gravity(const TiXmlElement* root = NULL);
    2221  virtual ~Gravity();
    2322
  • orxonox/trunk/src/lib/physics/fields/point_gravity.cc

    r4395 r4742  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 PointGravity::PointGravity () 
     27PointGravity::PointGravity ()
    2828{
    29    this->setClassName ("PointGravity");
     29   this->setClassID(CL_FIELD_POINT_GRAVITY, "PointGravity");
    3030}
    3131
     
    3535
    3636*/
    37 PointGravity::~PointGravity () 
     37PointGravity::~PointGravity ()
    3838{
    3939  // delete what has to be deleted here
  • orxonox/trunk/src/lib/physics/fields/twirl.cc

    r4395 r4742  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2525   \todo this constructor is not jet implemented - do it
    2626*/
    27 Twirl::Twirl () 
     27Twirl::Twirl ()
    2828{
    29    this->setClassName ("Twirl");
     29   this->setClassID(CL_FIELD_TWIRL, "Twirl");
    3030}
    3131
     
    3535
    3636*/
    37 Twirl::~Twirl () 
     37Twirl::~Twirl ()
    3838{
    3939  // delete what has to be deleted here
Note: See TracChangeset for help on using the changeset viewer.