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

#include <Vessel.h>

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

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
- Public Types inherited from dyno::RigidBody< TDataType >
typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
typedef dyno::Quat< RealQuat
 
- Public Types inherited from dyno::ParametricModel< 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

 Vessel ()
 
 ~Vessel () override
 
NBoundingBox boundingBox () override
 
std::string getNodeType () override
 
 DEF_VAR (Coord, BarycenterOffset, Coord(0), "The center offset defined in vessel's local frame")
 
 DEF_VAR (FilePath, EnvelopeName, "", "")
 
 DEF_VAR (FilePath, TextureMeshName, "", "")
 
 DEF_VAR (Real, Density, Real(1000), "Density")
 
 DEF_VAR_STATE (Coord, Barycenter, Coord(0), "A vessel's barycenter, note it can be different from the Center")
 
 DEF_INSTANCE_STATE (TriangleSet< TDataType >, Envelope, "Envelope for the vessel")
 
 DEF_INSTANCE_STATE (TextureMesh, TextureMesh, "Texture mesh of the Vessel")
 
 DEF_ARRAYLIST_STATE (Transform3f, InstanceTransform, DeviceType::GPU, "Instance transforms")
 
- Public Member Functions inherited from dyno::RigidBody< TDataType >
 RigidBody ()
 
 ~RigidBody () override
 
 DEF_VAR (Coord, Gravity, Coord(0.0, -9.8, 0.0), "Gravity")
 
 DEF_VAR_STATE (Real, Mass, Real(1), "Mass of the rigid body")
 Rigid body mass.
 
 DEF_VAR_STATE (Coord, Center, Coord(0), "Center of the rigid body")
 Rigid body center.
 
 DEF_VAR_STATE (Coord, Velocity, Coord(0), "Velocity of rigid bodies")
 Rigid body velocity.
 
 DEF_VAR_STATE (Coord, AngularVelocity, Coord(0), "Angular velocity of of the rigid body")
 Rigid body angular velocity.
 
 DEF_VAR_STATE (Matrix, RotationMatrix, Matrix::identityMatrix(), "Rotation matrix of of the rigid body")
 Particle position.
 
 DEF_VAR_STATE (Matrix, Inertia, Matrix::identityMatrix(), "Inertia matrix")
 
 DEF_VAR_STATE (Quat, Quaternion, Quat(0, 0, 0), "Quaternion")
 
 DEF_VAR_STATE (Matrix, InitialInertia, Matrix::identityMatrix(), "Initial inertia matrix")
 
- Public Member Functions inherited from dyno::ParametricModel< TDataType >
 ParametricModel ()
 
Quat< RealcomputeQuaternion ()
 
 DEF_VAR (Coord, Location, 0, "Node location")
 
 DEF_VAR (Coord, Rotation, 0, "Node rotation")
 
 DEF_VAR (Coord, Scale, Coord(1), "Node scale")
 
- 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 ()
 
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
 
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
 

Private Member Functions

void transform ()
 

Private Attributes

TriangleSet< TDataType > mInitialEnvelope
 
Coord mShapeCenter = Coord(0)
 

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
 
- 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::Vessel< TDataType >

Definition at line 27 of file Vessel.h.

Member Typedef Documentation

◆ Coord

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

Definition at line 32 of file Vessel.h.

◆ Matrix

template<typename TDataType>
typedef TDataType::Matrix dyno::Vessel< TDataType >::Matrix

Definition at line 33 of file Vessel.h.

◆ Real

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

Definition at line 31 of file Vessel.h.

Constructor & Destructor Documentation

◆ Vessel()

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

Definition at line 13 of file Vessel.cpp.

Here is the call graph for this function:

◆ ~Vessel()

template<typename TDataType>
dyno::Vessel< TDataType >::~Vessel ( )
override

Definition at line 74 of file Vessel.cpp.

Member Function Documentation

◆ boundingBox()

template<typename TDataType>
NBoundingBox dyno::Vessel< TDataType >::boundingBox ( )
overridevirtual

Reimplemented from dyno::Node.

Definition at line 80 of file Vessel.cpp.

◆ DEF_ARRAYLIST_STATE()

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_ARRAYLIST_STATE ( Transform3f ,
InstanceTransform ,
DeviceType::GPU ,
"Instance transforms"  )

◆ DEF_INSTANCE_STATE() [1/2]

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_INSTANCE_STATE ( TextureMesh ,
TextureMesh ,
"Texture mesh of the Vessel< TDataType >"  )

◆ DEF_INSTANCE_STATE() [2/2]

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_INSTANCE_STATE ( TriangleSet< TDataType > ,
Envelope ,
"Envelope for the vessel"  )

◆ DEF_VAR() [1/4]

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_VAR ( Coord ,
BarycenterOffset ,
Coord(0) ,
"The center offset defined in vessel's local frame"  )

◆ DEF_VAR() [2/4]

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_VAR ( FilePath ,
EnvelopeName ,
"" ,
""  )

◆ DEF_VAR() [3/4]

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_VAR ( FilePath ,
TextureMeshName ,
"" ,
""  )

◆ DEF_VAR() [4/4]

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_VAR ( Real ,
Density ,
Real(1000) ,
"Density"  )

◆ DEF_VAR_STATE()

template<typename TDataType>
dyno::Vessel< TDataType >::DEF_VAR_STATE ( Coord ,
Barycenter ,
Coord(0) ,
"A vessel's barycenter,
note it can be different from the Center"  )

◆ getNodeType()

template<typename TDataType>
std::string dyno::Vessel< TDataType >::getNodeType ( )
inlineoverridevirtual

Reimplemented from dyno::RigidBody< TDataType >.

Definition at line 40 of file Vessel.h.

◆ resetStates()

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

Reimplemented from dyno::Node.

Definition at line 90 of file Vessel.cpp.

Here is the call graph for this function:

◆ transform()

template<typename TDataType>
void dyno::Vessel< TDataType >::transform ( )
private

Definition at line 205 of file Vessel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateStates()

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

Reimplemented from dyno::RigidBody< TDataType >.

Definition at line 158 of file Vessel.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ mInitialEnvelope

template<typename TDataType>
TriangleSet<TDataType> dyno::Vessel< TDataType >::mInitialEnvelope
private

Definition at line 66 of file Vessel.h.

◆ mShapeCenter

template<typename TDataType>
Coord dyno::Vessel< TDataType >::mShapeCenter = Coord(0)
private

Definition at line 68 of file Vessel.h.


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