In file SM2/SM2.h:

class SM2 : public SM2Topology, public Data3D, public GeneralFormat, ifdef GRAPHICS public PickingObject, public SurfaceSliceable, endif public DeformableModel3D

2 simplex mesh

Inheritance:


Public Classes

enum DeformationType
the different type of deformation applied on 2-simplex mesh
NONE
do not deform 2simplex mesh
LOCAL
apply local (per vertex) deformation forces
GLOBALLY_CONSTRAINED
mix local deformation and global transformation forces
GLOBAL
apply global transformation forces
enum SELECTION_MODE
model subobject selection mode
SELECT_ZONE
select model zone
EDIT_ZONE
edit mesh zone
SELECT_SUBOBJECT
select model edge or vertex
SELECT_FACE
select 2-simplex mesh face
GRAB
grab closest vertices

Public Methods

Vec3 getCenter () const
return the mesh center
double getRadius () const
return the mesh radius of the circumscribed sphere
virtual SM2VertexTopology* newVertex (SM2VertexTopology *n0 = 0, SM2VertexTopology *n1 = 0, SM2VertexTopology *n2 = 0, SM2FaceTopology *f0 = 0, SM2FaceTopology *f1 = 0, SM2FaceTopology *f2 = 0, SM2EdgeTopology *e0 = 0, SM2EdgeTopology *e1 = 0, SM2EdgeTopology *e2 = 0)
Creates new vertex
virtual SM2Vertex* newVertex (const SM2Vertex& org)
Creates new vertex by copy
virtual SM2EdgeTopology* newEdge ( SM2VertexTopology *v1, SM2VertexTopology *v2, SM2FaceTopology *f1 = 0, SM2FaceTopology *f2 = 0)
creates a new edge
virtual SM2FaceTopology* newFace (SM2EdgeTopology *edge, unsigned int orientation, SM2ZoneTopology *zone = 0)
creates a new face
void append (const SM2& mesh)
add in the current mesh a copy of a given mesh
void refine (void)
Refines the mesh (approx
void refineOld (void)
Refines the mesh (twice more faces) returns the new number of faces
void decimate (void)
Decimates the mesh (half less faces if possible) returns the new number of faces
void checkContourTopology (void) const
tests if the contour definition on a simplex mesh is coherent: prints error on cerr otherwise
void computeInternalForces (void)
computes all vertices internal forces
void computeExternalForces (void)
computes all vertices external forces
void computeAveragedExternalForces (void)
computes all vertices averaged forces
void computeGlobalForces (void)
computes all vertices global forces
void computeGloballyConstrainedForces (void)
computes all vertices globally constrained forces
void computeTotalForces (void)
computes all vertices total forces
void updatePosition (void)
updates all vertices position
void computeForces (void)
computes all vertices forces
void setStopFunction (SM2_STOP_FUNCTION _stop)
set the new function that estimates if the mesh should be active
SM2_STOP_FUNCTION getStopFunction () const
get the new function that estimates if the mesh should be active
void setStopDistance (const double d)
set the distance use to decide if the mesh shoud be active or not
double getStopDistance () const
get the distance use to decide if the mesh shoud be active or not
void setStopClientData (void *clientData)
set the data structure (void pointer) used as a parameter to the stop function
void* getStopClientData () const
get the data structure (void pointer) used as a parameter to the stop function
static bool testSM2Displacement (SM2 *mesh, void *clientData=0)
a stop function that tests if the maximum dispacement |position-previousPosition| is greater than a threshold)
double getVolume (void) const
returns model volume
SM2Contour3D* assembleContour (int tag) throw(SM2Contour3D::CannotCreateContour)
create a closed contour on a 2-simplex mesh given a label
Transformation::Type getGlobalTransformation (void) const
returns global transformation type
DeformationType getDeformationType (void) const
returns mesh deformation type
void setGlobalTransformation (Transformation::Type type)
set global transformation type
void setDeformationType (DeformationType type)
set model deformation type
void setSurfaceChanged (bool b)
set surfaceChanged flag
bool getSurfaceChanged (void) const
returns surfaceChanged flag
const TclString& getFileName (void) const
returns mesh file name
void setFileName (const char *name)
set new mesh file name
bool getUseReferenceShape (void) const
returns reference shape flag
void setUseReferenceShape (bool rs)
set reference shape flag
RangeInformation* getRangeInformation () const
get the range information applied on all vertices
void setRangeInformation ( RangeInformation * ri)
set the range information applied on all vertices
virtual void translate (const Vec3& tr)
translates the object
virtual void rotate (const Rotation3D& rotation)
rotates the object
virtual void scale (const double scale)
scales the object
SELECTION_MODE getSelectionMode (void) const
returns model subobject selection mode
void setSelectionMode (SELECTION_MODE mode)
set model subobject selection mode
virtual void redraw (Camera3D *)
all graphics objects can be drawn
virtual void updateCenter (Vec3& center, unsigned int& n)
Returns the graphic object center and weight
virtual double updateRadius (const Vec3& center)
Returns the graphic object radius given its center
virtual double computeClosestDistance (DataTypes::MouseClick& mc) const
The routine that allows the camera to select an object by computing the distance of an object from its radial line
void selectObject (const Vec2 pixel, Camera3D *cam)
looks for closest subobject from click point
void grabCallback (const Vec2& pixel, Camera3D *cam)
grab vertices from a mouse click in a 3D camera
void grab (const Vec3& direction, const Vec3 &pos)
grab vertices towards a 3D point
Vec3 * grab2D (const Vec3& direction, const Vec3 &pos)
grab vertices towards a point in a slice
void setSelectedFace (SM2Face *f)
returns mesh selected face
void setSelectedZone (SM2Zone *z)
returns mesh selected zone
void setSelectedEdge (SM2Edge *e)
returns mesh selected edge
void setSelectedVertex (SM2Vertex *v)
returns mesh selected edge
SM2Vertex* getSelectedVertex (void) const
returns mesh selected vertex
SM2Edge* getSelectedEdge (void) const
returns mesh selected edge
SM2Face* getSelectedFace (void) const
returns mesh selected face
SM2Zone* getSelectedZone (void) const
returns mesh selected zone
virtual void selected (void)
function called when this object is selected
virtual void unselected (void)
function called when this object is unselected
void unselect (void)
unselects any subobject
void select (SM2Vertex *v)
select given vertex
void select (SM2Edge *e)
select given edge
void select (SM2Face *e)
select given face
void select (SM2Zone *e)
select given zone
void selectVertex (int ref)
select given vertex
void selectEdge (int ref)
select given edge
void selectFace (int ref)
select given face
void selectZone (int ref)
select given zone
void setRendering (const TclString& n)
set surface rendering mode
unsigned short int getGrabRange (void) const
returns model grab range
void setMaximumRigidity (void)
computes and store each vertex maximum rigidity
unsigned int getMaximumRigidity (void) const
returns mesh maximum rigidity
void computeSimplexAngle (void)
computes all vertices simplex angle
void computeMeanCurvature (void)
computes all vertices mean curvature
virtual void setScene (Scene3D *scene)
move model in new scene, resynchronize model traces in cameras
void setLocality (double locality)
set the locality of all model vertices to given value and switch to corresponding deformation mode
SM2VerticesIterator firstVertex (void) const
returns an iterator on vertices, initialized on first vertex
SM2VerticesIterator lastVertex (void) const
returns an iterator on vertices, initialized on last vertex
SM2EdgesIterator firstEdge (void) const
returns an iterator on edges, initialized on first edge
SM2EdgesIterator lastEdge (void) const
returns an iterator on edges, initialized on last edge
SM2FacesIterator firstFace (void) const
returns an iterator on faces, initialized on first face
SM2FacesIterator lastFace (void) const
returns an iterator on faces, initialized on last face
SM2ZonesIterator firstZone (void) const
returns an iterator on zones, initialized on first zone
SM2ZonesIterator lastZone (void) const
returns an iterator on zones, initialized on last zone
SM2ContoursIterator firstContour () const
returns an iterator on the contour list
SM2ContoursIterator lastContour () const
returns an iterator on the contour list
SM2Vertex* getFirstVertex (void) const
returns first mesh vertex
SM2Edge* getFirstEdge (void) const
returns first mesh edge
SM2Face* getFirstFace (void) const
returns first mesh face
SM2Zone* getFirstZone (void) const
returns first mesh zone
SM2Vertex* getLastVertex (void) const
returns last mesh vertex
SM2Edge* getLastEdge (void) const
returns last mesh edge
SM2Face* getLastFace (void) const
returns last mesh face
SM2Zone* getLastZone (void) const
returns last mesh zone
void iterate (const unsigned int n)
model deformation callback
void apply (void (SM2Vertex::*ptr)(void))
apply member function on each mesh vertex
void apply (void (SM2Vertex::*ptr)(int), int val)
apply member function on each mesh vertex
void apply (void (SM2Vertex::*ptr)(const unsigned int), const unsigned int val)
apply member function on each mesh vertex
void apply (void (SM2Vertex::*ptr)(float), float val)
apply member function on each mesh vertex
void apply (void (SM2Vertex::*ptr)(const double), const double val)
apply member function on each mesh vertex
void apply (void (SM2Vertex::*ptr)(void *), void *val)
apply member function on each mesh vertex
void apply (void (SM2Edge::*ptr)(void))
apply member function on each mesh edge
void apply (void (SM2Face::*ptr)(void))
apply member function on each mesh face
void setInternalForce (InternalForce3DType *ft)
set a given internal force as the main internal force applying on all vertices : updates the internalForceType field of all vertices and eventually call the ft->setGlobalFunction()
void setInternalForce (char *forceName)
find the internal force corresponding to its name
InternalForce3DType* getInternalForceType () const
returns the internal force type applying on the whole contour
void flipNormals (void)
flip every model normals
bool areNormalsFlipped () const
whether the direction normal vector at each vertex and each face should be flipped for display purposes
SM2Vertex* getVertex (unsigned int i) const
get vertex by index
SM2Edge* getEdge (unsigned int i) const
get edge by index
SM2Face* getFace (unsigned int i) const
get face by index
SM2Zone* getZone (unsigned int i) const
get zone by index
std::list intersectWithPlane (const Vec3& normal, const Vec3& origin, const Vec3& vx, const Vec3& vy)
compute model surface intersection with a plane
virtual TclString getSurfaceSliceableName () const
returns the string identifying the Tcl name of simplex mesh
static void drawVector (const Vec3& from, const Vec3& arrow, const Color& color, double width)
draw an arrow
TclSM2* getInterface (void) const
returns simplex mesh interface

