Changeset 13041 for OpenSceneGraph/trunk/src/osgSim/ShapeAttribute.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgSim/ShapeAttribute.cpp
r12640 r13041 36 36 _integer(value) 37 37 {} 38 38 39 39 ShapeAttribute::ShapeAttribute(const char * name, double value) : 40 40 _name(name), … … 54 54 copy(sa); 55 55 } 56 57 56 57 58 58 ShapeAttribute::~ShapeAttribute() 59 59 { 60 free(); 60 free(); 61 61 } 62 62 63 63 void ShapeAttribute::free() 64 64 { 65 if ((_type == STRING) && (_string)) 65 if ((_type == STRING) && (_string)) 66 66 { 67 67 ::free(_string); … … 72 72 void ShapeAttribute::setValue(const char * value) 73 73 { 74 free(); 75 _type = STRING; 74 free(); 75 _type = STRING; 76 76 _string = (value ? strdup(value) : 0); 77 77 } … … 111 111 { 112 112 if (&sa == this) return *this; 113 113 114 114 free(); 115 115 copy(sa); 116 116 117 117 return *this; 118 118 } … … 123 123 if (_name<sa._name) return -1; 124 124 if (sa._name<_name) return 1; 125 125 126 126 if (_type<sa._type) return -1; 127 127 if (sa._type<_type) return 1; 128 128 129 129 if (_name<sa._name) return -1; 130 130 if (sa._name<_name) return 1; 131 131 132 132 switch (_type) 133 133 { … … 158 158 { 159 159 const_iterator salIt, thisIt, thisEnd = end(); 160 160 161 161 int ret; 162 162 for (thisIt = begin(), salIt = sal.begin(); thisIt!= thisEnd; ++thisIt, ++salIt) 163 if ((ret = thisIt->compare(*salIt)) != 0) return ret; 164 163 if ((ret = thisIt->compare(*salIt)) != 0) return ret; 164 165 165 return 0; 166 166 }
