#include <poly_AdaptiveDistanceField.h>
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_SVO * | GetRoot () override |
void | SetRoot (poly_SVO *pRoot) |
void | SetBoundaryEvaluationMode (const bool on) |
t_ptr< poly_AdaptiveDistanceField > | ShallowCopy () 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_xyz & | GetDomainMin () const |
const t_xyz & | GetDomainMax () 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_SVO * | m_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) |
Distance field represented by voxelization and its associated real function to calculate the distance values.
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.
[in] | isUniform | indicates whether uniform voxelization is requested. |
[in] | precision | distance field approximation precision. |
[in] | bndMode | boundary evaluation mode. |
[in] | progress | progress notifier. |
[in] | plotter | imperative plotter. |
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.
[in] | pRoot | octree to handle. |
[in] | isUniform | indicates whether uniform voxelization is requested. |
[in] | precision | distance field approximation precision. |
[in] | bndMode | boundary evaluation mode. |
[in] | progress | progress notifier. |
[in] | plotter | imperative plotter. |
|
virtual |
Dtor. CAUTION: this dtor does not destroy the octree.
|
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.
[in] | minCellSize | min allowed voxel size. |
[in] | maxCellSize | max allowed voxel size. |
[in] | precision | precision of implicit function approximation. |
[in] | isUniform | indicates whether the uniform (non-adaptive) voxelization is requested. |
[in] | func | driving function. |
Implements mobius::poly_BaseDistanceField.
|
virtual |
Evaluates the distance field as a conventional trivariate function.
[in] | x | X coordinate of the argument point. |
[in] | y | Y coordinate of the argument point. |
[in] | z | Z coordinate of the argument point. |
Implements mobius::core_TrivariateFunc.
|
inlineoverridevirtual |
Implements mobius::poly_BaseDistanceField.
|
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.
[in] | on | the Boolean value to set. |
|
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.
[in] | pRoot | new root SVO node to set. |
|
inline |
Creates shallow copy of this distance field.