Public

constructors
SM2 (const TclString& name, Scene3D *scene=0, GeneralFormatModuleVersion::INPUTREADFUNCTION readFct = (GeneralFormatModuleVersion::INPUTREADFUNCTION) &SM2::readMainModule)
build from file
SM2 (const SM2& org)
copy constructor
destructor
virtual ~SM2 ()
delete object from scene

Protected Fields

ObjectsList <SM2Contour3D> contours
the list of contours
TclString filename
name under which the file is saved
TclString meshname
name of this mesh (could have several meshes in a file)
unsigned int maximumRigidity
maximum possible rigidity in the 2-simplex mesh
SM2_STOP_FUNCTION stopFct
the fonction to be called to decide if the mesh should still be iterated or not
void* stopClientData
some parameters used by the stop function
double stopDistance
some distance used to decide if the mesh should still be active or not
double damping
2-simplex mesh damping coefficient for evolution law
DeformationType deformationType
type of deformation used
Transformation::Type globalTransformation
type of global transformation used
bool balloonForce
whether to use balloon force
double balloonCoefficient
balloon force weight
bool useReferenceShape
whether to compute shape spring forces
RangeInformation* rangeInformation
the range information used for all vertices
Vec3 referenceCenter
2-simplex mesh reference (stored) center
bool surfaceChanged
whether 2simplex mesh was deformed
bool displayNormals
whether to display surface normal at vertices
bool displayTopologyConstraint
whether to display structures built for a topology constraint
bool displayFaceEdges
whether to display all face edges of the data structure built for a topology constraint *
bool displaySimplifiedEdges
whether to display all simplified edges of the data structure built for a topology constraint *
bool displayIntersections
whether to display all intersection lines of the data structure built for a topology constraint *
bool displayVoxelIntersections
whether to display the voxels where intersections occur in the data structure built for a topology constraint *
bool displayIntersectionContours
whether to display intersection contours *
int displayForces
whether to display each force type
static Color normalsColor
normal display color
static float normalsWidth
normal display width
static double normalsScale
normals arrows display scale
static Color forcesColor [6]
each force display color
static float forcesWidth
each force display width
static double forcesScale
force display scale
bool flipNormal
whether we should flip normal for display
bool displayGrabArrow
whether mouse grab arrow should be displayed on next redraw
Vec3 grabOrg
mouse grab arrow origin
Vec3 grabArrow
mouse grab arrow
static Color grabArrowColor
grab arrow display color
SELECTION_MODE selectionMode
model subobject selection mode
unsigned short int grabRange
mouse grab extension
GLuint faceDisplayList
The face display list for picking and LIE collision
SM2Vertex* selectedVertex
pointer on selected vertex (0 if no vertex is selected)
SM2Face* selectedFace
pointer on selected face (0 if no face is selected)
SM2Edge* selectedEdge
pointer on selected edge (0 if no edge is selected)
SM2Zone* selectedZone
pointer on selected zone (0 if no zone is selected)
Vec3 center
2-simplex mesh center
double radius
sphere that include the 2simplex mesh radius
InternalForce3DType* mainInternalForce
internal force used for all vertices internal force computation
Matrix4x4 globalMatrix
cumulated global transformations

