Permalink
Browse files

Updated OpenVDB (OSX) to 2.2.0, rebuilt OpenEXR (OSX) with GCC4.8 ins…

…tead of Clang
  • Loading branch information...
1 parent 711298a commit 52cce41579d9557e5bd64f3a5085dd4cc80c619c @betajippity committed Mar 4, 2014
Showing with 1,924 additions and 851 deletions.
  1. +56 −16 include/openvdb/Grid.h
  2. +25 −0 include/openvdb/Platform.h
  3. +1 −1 include/openvdb/Types.h
  4. +19 −14 include/openvdb/io/Compression.h
  5. +235 −164 include/openvdb/math/FiniteDifference.h
  6. +1 −1 include/openvdb/math/Maps.h
  7. +91 −74 include/openvdb/math/Mat.h
  8. +1 −3 include/openvdb/math/Mat4.h
  9. +5 −0 include/openvdb/math/Math.h
  10. +171 −161 include/openvdb/math/Operators.h
  11. +14 −3 include/openvdb/math/Ray.h
  12. +11 −6 include/openvdb/math/Stencils.h
  13. +19 −0 include/openvdb/math/Vec2.h
  14. +20 −0 include/openvdb/math/Vec3.h
  15. +22 −0 include/openvdb/math/Vec4.h
  16. +19 −0 include/openvdb/tools/Composite.h
  17. +2 −1 include/openvdb/tools/Dense.h
  18. +7 −4 include/openvdb/tools/Filter.h
  19. +201 −97 include/openvdb/tools/GridOperators.h
  20. +1 −1 include/openvdb/tools/GridTransformer.h
  21. +88 −25 include/openvdb/tools/Interpolation.h
  22. +5 −2 include/openvdb/tools/LevelSetFilter.h
  23. +8 −16 include/openvdb/tools/LevelSetMorph.h
  24. +1 −1 include/openvdb/tools/LevelSetRebuild.h
  25. +71 −25 include/openvdb/tools/MeshToVolume.h
  26. +17 −8 include/openvdb/tools/Morphology.h
  27. +288 −84 include/openvdb/tools/RayIntersector.h
  28. +225 −24 include/openvdb/tools/RayTracer.h
  29. +158 −0 include/openvdb/tools/VectorTransformer.h
  30. +54 −42 include/openvdb/tools/VolumeToMesh.h
  31. +68 −49 include/openvdb/tools/VolumeToSpheres.h
  32. +5 −5 include/openvdb/tree/LeafNodeBool.h
  33. +12 −13 include/openvdb/tree/Tree.h
  34. +1 −9 include/openvdb/util/MapsUtil.h
  35. +2 −2 include/openvdb/version.h
  36. BIN lib/osx/libHalf.a
  37. BIN lib/osx/libIex.a
  38. BIN lib/osx/libIexMath.a
  39. BIN lib/osx/libIlmImf.a
  40. BIN lib/osx/libIlmThread.a
  41. BIN lib/osx/libImath.a
  42. BIN lib/osx/libopenvdb.a
