Changeset 1486 for GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
- Timestamp:
- 09/25/06 18:54:21 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r1415 r1486 35 35 /** initialization to the non existing bounding box 36 36 */ 37 void Initialize() { 38 mMin = Vector3(MAXFLOAT); 39 mMax = Vector3(-MAXFLOAT); 40 } 37 void Initialize(); 41 38 42 39 /** The center of the box 43 40 */ 44 Vector3 Center() const { return 0.5 * (mMin + mMax); }41 Vector3 Center() const; 45 42 46 43 /** The diagonal of the box 47 44 */ 48 Vector3 Diagonal() const { return (mMax -mMin); } 49 50 float Center(const int axis) const { 51 return 0.5f * (mMin[axis] + mMax[axis]); 52 } 53 54 float Min(const int axis) const { 55 return mMin[axis]; 56 } 57 58 float Max(const int axis) const { 59 return mMax[axis]; 60 } 61 62 float Size(const int axis) const { 63 return Max(axis) - Min(axis); 64 } 45 Vector3 Diagonal() const; 46 47 float Center(const int axis) const; 48 49 float Min(const int axis) const; 50 51 float Max(const int axis) const; 52 53 float Size(const int axis) const; 65 54 66 55 // Read-only const access tomMin and max vectors using references 67 const Vector3& Min() const { return mMin;} 68 const Vector3& Max() const { return mMax;} 69 70 void Enlarge (const Vector3 &v) { 71 mMax += v; 72 mMin -= v; 73 } 74 75 void SetMin(const Vector3 &v) { 76 mMin = v; 77 } 78 79 void SetMax(const Vector3 &v) { 80 mMax = v; 81 } 82 83 void SetMin(int axis, const float value) { 84 mMin[axis] = value; 85 } 86 87 void SetMax(int axis, const float value) { 88 mMax[axis] = value; 89 } 56 const Vector3& Min() const; 57 const Vector3& Max() const; 58 59 void Enlarge (const Vector3 &v); 60 61 void SetMin(const Vector3 &v); 62 63 void SetMax(const Vector3 &v); 64 65 void SetMin(int axis, const float value); 66 67 void SetMax(int axis, const float value); 90 68 91 69 // Decrease box by given splitting plane 92 void Reduce(int axis, int right, float value) { 93 if ( (value >=mMin[axis]) && (value <= mMax[axis]) ) 94 if (right) 95 mMin[axis] = value; 96 else 97 mMax[axis] = value; 98 } 99 70 void Reduce(int axis, int right, float value); 100 71 101 72 102 73 // the size of the box along all the axes 103 Vector3 Size() const { return mMax - mMin; }74 Vector3 Size() const; 104 75 105 76 // Return whether the box is unbounded. Unbounded boxes appear
Note: See TracChangeset
for help on using the changeset viewer.