Protected Methods

void buildFaceDisplayList ()
build the face display list when needed
void surfaceHasChanged ()
function called when the surface geometry or topology has changed
void init (GeneralFormatModuleVersion::INPUTREADFUNCTION readFct = (GeneralFormatModuleVersion::INPUTREADFUNCTION) &SM2::readMainModule)
constructors common code
void renumber (void) const
renumber mesh vertices, faces, edges and zones
void readMainModule (GFInput &input)
general format read function for main module
void skipMainModule (GFInput &input)
general format skip function for main module
void writeMainModule (GFOutput &output)
general format write function for main module
void readRangeInformation (GFInput &input)
general format read function for range information
void skipRangeInformation (GFInput &input)
general format skip function for range information
void writeRangeInformation (GFOutput &output)
general format write function for range information
void setShapeInternalForce (void)
initialization method for shape internal forces
void setSpringInternalForce (void)
initialization method for spring internal forces
void computeEdgesLengthAndDirection (void)
computes all edges length and direction
SM2 (Scene3D *scene)
creates an empty mesh
void copy (const SM2& org, SM2Vertex **vertexTable, int *refs)
part of copy constructor (after vertices have been copied)
void readMainModule2 (GFInput &input, int nbVertices)
general format read function for main module

Protected


compute model surface intersection with a volumetric image

