Biomechanical Joint Model
 Author: Anderson Maciel

COME_Mesh Class Reference

#include <comemesh.h>

Inherits COME.

Inheritance diagram for COME_Mesh:

Inheritance graph
[legend]
Collaboration diagram for COME_Mesh:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 COME_Mesh ()
 COME_Mesh (const vector< COME_Vertex3D > verticesN, const vector< COME_Face > facesN, COME_BioStructure *parentN)
 ~COME_Mesh ()
int loadImage (string filename)
void addFaceAsIndices (vector< int > indicesN)
void addVertex (COME_Vertex3D vertexN)
void setAVertex (COME_Vertex3D vertN, int iPosN)
void setCollisionDetectableFaces ()
vector< COME_Vertex3D > & getVertices ()
vector< COME_Vertex3D > * getVerticesPt ()
vector< COME_Vertex3DgetVerticesGlobal ()
vector< COME_FacegetFaces () const
vector< COME_Vertex3DgetVerticesFace (int iNumberFace) const
vector< COME_Vertex3DgetVerticesFaceGlobalPosition (int iNumberFace) const
COME_Vertex3D getAVertex (int iPosN) const
COME_Vertex3D getClosestVertex (COME_Point3D givenPoint) const
int getClosestVertexIndex (COME_Point3D givenPoint) const
int getClosestFaceIndex (COME_Point3D givenPoint)
COME_Face getAFace (int iNumberFace) const
int getNumberFaces () const
ImagegetTexture ()
unsigned int * getTextureID ()
string getFileName ()
void setFileName (string newName)
void getEnvelop (COME_Point3D &mins, COME_Point3D &maxs)
COME_Point3D medialPoint ()
void updateVerticesNormals ()
bool isInside (COME_Point3D currentPoint)
void findIntersections (COME_Point3D pi, COME_Point3D pf, vector< COME_Point3D > *allIntersections)
bool loadFile (string fileName, double scaleFactor, COME_Point3D originTranslation)
void resetMesh ()
void update ()
void estabilishLinkVerticesFaces ()
int simplify (double minDistance)
void scaleOnNormals (double factor)
void scale (double factor)
void scale (double factorx, double factory, double factorz)
void translate (double dx, double dy, double dz)
void rotate (double rx, double ry, double rz)
void transform (COME_Matrix M)
void anchorToMolecules (COME_MoleculesTissue *substract, int anchorNumber)
void resetCollisionDisps ()
int getClosestFaceIndex (COME_Point3D givenPoint) const
void changeAnchorIfNear (COME_Molecule *molecule, int anchorNumber, int vert)
int findDistantAnchor (int indVertex, int anchorNumber)
void initClosestNeighbour ()
COME_Vertex3D calcGravityPoint (vector< COME_Vertex3D > vertices)
double calcVolume ()
double calcAreaOfFace (vector< COME_Vertex3D > verticesFace)
double distanceVertexFace (COME_Vertex3D vertex, vector< COME_Vertex3D > verticesFace)
COME_Vertex3D getAVertexGlobalPosition (int iPosN)
COME_Matrix getGIM ()
void updateFacesNormalsGlobalPosition ()
void updateVerticesNormalsGlobalPosition ()
void updateGlobalPositions ()
void initVerticesNeighbours ()
void initFacesNeighbours ()
COME_FacegetAFacePt (int iNumberFace)
vector< COME_Face * > getPtFaces ()
vector< COME_Face > * getFacesPt ()
vector< COME_Vertex3DupdateMesh ()
void updateSkin ()
vector< COME_Vertex3D > * getVerticesGlobalPt ()
COME_Vertex3DgetAVertexGlobalPositionPt (int iPosN)
COME_Vertex3DgetAVertexPt (int iPosN)

Protected Member Functions

void edgeCollapse (int v1, int v2)
void reverse (char *data, int size)

Protected Attributes

vector< COME_Vertex3Dvertices
vector< COME_Vertex3DverticesGlobal
vector< COME_Facefaces
Imagetexture
unsigned int textureID
string meshFile

Static Protected Attributes

static int textureCount = 0

Detailed Description

Definition at line 57 of file comemesh.h.


Constructor & Destructor Documentation

COME_Mesh::COME_Mesh  ) 
 

Construction/Destruction

Definition at line 51 of file comemesh.cpp.

References texture, and textureID.

COME_Mesh::COME_Mesh const vector< COME_Vertex3D verticesN,
const vector< COME_Face facesN,
COME_BioStructure parentN
 

Definition at line 57 of file comemesh.cpp.

References faces, COME::parent, texture, and vertices.

