Changeset 13041 for OpenSceneGraph/trunk/include/osgSim/ShapeAttribute
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgSim/ShapeAttribute
r12636 r13041 26 26 { 27 27 public: 28 /// ShapeAttribute data type. 28 /// ShapeAttribute data type. 29 29 enum Type 30 30 { … … 34 34 STRING 35 35 }; 36 36 37 37 ShapeAttribute(); 38 38 ShapeAttribute(const char * name); 39 39 ShapeAttribute(const char * name, int value); 40 40 ShapeAttribute(const char * name, double value); 41 41 42 42 /** Note, ShapeAttribute takes a copy of both name and value, the calling code should manage its own clean up of the original strings.*/ 43 43 ShapeAttribute(const char * name, const char * value); 44 44 45 45 ShapeAttribute(const ShapeAttribute & sa); 46 46 47 47 ~ShapeAttribute(); 48 48 49 49 ShapeAttribute& operator = (const ShapeAttribute& sa); 50 50 51 51 /** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/ 52 52 int compare(const osgSim::ShapeAttribute& sa) const; … … 64 64 /// Get the attribute data type. 65 65 const Type getType() const { return _type; } 66 66 67 67 /// Get the attribute data as an int. 68 68 int getInt() const { return _integer; } … … 73 73 /// Get the attribute data as a string. 74 74 const char * getString() const { return _string; } 75 75 76 76 /// Set an integer attribute data. 77 77 void setValue(int value) { free(); _type = INTEGER; _integer = value; } … … 83 83 void setValue(const char * value); 84 84 85 85 86 86 private: 87 87 88 88 void free(); 89 89 void copy(const ShapeAttribute& sa); 90 90 91 91 std::string _name; 92 92 Type _type; 93 93 94 94 union 95 95 { … … 104 104 public: 105 105 META_Object(osgSim, ShapeAttributeList) 106 106 107 107 ShapeAttributeList(): 108 108 Object() 109 109 {} 110 110 111 111 /** Copy constructor, optional CopyOp object can be used to control 112 112 * shallow vs deep copying of dynamic data.*/ … … 116 116 { 117 117 } 118 118 119 119 /** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/ 120 120 virtual int compare(const osgSim::ShapeAttributeList& sal) const; 121 121 122 122 protected: 123 123 virtual ~ShapeAttributeList() {}