Inherited from SM2Topology:

Public Methods

virtual unsigned int regularizeTopology(void)
static SM2FaceTopology* sameFace(const SM2EdgeTopology *e1, const SM2EdgeTopology *e2)
SM2TopologyVerticesIterator firstVertexTopology(void) const
SM2TopologyVerticesIterator lastVertexTopology(void) const
SM2TopologyEdgesIterator firstEdgeTopology(void) const
SM2TopologyEdgesIterator lastEdgeTopology(void) const
SM2TopologyFacesIterator firstFaceTopology(void) const
SM2TopologyFacesIterator lastFaceTopology(void) const
SM2TopologyZonesIterator firstZoneTopology(void) const
SM2TopologyZonesIterator lastZoneTopology(void) const
SM2VertexTopology* getFirstVertexTopology(void) const
SM2EdgeTopology* getFirstEdgeTopology(void) const
SM2FaceTopology* getFirstFaceTopology(void) const
SM2ZoneTopology* getFirstZoneTopology(void) const
unsigned int getNumberOfVertices(void) const
unsigned int getNumberOfEdges(void) const
unsigned int getNumberOfFaces(void) const
unsigned int getNumberOfZones(void) const
void addVertex(SM2VertexTopology* v)
void addEdge(SM2EdgeTopology* e)
void addFace(SM2FaceTopology* f)
void addZone(SM2ZoneTopology* z)

Public

constructor

SM2Topology()
builds an empty mesh

Protected Fields

ObjectsList <SM2VertexTopology> vertices
ObjectsList <SM2FaceTopology> faces
ObjectsList <SM2EdgeTopology> edges
ObjectsList <SM2ZoneTopology> zones

Documentation

2 simplex mesh
enum DeformationType
the different type of deformation applied on 2-simplex mesh

NONE
do not deform 2simplex mesh

LOCAL
apply local (per vertex) deformation forces

GLOBALLY_CONSTRAINED
mix local deformation and global transformation forces

GLOBAL
apply global transformation forces

enum SELECTION_MODE
model subobject selection mode

SELECT_ZONE
select model zone

EDIT_ZONE
edit mesh zone

SELECT_SUBOBJECT
select model edge or vertex

SELECT_FACE
select 2-simplex mesh face

GRAB
grab closest vertices

ObjectsList <SM2Contour3D> contours
the list of contours

TclString filename
name under which the file is saved

TclString meshname
name of this mesh (could have several meshes in a file)

unsigned int maximumRigidity
maximum possible rigidity in the 2-simplex mesh

SM2_STOP_FUNCTION stopFct
the fonction to be called to decide if the mesh should still be iterated or not

void* stopClientData
some parameters used by the stop function

double stopDistance
some distance used to decide if the mesh should still be active or not

double damping
2-simplex mesh damping coefficient for evolution law

DeformationType deformationType
type of deformation used

Transformation::Type globalTransformation
type of global transformation used

bool balloonForce
whether to use balloon force

double balloonCoefficient
balloon force weight