COME_Mesh::~COME_Mesh  ) 
 

Definition at line 65 of file comemesh.cpp.


Member Function Documentation

void COME_Mesh::addFaceAsIndices vector< int >  indicesN  ) 
 

Setting

next line don't apply when loading a mesh from a file

Definition at line 75 of file comemesh.cpp.

References faces, and COME_Face::updateNormal().

Referenced by COME_MoleculesBone::generateEnvelopSurface(), and loadFile().

Here is the call graph for this function:

void COME_Mesh::addVertex COME_Vertex3D  vertexN  ) 
 

Add a vertex to global vector when adding a vertex to the mesh

Definition at line 86 of file comemesh.cpp.

References vertices, and verticesGlobal.

Referenced by COME_MoleculesBone::generateEnvelopSurface(), and loadFile().

void COME_Mesh::anchorToMolecules COME_MoleculesTissue substract,
int  anchorNumber
 

Associate every vertex of this mesh to the anchorNumber nearest molecules of the organ associated to this mesh by means of its parent.

Definition at line 949 of file comemesh.cpp.

References COME_MoleculesTissue::getShape(), INFINITE, and vertices.

Here is the call graph for this function:

double COME_Mesh::calcAreaOfFace vector< COME_Vertex3D verticesFace  ) 
 

Definition at line 1170 of file comemesh.cpp.

References b.

Referenced by calcVolume().

COME_Vertex3D COME_Mesh::calcGravityPoint vector< COME_Vertex3D vertices  ) 
 

Definition at line 1150 of file comemesh.cpp.

References COME_Point3D::x, COME_Point3D::y, and COME_Point3D::z.

Referenced by calcVolume().

double COME_Mesh::calcVolume  ) 
 

Definition at line 1205 of file comemesh.cpp.

References calcAreaOfFace(), calcGravityPoint(), distanceVertexFace(), faces, getVerticesGlobal(), and verticesGlobal.

Here is the call graph for this function:

void COME_Mesh::changeAnchorIfNear COME_Molecule molecule,
int  anchorNumber,
int  vert
 

Definition at line 1083 of file comemesh.cpp.

References findDistantAnchor(), COME_SubSpaceElement::getPosition(), vertices, and COME_Point3D::vpDistance().

Here is the call graph for this function:

double COME_Mesh::distanceVertexFace COME_Vertex3D  vertex,
vector< COME_Vertex3D verticesFace
 

Definition at line 1190 of file comemesh.cpp.

References myAbs(), COME_Vector3D::setVector3D(), COME_Vector3D::vpModule(), COME_Vector3D::vpNormalize(), COME_Point3D::x, COME_Point3D::y, and COME_Point3D::z.

Referenced by calcVolume().

Here is the call graph for this function:

void COME_Mesh::edgeCollapse int  v1,
int  v2
[protected]
 

Implements edge-collapse algorithm to remove edge between v1 and v2.

Definition at line 773 of file comemesh.cpp.

References faces.

Referenced by simplify().

void COME_Mesh::estabilishLinkVerticesFaces  ) 
 

Asks every face in this mesh to update itself.

Definition at line 727 of file comemesh.cpp.

References faces, and vertices.

Referenced by COME_MoleculesCartilage::updateSurface(), and COME_MoleculesBone::updateSurface().

int COME_Mesh::findDistantAnchor int  indVertex,
int  anchorNumber
 

Definition at line 1101 of file comemesh.cpp.

References vertices.

Referenced by changeAnchorIfNear().

void COME_Mesh::findIntersections COME_Point3D  pi,
COME_Point3D  pf,
vector< COME_Point3D > *  allIntersections
 

Calculate and add to allIntersections any existing intersection between the segment defined by pi..pf and this mesh.

Definition at line 504 of file comemesh.cpp.

References faces, and getVerticesGlobalPt().

Referenced by COME_MoleculesCartilage::discretize().

Here is the call graph for this function:

COME_Face COME_Mesh::getAFace int  iNumberFace  )  const
 

Definition at line 284 of file comemesh.cpp.

References faces.

Referenced by COME_Collision::calculatePenetration(), and COME_Collision::COME_Collision().

COME_Face * COME_Mesh::getAFacePt int  iNumberFace  ) 
 

Definition at line 290 of file comemesh.cpp.

References faces.

Referenced by COME_Vertex3D::addNeighbour(), COME_Collide::addProximities(), COME_Collision::calculatePenetrationGlobalPosition(), COME_Collide::detectContacts(), COME_Collide::detectContactsDisplacement(), COME_Collide::findMaxProjection(), and COME_Collide::findMinProjection().

