OpenVDB  6.2.0
Classes | Namespaces | Enumerations | Functions
Composite.h File Reference

Functions to efficiently perform various compositing operations on grids. More...

#include <openvdb/Platform.h>
#include <openvdb/Exceptions.h>
#include <openvdb/Types.h>
#include <openvdb/Grid.h>
#include <openvdb/math/Math.h>
#include "ValueTransformer.h"
#include "Prune.h"
#include "SignedFloodFill.h"
#include <tbb/blocked_range.h>
#include <tbb/parallel_for.h>
#include <tbb/parallel_reduce.h>
#include <tbb/task_group.h>
#include <tbb/task_scheduler_init.h>
#include <type_traits>
#include <functional>

Go to the source code of this file.

Classes

struct  BuildPrimarySegment< TreeType, Operation >
 
struct  BuildSecondarySegment< TreeType, Operation >
 
struct  GridOrTreeConstructor< TreeType >
 
struct  GridOrTreeConstructor< Grid< TreeType > >
 
struct  CompReplaceOp< TreeT >
 
class  CsgVisitorBase< TreeType >
 
struct  CsgUnionVisitor< TreeType >
 
struct  CsgIntersectVisitor< TreeType >
 
struct  CsgDiffVisitor< TreeType >
 

Namespaces

 openvdb
 
 openvdb::v6_2
 
 openvdb::v6_2::tools
 
 openvdb::v6_2::tools::composite
 

Enumerations

enum  CSGOperation { CSG_UNION, CSG_INTERSECTION, CSG_DIFFERENCE }
 

Functions

template<typename GridOrTreeT >
void csgUnion (GridOrTreeT &a, GridOrTreeT &b, bool prune=true)
 Given two level set grids, replace the A grid with the union of A and B. More...
 
template<typename GridOrTreeT >
void csgIntersection (GridOrTreeT &a, GridOrTreeT &b, bool prune=true)
 Given two level set grids, replace the A grid with the intersection of A and B. More...
 
template<typename GridOrTreeT >
void csgDifference (GridOrTreeT &a, GridOrTreeT &b, bool prune=true)
 Given two level set grids, replace the A grid with the difference A / B. More...
 
template<typename GridOrTreeT >
GridOrTreeT::Ptr csgUnionCopy (const GridOrTreeT &a, const GridOrTreeT &b)
 Threaded CSG union operation that produces a new grid or tree from immutable inputs. More...
 
template<typename GridOrTreeT >
GridOrTreeT::Ptr csgIntersectionCopy (const GridOrTreeT &a, const GridOrTreeT &b)
 Threaded CSG intersection operation that produces a new grid or tree from immutable inputs. More...
 
template<typename GridOrTreeT >
GridOrTreeT::Ptr csgDifferenceCopy (const GridOrTreeT &a, const GridOrTreeT &b)
 Threaded CSG difference operation that produces a new grid or tree from immutable inputs. More...
 
template<typename GridOrTreeT >
void compMax (GridOrTreeT &a, GridOrTreeT &b)
 Given grids A and B, compute max(a, b) per voxel (using sparse traversal). Store the result in the A grid and leave the B grid empty. More...
 
template<typename GridOrTreeT >
void compMin (GridOrTreeT &a, GridOrTreeT &b)
 Given grids A and B, compute min(a, b) per voxel (using sparse traversal). Store the result in the A grid and leave the B grid empty. More...
 
template<typename GridOrTreeT >
void compSum (GridOrTreeT &a, GridOrTreeT &b)
 Given grids A and B, compute a + b per voxel (using sparse traversal). Store the result in the A grid and leave the B grid empty. More...
 
template<typename GridOrTreeT >
void compMul (GridOrTreeT &a, GridOrTreeT &b)
 Given grids A and B, compute a * b per voxel (using sparse traversal). Store the result in the A grid and leave the B grid empty. More...
 
template<typename GridOrTreeT >
void compDiv (GridOrTreeT &a, GridOrTreeT &b)
 Given grids A and B, compute a / b per voxel (using sparse traversal). Store the result in the A grid and leave the B grid empty. More...
 
template<typename GridOrTreeT >
void compReplace (GridOrTreeT &a, const GridOrTreeT &b)
 Copy the active voxels of B into A. More...
 
template<typename T >
const std::enable_if<!VecTraits< T >::IsVec, T >::type & min (const T &a, const T &b)
 
template<typename T >
const std::enable_if<!VecTraits< T >::IsVec, T >::type & max (const T &a, const T &b)
 
template<typename T >
const std::enable_if< VecTraits< T >::IsVec, T >::type & min (const T &a, const T &b)
 
template<typename T >
const std::enable_if< VecTraits< T >::IsVec, T >::type & max (const T &a, const T &b)
 
template<typename T >
std::enable_if<!std::is_integral< T >::value, T >::type divide (const T &a, const T &b)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type divide (const T &a, const T &b)
 
bool divide (bool a, bool)
 
template<CSGOperation Operation, typename TreeType >
TreeType::Ptr doCSGCopy (const TreeType &lhs, const TreeType &rhs)
 
template<typename TreeT , typename OpT = composite::CopyOp<TreeT>>
void compActiveLeafVoxels (TreeT &srcTree, TreeT &dstTree, OpT op=composite::CopyOp< TreeT >())
 Composite the active values in leaf nodes, i.e. active voxels, of a source tree into a destination tree. More...
 

Detailed Description

Functions to efficiently perform various compositing operations on grids.

Authors
Peter Cucka, Mihai Alden, Ken Museth