bool useReferenceShape
whether to compute shape spring forces

RangeInformation* rangeInformation
the range information used for all vertices

Vec3 referenceCenter
2-simplex mesh reference (stored) center

bool surfaceChanged
whether 2simplex mesh was deformed

bool displayNormals
whether to display surface normal at vertices

bool displayTopologyConstraint
whether to display structures built for a topology constraint

bool displayFaceEdges
whether to display all face edges of the data structure built for a topology constraint *

bool displaySimplifiedEdges
whether to display all simplified edges of the data structure built for a topology constraint *

bool displayIntersections
whether to display all intersection lines of the data structure built for a topology constraint *

bool displayVoxelIntersections
whether to display the voxels where intersections occur in the data structure built for a topology constraint *

bool displayIntersectionContours
whether to display intersection contours *

int displayForces
whether to display each force type

static Color normalsColor
normal display color

static float normalsWidth
normal display width

static double normalsScale
normals arrows display scale

static Color forcesColor[6]
each force display color

static float forcesWidth
each force display width

static double forcesScale
force display scale

bool flipNormal
whether we should flip normal for display

bool displayGrabArrow
whether mouse grab arrow should be displayed on next redraw

Vec3 grabOrg
mouse grab arrow origin

Vec3 grabArrow
mouse grab arrow

static Color grabArrowColor
grab arrow display color

SELECTION_MODE selectionMode
model subobject selection mode

unsigned short int grabRange
mouse grab extension

GLuint faceDisplayList
The face display list for picking and LIE collision

void buildFaceDisplayList()
build the face display list when needed

void surfaceHasChanged()
function called when the surface geometry or topology has changed

SM2Vertex* selectedVertex
pointer on selected vertex (0 if no vertex is selected)

SM2Face* selectedFace
pointer on selected face (0 if no face is selected)

SM2Edge* selectedEdge
pointer on selected edge (0 if no edge is selected)

SM2Zone* selectedZone
pointer on selected zone (0 if no zone is selected)

Vec3 center
2-simplex mesh center

double radius
sphere that include the 2simplex mesh radius

Vec3 getCenter() const
return the mesh center

double getRadius() const
return the mesh radius of the circumscribed sphere

InternalForce3DType* mainInternalForce
internal force used for all vertices internal force computation

Matrix4x4 globalMatrix
cumulated global transformations

void init(GeneralFormatModuleVersion::INPUTREADFUNCTION readFct = (GeneralFormatModuleVersion::INPUTREADFUNCTION) &SM2::readMainModule)
constructors common code

void renumber(void) const
renumber mesh vertices, faces, edges and zones

void readMainModule(GFInput &input)
general format read function for main module

void skipMainModule(GFInput &input)
general format skip function for main module

void writeMainModule(GFOutput &output)
general format write function for main module

void readRangeInformation(GFInput &input)
general format read function for range information

void skipRangeInformation(GFInput &input)
general format skip function for range information

void writeRangeInformation(GFOutput &output)
general format write function for range information

void setShapeInternalForce(void)
initialization method for shape internal forces

void setSpringInternalForce(void)
initialization method for spring internal forces

void computeEdgesLengthAndDirection(void)
computes all edges length and direction

constructors

SM2(const TclString& name, Scene3D *scene=0, GeneralFormatModuleVersion::INPUTREADFUNCTION readFct = (GeneralFormatModuleVersion::INPUTREADFUNCTION) &SM2::readMainModule)
build from file
Parameters:
name - simplex mesh file name
scene - scene to build object in
readFct - read main module function (if default one should be overloaded by a child)

SM2(const SM2& org)
copy constructor

destructor

virtual ~SM2()
delete object from scene

virtual SM2VertexTopology* newVertex(SM2VertexTopology *n0 = 0, SM2VertexTopology *n1 = 0, SM2VertexTopology *n2 = 0, SM2FaceTopology *f0 = 0, SM2FaceTopology *f1 = 0, SM2FaceTopology *f2 = 0, SM2EdgeTopology *e0 = 0, SM2EdgeTopology *e1 = 0, SM2EdgeTopology *e2 = 0)
Creates new vertex. Warning: SM2Vertex, SM2Face and SM2Edge structures should be transmitted as parameters of this method (otherwise manipulating the resulting vertex should lead to unpredictible segmentation fault!).
Parameters:
n0 - first neighbor,
n1 - second neighbor,
n2 - third neighbor,
f0 - first face,
f1 - second face,
f2 - third face,
e0 - first edge,
e1 - second edge,
e2 - third edge

