Microflow 3D  v1.0
MF::GB Namespace Reference

Data Structures

class  AutoSettingNode
 A class of methods that automatically classify nodes of any geometry. More...
 
class  BoundaryFromThread
 Adds boundary nodes from thread_params.cfg file to VDBGrid. More...
 
class  FluidFromThread
 Adds fluid nodes from thread_params.cfg file to VDBGrid. More...
 
class  GeometryBuildFromSTL
 
class  NodeID
 A class that allows to determine the proper NodeID from combined nodeType, uidThreadNr, ThreadCount, ComponentNr and PhaseNr. More...
 
class  SolidFromThread
 Adds solid nodes from thread_params.cfg file to VDBGrid. More...
 
class  StlMesher
 Converts surface mesh to volumetric grid with constant voxelSize spacing. More...
 

Functions

template<typename T >
void setGridName (T VDBGridPtr, const std::string &GridName)
 Adds grid name to a VDBGrid. More...
 
template<typename T >
void insertMetaDataFloat (T VDBGridPtr, const std::string &MetaName, float value)
 Adds float metadata to a VDBGrid. More...
 
template<typename T >
void insertMetaDataInt (T VDBGridPtr, const std::string &MetaName, int32_t value)
 Adds integer metadata to a VDBGrid. More...
 
template<typename T >
void insertMetaDataDouble (T VDBGridPtr, const std::string &MetaName, double value)
 Adds double metadata to a VDBGrid. More...
 
template<typename T >
void insertMetaDataString (T VDBGridPtr, const std::string &MetaName, const std::string &string)
 Adds string metadata to a VDBGrid. More...
 
template<typename T , typename T2 >
const T2 & getMetaData (T VDBGridPtr, const std::string &MetaName)
 Returns from a VDBGrid the metadata of a MetaName. More...
 
template<typename T >
void setGridToFogVolume (T VDBGridPtr, bool voxelizeActiveTiles=true)
 Changes a VDBGrid type to a FogVolume. More...
 
template<typename T >
void setGridBackgroundValue (T VDBGridPtr, float value)
 Sets the background value of a VDBGrid. More...
 
template<typename T >
openvdb::FloatGrid::Ptr getGridNewCopy (T VDBGridPtr)
 Copies of a VDBGrid. More...
 
template<typename T >
void VDBFileWrite (T VDBGridPtr, const std::string &FileName)
 Writes to file a VDBGrid. More...
 
void unionOfTwoGrids (const openvdb::FloatGrid::Ptr &gridA, const openvdb::FloatGrid::Ptr &gridB)
 Union of two VDBGrids. More...
 
void intersectionOfTwoGrids (const openvdb::FloatGrid::Ptr &gridA, const openvdb::FloatGrid::Ptr &gridB)
 Intersection of two VDBGrids. More...
 
void differenceOfTwoGrids (const openvdb::FloatGrid::Ptr &gridA, const openvdb::FloatGrid::Ptr &gridB)
 Difference of two VDBGrids. More...
 

Function Documentation

◆ differenceOfTwoGrids()

void MF::GB::differenceOfTwoGrids ( const openvdb::FloatGrid::Ptr &  gridA,
const openvdb::FloatGrid::Ptr &  gridB 
)
inline

Difference of two VDBGrids.

Definition at line 73 of file VDBGridOperations.h.

73 { openvdb::tools::csgDifference(*gridA, *gridB); }

◆ getGridNewCopy()

template<typename T >
openvdb::FloatGrid::Ptr MF::GB::getGridNewCopy ( VDBGridPtr)

Copies of a VDBGrid.

Definition at line 60 of file VDBGridOperations.h.

60 { return VDBGridPtr->deepCopy(); }

◆ getMetaData()

template<typename T , typename T2 >
const T2& MF::GB::getMetaData ( VDBGridPtr,
const std::string &  MetaName 
)

Returns from a VDBGrid the metadata of a MetaName.

Definition at line 47 of file VDBGridOperations.h.