COME_Vertex3D COME_Mesh::getAVertex int  iPosN  )  const
 

Definition at line 271 of file comemesh.cpp.

References vertices.

COME_Vertex3D COME_Mesh::getAVertexGlobalPosition int  iPosN  ) 
 

Definition at line 165 of file comemesh.cpp.

References verticesGlobal.

COME_Vertex3D * COME_Mesh::getAVertexGlobalPositionPt int  iPosN  ) 
 

Definition at line 160 of file comemesh.cpp.

References verticesGlobal.

COME_Vertex3D * COME_Mesh::getAVertexPt int  iPosN  ) 
 

Definition at line 277 of file comemesh.cpp.

References vertices.

int COME_Mesh::getClosestFaceIndex COME_Point3D  givenPoint  )  const
 

int COME_Mesh::getClosestFaceIndex COME_Point3D  givenPoint  ) 
 

Definition at line 205 of file comemesh.cpp.

References faces.

Referenced by COME_Collide::addProximities().

COME_Vertex3D COME_Mesh::getClosestVertex COME_Point3D  givenPoint  )  const
 

Definition at line 171 of file comemesh.cpp.

References verticesGlobal, and COME_Point3D::vpDistance().

Here is the call graph for this function:

int COME_Mesh::getClosestVertexIndex COME_Point3D  givenPoint  )  const
 

Definition at line 188 of file comemesh.cpp.

References verticesGlobal.

Referenced by COME_Collide::addProximities().

void COME_Mesh::getEnvelop COME_Point3D mins,
COME_Point3D maxs
 

Definition at line 302 of file comemesh.cpp.

References vertices.

Referenced by COME_MoleculesCartilage::discretize(), COME_Discretizer::fileOpen(), and COME_Clamp::getEnvelop().

vector< COME_Face > COME_Mesh::getFaces  )  const
 

Definition at line 223 of file comemesh.cpp.

References faces.

vector< COME_Face > * COME_Mesh::getFacesPt  ) 
 

Definition at line 228 of file comemesh.cpp.

References faces.

string COME_Mesh::getFileName  ) 
 

Getting

Definition at line 128 of file comemesh.cpp.

References meshFile.

COME_Matrix COME_Mesh::getGIM  ) 
 

Definition at line 155 of file comemesh.cpp.

References COME::parent.

int COME_Mesh::getNumberFaces  )  const
 

Definition at line 296 of file comemesh.cpp.

References faces.

vector< COME_Face * > COME_Mesh::getPtFaces  ) 
 

Definition at line 233 of file comemesh.cpp.

References faces.

Image * COME_Mesh::getTexture  ) 
 

Definition at line 1401 of file comemesh.cpp.

References texture.

unsigned int * COME_Mesh::getTextureID  ) 
 

Definition at line 1407 of file comemesh.cpp.

References textureID.

vector< COME_Vertex3D > & COME_Mesh::getVertices  ) 
 

Definition at line 134 of file comemesh.cpp.

References vertices.

Referenced by initClosestNeighbour().

vector< COME_Vertex3D > COME_Mesh::getVerticesFace int  iNumberFace  )  const
 

Definition at line 243 of file comemesh.cpp.

References faces, COME_Face::getNumberVertices(), and COME_Face::getVertex().

Here is the call graph for this function:

vector< COME_Vertex3D > COME_Mesh::getVerticesFaceGlobalPosition int  iNumberFace  )  const
 

Definition at line 257 of file comemesh.cpp.

References faces, COME_Face::getNumberVertices(), and COME_Face::getVertexGlobalPosition().

Referenced by COME_Collide::detectContacts(), and COME_Collide::detectContactsDisplacement().

Here is the call graph for this function:

vector< COME_Vertex3D > COME_Mesh::getVerticesGlobal  ) 
 

Definition at line 145 of file comemesh.cpp.

References verticesGlobal.

Referenced by calcVolume().

vector< COME_Vertex3D > * COME_Mesh::getVerticesGlobalPt  ) 
 

Definition at line 150 of file comemesh.cpp.

References verticesGlobal.

Referenced by COME_Collide::addProximities(), and findIntersections().

vector< COME_Vertex3D > * COME_Mesh::getVerticesPt  ) 
 

Definition at line 140 of file comemesh.cpp.

References vertices.

Referenced by COME_Collide::addProximities(), and COME_MoleculesCartilage::initializeJacobian().

void COME_Mesh::initClosestNeighbour  ) 
 

Definition at line 1120 of file comemesh.cpp.

References faces, and getVertices().

Here is the call graph for this function:

