cGELMesh Class Reference

This class inherits from class cMesh and integrate a skeleton model for modelling deformations of the mesh.

#include <CGELMesh.h>

Inheritance diagram for cGELMesh:

Public Member Functions

 cGELMesh ()
 Constructor of cGELMesh. More...
 
virtual ~cGELMesh ()
 Destructor of cGELMesh. More...
 
void buildVertices ()
 This method builds all dynamic vertices that describe the deformable mesh. More...
 
void connectVerticesToSkeleton (bool a_connectToNodesOnly)
 This method connects each dynamic vertex to the skeleton. More...
 
void updateVertexPosition ()
 This method updates the position of all vertices connected to the skeleton. More...
 
void clearForces ()
 This method sets all computed forces to zero. More...
 
void clearExternalForces ()
 This method sets all external forces to zero. More...
 
void computeForces ()
 This method computes all internal forces. More...
 
void computeNextPose (double iTimeInterval)
 This method updates the simulation over a time interval. More...
 
void applyNextPose ()
 This method updates the position of the mesh after computation. More...
 
virtual void render (chai3d::cRenderOptions &a_options)
 This method renders the deformable mesh graphically. More...
 
- Public Member Functions inherited from chai3d::cMultiMesh
 cMultiMesh ()
 
virtual ~cMultiMesh ()
 
virtual void setEnabled (bool a_enabled, const bool a_affectChildren=false)
 
virtual cMultiMesh * copy (const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=true)
 
virtual void setHapticEnabled (const bool a_hapticEnabled, const bool a_affectChildren=false)
 
virtual void setStiffness (const double a_stiffness, const bool a_affectChildren=false)
 
virtual void setFriction (double a_staticFriction, double a_dynamicFriction, const bool a_affectChildren=false)
 
virtual void setShowEnabled (const bool a_show, const bool a_affectChildren=false)
 
virtual void setWireMode (const bool a_showWireMode, const bool a_affectChildren=true)
 
virtual void setUseCulling (const bool a_useCulling, const bool a_affectChildren=true)
 
virtual void setUseTransparency (const bool a_useTransparency, const bool a_affectChildren=false)
 
virtual void setTransparencyLevel (const float a_level, const bool a_applyToVertices=false, const bool a_applyToTextures=false, const bool a_affectChildren=false)
 
virtual void setUseDisplayList (const bool a_useDisplayList, const bool a_affectChildren=false)
 
virtual void markForUpdate (const bool a_affectChildren=false)
 
virtual void setUseMaterial (const bool a_useMaterial, const bool a_affectChildren=true)
 
virtual void setMaterial (cMaterialPtr a_material, const bool a_affectChildren=false)
 
virtual void setMaterial (cMaterial &a_material, const bool a_affectChildren=false)
 
virtual void backupMaterialColors (const bool a_affectChildren=false)
 
virtual void restoreMaterialColors (const bool a_affectChildren=false)
 
virtual void setUseTexture (const bool a_useTexture, const bool a_affectChildren=true)
 
virtual void setTexture (cTexture1dPtr, const bool a_affectChildren=false)
 
virtual void setShaderProgram (cShaderProgramPtr a_shaderProgram, const bool a_affectChildren=false)
 
virtual void setShowBoundaryBox (const bool a_showBoundaryBox, const bool a_affectChildren=false)
 
virtual void deleteCollisionDetector (const bool a_affectChildren=false)
 