virtual SM2Vertex* newVertex(const SM2Vertex& org)
Creates new vertex by copy
Parameters:
org - vertex to copy

virtual SM2EdgeTopology* newEdge( SM2VertexTopology *v1, SM2VertexTopology *v2, SM2FaceTopology *f1 = 0, SM2FaceTopology *f2 = 0)
creates a new edge. Warning: SM2Vertex, SM2Face and SM2Edge structures should be transmitted as parameters of this method (otherwise manipulating the resulting vertex should lead to unpredictible segmentation fault!).
Parameters:
mesh - edge mesh
v1 - first edge vertex
v2 - second edge vertex
f1 - first edge face
f2 - second edge face

virtual SM2FaceTopology* newFace(SM2EdgeTopology *edge, unsigned int orientation, SM2ZoneTopology *zone = 0)
creates a new face. Warning: SM2Vertex, SM2Face and SM2Edge structures should be transmitted as parameters of this method (otherwise manipulating the resulting vertex should lead to unpredictible segmentation fault!).
Parameters:
edge - one face edge
zone - zone face belongs to

void append(const SM2& mesh)
add in the current mesh a copy of a given mesh
Parameters:
mesh - a 2-simplex mesh that will be inserted in the current mesh *

void refine(void)
Refines the mesh (approx. three times more faces) returns the new number of faces

void refineOld(void)
Refines the mesh (twice more faces) returns the new number of faces

void decimate(void)
Decimates the mesh (half less faces if possible) returns the new number of faces

void checkContourTopology(void) const
tests if the contour definition on a simplex mesh is coherent: prints error on cerr otherwise

void computeInternalForces(void)
computes all vertices internal forces

void computeExternalForces(void)
computes all vertices external forces

void computeAveragedExternalForces(void)
computes all vertices averaged forces

void computeGlobalForces(void)
computes all vertices global forces

void computeGloballyConstrainedForces(void)
computes all vertices globally constrained forces

void computeTotalForces(void)
computes all vertices total forces

void updatePosition(void)
updates all vertices position

void computeForces(void)
computes all vertices forces

void setStopFunction(SM2_STOP_FUNCTION _stop)
set the new function that estimates if the mesh should be active

SM2_STOP_FUNCTION getStopFunction() const
get the new function that estimates if the mesh should be active

void setStopDistance(const double d)
set the distance use to decide if the mesh shoud be active or not

double getStopDistance() const
get the distance use to decide if the mesh shoud be active or not

void setStopClientData(void *clientData)
set the data structure (void pointer) used as a parameter to the stop function

void* getStopClientData() const
get the data structure (void pointer) used as a parameter to the stop function

static bool testSM2Displacement(SM2 *mesh, void *clientData=0)
a stop function that tests if the maximum dispacement |position-previousPosition| is greater than a threshold)

double getVolume(void) const
returns model volume

SM2Contour3D* assembleContour(int tag) throw(SM2Contour3D::CannotCreateContour)
create a closed contour on a 2-simplex mesh given a label
Throws:
SM2Contour3D ::CannotCreateContour when it is not possible to create a contour because it does not follow a basic rule : each contour vertex must have exactly 2 neighbors on the contour
Returns:
the created contour or 0 if no vertices have a label equal to tag
Parameters:
tag - all vertices having a label equal to tag are considered to be part of the contour

Transformation::Type getGlobalTransformation(void) const
returns global transformation type

DeformationType getDeformationType(void) const
returns mesh deformation type

void setGlobalTransformation(Transformation::Type type)
set global transformation type
Parameters:
type - new global transformation type

void setDeformationType(DeformationType type)
set model deformation type
Parameters:
type - new deformation type

void setSurfaceChanged(bool b)
set surfaceChanged flag

bool getSurfaceChanged(void) const
returns surfaceChanged flag

const TclString& getFileName(void) const
returns mesh file name

void setFileName(const char *name)
set new mesh file name
Parameters:
name - new file name

bool getUseReferenceShape(void) const
returns reference shape flag

void setUseReferenceShape(bool rs)
set reference shape flag

RangeInformation* getRangeInformation() const
get the range information applied on all vertices

void setRangeInformation( RangeInformation * ri)
set the range information applied on all vertices

virtual void translate(const Vec3& tr)
translates the object
Parameters:
tr - translation vector

virtual void rotate(const Rotation3D& rotation)
rotates the object
Parameters:
rotation - rotation matrix

virtual void scale(const double scale)
scales the object
Parameters:
scale - scale facto

SELECTION_MODE getSelectionMode(void) const
returns model subobject selection mode