void COME_Mesh::initFacesNeighbours  ) 
 

Enters the faces neighbours into a vector

Definition at line 1250 of file comemesh.cpp.

References b, faces, and box::size().

Referenced by COME_Clamp::initializeSkinning().

Here is the call graph for this function:

void COME_Mesh::initVerticesNeighbours  ) 
 

Enters the vetices neighbours into a vector

Definition at line 1228 of file comemesh.cpp.

References faces, and verticesGlobal.

Referenced by COME_Clamp::initializeSkinning().

bool COME_Mesh::isInside COME_Point3D  currentPoint  ) 
 

This method verifies if the specified point is inside or outside this mesh.

Definition at line 487 of file comemesh.cpp.

References faces, and COME::setParent().

Referenced by COME_Mechatester::updateClampIntersections(), and COME_MoleculesBone::updateInertiaTensor().

Here is the call graph for this function:

bool COME_Mesh::loadFile string  fileName,
double  scaleFactor,
COME_Point3D  originTranslation
 

Load a 3D mesh from a non-COME_Standard file.

Definition at line 544 of file comemesh.cpp.

References addFaceAsIndices(), addVertex(), COME_Point3D::getX(), COME_Point3D::getY(), COME_Point3D::getZ(), and setFileName().

Here is the call graph for this function:

int COME_Mesh::loadImage string  filename  ) 
 

Definition at line 1292 of file comemesh.cpp.

References Image::data, reverse(), Image::sizeX, Image::sizeY, texture, textureCount, and textureID.

Here is the call graph for this function:

COME_Point3D COME_Mesh::medialPoint  ) 
 

Definition at line 362 of file comemesh.cpp.

References vertices.

void COME_Mesh::resetCollisionDisps  ) 
 

Definition at line 374 of file comemesh.cpp.

References vertices, and verticesGlobal.

void COME_Mesh::resetMesh  ) 
 

Delete all information (vertices and faces) in this mesh.

Definition at line 701 of file comemesh.cpp.

Referenced by COME_MoleculesBone::generateEnvelopSurface().

void COME_Mesh::reverse char *  data,
int  size
[protected]
 

Definition at line 1277 of file comemesh.cpp.

Referenced by loadImage().

void COME_Mesh::rotate double  rx,
double  ry,
double  rz
 

Rotate all vertices of the mesh by the angles in the order xyz. To rotate in another order, make several consecutive calls to this function with zero angles for the axis you don't want to rotate.

Rotate on X

Rotate on Y

Rotate on Z

Definition at line 896 of file comemesh.cpp.

References vertices.

Referenced by COME_BioStructure::rotate().

void COME_Mesh::scale double  factorx,
double  factory,
double  factorz
 

Scale all vertices of the mesh by the factor.

Definition at line 850 of file comemesh.cpp.

References vertices.

void COME_Mesh::scale double  factor  ) 
 

Scale all vertices of the mesh by the factor.

Definition at line 819 of file comemesh.cpp.

References updateSkin(), and vertices.

Referenced by COME_BioStructure::scale().

Here is the call graph for this function:

void COME_Mesh::scaleOnNormals double  factor  ) 
 

Displace all vertices of the mesh in the opposite sense of vertices normals. It ensures a scale operation on the mesh which results in a mesh representing an internal layer of the original.

Definition at line 835 of file comemesh.cpp.

References vertices.

void COME_Mesh::setAVertex COME_Vertex3D  vertN,
int  iPosN
 

Definition at line 93 of file comemesh.cpp.

References vertices.

void COME_Mesh::setCollisionDetectableFaces  ) 
 

Definition at line 100 of file comemesh.cpp.

References faces, and COME::parent.

Referenced by COME_BioStructure::setSurface().

void COME_Mesh::setFileName string  newName  ) 
 

Definition at line 117 of file comemesh.cpp.

References meshFile.

Referenced by loadFile().

int COME_Mesh::simplify double  minDistance  ) 
 

Calls edge-collapse method to remove all edges smaller than minDistance. Returns number of remaining faces in the mesh.

Definition at line 742 of file comemesh.cpp.

References edgeCollapse(), and faces.

Here is the call graph for this function:

void COME_Mesh::transform COME_Matrix  M  ) 
 

Apply the transformation given by the matrix M to all vertices. Used to transform rigid structure like bones.

Definition at line 805 of file comemesh.cpp.

References updateSkin(), and vertices.

Here is the call graph for this function:

void COME_Mesh::translate double  dx,
double  dy,
double  dz
 

Translate all vertices of the mesh by the distances.

OPERATION

Definition at line 881 of file comemesh.cpp.

