Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r348 - in trunk: . Core/Geometry
- Date: Wed, 25 May 2005 14:24:38 -0600 (MDT)
Author: bigler
Date: Wed May 25 14:24:37 2005
New Revision: 348
Modified:
trunk/Core/Geometry/BBox.h
trunk/MantaTypes.h
Log:
Core/Geometry/BBox.h
Added reset function which sets the state of min and max to
uninitialized. Empty constructor now calls reset.
MantaTypes.h
Comment that Point and Vector types must use Dim = 3.
Modified: trunk/Core/Geometry/BBox.h
==============================================================================
--- trunk/Core/Geometry/BBox.h (original)
+++ trunk/Core/Geometry/BBox.h Wed May 25 14:24:37 2005
@@ -2,6 +2,10 @@
#ifndef Manta_Core_BBox_h
#define Manta_Core_BBox_h
+#include <sgi_stl_warnings_off.h>
+#include <limits>
+#include <sgi_stl_warnings_on.h>
+
namespace Manta {
class BBox {
public:
@@ -9,10 +13,20 @@
: min(min), max(max) {
}
BBox() {
+ // Need to initialize min and max.
+ reset();
}
~BBox() {
}
+ // This resets min and max to an uninitialized state that will
+ // accept new bounds [MAX, -MAX].
+ void reset() {
+ Real max_val = std::numeric_limits<Real>::max();
+ min = Point( max_val, max_val, max_val);
+ max = Point(-max_val, -max_val, -max_val);
+ }
+
Vector diagonal() const {
return max-min;
}
Modified: trunk/MantaTypes.h
==============================================================================
--- trunk/MantaTypes.h (original)
+++ trunk/MantaTypes.h Wed May 25 14:24:37 2005
@@ -14,6 +14,7 @@
// Points/Vectors - forward declarations
template<typename T, int Dim> class PointT;
+ // Point and Vector must always use Dim = 3
typedef PointT<Real, 3> Point;
template<typename T, int Dim> class VectorT;
typedef VectorT<Real, 3> Vector;
- [MANTA] r348 - in trunk: . Core/Geometry, bigler, 05/25/2005
Archive powered by MHonArc 2.6.16.