PeriDyno 1.0.0
Loading...
Searching...
No Matches
dyno::PoissonDiskSampling< TDataType > Class Template Reference

#include <PoissonDiskSampling.h>

Inheritance diagram for dyno::PoissonDiskSampling< TDataType >:
Collaboration diagram for dyno::PoissonDiskSampling< TDataType >:

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
- Public Types inherited from dyno::SdfSampler< TDataType >
typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TopologyModule::Hexahedron Hexahedron
 
- Public Types inherited from dyno::Sampler< TDataType >
typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
- Public Types inherited from dyno::Node
template<class T>
using SPtr = std::shared_ptr<T>
 
- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 PoissonDiskSampling ()
 
void ConstructGrid ()
 
bool collisionJudge2D (Coord point)
 
bool collisionJudge (Coord point)
 
std::shared_ptr< DistanceField3D< TDataType > > loadSdf ()
 
 DEF_VAR (Coord, Box_a, 0.0f, "Lower boudary of the sampling area")
 
 DEF_VAR (Coord, Box_b, 0.1f, "Upper boundary of the sampling area")
 
 DEF_VAR (FilePath, SdfFileName, "", "")
 
Real lerp (Real a, Real b, Real alpha)
 
Real getDistanceFromSDF (const Coord &p, Coord &normal)
 
std::shared_ptr< DistanceField3D< TDataType > > getSDF ()
 
Coord getOnePointInsideSDF ()
 
- Public Member Functions inherited from dyno::SdfSampler< TDataType >
 SdfSampler ()
 
 ~SdfSampler () override
 
void resetStates () override
 
bool validateInputs () override
 
std::shared_ptr< dyno::DistanceField3D< TDataType > > convert2Uniform (VolumeOctree< TDataType > *volume, Real h)
 
 DEF_NODE_PORT (VolumeOctree< TDataType >, Volume, "")
 
 DEF_VAR (float, Spacing, Real(0.02), " ")
 
 DEF_VAR (Vec3f, CubeTilt, 0, "Cube Init Rotation")
 
 DEF_VAR (Vec3f, X, Coord(1, 0.0f, 0.0f), "Cube Init X Rotation")
 
 DEF_VAR (Vec3f, Y, Coord(0.0f, 1, 0.0f), "Cube Init Y Rotation")
 
 DEF_VAR (Vec3f, Z, Coord(0.0f, 0.0f, 1), "Cube Init Z Rotation")
 
 DEF_VAR (Real, Alpha, Real(0), " ")
 
 DEF_VAR (Real, Beta, Real(0), " ")
 
 DEF_VAR (Real, Gamma, Real(0), " ")
 
- Public Member Functions inherited from dyno::Sampler< TDataType >
 Sampler ()
 
std::string getNodeType () override
 
 DEF_INSTANCE_STATE (PointSet< TDataType >, PointSet, "")
 
- Public Member Functions inherited from dyno::Node
 Node ()
 
 ~Node () override
 
void setName (std::string name)
 
std::string getName () override
 
bool isAutoSync ()
 
bool isAutoHidden ()
 
void setAutoSync (bool con)
 Whether the node can be automatically synchronized when its ancestor is updated.
 
void setAutoHidden (bool con)
 
virtual bool isActive ()
 Check the state of dynamics.
 
virtual void setActive (bool active)
 Set the state of dynamics.
 
virtual bool isVisible ()
 Check the visibility of context.
 
virtual void setVisible (bool visible)
 Set the visibility of context.
 
virtual Real getDt ()
 Simulation timestep.
 
void setDt (Real dt)
 
void setSceneGraph (SceneGraph *scn)
 
SceneGraphgetSceneGraph ()
 
std::vector< NodePort * > & getImportNodes ()
 
std::vector< NodePort * > & getExportNodes ()
 
bool addModule (std::shared_ptr< Module > module)
 Add a module to m_module_list and other special module lists.
 
bool deleteModule (std::shared_ptr< Module > module)
 
template<class TModule>
bool addModule (std::shared_ptr< TModule > tModule)
 Add a speical kind of module.
 
template<class TModule>
bool deleteModule (std::shared_ptr< TModule > tModule)
 
std::list< std::shared_ptr< Module > > & getModuleList ()
 
bool hasModule (std::string name)
 
std::shared_ptr< ModulegetModule (std::string name)
 Get a module by its name.
 
template<class TModule>
std::shared_ptr< TModule > getModule ()
 Get the Module by the module class name.
 
template<class TModule>
std::shared_ptr< TModule > getModule (std::string name)
 
std::shared_ptr< PipelineresetPipeline ()
 
std::shared_ptr< AnimationPipelineanimationPipeline ()
 
std::shared_ptr< GraphicsPipelinegraphicsPipeline ()
 
template<class TModule>
std::shared_ptr< TModule > addModule (std::string name)
 
