QUAOAR STUDIO // Mobius API
mobius::poly_AdaptiveDistanceField Class Reference

#include <poly_AdaptiveDistanceField.h>

Inheritance diagram for mobius::poly_AdaptiveDistanceField:
Collaboration diagram for mobius::poly_AdaptiveDistanceField:

Public Member Functions

mobiusPoly_EXPORT poly_AdaptiveDistanceField (const double precision, const bool isUniform, const bool bndMode=false, core_ProgressEntry progress=nullptr, core_PlotterEntry plotter=nullptr)
 
mobiusPoly_EXPORT poly_AdaptiveDistanceField (poly_SVO *pRoot, const double precision, const bool isUniform, const bool bndMode=false, core_ProgressEntry progress=nullptr, core_PlotterEntry plotter=nullptr)
 
virtual mobiusPoly_EXPORT ~poly_AdaptiveDistanceField ()
 
mobiusPoly_EXPORT bool Build (const double minCellSize, const double maxCellSize, const t_ptr< poly_RealFunc > &func) override
 
virtual mobiusPoly_EXPORT double Eval (const double x, const double y, const double z) const
 
poly_SVOGetRoot () override
 
void SetRoot (poly_SVO *pRoot)
 
void SetBoundaryEvaluationMode (const bool on)
 
t_ptr< poly_AdaptiveDistanceFieldShallowCopy () const
 
- Public Member Functions inherited from mobius::poly_RealFunc
 poly_RealFunc ()
 Default ctor.
 
 poly_RealFunc (const t_xyz &domainMin, const t_xyz &domainMax)
 
const t_xyzGetDomainMin () const
 
const t_xyzGetDomainMax () const
 
- Public Member Functions inherited from mobius::core_OBJECT
mobiusCore_EXPORT void IncRef ()
 
mobiusCore_EXPORT void DecRef ()
 
mobiusCore_EXPORT int NbRefs () const
 
virtual mobiusCore_EXPORT void Dump (std::ostream *out) const
 
const mobiusCore_EXPORT std::string & GetName () const
 
mobiusCore_EXPORT void SetName (const std::string &name)
 
mobiusCore_EXPORT bool HasName () const
 

Protected Attributes

poly_SVOm_pRoot
 Root voxel.
 
double m_fPrecision
 Distance field approximation precision.
 
bool m_bUniform
 Indicates whether uniform mode is enabled.
 
bool m_bBndMode
 Boundary evaluation mode.
 
core_ProgressEntry m_progress
 Progress notifier.
 
core_PlotterEntry m_plotter
 Imperative plotter.
 
- Protected Attributes inherited from mobius::poly_RealFunc
t_xyz m_domainMin
 Min bound of the three-dimensional domain.
 
t_xyz m_domainMax
 Max bound of the three-dimensional domain.
 

Additional Inherited Members

- Static Public Member Functions inherited from mobius::poly_BaseDistanceField
static mobiusPoly_EXPORT bool IsIn (poly_SVO *pNode)
 
static mobiusPoly_EXPORT bool IsOut (poly_SVO *pNode)
 
static mobiusPoly_EXPORT bool IsZeroCrossing (poly_SVO *pNode)
 

Detailed Description

Distance field represented by voxelization and its associated real function to calculate the distance values.

Constructor & Destructor Documentation

◆ poly_AdaptiveDistanceField() [1/2]

mobiusPoly_EXPORT mobius::poly_AdaptiveDistanceField::poly_AdaptiveDistanceField ( const double  precision,
const bool  isUniform,
const bool  bndMode = false,
core_ProgressEntry  progress = nullptr,
core_PlotterEntry  plotter = nullptr 
)

Ctor.

Parameters
[in]isUniformindicates whether uniform voxelization is requested.
[in]precisiondistance field approximation precision.
[in]bndModeboundary evaluation mode.
[in]progressprogress notifier.
[in]plotterimperative plotter.

◆ poly_AdaptiveDistanceField() [2/2]

mobiusPoly_EXPORT mobius::poly_AdaptiveDistanceField::poly_AdaptiveDistanceField ( poly_SVO pRoot,
const double  precision,
const bool  isUniform,
const bool  bndMode = false,
core_ProgressEntry  progress = nullptr,
core_PlotterEntry  plotter = nullptr 
)

Ctor with initialization.

Parameters
[in]pRootoctree to handle.
[in]isUniformindicates whether uniform voxelization is requested.
[in]precisiondistance field approximation precision.
[in]bndModeboundary evaluation mode.
[in]progressprogress notifier.
[in]plotterimperative plotter.

◆ ~poly_AdaptiveDistanceField()

virtual mobiusPoly_EXPORT mobius::poly_AdaptiveDistanceField::~poly_AdaptiveDistanceField ( )
virtual

Dtor. CAUTION: this dtor does not destroy the octree.

Member Function Documentation

◆ Build()

mobiusPoly_EXPORT bool mobius::poly_AdaptiveDistanceField::Build ( const double  minCellSize,
const double  maxCellSize,
const t_ptr< poly_RealFunc > &  func 
)
overridevirtual

Builds distance field with the specified spatial resolution for the passed distance function. The method accepts min and max cell sizes to limit the voxelization granularity. The precision argument is used to compare the real distance function with its linear approximation. The adaptive distance field strives to capture the field's bevaior, so any significant deviation of the distance from its linear approximation leads to sub-splitting. The latter will not happen if the uniform voxelization mode is requested.

Parameters
[in]minCellSizemin allowed voxel size.
[in]maxCellSizemax allowed voxel size.
[in]precisionprecision of implicit function approximation.
[in]isUniformindicates whether the uniform (non-adaptive) voxelization is requested.
[in]funcdriving function.
Returns
true in case of success, false – otherwise.

Implements mobius::poly_BaseDistanceField.

◆ Eval()

virtual mobiusPoly_EXPORT double mobius::poly_AdaptiveDistanceField::Eval ( const double  x,
const double  y,
const double  z 
) const
virtual

Evaluates the distance field as a conventional trivariate function.

Parameters
[in]xX coordinate of the argument point.
[in]yY coordinate of the argument point.
[in]zZ coordinate of the argument point.
Returns
function value.

Implements mobius::core_TrivariateFunc.

◆ GetRoot()

poly_SVO* mobius::poly_AdaptiveDistanceField::GetRoot ( )
inlineoverridevirtual
Returns
root SVO node.

Implements mobius::poly_BaseDistanceField.

◆ SetBoundaryEvaluationMode()

void mobius::poly_AdaptiveDistanceField::SetBoundaryEvaluationMode ( const bool  on)
inline

Enables/disables the boundary evaluation mode. In this mode, only the zero-crossing voxels are computed precisely. The inner and the outer voxels are computed as -1 and +1 respectively.

Parameters
[in]onthe Boolean value to set.

◆ SetRoot()

void mobius::poly_AdaptiveDistanceField::SetRoot ( poly_SVO pRoot)
inline

Allows to set a new root node for the distance field. Use with care as this setter does absolutely nothing in terms of memory management.

Parameters
[in]pRootnew root SVO node to set.

◆ ShallowCopy()

t_ptr<poly_AdaptiveDistanceField> mobius::poly_AdaptiveDistanceField::ShallowCopy ( ) const
inline

Creates shallow copy of this distance field.

Returns
copy of the field pointing to the same octree.

The documentation for this class was generated from the following file: