PeriDyno 0.9.2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
dyno::StaticBoundary< TDataType > Class Template Reference

#include <StaticBoundary.h>

Inheritance diagram for dyno::StaticBoundary< TDataType >:
Inheritance graph
[legend]
Collaboration diagram for dyno::StaticBoundary< TDataType >:
Collaboration graph
[legend]

Public Types

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

 StaticBoundary ()
 
 ~StaticBoundary () override
 
void loadSDF (std::string filename, bool bOutBoundary=false)
 
std::shared_ptr< NodeloadCube (Coord lo, Coord hi, Real distance=0.005f, bool bOutBoundary=false)
 
void loadShpere (Coord center, Real r, Real distance=0.005f, bool bOutBoundary=false, bool bVisible=false)
 
void translate (Coord t)
 
void scale (Real s)
 
void resetStates ()
 
 DEF_VAR (Real, TangentialFriction, 0.0, "Tangential friction")
 
 DEF_VAR (Real, NormalFriction, 1.0, "Normal friction")
 
 DEF_VAR (Vec3f, CubeVertex_lo, Vec3f(0.0f), "Cube")
 
 DEF_VAR (Vec3f, CubeVertex_hi, Vec3f(1.0f), "Cube")
 
 DEF_VAR (FilePath, FileName, "", "")
 
 DEF_NODE_PORTS (RigidBody< TDataType >, RigidBody, "A rigid body")
 
 DEF_NODE_PORTS (ParticleSystem< TDataType >, ParticleSystem, "Particle Systems")
 
- Public Member Functions inherited from dyno::Node
 Node ()
 
 ~Node () override
 
void setName (std::string name)
 
std::string getName () override
 
virtual std::string getNodeType ()
 
bool isAutoSync ()
 
void setAutoSync (bool con)
 Whether the node can be automatically synchronized when its ancestor is updated.
 
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< TModulegetModule ()
 Get the Module by the module class name.
 
template<class TModule >
std::shared_ptr< TModulegetModule (std::string name)
 
std::shared_ptr< PipelineresetPipeline ()
 
std::shared_ptr< AnimationPipelineanimationPipeline ()
 
std::shared_ptr< GraphicsPipelinegraphicsPipeline ()
 
template<class TModule >
std::shared_ptr< TModuleaddModule (std::string name)
 
void update ()
 Called every time interval.
 
void updateGraphicsContext ()
 
void reset ()
 
virtual NBoundingBox boundingBox ()
 
bool connect (NodePort *nPort)
 
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 ()
 

Public Attributes

std::vector< std::shared_ptr< BoundaryConstraint< TDataType > > > m_obstacles
 
std::vector< std::shared_ptr< RigidBody< TDataType > > > m_rigids
 
std::vector< std::shared_ptr< ParticleSystem< TDataType > > > m_particleSystems
 
- Public Attributes inherited from dyno::Node
std::string m_node_name
 

Protected Member Functions

void updateStates () override
 
- Protected Member Functions inherited from dyno::Node
bool appendExportNode (NodePort *nodePort)
 
bool removeExportNode (NodePort *nodePort)
 
virtual void preUpdateStates ()
 
virtual void postUpdateStates ()
 
virtual void updateTopology ()
 
virtual bool validateInputs ()
 
virtual bool requireUpdate ()
 
void tick ()
 notify all state and output fields are updated
 

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.
 
- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Detailed Description

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

Definition at line 14 of file StaticBoundary.h.

Member Typedef Documentation

◆ Coord

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

Definition at line 19 of file StaticBoundary.h.

◆ Real

Definition at line 18 of file StaticBoundary.h.

Constructor & Destructor Documentation

◆ StaticBoundary()

template<typename TDataType >
dyno::StaticBoundary< TDataType >::StaticBoundary ( )

Definition at line 15 of file StaticBoundary.cpp.

◆ ~StaticBoundary()

Definition at line 23 of file StaticBoundary.cpp.

Member Function Documentation

◆ DEF_NODE_PORTS() [1/2]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_NODE_PORTS ( ParticleSystem< TDataType ,
ParticleSystem  ,
"Particle Systems"   
)

◆ DEF_NODE_PORTS() [2/2]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_NODE_PORTS ( RigidBody< TDataType ,
RigidBody  ,
"A rigid body"   
)

◆ DEF_VAR() [1/5]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_VAR ( FilePath  ,
FileName  ,
""  ,
""   
)

◆ DEF_VAR() [2/5]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_VAR ( Real  ,
NormalFriction  ,
1.  0,
"Normal friction"   
)

◆ DEF_VAR() [3/5]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_VAR ( Real  ,
TangentialFriction  ,
0.  0,
"Tangential friction"   
)

◆ DEF_VAR() [4/5]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_VAR ( Vec3f  ,
CubeVertex_hi  ,
Vec3f(1.0f)  ,
"Cube"   
)

◆ DEF_VAR() [5/5]

template<typename TDataType >
dyno::StaticBoundary< TDataType >::DEF_VAR ( Vec3f  ,
CubeVertex_lo  ,
Vec3f(0.0f)  ,
"Cube"   
)

◆ loadCube()

template<typename TDataType >
std::shared_ptr< Node > dyno::StaticBoundary< TDataType >::loadCube ( Coord  lo,
Coord  hi,
Real  distance = 0.005f,
bool  bOutBoundary = false 
)

Definition at line 86 of file StaticBoundary.cpp.

◆ loadSDF()

template<typename TDataType >
void dyno::StaticBoundary< TDataType >::loadSDF ( std::string  filename,
bool  bOutBoundary = false 
)

Definition at line 73 of file StaticBoundary.cpp.

◆ loadShpere()

template<typename TDataType >
void dyno::StaticBoundary< TDataType >::loadShpere ( Coord  center,
Real  r,
Real  distance = 0.005f,
bool  bOutBoundary = false,
bool  bVisible = false 
)

Definition at line 104 of file StaticBoundary.cpp.

◆ resetStates()

template<typename TDataType >
void dyno::StaticBoundary< TDataType >::resetStates ( )
virtual

Reimplemented from dyno::Node.

Definition at line 137 of file StaticBoundary.cpp.

◆ scale()

Definition at line 117 of file StaticBoundary.cpp.

◆ translate()

template<typename TDataType >
void dyno::StaticBoundary< TDataType >::translate ( Coord  t)

Definition at line 126 of file StaticBoundary.cpp.

◆ updateStates()

template<typename TDataType >
void dyno::StaticBoundary< TDataType >::updateStates ( )
overrideprotectedvirtual

Reimplemented from dyno::Node.

Definition at line 47 of file StaticBoundary.cpp.

Member Data Documentation

◆ m_obstacles

template<typename TDataType >
std::vector<std::shared_ptr<BoundaryConstraint<TDataType> > > dyno::StaticBoundary< TDataType >::m_obstacles

Definition at line 44 of file StaticBoundary.h.

◆ m_particleSystems

template<typename TDataType >
std::vector<std::shared_ptr<ParticleSystem<TDataType> > > dyno::StaticBoundary< TDataType >::m_particleSystems

Definition at line 47 of file StaticBoundary.h.

◆ m_rigids

template<typename TDataType >
std::vector<std::shared_ptr<RigidBody<TDataType> > > dyno::StaticBoundary< TDataType >::m_rigids

Definition at line 46 of file StaticBoundary.h.


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