[Bf-blender-cvs] [724750f] soc-2013-cycles_volume: Updated OpenVDB library to 2.3.0;

Rafael Campos noreply at git.blender.org
Wed Apr 30 21:54:44 CEST 2014


Commit: 724750f47d836df1e71a538283e1c99f4e69f8fc
Author: Rafael Campos
Date:   Wed Apr 30 16:47:09 2014 -0300
https://developer.blender.org/rB724750f47d836df1e71a538283e1c99f4e69f8fc

Updated OpenVDB library to 2.3.0;

===================================================================

M	extern/openvdb/CMakeLists.txt
M	extern/openvdb/internal/openvdb/Grid.h
M	extern/openvdb/internal/openvdb/Platform.h
M	extern/openvdb/internal/openvdb/Types.h
M	extern/openvdb/internal/openvdb/io/Archive.cc
M	extern/openvdb/internal/openvdb/io/Archive.h
M	extern/openvdb/internal/openvdb/io/Compression.h
M	extern/openvdb/internal/openvdb/io/File.cc
M	extern/openvdb/internal/openvdb/io/File.h
M	extern/openvdb/internal/openvdb/io/GridDescriptor.cc
A	extern/openvdb/internal/openvdb/io/Queue.cc
A	extern/openvdb/internal/openvdb/io/Queue.h
M	extern/openvdb/internal/openvdb/io/Stream.cc
M	extern/openvdb/internal/openvdb/io/Stream.h
M	extern/openvdb/internal/openvdb/math/BBox.h
M	extern/openvdb/internal/openvdb/math/Coord.h
A	extern/openvdb/internal/openvdb/math/DDA.h
M	extern/openvdb/internal/openvdb/math/FiniteDifference.h
M	extern/openvdb/internal/openvdb/math/Hermite.h
M	extern/openvdb/internal/openvdb/math/LegacyFrustum.h
M	extern/openvdb/internal/openvdb/math/Maps.cc
M	extern/openvdb/internal/openvdb/math/Maps.h
M	extern/openvdb/internal/openvdb/math/Mat.h
M	extern/openvdb/internal/openvdb/math/Mat3.h
M	extern/openvdb/internal/openvdb/math/Mat4.h
M	extern/openvdb/internal/openvdb/math/Math.h
M	extern/openvdb/internal/openvdb/math/Operators.h
M	extern/openvdb/internal/openvdb/math/Proximity.cc
M	extern/openvdb/internal/openvdb/math/Proximity.h
M	extern/openvdb/internal/openvdb/math/QuantizedUnitVec.cc
A	extern/openvdb/internal/openvdb/math/Ray.h
M	extern/openvdb/internal/openvdb/math/Stats.h
M	extern/openvdb/internal/openvdb/math/Stencils.h
M	extern/openvdb/internal/openvdb/math/Transform.cc
M	extern/openvdb/internal/openvdb/math/Transform.h
M	extern/openvdb/internal/openvdb/math/Tuple.h
M	extern/openvdb/internal/openvdb/math/Vec2.h
M	extern/openvdb/internal/openvdb/math/Vec3.h
M	extern/openvdb/internal/openvdb/math/Vec4.h
M	extern/openvdb/internal/openvdb/tools/Composite.h
M	extern/openvdb/internal/openvdb/tools/Dense.h
A	extern/openvdb/internal/openvdb/tools/DenseSparseTools.h
M	extern/openvdb/internal/openvdb/tools/Filter.h
M	extern/openvdb/internal/openvdb/tools/GridOperators.h
M	extern/openvdb/internal/openvdb/tools/GridTransformer.h
M	extern/openvdb/internal/openvdb/tools/Interpolation.h
M	extern/openvdb/internal/openvdb/tools/LevelSetAdvect.h
M	extern/openvdb/internal/openvdb/tools/LevelSetFilter.h
A	extern/openvdb/internal/openvdb/tools/LevelSetMeasure.h
A	extern/openvdb/internal/openvdb/tools/LevelSetMorph.h
M	extern/openvdb/internal/openvdb/tools/LevelSetRebuild.h
M	extern/openvdb/internal/openvdb/tools/LevelSetTracker.h
M	extern/openvdb/internal/openvdb/tools/LevelSetUtil.h
M	extern/openvdb/internal/openvdb/tools/MeshToVolume.h
M	extern/openvdb/internal/openvdb/tools/Morphology.h
M	extern/openvdb/internal/openvdb/tools/ParticlesToLevelSet.h
M	extern/openvdb/internal/openvdb/tools/PointScatter.h
A	extern/openvdb/internal/openvdb/tools/RayIntersector.h
A	extern/openvdb/internal/openvdb/tools/RayTracer.h
M	extern/openvdb/internal/openvdb/tools/ValueTransformer.h
A	extern/openvdb/internal/openvdb/tools/VectorTransformer.h
M	extern/openvdb/internal/openvdb/tools/VolumeToMesh.h
A	extern/openvdb/internal/openvdb/tools/VolumeToSpheres.h
M	extern/openvdb/internal/openvdb/tree/InternalNode.h
M	extern/openvdb/internal/openvdb/tree/Iterator.h
M	extern/openvdb/internal/openvdb/tree/LeafManager.h
M	extern/openvdb/internal/openvdb/tree/LeafNode.h
M	extern/openvdb/internal/openvdb/tree/LeafNodeBool.h
M	extern/openvdb/internal/openvdb/tree/NodeUnion.h
M	extern/openvdb/internal/openvdb/tree/RootNode.h
M	extern/openvdb/internal/openvdb/tree/Tree.h
M	extern/openvdb/internal/openvdb/tree/TreeIterator.h
M	extern/openvdb/internal/openvdb/tree/Util.h
M	extern/openvdb/internal/openvdb/tree/ValueAccessor.h
M	extern/openvdb/internal/openvdb/util/MapsUtil.h
M	extern/openvdb/internal/openvdb/util/NodeMasks.h
M	extern/openvdb/internal/openvdb/util/Util.h
M	extern/openvdb/internal/openvdb/util/logging.h
M	extern/openvdb/internal/openvdb/version.h
M	intern/cycles/kernel/textures/vdb_lookup.h
M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib

===================================================================

diff --git a/extern/openvdb/CMakeLists.txt b/extern/openvdb/CMakeLists.txt
index 7eb33cf..82d0d02 100644
--- a/extern/openvdb/CMakeLists.txt
+++ b/extern/openvdb/CMakeLists.txt
@@ -40,6 +40,7 @@ set(SRC
 	internal/openvdb/io/Compression.cc
 	internal/openvdb/io/File.cc
 	internal/openvdb/io/GridDescriptor.cc
+	internal/openvdb/io/Queue.cc
 	internal/openvdb/io/Stream.cc
 	internal/openvdb/math/Hermite.cc
 	internal/openvdb/math/Maps.cc
@@ -59,9 +60,11 @@ set(SRC
 	internal/openvdb/io/Compression.h
 	internal/openvdb/io/File.h
 	internal/openvdb/io/GridDescriptor.h
+	internal/openvdb/io/Queue.h
 	internal/openvdb/io/Stream.h
 	internal/openvdb/math/BBox.h
 	internal/openvdb/math/Coord.h
+	internal/openvdb/math/DDA.h
 	internal/openvdb/math/FiniteDifference.h
 	internal/openvdb/math/Hermite.h
 	internal/openvdb/math/LegacyFrustum.h
@@ -74,6 +77,7 @@ set(SRC
 	internal/openvdb/math/Proximity.h
 	internal/openvdb/math/QuantizedUnitVec.h
 	internal/openvdb/math/Quat.h
+	internal/openvdb/math/Ray.h
 	internal/openvdb/math/Stats.h
 	internal/openvdb/math/Stencils.h
 	internal/openvdb/math/Transform.h
@@ -90,6 +94,7 @@ set(SRC
 	internal/openvdb/PlatformConfig.h
 	internal/openvdb/tools/Composite.h
 	internal/openvdb/tools/Dense.h
+	internal/openvdb/tools/DenseSparseTools.h
 	internal/openvdb/tools/Filter.h
 	internal/openvdb/tools/GridOperators.h
 	internal/openvdb/tools/GridTransformer.h
@@ -97,6 +102,8 @@ set(SRC
 	internal/openvdb/tools/LevelSetAdvect.h
 	internal/openvdb/tools/LevelSetFilter.h
 	internal/openvdb/tools/LevelSetFracture.h
+	internal/openvdb/tools/LevelSetMeasure.h
+    internal/openvdb/tools/LevelSetMorph.h
 	internal/openvdb/tools/LevelSetRebuild.h
 	internal/openvdb/tools/LevelSetSphere.h
 	internal/openvdb/tools/LevelSetTracker.h
@@ -106,9 +113,13 @@ set(SRC
 	internal/openvdb/tools/ParticlesToLevelSet.h
 	internal/openvdb/tools/PointAdvect.h
 	internal/openvdb/tools/PointScatter.h
+	internal/openvdb/tools/RayIntersector.h
+    internal/openvdb/tools/RayTracer.h
 	internal/openvdb/tools/Statistics.h
 	internal/openvdb/tools/ValueTransformer.h
+	internal/openvdb/tools/VectorTransformer.h 
 	internal/openvdb/tools/VolumeToMesh.h
+	internal/openvdb/tools/VolumeToSpheres.h
 	internal/openvdb/tree/InternalNode.h
 	internal/openvdb/tree/Iterator.h
 	internal/openvdb/tree/LeafManager.h
diff --git a/extern/openvdb/internal/openvdb/Grid.h b/extern/openvdb/internal/openvdb/Grid.h
index e6f6914..42018f2 100644
--- a/extern/openvdb/internal/openvdb/Grid.h
+++ b/extern/openvdb/internal/openvdb/Grid.h
@@ -93,7 +93,7 @@ inline typename Grid<typename TreePtrType::element_type>::Ptr createGrid(TreePtr
 /// that is larger than one voxel unit, otherwise zero crossings are not guaranteed.
 template<typename GridType>
 typename GridType::Ptr createLevelSet(
-    double voxelSize = 1.0, double halfWidth = LEVEL_SET_HALF_WIDTH);
+    Real voxelSize = 1.0, Real halfWidth = LEVEL_SET_HALF_WIDTH);
 
 
 ////////////////////////////////////////
@@ -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;
 };
@@ -509,6 +509,13 @@ public:
     explicit Grid(TreePtrType);
     /// Deep copy another grid's metadata, transform and tree.
     Grid(const Grid&);
+    /// @brief Deep copy the metadata, transform and tree of another grid whose tree
+    /// configuration is the same as this grid's but whose value type is different.
+    /// Cast the other grid's values to this grid's value type.
+    /// @throw TypeError if the other grid's tree configuration doesn't match this grid's
+    /// or if this grid's ValueType is not constructible from the other grid's ValueType.
+    template<typename OtherTreeType>
+    explicit Grid(const Grid<OtherTreeType>&);
     /// Deep copy another grid's metadata, but share its tree and transform.
     Grid(const Grid&, ShallowCopy);
     /// @brief Deep copy another grid's metadata and transform, but construct a new tree
@@ -618,10 +625,12 @@ public:
     /// Reduce the memory footprint of this grid by increasing its sparseness.
     virtual void pruneGrid(float tolerance = 0.0);
 
-    /// @brief Transfer active voxels from another grid to this grid
-    /// wherever those voxels coincide with inactive voxels in this grid.
-    /// @note This operation always empties the other tree.
-    void merge(Grid& other) { tree().merge(other.tree()); }
+    /// @brief Efficiently merge another grid into this grid using one of several schemes.
+    /// @details This operation is primarily intended to combine grids that are mostly
+    /// non-overlapping (for example, intermediate grids from computations that are
+    /// parallelized across disjoint regions of space).
+    /// @warning This operation always empties the other grid.
+    void merge(Grid& other, MergePolicy policy = MERGE_ACTIVE_STATES);
 
     /// @brief Union this grid's set of active values with the active values
     /// of the other grid, whose value type may be different.
@@ -630,16 +639,42 @@ public:
     /// 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()); }
-    /// @todo topologyIntersection
-    /// @todo topologyDifference
+    void topologyUnion(const Grid<OtherTreeType>& other);
+
+    /// @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 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);
+
+    /// @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
@@ -812,6 +847,9 @@ struct TreeAdapter
     typedef typename NonConstGridType::Ptr      NonConstGridPtrType;
     typedef typename GridType::ConstPtr         ConstGridPtrType;
     typedef typename TreeType::ValueType        ValueType;
+    typedef typename tree::ValueAccessor<TreeType>         AccessorType;
+    typedef typename tree::ValueAccessor<const TreeType>   ConstAccessorType;
+    typedef typename tree::ValueAccessor<NonConstTreeType> NonConstAccessorType;
 
     static TreeType& tree(TreeType& t) { return t; }
     static TreeType& tree(GridType& g) { return g.tree(); }
@@ -839,6 +877,9 @@ struct TreeAdapter<Grid<_TreeType> >
     typedef typename NonConstGridType::Ptr      NonConstGridPtrType;
     typedef typename GridType::ConstPtr         ConstGridPtrType;
     typedef typename TreeType::ValueType        ValueType;
+    typedef typename tree::ValueAccessor<TreeType>         AccessorType;
+    typedef typename tree::ValueAccessor<const TreeType>   ConstAccessorType;
+    typedef typename tree::ValueAccessor<NonConstTreeType> NonConstAccessorType;
 
     static TreeType& tree(TreeType& t) { return t; }
     static TreeType& tree(GridType& g) { return g.tree(); }
@@ -849,6 +890,38 @@ struct TreeAdapter<Grid<_TreeType> >
     static const TreeType& constTree(const TreeType& t) { return t; }
     static const TreeType& constTree(const GridType& g) { return g.constTree(); }
 };
+
+/// Partial specialization for ValueAccessor types
+template<typename _TreeType>
+struct TreeAdapter<tree::ValueAccessor<_TreeType> >
+{
+    typedef _TreeType                           TreeType;
+    typedef typename boost::remove_const<TreeType>::type NonConstTreeType;
+    typedef typename TreeType::Ptr              TreePtrType;
+    typedef typename TreeType::ConstPtr         ConstTreePtrType;
+    typedef typename NonConstTreeType::Ptr      NonConstTreePtrType;
+    typedef Grid<TreeType>                      GridType;
+    typedef Grid<NonConstTreeType>              NonConstGridType;
+    typedef typename GridType::Ptr              GridPtrType;
+    typedef typename NonConstGridType::Ptr      NonConstGridPtrType;
+    typedef typename GridType::ConstPtr         ConstGridPtrType;
+    typedef typename TreeType::ValueType    

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list