virtual bool computeCollisionDetection (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 
virtual void setShowCollisionDetector (const bool a_showCollisionDetector, const bool a_affectChildren=false)
 
virtual void setCollisionDetectorProperties (unsigned int a_displayDepth, cColorf &a_color, const bool a_affectChildren=false)
 
virtual void createBruteForceCollisionDetector ()
 
virtual void createAABBCollisionDetector (const double a_radius)
 
virtual cVector3d computeInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
 
cMesh * newMesh ()
 
bool addMesh (cMesh *a_mesh)
 
bool removeMesh (cMesh *a_mesh)
 
bool removeAllMesh ()
 
bool deleteMesh (cMesh *a_mesh)
 
bool deleteAllMeshes ()
 
int getNumMeshes ()
 
cMesh * getMesh (unsigned int a_index)
 
void convertToSingleMesh (cMesh *a_mesh)
 
bool getVertex (const unsigned int a_index, cMesh *&a_mesh, unsigned int &a_vertexIndex)
 
cVector3d getVertexPos (unsigned int a_index)
 
unsigned int getNumVertices () const
 
virtual void setUseVertexColors (const bool a_useColors, const bool a_affectChildren=true)
 
void setVertexColor (const cColorf &a_color)
 
bool getTriangle (const unsigned int a_index, cMesh *&a_mesh, unsigned int &a_triangleIndex)
 
unsigned int getNumTriangles () const
 
void clear ()
 
void setShowTriangles (const bool a_showTriangles)
 
void computeAllEdges (double a_angleThresholdDeg=40.0)
 
void clearAllEdges ()
 
void setShowEdges (const bool a_showEdges)
 
void setEdgeProperties (const double a_width, const cColorf &a_color)
 
void setEdgeLineWidth (const double a_width)
 
void setShowNormals (const bool &a_showNormals)
 
void setNormalsProperties (const double a_length, const cColorf &a_color)
 
void setNormalsLength (const double a_length)
 
void computeAllNormals ()
 
void reverseAllNormals ()
 
void computeBTN ()
 
void setShowTangents (const bool a_showTangents)
 
virtual bool loadFromFile (std::string a_filename)
 
virtual bool saveToFile (std::string a_filename)
 
virtual void scale (const double &a_scaleFactor, const bool a_affectChildren=true)
 
void scaleXYZ (const double a_scaleX, const double a_scaleY, const double a_scaleZ)
 
- Public Member Functions inherited from chai3d::cGenericObject
 cGenericObject ()
 
virtual ~cGenericObject ()
 
bool getEnabled () const
 
virtual void setLocalPos (const cVector3d &a_localPos)
 
void setLocalPos (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0)
 
cVector3d getLocalPos () const
 
cVector3d getGlobalPos () const
 
virtual void setLocalRot (const cMatrix3d &a_localRot)
 
cMatrix3d getLocalRot () const
 
cMatrix3d getGlobalRot () const
 
void setLocalTransform (const cTransform &a_transform)
 
cTransform getLocalTransform ()
 
cTransform getGlobalTransform ()
 
void translate (const cVector3d &a_translation)
 
void translate (const double a_x, const double a_y, const double a_z=0.0)
 
void rotateAboutLocalAxisRad (const cVector3d &a_axis, const double a_angleRad)
 
void rotateAboutLocalAxisDeg (const cVector3d &a_axis, const double a_angleDeg)
 
void rotateAboutLocalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad)
 
void rotateAboutLocalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg)
 
void rotateAboutGlobalAxisRad (const cVector3d &a_axis, const double a_angleRad)
 
void rotateAboutGlobalAxisDeg (const cVector3d &a_axis, const double a_angleDeg)
 
void rotateAboutGlobalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad)
 
void rotateAboutGlobalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg)
 
void rotateExtrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder)
 
void rotateExtrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder)
 
void rotateIntrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder)
 
void rotateIntrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder)
 
virtual void computeGlobalPositions (const bool a_frameOnly=true, const cVector3d &a_globalPos=cVector3d(0.0, 0.0, 0.0), const cMatrix3d &a_globalRot=cIdentity3d())
 
void computeGlobalPositionsFromRoot (const bool a_frameOnly=true)
 
bool addEffect (cGenericEffect *a_effect)
 
bool removeEffect (cGenericEffect *a_effect)
 
void deleteAllEffects ()
 
bool createEffectMagnetic ()
 
bool deleteEffectMagnetic ()
 