View
@@ -417,7 +417,7 @@ typedef boost::shared_ptr<GridCPtrSet> GridCPtrSetPtr;
/// @brief Predicate functor that returns @c true for grids that have a specified name
struct OPENVDB_API GridNamePred
{
- GridNamePred(const Name& name): name(name) {}
+ GridNamePred(const Name& _name): name(_name) {}
bool operator()(const GridBase::ConstPtr& g) const { return g && g->getName() == name; }
Name name;
};
@@ -632,35 +632,42 @@ class Grid: public GridBase
/// value maps to a voxel if the corresponding value already mapped to a voxel
/// OR if it is a voxel in the other grid. Thus, a resulting value can only
/// map to a tile if the corresponding value already mapped to a tile
- /// AND if it is a tile value in other grid.
+ /// AND if it is a tile value in the other grid.
///
/// @note This operation modifies only active states, not values.
/// Specifically, active tiles and voxels in this grid are not changed, and
/// tiles or voxels that were inactive in this grid but active in the other grid
/// are marked as active in this grid but left with their original values.
template<typename OtherTreeType>
- void topologyUnion(const Grid<OtherTreeType>& other) { tree().topologyUnion(other.tree()); }
+ void topologyUnion(const Grid<OtherTreeType>& other);
- /// @brief Intersects this tree's set of active values with the active values
- /// of the other tree, whose @c ValueType may be different.
- /// @details The resulting state of a value is active only if the corresponding
+ /// @brief Intersect this grid's set of active values with the active values
+ /// of the other grid, whose value type may be different.
+ /// @details The resulting state of a value is active only if the corresponding
/// value was already active AND if it is active in the other tree. Also, a
/// resulting value maps to a voxel if the corresponding value
/// already mapped to an active voxel in either of the two grids
/// and it maps to an active tile or voxel in the other grid.
///
- /// @note This operation can delete branches in this grid if they
- /// overlap with inactive tiles in the other grid. Likewise active
- /// voxels can be turned into unactive voxels resulting in leaf
- /// nodes with no active values. Thus, it is recommended to
- /// subsequently call prune.
+ /// @note This operation can delete branches of this grid that overlap with
+ /// inactive tiles in the other grid. Also, because it can deactivate voxels,
+ /// it can create leaf nodes with no active values. Thus, it is recommended
+ /// to prune this grid after calling this method.
template<typename OtherTreeType>
- void topologyIntersection(const Grid<OtherTreeType>& other)
- {
- tree().topologyIntersection(other.tree());
- }
+ void topologyIntersection(const Grid<OtherTreeType>& other);
- /// @todo topologyDifference
+ /// @brief Difference this grid's set of active values with the active values
+ /// of the other grid, whose value type may be different.
+ /// @details After this method is called, voxels in this grid will be active
+ /// only if they were active to begin with and if the corresponding voxels
+ /// in the other grid were inactive.
+ ///
+ /// @note This operation can delete branches of this grid that overlap with
+ /// active tiles in the other grid. Also, because it can deactivate voxels,
+ /// it can create leaf nodes with no active values. Thus, it is recommended
+ /// to prune this grid after calling this method.
+ template<typename OtherTreeType>
+ void topologyDifference(const Grid<OtherTreeType>& other);
//
// Statistics
@@ -1106,6 +1113,9 @@ Grid<TreeT>::newTree()
}
+////////////////////////////////////////
+
+
template<typename TreeT>
inline void
Grid<TreeT>::fill(const CoordBBox& bbox, const ValueType& value, bool active)
@@ -1139,6 +1149,36 @@ Grid<TreeT>::merge(Grid& other, MergePolicy policy)
template<typename TreeT>
+template<typename OtherTreeType>
+inline void
+Grid<TreeT>::topologyUnion(const Grid<OtherTreeType>& other)
+{
+ tree().topologyUnion(other.tree());
+}
+
+
+template<typename TreeT>
+template<typename OtherTreeType>
+inline void
+Grid<TreeT>::topologyIntersection(const Grid<OtherTreeType>& other)
+{
+ tree().topologyIntersection(other.tree());
+}
+
+
+template<typename TreeT>
+template<typename OtherTreeType>
+inline void
+Grid<TreeT>::topologyDifference(const Grid<OtherTreeType>& other)
+{
+ tree().topologyDifference(other.tree());
+}
+
+
+////////////////////////////////////////
+
+
+template<typename TreeT>
inline void
Grid<TreeT>::evalMinMax(ValueType& minVal, ValueType& maxVal) const
{
View
@@ -55,6 +55,31 @@
#define OPENVDB_CHECK_GCC(MAJOR, MINOR) 0
#endif
+/// Macro for determining if there are sufficient C++0x/C++11 features
+#ifdef __INTEL_COMPILER
+ #ifdef __INTEL_CXX11_MODE__
+ #define OPENVDB_HAS_CXX11 1
+ #endif
+#elif defined(__clang__)
+ #ifndef _LIBCPP_VERSION
+ #include <ciso646>
+ #endif
+ #ifdef _LIBCPP_VERSION
+ #define OPENVDB_HAS_CXX11 1
+ #endif
+#elif defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus > 199711L)
+ #define OPENVDB_HAS_CXX11 1
+#elif defined(_MSC_VER)
+ #if (_MSC_VER >= 1700)
+ #define OPENVDB_HAS_CXX11 1
+ #endif
+#endif
+#if defined(__GNUC__) && !OPENVDB_CHECK_GCC(4, 4)
+ // ICC uses GCC's standard library headers, so even if the ICC version
+ // is recent enough for C++11, the GCC version might not be.
+ #undef OPENVDB_HAS_CXX11
+#endif
+
/// For compilers that need templated function specializations to have
/// storage qualifiers, we need to declare the specializations as static inline.
/// Otherwise, we'll get linker errors about multiply defined symbols.
View
@@ -306,7 +306,7 @@ class CombineArgs
template<typename ValueType, typename CombineOp>
struct SwappedCombineOp
{
- SwappedCombineOp(CombineOp& op): op(op) {}
+ SwappedCombineOp(CombineOp& _op): op(_op) {}
void operator()(CombineArgs<ValueType>& args)
{
@@ -86,7 +86,8 @@ enum {
/*2*/ NO_MASK_AND_ONE_INACTIVE_VAL, // all inactive vals have the same non-background val
/*3*/ MASK_AND_NO_INACTIVE_VALS, // mask selects between -background and +background
/*4*/ MASK_AND_ONE_INACTIVE_VAL, // mask selects between backgd and one other inactive val
- /*5*/ MASK_AND_TWO_INACTIVE_VALS // mask selects between two non-background inactive vals
+ /*5*/ MASK_AND_TWO_INACTIVE_VALS, // mask selects between two non-background inactive vals
+ /*6*/ NO_MASK_AND_ALL_VALS // > 2 inactive vals, so no mask compression at all
};
@@ -282,7 +283,7 @@ readCompressedValues(std::istream& is, ValueT* destBuf, Index destCount,
zipped = compression & COMPRESS_ZIP,
maskCompressed = compression & COMPRESS_ACTIVE_MASK;
- int8_t metadata = NO_MASK_OR_INACTIVE_VALS;
+ int8_t metadata = NO_MASK_AND_ALL_VALS;
if (getFormatVersion(is) >= OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION) {
// Read the flag that specifies what, if any, additional metadata
// (selection mask and/or inactive value(s)) is saved.
@@ -297,9 +298,9 @@ readCompressedValues(std::istream& is, ValueT* destBuf, Index destCount,
ValueT inactiveVal0 =
((metadata == NO_MASK_OR_INACTIVE_VALS) ? background : math::negative(background));
- if (metadata != NO_MASK_OR_INACTIVE_VALS &&
- metadata != NO_MASK_AND_MINUS_BG &&
- metadata != MASK_AND_NO_INACTIVE_VALS)
+ if (metadata == NO_MASK_AND_ONE_INACTIVE_VAL ||
+ metadata == MASK_AND_ONE_INACTIVE_VAL ||
+ metadata == MASK_AND_TWO_INACTIVE_VALS)
{
// Read one of at most two distinct inactive values.
is.read(reinterpret_cast<char*>(&inactiveVal0), sizeof(ValueT));
@@ -310,9 +311,9 @@ readCompressedValues(std::istream& is, ValueT* destBuf, Index destCount,
}
MaskT selectionMask;
- if (metadata != NO_MASK_OR_INACTIVE_VALS &&
- metadata != NO_MASK_AND_MINUS_BG &&
- metadata != NO_MASK_AND_ONE_INACTIVE_VAL)
+ if (metadata == MASK_AND_NO_INACTIVE_VALS ||
+ metadata == MASK_AND_ONE_INACTIVE_VAL ||
+ metadata == MASK_AND_TWO_INACTIVE_VALS)
{
// For use in mask compression (only), read the bitmask that selects
// between two distinct inactive values.
@@ -323,7 +324,9 @@ readCompressedValues(std::istream& is, ValueT* destBuf, Index destCount,
boost::scoped_array<ValueT> scopedTempBuf;
Index tempCount = destCount;
- if (maskCompressed && getFormatVersion(is) >= OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION) {
+ if (maskCompressed && metadata != NO_MASK_AND_ALL_VALS
+ && getFormatVersion(is) >= OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION)
+ {
tempCount = valueMask.countOn();
if (tempCount != destCount) {
// If this node has inactive voxels, allocate a temporary buffer
@@ -395,7 +398,7 @@ writeCompressedValues(std::ostream& os, ValueT* srcBuf, Index srcCount,
ValueT* tempBuf = srcBuf;
boost::scoped_array<ValueT> scopedTempBuf;
- int8_t metadata = NO_MASK_OR_INACTIVE_VALS;
+ int8_t metadata = NO_MASK_AND_ALL_VALS;
if (!maskCompress) {
os.write(reinterpret_cast<const char*>(&metadata), /*bytes=*/1);
@@ -478,13 +481,15 @@ writeCompressedValues(std::ostream& os, ValueT* srcBuf, Index srcCount,
metadata = MASK_AND_ONE_INACTIVE_VAL;
}
}
+ } else if (numUniqueInactiveVals > 2) {
+ metadata = NO_MASK_AND_ALL_VALS;
}
os.write(reinterpret_cast<const char*>(&metadata), /*bytes=*/1);
- if (metadata != NO_MASK_OR_INACTIVE_VALS &&
- metadata != NO_MASK_AND_MINUS_BG &&
- metadata != MASK_AND_NO_INACTIVE_VALS)
+ if (metadata == NO_MASK_AND_ONE_INACTIVE_VAL ||
+ metadata == MASK_AND_ONE_INACTIVE_VAL ||
+ metadata == MASK_AND_TWO_INACTIVE_VALS)
{
if (!toHalf) {
// Write one of at most two distinct inactive values.
@@ -505,7 +510,7 @@ writeCompressedValues(std::ostream& os, ValueT* srcBuf, Index srcCount,
}
}
- if (metadata == NO_MASK_OR_INACTIVE_VALS && numUniqueInactiveVals > 2) {
+ if (metadata == NO_MASK_AND_ALL_VALS) {
// If there are more than two unique inactive values, the entire input buffer
// needs to be saved (both active and inactive values).
/// @todo Save the selection mask as long as most of the inactive values
Oops, something went wrong.

0 comments on commit 52cce41

Please sign in to comment.