References vertices.

Referenced by COME_BioStructure::translate().

void COME_Mesh::update  ) 
 

Uses displacements stored in the molecules related to each face of this mesh to update itself the positions of all its vertices.

I guess it's never called

Definition at line 712 of file comemesh.cpp.

References faces, and vertices.

void COME_Mesh::updateFacesNormalsGlobalPosition  ) 
 

TEST FOR PROXIMITIES

Definition at line 427 of file comemesh.cpp.

References faces.

Referenced by updateSkin().

void COME_Mesh::updateGlobalPositions  ) 
 

Definition at line 404 of file comemesh.cpp.

References COME::parent, vertices, and verticesGlobal.

Referenced by updateSkin().

vector<COME_Vertex3D> COME_Mesh::updateMesh  ) 
 

void COME_Mesh::updateSkin  ) 
 

Updating

Definition at line 391 of file comemesh.cpp.

References COME::flagSkinning, updateFacesNormalsGlobalPosition(), updateGlobalPositions(), and updateVerticesNormalsGlobalPosition().

Referenced by COME_BioStructure::rotate(), scale(), COME_BioStructure::scale(), transform(), COME_BioStructure::translate(), COME_MoleculesCartilage::updateSkin(), COME_MoleculesBone::updateSkin(), and COME_Clamp::updateSkin().

Here is the call graph for this function:

void COME_Mesh::updateVerticesNormals  ) 
 

Definition at line 442 of file comemesh.cpp.

References faces, vertices, and verticesGlobal.

void COME_Mesh::updateVerticesNormalsGlobalPosition  ) 
 

Definition at line 462 of file comemesh.cpp.

References faces, vertices, and verticesGlobal.

Referenced by updateSkin().


Member Data Documentation

vector<COME_Face> COME_Mesh::faces [protected]
 

Definition at line 62 of file comemesh.h.

Referenced by addFaceAsIndices(), calcVolume(), COME_Mesh(), edgeCollapse(), estabilishLinkVerticesFaces(), findIntersections(), getAFace(), getAFacePt(), getClosestFaceIndex(), getFaces(), getFacesPt(), getNumberFaces(), getPtFaces(), getVerticesFace(), getVerticesFaceGlobalPosition(), initClosestNeighbour(), initFacesNeighbours(), initVerticesNeighbours(), isInside(), setCollisionDetectableFaces(), simplify(), update(), updateFacesNormalsGlobalPosition(), updateVerticesNormals(), and updateVerticesNormalsGlobalPosition().

string COME_Mesh::meshFile [protected]
 

Definition at line 66 of file comemesh.h.

Referenced by getFileName(), and setFileName().

Image* COME_Mesh::texture [protected]
 

Definition at line 63 of file comemesh.h.

Referenced by COME_Mesh(), getTexture(), and loadImage().

int COME_Mesh::textureCount = 0 [static, protected]
 

PROJECT.....: CO-ME RESPONSIBLE.: Anderson Maciel

AUTHOR......: Anderson Maciel and Fabiana Benedetti DATE........: September/10/2002 DESCRIPTION.: Class definition.

Definition at line 65 of file comemesh.h.

Referenced by loadImage().

unsigned int COME_Mesh::textureID [protected]
 

Definition at line 64 of file comemesh.h.

Referenced by COME_Mesh(), getTextureID(), and loadImage().

vector<COME_Vertex3D> COME_Mesh::vertices [protected]
 

Definition at line 60 of file comemesh.h.

Referenced by addVertex(), anchorToMolecules(), changeAnchorIfNear(), COME_Mesh(), estabilishLinkVerticesFaces(), findDistantAnchor(), getAVertex(), getAVertexPt(), getEnvelop(), getVertices(), getVerticesPt(), medialPoint(), resetCollisionDisps(), rotate(), scale(), scaleOnNormals(), setAVertex(), transform(), translate(), update(), updateGlobalPositions(), updateVerticesNormals(), and updateVerticesNormalsGlobalPosition().

vector<COME_Vertex3D> COME_Mesh::verticesGlobal [protected]
 

Definition at line 61 of file comemesh.h.

Referenced by addVertex(), calcVolume(), getAVertexGlobalPosition(), getAVertexGlobalPositionPt(), getClosestVertex(), getClosestVertexIndex(), getVerticesGlobal(), getVerticesGlobalPt(), initVerticesNeighbours(), resetCollisionDisps(), updateGlobalPositions(), updateVerticesNormals(), and updateVerticesNormalsGlobalPosition().


The documentation for this class was generated from the following files:
Generated on Thu Dec 1 10:14:23 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5