bool createEffectStickSlip ()
 
bool deleteEffectStickSlip ()
 
bool createEffectSurface ()
 
bool deleteEffectSurface ()
 
bool createEffectVibration ()
 
bool deleteEffectVibration ()
 
bool createEffectViscosity ()
 
bool deleteEffectViscosity ()
 
bool getHapticEnabled () const
 
bool getShowEnabled () const
 
bool getWireMode () const
 
bool getUseCulling () const
 
bool getUseTransparency () const
 
bool getUseDisplayList () const
 
bool getUseVertexColors () const
 
bool getUseMaterial () const
 
bool getUseTexture () const
 
virtual cShaderProgramPtr getShaderProgram ()
 
bool getShowBoundaryBox () const
 
cVector3d getBoundaryMin () const
 
cVector3d getBoundaryMax () const
 
cVector3d getBoundaryCenter () const
 
bool getBoundaryBoxEmpty ()
 
virtual void computeBoundaryBox (const bool a_includeChildren=true)
 
virtual void setShowFrame (const bool a_showFrame, const bool a_affectChildren=false)
 
bool getShowFrame (void) const
 
virtual void setFrameSize (const double a_size=1.0, const bool a_affectChildren=false)
 
double getFrameSize () const
 
void setCollisionDetector (cGenericCollision *a_collisionDetector)
 
cGenericCollision * getCollisionDetector () const
 
bool getShowCollisionDetector ()
 
void setParent (cGenericObject *a_parent)
 
cGenericObject * getParent () const
 
void setOwner (cGenericObject *a_owner)
 
cGenericObject * getOwner ()
 
cGenericObject * getChild (const unsigned int a_index) const
 
bool addChild (cGenericObject *a_object)
 
bool removeChild (cGenericObject *a_object)
 
bool removeFromGraph ()
 
bool deleteChild (cGenericObject *a_object)
 
void clearAllChildren ()
 
void deleteAllChildren ()
 
unsigned int getNumChildren ()
 
unsigned int getNumDescendants (bool a_includeCurrentObject=false)
 
void setGhostEnabled (bool a_ghostEnabled)
 
bool getGhostEnabled ()
 
virtual void renderSceneGraph (cRenderOptions &a_options)
 
virtual void adjustCollisionSegment (cVector3d &a_segmentPointA, cVector3d &a_segmentPointAadjusted)
 
- Public Member Functions inherited from chai3d::cGenericType
 cGenericType ()
 
virtual ~cGenericType ()
 

Public Attributes

std::list< cGELSkeletonNode * > m_nodes
 List of nodes composing the skeleton. More...
 
std::list< cGELSkeletonLink * > m_links
 List of links connecting the different nodes. More...
 
std::list< cGELLinearSpring * > m_linearSprings
 List of linear springs connecting vertices together. More...
 
std::vector< cGELVertex > m_gelVertices
 List of deformable vertices. More...
 
bool m_showSkeletonModel
 If true then display skeleton. More...
 
bool m_showMassParticleModel
 If true then display mass particle model. More...
 
bool m_useSkeletonModel
 If true then use skeleton model. More...
 
bool m_useMassParticleModel
 If true then use vertex mass particle model. More...
 
- Public Attributes inherited from chai3d::cMultiMesh
std::vector< cMesh * > * m_meshes
 
- Public Attributes inherited from chai3d::cGenericObject
std::string m_name
 
cMaterialPtr m_material
 
cTexture1dPtr m_texture
 
cNormalMapPtr m_normalMap
 
int m_userTag
 
void * m_userData
 
std::string m_userName
 
cGenericObject * m_userExternalObject
 
cVector3d m_interactionPoint
 
cVector3d m_interactionNormal
 
bool m_interactionInside
 

Additional Inherited Members

- Static Public Attributes inherited from chai3d::cGenericObject
static cColorf s_boundaryBoxColor
 
- Protected Member Functions inherited from chai3d::cMultiMesh
virtual void updateGlobalPositions (const bool a_frameOnly)
 
