Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1657 - in trunk/Core: Color Geometry
- Date: Thu, 16 Aug 2007 17:18:22 -0600 (MDT)
Author: boulos
Date: Thu Aug 16 17:18:22 2007
New Revision: 1657
Modified:
trunk/Core/Color/ColorSpace_fancy.h
trunk/Core/Geometry/BBox.h
Log:
Core/Color/ColorSpace_fancy.h
Adding include guards just in case you try to use this in a header.
You should probably be including MantaTypes.h instead if you're
looking to forward declare, etc.
Core/Geometry/BBox.h
Bug fix for getCorner (was missing shifts).
Modified: trunk/Core/Color/ColorSpace_fancy.h
==============================================================================
--- trunk/Core/Color/ColorSpace_fancy.h (original)
+++ trunk/Core/Color/ColorSpace_fancy.h Thu Aug 16 17:18:22 2007
@@ -1,3 +1,6 @@
+#ifndef MANTA_CORE_COLOR_COLORSPACE_FANCY_H_
+#define MANTA_CORE_COLOR_COLORSPACE_FANCY_H_
+
#include <Core/Color/ColorSpace.h>
#include <sgi_stl_warnings_off.h>
@@ -6,7 +9,7 @@
#include <sgi_stl_warnings_on.h>
namespace Manta {
-
+
template<typename Traits>
std::string ColorSpace<Traits>::toString() const {
std::ostringstream out;
@@ -21,3 +24,5 @@
}
} // end namespace Manta
+
+#endif // MANTA_CORE_COLOR_COLORSPACE_FANCY_H_
Modified: trunk/Core/Geometry/BBox.h
==============================================================================
--- trunk/Core/Geometry/BBox.h (original)
+++ trunk/Core/Geometry/BBox.h Thu Aug 16 17:18:22 2007
@@ -12,7 +12,7 @@
namespace Manta {
class BBox {
public:
-
+
BBox(const Vector& min_, const Vector& max_ ) {
bounds[0] = min_;
bounds[1] = max_;
@@ -37,7 +37,7 @@
}
#endif
-
+
// This resets min and max to an uninitialized state that will
// accept new bounds [MAX, -MAX].
void reset() {
@@ -50,7 +50,7 @@
bounds[0] = min_;
bounds[1] = max_;
}
-
+
// Test whether the box is in the "uninitialized state"
bool isDefault() const {
Real max_val = std::numeric_limits<Real>::max();
@@ -69,7 +69,7 @@
bounds[0] = Min(bounds[0], p);
bounds[1] = Max(bounds[1], p);
}
-
+
void extendBySphere(const Vector& p, Real radius) {
bounds[0] = Min(bounds[0], p-Vector(radius, radius, radius));
bounds[1] = Max(bounds[1], p+Vector(radius, radius, radius));
@@ -101,7 +101,9 @@
}
Vector getCorner(int i) const {
- return Vector(bounds[i&4].x(), bounds[i&2].y(), bounds[i&1].z());
+ return Vector(bounds[(i&4)>>2].x(),
+ bounds[(i&2)>>1].y(),
+ bounds[i&1].z());
}
double computeVolume() const
@@ -128,7 +130,7 @@
#ifndef SWIG
inline Vector &operator[] (int i) { return bounds[i]; }
inline const Vector &operator[] (int i) const { return bounds[i]; }
-#endif
+#endif
private:
Vector bounds[2];
};
- [Manta] r1657 - in trunk/Core: Color Geometry, boulos, 08/16/2007
Archive powered by MHonArc 2.6.16.