PeriDyno 0.8.2
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
dyno::ObjMesh< TDataType > Class Template Reference

#include <ObjLoader.h>

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

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
typedef ::dyno::Quat< RealTQuat
 
- 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

 ObjMesh ()
 
 DEF_VAR (Vec3f, Location, 0, "Node location")
 
 DEF_VAR (Vec3f, Rotation, 0, "Node rotation")
 
 DEF_VAR (Vec3f, Scale, Vec3f(1.0f), "Node scale")
 
 DEF_VAR (FilePath, FileName, "", "")
 
 DEF_INSTANCE_OUT (TriangleSet< TDataType >, TriangleSet, "")
 
 DEF_VAR (bool, Sequence, false, "Import Sequence")
 
 DEF_VAR (Coord, Velocity, Coord(0), "")
 
 DEF_VAR (Coord, Center, Coord(0), "")
 
 DEF_VAR (Coord, AngularVelocity, Coord(0), "")
 
 DEF_INSTANCE_STATE (TopologyModule, Topology, "Topology")
 
- Public Member Functions inherited from dyno::Node
 Node (std::string name="default")
 
 ~Node () override
 
void setName (std::string name)
 
std::string getName () override
 
virtual std::string getNodeType ()
 
bool isControllable ()
 
void setControllable (bool con)
 
bool canExported ()
 
void allowExported (bool ex)
 To allow exporting the node. More...
 
virtual bool isActive ()
 Check the state of dynamics. More...
 
virtual void setActive (bool active)
 Set the state of dynamics. More...
 
virtual bool isVisible ()
 Check the visibility of context. More...
 
virtual void setVisible (bool visible)
 Set the visibility of context. More...
 
virtual Real getDt ()
 Simulation timestep. More...
 
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. More...
 
bool deleteModule (std::shared_ptr< Module > module)
 
template<class TModule >
bool addModule (std::shared_ptr< TModule > tModule)
 Add a speical kind of module. More...
 
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. More...
 
template<class TModule >
std::shared_ptr< TModule > getModule ()
 Get the Module by the module class name. More...
 
template<class TModule >
std::shared_ptr< TModule > getModule (std::string name)
 
std::shared_ptr< AnimationPipelineanimationPipeline ()
 
std::shared_ptr< GraphicsPipelinegraphicsPipeline ()
 
template<class TModule >
std::shared_ptr< TModule > addModule (std::string name)
 
void initialize ()
 Initialize all states, called before the node is first updated. More...
 
void update ()
 Called every time interval. More...
 
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. More...
 
std::vector< NodePort * > & getAllNodePorts ()
 
uint sizeOfNodePorts ()
 
uint sizeOfImportNodes () const
 
uint sizeOfExportNodes () const
 
 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. More...
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI. More...
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description. More...
 
virtual std::string getName ()
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default. More...
 
bool addField (FieldID name, FBase *data)
 Add a field to Base. More...
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer. More...
 
bool findFieldAlias (const FieldID name)
 Find a field by its name. More...
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions. More...
 
bool removeField (FBase *data)
 Remove a field by its pointer. More...
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name. More...
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name. More...
 
std::vector< FBase * > & getAllFields ()
 
virtual bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true)
 Attach a field to Base. More...
 
template<typename T >
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields. More...
 
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::shared_ptr< GLSurfaceVisualModulesurfacerender
 
- Public Attributes inherited from dyno::Node
std::string m_node_name
 

Protected Member Functions

void resetStates () override
 
void updateStates () override
 
void loadObj (TriangleSet< TDataType > &Triangleset, std::string filename)
 
- 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 void resetStates ()
 
virtual bool validateInputs ()
 
void tick ()
 notify all state and output fields are updated More...
 

Private Attributes

Quat< RealrotQuat = Quat<Real>()
 
Matrix rotMat
 
DArray< CoordinitPos
 
Coord center
 
Coord centerInit
 
Real PI = 3.1415926535
 

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. More...
 
- 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::ObjMesh< TDataType >

Definition at line 22 of file ObjLoader.h.

Member Typedef Documentation

◆ Coord

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

Definition at line 28 of file ObjLoader.h.

◆ Matrix

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

Definition at line 29 of file ObjLoader.h.

◆ Real

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

Definition at line 27 of file ObjLoader.h.

◆ TQuat

template<typename TDataType >
typedef ::dyno::Quat<Real> dyno::ObjMesh< TDataType >::TQuat

Definition at line 31 of file ObjLoader.h.

Constructor & Destructor Documentation

◆ ObjMesh()

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

Member Function Documentation

◆ DEF_INSTANCE_OUT()

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_INSTANCE_OUT ( TriangleSet< TDataType >  ,
TriangleSet  ,
""   
)

◆ DEF_INSTANCE_STATE()

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_INSTANCE_STATE ( TopologyModule  ,
Topology  ,
"Topology"   
)

◆ DEF_VAR() [1/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( bool  ,
Sequence  ,
false  ,
"Import Sequence"   
)

◆ DEF_VAR() [2/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( Coord  ,
AngularVelocity  ,
Coord(0)  ,
""   
)

◆ DEF_VAR() [3/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( Coord  ,
Center  ,
Coord(0)  ,
""   
)

◆ DEF_VAR() [4/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( Coord  ,
Velocity  ,
Coord(0)  ,
""   
)

◆ DEF_VAR() [5/8]

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

◆ DEF_VAR() [6/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( Vec3f  ,
Location  ,
,
"Node location"   
)

◆ DEF_VAR() [7/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( Vec3f  ,
Rotation  ,
,
"Node rotation"   
)

◆ DEF_VAR() [8/8]

template<typename TDataType >
dyno::ObjMesh< TDataType >::DEF_VAR ( Vec3f  ,
Scale  ,
Vec3f(1.0f)  ,
"Node scale"   
)

◆ loadObj()

template<typename TDataType >
void dyno::ObjMesh< TDataType >::loadObj ( TriangleSet< TDataType > &  Triangleset,
std::string  filename 
)
protected

◆ resetStates()

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

Reimplemented from dyno::Node.

◆ updateStates()

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

Reimplemented from dyno::Node.

Member Data Documentation

◆ center

template<typename TDataType >
Coord dyno::ObjMesh< TDataType >::center
private

Definition at line 68 of file ObjLoader.h.

◆ centerInit

template<typename TDataType >
Coord dyno::ObjMesh< TDataType >::centerInit
private

Definition at line 69 of file ObjLoader.h.

◆ initPos

template<typename TDataType >
DArray<Coord> dyno::ObjMesh< TDataType >::initPos
private

Definition at line 66 of file ObjLoader.h.

◆ PI

template<typename TDataType >
Real dyno::ObjMesh< TDataType >::PI = 3.1415926535
private

Definition at line 70 of file ObjLoader.h.

◆ rotMat

template<typename TDataType >
Matrix dyno::ObjMesh< TDataType >::rotMat
private

Definition at line 64 of file ObjLoader.h.

◆ rotQuat

template<typename TDataType >
Quat<Real> dyno::ObjMesh< TDataType >::rotQuat = Quat<Real>()
private

Definition at line 63 of file ObjLoader.h.

◆ surfacerender

template<typename TDataType >
std::shared_ptr<GLSurfaceVisualModule> dyno::ObjMesh< TDataType >::surfacerender

Definition at line 54 of file ObjLoader.h.


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