virtual void updateBoundaryBox ()
 
void copyMultiMeshProperties (cMultiMesh *a_obj, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector)
 
- Protected Member Functions inherited from chai3d::cGenericObject
virtual void scaleObject (const double &a_scaleFactor)
 
virtual void computeLocalInteraction (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN)
 
virtual cVector3d computeOtherInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions)
 
virtual bool computeOtherCollisionDetection (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 
void copyGenericObjectProperties (cGenericObject *a_objDest, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector)
 
- Protected Attributes inherited from chai3d::cGenericObject
cGenericObject * m_parent
 
cGenericObject * m_owner
 
std::vector< cGenericObject * > m_children
 
cVector3d m_localPos
 
cVector3d m_globalPos
 
cMatrix3d m_localRot
 
cMatrix3d m_globalRot
 
cVector3d m_prevGlobalPos
 
cMatrix3d m_prevGlobalRot
 
cVector3d m_boundaryBoxMin
 
cVector3d m_boundaryBoxMax
 
bool m_boundaryBoxEmpty
 
double m_frameSize
 
double m_frameThicknessScale
 
bool m_enabled
 
bool m_showEnabled
 
bool m_hapticEnabled
 
bool m_ghostEnabled
 
bool m_showFrame
 
bool m_showBoundaryBox
 
bool m_showCollisionDetector
 
bool m_useTextureMapping
 
bool m_useMaterialProperty
 
bool m_useVertexColors
 
bool m_useDisplayList
 
cDisplayList m_displayList
 
int m_triangleMode
 
bool m_useTransparency
 
bool m_cullingEnabled
 
cShaderProgramPtr m_shaderProgram
 
cTransform m_frameGL
 
cGenericCollision * m_collisionDetector
 
std::vector< cGenericEffect * > m_effects
 
- Static Protected Attributes inherited from chai3d::cGenericObject
static cMaterialPtr s_defaultMaterial
 

Constructor & Destructor Documentation

cGELMesh::cGELMesh ( )
inline
virtual cGELMesh::~cGELMesh ( )
inlinevirtual

Member Function Documentation

void cGELMesh::buildVertices ( )

This method builds the dynamic vertices of this deformable mesh.

void cGELMesh::connectVerticesToSkeleton ( bool  a_connectToNodesOnly)

This method connects each dynamic vertex to the nearest node on the skeleton.

Parameters
a_connectToNodesOnlyif true, then skin is only connected to nodes only, if false then skin mesh is connected to nodes and links.
void cGELMesh::updateVertexPosition ( )

This method updates the position of each vertex attached to the skeleton.

void cGELMesh::clearForces ( )

This method clears all force variables and sets them to zero.

void cGELMesh::clearExternalForces ( )

This method clears all external force variables and sets them to zero.

void cGELMesh::computeForces ( )

This method computes all internal forces by parsing every elastic link of the skeleton.

void cGELMesh::computeNextPose ( double  a_timeInterval)

This method updates the simulation over a given time interval passed as argument.

Parameters
a_timeIntervalTime interval.
void cGELMesh::applyNextPose ( )

This method updates the position of every skeleton node.

void cGELMesh::render ( chai3d::cRenderOptions &  a_options)
virtual

This method graphically renders the deformable mesh in OpenGL.

Parameters
a_optionsRendering options.

Reimplemented from chai3d::cMultiMesh.

Member Data Documentation

std::list<cGELSkeletonNode*> cGELMesh::m_nodes
std::list<cGELSkeletonLink*> cGELMesh::m_links
std::list<cGELLinearSpring*> cGELMesh::m_linearSprings
std::vector<cGELVertex> cGELMesh::m_gelVertices
bool cGELMesh::m_showSkeletonModel
bool cGELMesh::m_showMassParticleModel
bool cGELMesh::m_useSkeletonModel
bool cGELMesh::m_useMassParticleModel

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