void update ()
 Called every time interval.
 
void updateGraphicsContext ()
 
void reset ()
 
virtual NBoundingBox boundingBox ()
 
bool connect (NodePort *nPort)
 Depth-first tree traversal.
 
bool disconnect (NodePort *nPort)
 
bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true) override
 Attach a field to Node.
 
std::vector< NodePort * > & getAllNodePorts ()
 
uint sizeOfNodePorts ()
 
uint sizeOfImportNodes () const
 
uint sizeOfExportNodes () const
 
void setForceUpdate (bool b)
 
 DEF_VAR_STATE (Real, ElapsedTime, 0, "Elapsed Time")
 
 DEF_VAR_STATE (Real, TimeStep, Real(0.033), "Time step size")
 
 DEF_VAR_STATE (uint, FrameNumber, 0, "Frame number")
 
- Public Member Functions inherited from dyno::OBase
 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
template<typename T>
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Protected Member Functions

void resetStates () override
 
GridIndex searchGrid (Coord point)
 
int indexTransform (int i, int j, int k)
 
int pointNumberRecommend ()
 
- Protected Member Functions inherited from dyno::Node
bool appendExportNode (NodePort *nodePort)
 
bool removeExportNode (NodePort *nodePort)
 
virtual void preUpdateStates ()
 
virtual void updateStates ()
 
virtual void postUpdateStates ()
 
virtual void updateTopology ()
 
virtual bool requireUpdate ()
 
void tick ()
 notify all state and output fields are updated
 

Protected Attributes

std::vector< int > m_grid
 
int gnum
 
int nx
 
int ny
 
int nz
 
Coord area_a
 
Coord area_b
 
Coord seed_point
 
Real dx
 
std::vector< Coordpoints
 
unsigned int desired_points
 
GridIndex gridIndex
 
unsigned int attempted_Times = 10
 
std::shared_ptr< DistanceField3D< TDataType > > inputSDF
 
bool SDF_flag = false
 
DArray< Realm_dist
 
CArray3D< Realhost_dist
 
Real m_h
 
Coord m_left
 
- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Private Member Functions

 DECLARE_TCLASS (PoissonDiskSampling, TDataType)
 

Additional Inherited Members

- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 
- Public Attributes inherited from dyno::Node
std::string m_node_name
 

Detailed Description

template<typename TDataType>
class dyno::PoissonDiskSampling< TDataType >

Definition at line 35 of file PoissonDiskSampling.h.

Member Typedef Documentation

◆ Coord

template<typename TDataType>
typedef TDataType::Coord dyno::PoissonDiskSampling< TDataType >::Coord

Definition at line 41 of file PoissonDiskSampling.h.

◆ Real

template<typename TDataType>
typedef TDataType::Real dyno::PoissonDiskSampling< TDataType >::Real

Definition at line 40 of file PoissonDiskSampling.h.

Constructor & Destructor Documentation

◆ PoissonDiskSampling()

template<typename TDataType>
dyno::PoissonDiskSampling< TDataType >::PoissonDiskSampling ( )
Here is the caller graph for this function:

Member Function Documentation

◆ collisionJudge()

template<typename TDataType>
bool dyno::PoissonDiskSampling< TDataType >::collisionJudge ( Coord point)

◆ collisionJudge2D()

template<typename TDataType>
bool dyno::PoissonDiskSampling< TDataType >::collisionJudge2D ( Coord point)

◆ ConstructGrid()

template<typename TDataType>
void dyno::PoissonDiskSampling< TDataType >::ConstructGrid ( )

◆ DECLARE_TCLASS()

template<typename TDataType>
dyno::PoissonDiskSampling< TDataType >::DECLARE_TCLASS ( PoissonDiskSampling< TDataType > ,
TDataType  )
private
Here is the call graph for this function:

◆ DEF_VAR() [1/3]

template<typename TDataType>
dyno::PoissonDiskSampling< TDataType >::DEF_VAR ( Coord ,
Box_a ,
0. 0f,
"Lower boudary of the sampling area"  )

◆ DEF_VAR() [2/3]

template<typename TDataType>
dyno::PoissonDiskSampling< TDataType >::DEF_VAR ( Coord ,
Box_b ,
0. 1f,
"Upper boundary of the sampling area"  )

◆ DEF_VAR() [3/3]

template<typename TDataType>
dyno::PoissonDiskSampling< TDataType >::DEF_VAR ( FilePath ,
SdfFileName ,
"" ,
""  )

◆ getDistanceFromSDF()

template<typename TDataType>
Real dyno::PoissonDiskSampling< TDataType >::getDistanceFromSDF ( const Coord & p,
Coord & normal )

◆ getOnePointInsideSDF()

template<typename TDataType>
Coord dyno::PoissonDiskSampling< TDataType >::getOnePointInsideSDF ( )

◆ getSDF()