void setSelectionMode(SELECTION_MODE mode)
set model subobject selection mode
Parameters:
mode - new subobject selection mode

virtual void redraw(Camera3D *)
all graphics objects can be drawn

virtual void updateCenter(Vec3& center, unsigned int& n)
Returns the graphic object center and weight. The weight is a measure of the number of primitives to allow barycentric computation of the whole scene center.
Parameters:
center - returned center
n - returned barycentric weight

virtual double updateRadius(const Vec3& center)
Returns the graphic object radius given its center

virtual double computeClosestDistance(DataTypes::MouseClick& mc) const
The routine that allows the camera to select an object by computing the distance of an object from its radial line
Returns:
distance to line
Parameters:
mc - 3D line descriptor

void selectObject(const Vec2 pixel, Camera3D *cam)
looks for closest subobject from click point
Parameters:
pixel - mouse click point
cam - click point camera

void grabCallback(const Vec2& pixel, Camera3D *cam)
grab vertices from a mouse click in a 3D camera
Parameters:
pixel - mouse click point
cam - click point camera

void grab(const Vec3& direction, const Vec3 &pos)
grab vertices towards a 3D point
Parameters:
direction - of grab
pos - point towards which the mesh is deformed

Vec3 * grab2D(const Vec3& direction, const Vec3 &pos)
grab vertices towards a point in a slice
Parameters:
direction - of grab
pos - point towards which the mesh is deformed

void setSelectedFace(SM2Face *f)
returns mesh selected face

void setSelectedZone(SM2Zone *z)
returns mesh selected zone

void setSelectedEdge(SM2Edge *e)
returns mesh selected edge

void setSelectedVertex(SM2Vertex *v)
returns mesh selected edge

SM2Vertex* getSelectedVertex(void) const
returns mesh selected vertex

SM2Edge* getSelectedEdge(void) const
returns mesh selected edge

SM2Face* getSelectedFace(void) const
returns mesh selected face

SM2Zone* getSelectedZone(void) const
returns mesh selected zone

virtual void selected(void)
function called when this object is selected

virtual void unselected(void)
function called when this object is unselected

void unselect(void)
unselects any subobject

void select(SM2Vertex *v)
select given vertex
Parameters:
v - vertex to select

void select(SM2Edge *e)
select given edge
Parameters:
e - edge to select

void select(SM2Face *e)
select given face
Parameters:
f - face to select

void select(SM2Zone *e)
select given zone
Parameters:
z - zone to select

void selectVertex(int ref)
select given vertex
Parameters:
ref - vertex unique reference

void selectEdge(int ref)
select given edge
Parameters:
ref - edge unique reference

void selectFace(int ref)
select given face
Parameters:
ref - face unique reference

void selectZone(int ref)
select given zone
Parameters:
ref - zone unique reference

void setRendering(const TclString& n)
set surface rendering mode
Parameters:
n - name of the rendering mode

unsigned short int getGrabRange(void) const
returns model grab range

void setMaximumRigidity(void)
computes and store each vertex maximum rigidity. This value is linked to the total number of vertices and the presence of contour where the rigidity must be zero

unsigned int getMaximumRigidity(void) const
returns mesh maximum rigidity

void computeSimplexAngle(void)
computes all vertices simplex angle

void computeMeanCurvature(void)
computes all vertices mean curvature

virtual void setScene(Scene3D *scene)
move model in new scene, resynchronize model traces in cameras

void setLocality(double locality)
set the locality of all model vertices to given value and switch to corresponding deformation mode
Parameters:
locality - new locality value (0.0 means global, 1.0 means local)

SM2VerticesIterator firstVertex(void) const
returns an iterator on vertices, initialized on first vertex

SM2VerticesIterator lastVertex(void) const
returns an iterator on vertices, initialized on last vertex

SM2EdgesIterator firstEdge(void) const
returns an iterator on edges, initialized on first edge

SM2EdgesIterator lastEdge(void) const
returns an iterator on edges, initialized on last edge

SM2FacesIterator firstFace(void) const
returns an iterator on faces, initialized on first face

SM2FacesIterator lastFace(void) const
returns an iterator on faces, initialized on last face

SM2ZonesIterator firstZone(void) const
returns an iterator on zones, initialized on first zone

SM2ZonesIterator lastZone(void) const
returns an iterator on zones, initialized on last zone

SM2ContoursIterator firstContour() const
returns an iterator on the contour list

SM2ContoursIterator lastContour() const
returns an iterator on the contour list

SM2Vertex* getFirstVertex(void) const
returns first mesh vertex

SM2Edge* getFirstEdge(void) const
returns first mesh edge