47 { return VDBGridPtr->template metaValue<T2>(MetaName); }

◆ insertMetaDataDouble()

template<typename T >
void MF::GB::insertMetaDataDouble ( VDBGridPtr,
const std::string &  MetaName,
double  value 
)

Adds double metadata to a VDBGrid.

Definition at line 39 of file VDBGridOperations.h.

39 {VDBGridPtr->insertMeta(MetaName, openvdb::DoubleMetadata(value)); }

◆ insertMetaDataFloat()

template<typename T >
void MF::GB::insertMetaDataFloat ( VDBGridPtr,
const std::string &  MetaName,
float  value 
)

Adds float metadata to a VDBGrid.

Definition at line 31 of file VDBGridOperations.h.

31 { VDBGridPtr->insertMeta(MetaName, openvdb::FloatMetadata(value));}

◆ insertMetaDataInt()

template<typename T >
void MF::GB::insertMetaDataInt ( VDBGridPtr,
const std::string &  MetaName,
int32_t  value 
)

Adds integer metadata to a VDBGrid.

Definition at line 35 of file VDBGridOperations.h.

35 { VDBGridPtr->insertMeta(MetaName, openvdb::Int32Metadata(value));}

◆ insertMetaDataString()

template<typename T >
void MF::GB::insertMetaDataString ( VDBGridPtr,
const std::string &  MetaName,
const std::string &  string 
)

Adds string metadata to a VDBGrid.

Definition at line 43 of file VDBGridOperations.h.

43 {VDBGridPtr->insertMeta(MetaName, openvdb::StringMetadata(string)); }

◆ intersectionOfTwoGrids()

void MF::GB::intersectionOfTwoGrids ( const openvdb::FloatGrid::Ptr &  gridA,
const openvdb::FloatGrid::Ptr &  gridB 
)
inline

Intersection of two VDBGrids.

Definition at line 71 of file VDBGridOperations.h.

71 { openvdb::tools::csgIntersection(*gridA, *gridB); }

◆ setGridBackgroundValue()

template<typename T >
void MF::GB::setGridBackgroundValue ( VDBGridPtr,
float  value 
)

Sets the background value of a VDBGrid.

Definition at line 56 of file VDBGridOperations.h.

56 { openvdb::tools::changeBackground(VDBGridPtr->tree(), value); }

◆ setGridName()

template<typename T >
void MF::GB::setGridName ( VDBGridPtr,
const std::string &  GridName 
)

Adds grid name to a VDBGrid.

Definition at line 27 of file VDBGridOperations.h.

27 { VDBGridPtr->setName(GridName); }

◆ setGridToFogVolume()

template<typename T >
void MF::GB::setGridToFogVolume ( VDBGridPtr,
bool  voxelizeActiveTiles = true 
)

Changes a VDBGrid type to a FogVolume.

Definition at line 51 of file VDBGridOperations.h.

51  {openvdb::tools::sdfToFogVolume(*VDBGridPtr);
52  if (voxelizeActiveTiles) VDBGridPtr->treePtr()->voxelizeActiveTiles();}

◆ unionOfTwoGrids()

void MF::GB::unionOfTwoGrids ( const openvdb::FloatGrid::Ptr &  gridA,
const openvdb::FloatGrid::Ptr &  gridB 
)
inline

Union of two VDBGrids.

Note
CSG operations on Float grids.
Two grids of the same type containing level set volumes. CSG operations always modify the A grid and leave the B grid empty.

Definition at line 69 of file VDBGridOperations.h.

69 { openvdb::tools::csgUnion(*gridA, *gridB); }

◆ VDBFileWrite()

template<typename T >
void MF::GB::VDBFileWrite ( VDBGridPtr,
const std::string &  FileName 
)

Writes to file a VDBGrid.

Definition at line 64 of file VDBGridOperations.h.

64 {auto w = new MF::RW::VDBWriter<T>(VDBGridPtr, FileName); delete w;}
The VDBWriter class provides a write interface for OpenVDB grid.
Definition: VDBWriter.h:21