template<typename TDataType>
std::shared_ptr< DistanceField3D< TDataType > > dyno::PoissonDiskSampling< TDataType >::getSDF ( )
inline

Definition at line 61 of file PoissonDiskSampling.h.

◆ indexTransform()

template<typename TDataType>
int dyno::PoissonDiskSampling< TDataType >::indexTransform ( int i,
int j,
int k )
protected

◆ lerp()

template<typename TDataType>
Real dyno::PoissonDiskSampling< TDataType >::lerp ( Real a,
Real b,
Real alpha )

◆ loadSdf()

template<typename TDataType>
std::shared_ptr< DistanceField3D< TDataType > > dyno::PoissonDiskSampling< TDataType >::loadSdf ( )

◆ pointNumberRecommend()

template<typename TDataType>
int dyno::PoissonDiskSampling< TDataType >::pointNumberRecommend ( )
protected

◆ resetStates()

template<typename TDataType>
void dyno::PoissonDiskSampling< TDataType >::resetStates ( )
overrideprotectedvirtual

Reimplemented from dyno::Node.

◆ searchGrid()

template<typename TDataType>
GridIndex dyno::PoissonDiskSampling< TDataType >::searchGrid ( Coord point)
protected

Member Data Documentation

◆ area_a

template<typename TDataType>
Coord dyno::PoissonDiskSampling< TDataType >::area_a
protected

Definition at line 83 of file PoissonDiskSampling.h.

◆ area_b

template<typename TDataType>
Coord dyno::PoissonDiskSampling< TDataType >::area_b
protected

Definition at line 83 of file PoissonDiskSampling.h.

◆ attempted_Times

template<typename TDataType>
unsigned int dyno::PoissonDiskSampling< TDataType >::attempted_Times = 10
protected

Definition at line 95 of file PoissonDiskSampling.h.

◆ desired_points

template<typename TDataType>
unsigned int dyno::PoissonDiskSampling< TDataType >::desired_points
protected

Definition at line 91 of file PoissonDiskSampling.h.

◆ dx

template<typename TDataType>
Real dyno::PoissonDiskSampling< TDataType >::dx
protected

Definition at line 87 of file PoissonDiskSampling.h.

◆ gnum

template<typename TDataType>
int dyno::PoissonDiskSampling< TDataType >::gnum
protected

Definition at line 80 of file PoissonDiskSampling.h.

◆ gridIndex

template<typename TDataType>
GridIndex dyno::PoissonDiskSampling< TDataType >::gridIndex
protected

Definition at line 93 of file PoissonDiskSampling.h.

◆ host_dist

template<typename TDataType>
CArray3D<Real> dyno::PoissonDiskSampling< TDataType >::host_dist
protected

Definition at line 105 of file PoissonDiskSampling.h.

◆ inputSDF

template<typename TDataType>
std::shared_ptr<DistanceField3D<TDataType> > dyno::PoissonDiskSampling< TDataType >::inputSDF
protected

Definition at line 97 of file PoissonDiskSampling.h.

◆ m_dist

template<typename TDataType>
DArray<Real> dyno::PoissonDiskSampling< TDataType >::m_dist
protected

Definition at line 101 of file PoissonDiskSampling.h.

◆ m_grid

template<typename TDataType>
std::vector<int> dyno::PoissonDiskSampling< TDataType >::m_grid
protected

Definition at line 78 of file PoissonDiskSampling.h.

◆ m_h

template<typename TDataType>
Real dyno::PoissonDiskSampling< TDataType >::m_h
protected

Definition at line 106 of file PoissonDiskSampling.h.

◆ m_left

template<typename TDataType>
Coord dyno::PoissonDiskSampling< TDataType >::m_left
protected

Definition at line 107 of file PoissonDiskSampling.h.

◆ nx

template<typename TDataType>
int dyno::PoissonDiskSampling< TDataType >::nx
protected

Definition at line 81 of file PoissonDiskSampling.h.

◆ ny

template<typename TDataType>
int dyno::PoissonDiskSampling< TDataType >::ny
protected

Definition at line 81 of file PoissonDiskSampling.h.

◆ nz

template<typename TDataType>
int dyno::PoissonDiskSampling< TDataType >::nz
protected

Definition at line 81 of file PoissonDiskSampling.h.

◆ points

template<typename TDataType>
std::vector<Coord> dyno::PoissonDiskSampling< TDataType >::points
protected

Definition at line 89 of file PoissonDiskSampling.h.

◆ SDF_flag

template<typename TDataType>
bool dyno::PoissonDiskSampling< TDataType >::SDF_flag = false
protected

Definition at line 99 of file PoissonDiskSampling.h.

◆ seed_point

template<typename TDataType>
Coord dyno::PoissonDiskSampling< TDataType >::seed_point
protected

Definition at line 85 of file PoissonDiskSampling.h.


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