SM2Face* getFirstFace(void) const
returns first mesh face

SM2Zone* getFirstZone(void) const
returns first mesh zone

SM2Vertex* getLastVertex(void) const
returns last mesh vertex

SM2Edge* getLastEdge(void) const
returns last mesh edge

SM2Face* getLastFace(void) const
returns last mesh face

SM2Zone* getLastZone(void) const
returns last mesh zone

void iterate(const unsigned int n)
model deformation callback
Parameters:
n - number of deformation stages to achieve

void apply(void (SM2Vertex::*ptr)(void))
apply member function on each mesh vertex
Parameters:
ptr - vertex member function without any arguments

void apply(void (SM2Vertex::*ptr)(int), int val)
apply member function on each mesh vertex
Parameters:
ptr - vertex member function with a single integer argument
val - integer value to transmit as argument

void apply(void (SM2Vertex::*ptr)(const unsigned int), const unsigned int val)
apply member function on each mesh vertex
Parameters:
ptr - vertex member function with a single unsigned integer argument
val - unsigned integer value to transmit as argument

void apply(void (SM2Vertex::*ptr)(float), float val)
apply member function on each mesh vertex
Parameters:
ptr - vertex member function with a single float argument
val - float value to transmit as argument

void apply(void (SM2Vertex::*ptr)(const double), const double val)
apply member function on each mesh vertex
Parameters:
ptr - vertex member function with a single double argument
val - double value to transmit as argument

void apply(void (SM2Vertex::*ptr)(void *), void *val)
apply member function on each mesh vertex
Parameters:
ptr - vertex member function with a single double argument
val - pointer to transmit as argument

void apply(void (SM2Edge::*ptr)(void))
apply member function on each mesh edge
Parameters:
ptr - edge member function without any arguments

void apply(void (SM2Face::*ptr)(void))
apply member function on each mesh face
Parameters:
ptr - face member function without any arguments

void setInternalForce(InternalForce3DType *ft)
set a given internal force as the main internal force applying on all vertices : updates the internalForceType field of all vertices and eventually call the ft->setGlobalFunction()
Parameters:
ft - the internal force

void setInternalForce(char *forceName)
find the internal force corresponding to its name. If no internal force can be found then used the first internal force un the global list of forces. Then set that internal force as the main internal force applying on all vertices : updates the internalForceType field of all vertices and eventually call the ft->setGlobalFunction()
Parameters:
forceName - the internal force name

InternalForce3DType* getInternalForceType() const
returns the internal force type applying on the whole contour

void flipNormals(void)
flip every model normals

bool areNormalsFlipped() const
whether the direction normal vector at each vertex and each face should be flipped for display purposes

SM2Vertex* getVertex(unsigned int i) const
get vertex by index
Returns:
vertex pointer if it exists in mesh, 0 otherwise
Parameters:
i - vertex unique id

SM2Edge* getEdge(unsigned int i) const
get edge by index
Returns:
edge pointer if it exists in mesh, 0 otherwise
Parameters:
i - edge unique id

SM2Face* getFace(unsigned int i) const
get face by index
Returns:
face pointer if it exists in mesh, 0 otherwise
Parameters:
i - face unique id

SM2Zone* getZone(unsigned int i) const
get zone by index
Returns:
zone pointer if it exists in mesh, 0 otherwise
Parameters:
i - zone unique id

SM2(Scene3D *scene)
creates an empty mesh
Parameters:
scene - scene to store mesh

void copy(const SM2& org, SM2Vertex **vertexTable, int *refs)
part of copy constructor (after vertices have been copied)
Parameters:
org - mesh to copy
vertexTable - new allocated vertices
refs - index correspondances between org vertex refereces and new mesh vertex references

void readMainModule2(GFInput &input, int nbVertices)
general format read function for main module

std::list intersectWithPlane(const Vec3& normal, const Vec3& origin, const Vec3& vx, const Vec3& vy)
compute model surface intersection with a plane
Parameters:
normal - plane normal
origin - one plane point
vx - plane x axis direction
vy - plane y axis direction

virtual TclString getSurfaceSliceableName() const
returns the string identifying the Tcl name of simplex mesh

compute model surface intersection with a volumetric image
Parameters:
inr - inrimage to plot intersection in
useZones - whether to use a different color for each model zone

static void drawVector(const Vec3& from, const Vec3& arrow, const Color& color, double width)
draw an arrow
Parameters:
from - vector origin
arraow - vector coordinates
color - arrow color
width - vector line width

TclSM2* getInterface(void) const
returns simplex mesh interface


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de