In file triangulation/Triangulation3D.h:

class Triangulation3D : public Triangulation, public Data3D, ifdef GRAPHICS public PickingObject, public SurfaceSliceable, endif public GeneralFormat

3D triangulation class

Inheritance:


Public Classes

class FileNotFound : public Exception
unable to open file

Public Fields

TriangulationVertex3D* selectedVertex
pointer on selected vertex (0 if no vertex is selected)
TriangulationTriangle3D* selectedTriangle
pointer on selected face (0 if no face is selected)
TriangulationEdge3D* selectedEdge
pointer on selected edge (0 if no edge is selected)
TriangulationZone* selectedZone
pointer on selected zone (0 if no zone is selected)
TriangulationPoint* selectedPoint
pointer on selected point (0 if no point is selected)

Public Methods

void skipMainModule (GFInput &input)
general format skip function for main module
void writeMainModule (GFOutput &output)
general format write function for main module
void readTextureModule (GFInput &input)
read the texture information of the triangulation
void skipTextureModule (GFInput &input)
skip the texture information of the triangulation
void writeTextureModule (GFOutput &output)
write the texture information of the triangulation
void saveAsTrian (char *name)
save the triangulation with the Trian format
void saveAsTr (char *name)
save the triangulation with the Tr format
void computeCenter ()
compute the center, radius and bounding box of the triangulation
void setTriangleTopology (TriangulationTriangle *t1, TriangulationTriangle *t2, unsigned int index)
set the edge topology given two triangles t1 and t2 such that t1->neighbor[index]=t2
virtual TriangulationTriangle* newTriangle (TriangulationTriangle *n0 = 0, TriangulationTriangle *n1 = 0, TriangulationTriangle *n2 = 0, TriangulationVertex *v0 = 0, TriangulationVertex *v1 = 0, TriangulationVertex *v2 = 0, TriangulationEdge *e0 = 0, TriangulationEdge *e1 = 0, TriangulationEdge *e2 = 0, TriangulationZone *zone = 0)
creates a new triangle
virtual TriangulationVertex* newVertex (TriangulationEdge *edge=0, unsigned int orientation=0 )
creates a new vertex
double getVolume (void) const
returns triangulation volume
const TclString& getFileName (void) const
returns mesh file name
void setFileName (const char *name)
set new mesh file name
void renumberMesh () const
renumber the vertex, edge and triangle reference
SELECTION_MODE getSelectionMode (void) const
returns model subobject selection mode
void setSelectionMode (SELECTION_MODE mode)
set model subobject selection mode
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
virtual void redraw (Camera3D *)
all graphics objects can be drawn
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
virtual void selectObject (const Vec2 pixel, Camera3D *cam)
finds the closest edge, zone, vertex or triangle from click point
void set1DTextureCoordinates (SET_TRIANGULATION_1D_TEXTURE_COORDINATES f, bool normalize=false)
set the 1D texture coordinates for all triangles
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
TriangulationVertex3D* getSelectedVertex (void) const
returns mesh selected vertex
TriangulationEdge* getSelectedEdge (void) const
returns mesh selected edge
TriangulationTriangle3D* getSelectedTriangle (void) const
returns mesh selected face
TriangulationPoint* getSelectedPoint (void) const
returns mesh selected point
TriangulationZone3D* 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
TriangulationVertex3D* getVertex (int vref) const
returns a 3D triangulation vertex given its reference
TriangulationEdge* getEdge (int eref) const
returns a 3D triangulation edge given its reference
TriangulationTriangle3D* getTriangle (int tref) const
returns a 3D triangulation triangle given its reference
TriangulationZone3D* getZone (int tref) const
returns a 3D triangulation zone given its reference
void select (TriangulationPoint *p)
select given point
void select (TriangulationVertex3D *v)
select given vertex
void select (TriangulationEdge3D *e)
select given edge
void select (TriangulationTriangle3D *t)
select given face
void select (TriangulationZone3D *z)
select given zone
void selectVertex (int ref)
select given vertex
void selectEdge (int ref)
select given edge
void selectTriangle (int ref)
select given face
void selectPoint (int ref, const Vec3 &eye, const Vec3 &dir)
select given face
void selectZone (int ref)
select given zone
void setRendering (TclString n)
set surface rendering mode
virtual void setScene (Scene3D *scene)
move model in new scene, resynchronize model traces in cameras
TriangulationLandmarkIterator firstLandmark (void) const
the first landmark on the triangulation
TriangulationLandmarkIterator lastLandmark (void) const
the last landmark on the triangulation
TriangulationVertex3DIterator firstVertex (void) const
returns an iterator on vertices, initialized on first vertex
TriangulationZone3DIterator firstZone (void) const
returns an iterator on zones, initialized on first zone
TriangulationTriangle3DIterator firstTriangle (void) const
returns an iterator on triangles, initialized on first face
TriangulationVertex3D* getFirstVertex (void) const
returns first mesh vertex
TriangulationTriangle3D* getFirstTriangle (void) const
returns first mesh face
TriangulationVertex3D* getLastVertex (void) const
returns last mesh vertex
TriangulationTriangle3D* getLastTriangle (void) const
returns last mesh face
void apply (void (TriangulationVertex3D::*ptr)(void))
apply member function on each mesh vertex
void apply (void (TriangulationVertex3D::*ptr)(int), int val)
apply member function on each mesh vertex
void apply (void (TriangulationVertex3D::*ptr)(unsigned int), unsigned int val)
apply member function on each mesh vertex
void apply (void (TriangulationVertex3D::*ptr)(float), float val)
apply member function on each mesh vertex
void apply (void (TriangulationVertex3D::*ptr)(double), double val)
apply member function on each mesh vertex
void apply (void (TriangulationVertex3D::*ptr)(void *), void *val)
apply member function on each mesh vertex
void apply (void (TriangulationEdge::*ptr)(void))
apply member function on each mesh edge
void apply (void (TriangulationTriangle3D::*ptr)(void))
apply member function on each mesh face
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
virtual void surfaceHasChanged ()
called when the geometry or mesh topology has changed
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 triangulation
TclTriangulation3D* getInterface (void) const
returns 3D triangulation interface

Public

exceptions
constructors
Triangulation3D (const TclString& name, Scene3D *scene)
build triangulation from file
Triangulation3D (unsigned int nbVertices, Vec3 *posTable, unsigned int nbTriangles, unsigned int **vertexTriangleTable, Scene3D *scene=0)
build triangulation from an array of vertices and triangles and then delete the arrays
Triangulation3D (const Triangulation3D& org)
copy constructor
Triangulation3D (Scene3D *scene=NULL)
create an empty Triangulation constructor that is called by inherited class
destructor
virtual ~Triangulation3D ()
delete object from scene

save the triangulation with the GH3D suitable for the GH3D software

returns an iterator on the contour list

Protected Classes

enum SELECTION_MODE
model subobject selection mode
SELECT_ZONE
select model zone
SELECT_EDGE
select triangulation edge
SELECT_VERTEX
select triangulation vertex
SELECT_TRIANGLE
select triangulation triangle
SELECT_POINT
select a point lying on a triangulation
EDIT_ZONE
edit the selected zone
GRAB
grab closest vertices

Protected Fields

ObjectsList <TriangulationLandmark> landmarkList
the global list of landmarks
TclString filename
name under which the file is saved
TclString triangulationname
name of this triangulation (could have several meshes in a file)
Vec3 referenceCenter
triangulation mesh reference (stored) center
double radius
sphere that include the 2simplex mesh radius
Vec3 center
triangulation mesh center
bool surfaceChanged
whether 2simplex mesh was deformed
bool displayNormals
whether to display surface normal at vertices
static Color normalsColor
normal display color
static float normalsWidth
normal display width
static double normalScale
normals arrows display scale
bool flipNormal
whether we should flip normal for display
SELECTION_MODE selectionMode
model subobject selection mode
Material selectedMaterial
the material used to draw selected triangle or zone
GLuint triangleDisplayList
The triangle display list for picking and LIE collision
GLuint edgeDisplayList
The edge display list for picking
GLuint vertexDisplayList
The vertex display list for picking
GLUquadricObj* Sphere
sphere to display selected points

Protected Methods

void initDisplay ()
constructors common code for display variables
void buildTriangleDisplayList ()
build the triangle display list when needed
void buildEdgeDisplayList (const Camera3D *cam)
build the edge display list when needed
void buildVertexDisplayList (const Camera3D *cam)
build the vertex display list when needed
void initGeneralFormat ()
constructors common code for the I/O routines
void readMainModule3D (GFInput &input)
general format read function for main module
void copyObject (const Triangulation3D &org)
copy a 3D triangulation into the current object

Inherited from Triangulation:

Public Methods

virtual TriangulationEdge* newEdge( TriangulationVertex *v1, TriangulationVertex *v2, TriangulationTriangle *t1 = 0, TriangulationTriangle *t2 = 0)
virtual unsigned int regularizeTopology(void)
static TriangulationVertex* sameVertex(const TriangulationEdge *e1, const TriangulationEdge *e2)
TriangulationVertexIterator lastVertex(void) const
TriangulationEdgeIterator firstEdge(void) const
TriangulationEdgeIterator lastEdge(void) const
TriangulationTriangleIterator lastTriangle(void) const
TriangulationZoneIterator lastZone(void) const
TriangulationEdge* getFirstEdge(void) const
TriangulationZone* getFirstZone(void) const
unsigned int getNumberOfVertices(void) const
unsigned int getNumberOfEdges(void) const
unsigned int getNumberOfTriangles(void) const
unsigned int getNumberOfZones(void) const
void addVertex(TriangulationVertex* v)
void addEdge(TriangulationEdge* e)
void addTriangle(TriangulationTriangle * f)
void addZone(TriangulationZone* z)
bool topologyCheck(void) const
void renumber(void)

Public

Exception classes

Exception thrown when the triangulation stored in a file is not a manifold
class NotAManifold: public Exception
mesh is not a manifold (edge shared by 3 triangles,...)

constructor

Triangulation()
builds an empty mesh

Protected Fields

ObjectsList <TriangulationVertex> vertexList
ObjectsList <TriangulationTriangle> triangleList
ObjectsList <TriangulationEdge> edgeList
ObjectsList <TriangulationZone> zoneList

Documentation

3D triangulation class
exceptions

class FileNotFound: public Exception
unable to open file

constructors

Triangulation3D(const TclString& name, Scene3D *scene)
build triangulation from file
Parameters:
name - triangulation file name
scene - scene to build object in

Triangulation3D(unsigned int nbVertices, Vec3 *posTable, unsigned int nbTriangles, unsigned int **vertexTriangleTable, Scene3D *scene=0)
build triangulation from an array of vertices and triangles and then delete the arrays
Parameters:
nbVertices - the number of vertices
posTable - an array of size nbVertices where we store the position of each vertex
nbTriangles - the number of triangles
vertexTriangleTable - the array of size nbTriangles that gives the each of each vertex (starting from 0 to nbVertices -1 ) of the triangle; vertexTriangleTable[i][j] is the ith (0scene - scene to build object in

Triangulation3D(const Triangulation3D& org)
copy constructor

Triangulation3D(Scene3D *scene=NULL)
create an empty Triangulation constructor that is called by inherited class

destructor

virtual ~Triangulation3D()
delete object from scene

ObjectsList <TriangulationLandmark> landmarkList
the global list of landmarks

TclString filename
name under which the file is saved

TclString triangulationname
name of this triangulation (could have several meshes in a file)

Vec3 referenceCenter
triangulation mesh reference (stored) center

double radius
sphere that include the 2simplex mesh radius

Vec3 center
triangulation mesh center

enum SELECTION_MODE
model subobject selection mode

SELECT_ZONE
select model zone

SELECT_EDGE
select triangulation edge

SELECT_VERTEX
select triangulation vertex

SELECT_TRIANGLE
select triangulation triangle

SELECT_POINT
select a point lying on a triangulation

EDIT_ZONE
edit the selected zone

GRAB
grab closest vertices

bool surfaceChanged
whether 2simplex mesh was deformed

bool displayNormals
whether to display surface normal at vertices

static Color normalsColor
normal display color

static float normalsWidth
normal display width

static double normalScale
normals arrows display scale

bool flipNormal
whether we should flip normal for display

SELECTION_MODE selectionMode
model subobject selection mode

Material selectedMaterial
the material used to draw selected triangle or zone

GLuint triangleDisplayList
The triangle display list for picking and LIE collision

GLuint edgeDisplayList
The edge display list for picking

GLuint vertexDisplayList
The vertex display list for picking

GLUquadricObj* Sphere
sphere to display selected points

void initDisplay()
constructors common code for display variables

void buildTriangleDisplayList()
build the triangle display list when needed

void buildEdgeDisplayList(const Camera3D *cam)
build the edge display list when needed

void buildVertexDisplayList(const Camera3D *cam)
build the vertex display list when needed

void initGeneralFormat()
constructors common code for the I/O routines

void readMainModule3D(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

save the triangulation with the GH3D suitable for the GH3D software

void readTextureModule(GFInput &input)
read the texture information of the triangulation

void skipTextureModule(GFInput &input)
skip the texture information of the triangulation

void writeTextureModule(GFOutput &output)
write the texture information of the triangulation

void saveAsTrian(char *name)
save the triangulation with the Trian format

void saveAsTr(char *name)
save the triangulation with the Tr format

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

TriangulationTriangle3D* selectedTriangle
pointer on selected face (0 if no face is selected)

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

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

TriangulationPoint* selectedPoint
pointer on selected point (0 if no point is selected)

void copyObject(const Triangulation3D &org)
copy a 3D triangulation into the current object

void computeCenter()
compute the center, radius and bounding box of the triangulation

void setTriangleTopology(TriangulationTriangle *t1, TriangulationTriangle *t2, unsigned int index)
set the edge topology given two triangles t1 and t2 such that t1->neighbor[index]=t2

virtual TriangulationTriangle* newTriangle(TriangulationTriangle *n0 = 0, TriangulationTriangle *n1 = 0, TriangulationTriangle *n2 = 0, TriangulationVertex *v0 = 0, TriangulationVertex *v1 = 0, TriangulationVertex *v2 = 0, TriangulationEdge *e0 = 0, TriangulationEdge *e1 = 0, TriangulationEdge *e2 = 0, TriangulationZone *zone = 0)
creates a new triangle
Parameters:
n0 - first triangle neighbor,
n1 - second triangle neighbor,
n2 - third triangle neighbor,
v0 - first vertex,
v1 - second vertex,
v2 - third vertex,
e0 - first edge,
e1 - second edge,
e2 - third edge,
zone - zone face belongs to

virtual TriangulationVertex* newVertex(TriangulationEdge *edge=0, unsigned int orientation=0 )
creates a new vertex
Parameters:
edge - one edge,
orientation - vertex orientation versus edge orientation (0 or 1)

double getVolume(void) const
returns triangulation volume

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

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

void renumberMesh() const
renumber the vertex, edge and triangle reference

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 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

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

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

virtual void selectObject(const Vec2 pixel, Camera3D *cam)
finds the closest edge, zone, vertex or triangle from click point
Parameters:
pixel - mouse click point
cam - click point camera

void set1DTextureCoordinates(SET_TRIANGULATION_1D_TEXTURE_COORDINATES f, bool normalize=false)
set the 1D texture coordinates for all triangles
Parameters:
f - a function that returns 1 texture coordinate for each triangle vertex
normalize - if the texture coordinates should be scaled between 0 and 1 (computes min and max value)

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

TriangulationVertex3D* getSelectedVertex(void) const
returns mesh selected vertex

TriangulationEdge* getSelectedEdge(void) const
returns mesh selected edge

TriangulationTriangle3D* getSelectedTriangle(void) const
returns mesh selected face

TriangulationPoint* getSelectedPoint(void) const
returns mesh selected point

TriangulationZone3D* 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

TriangulationVertex3D* getVertex(int vref) const
returns a 3D triangulation vertex given its reference. returns NULL if the reference is not correct

TriangulationEdge* getEdge(int eref) const
returns a 3D triangulation edge given its reference. returns NULL if the reference is not correct

TriangulationTriangle3D* getTriangle(int tref) const
returns a 3D triangulation triangle given its reference. returns NULL if the reference is not correct

TriangulationZone3D* getZone(int tref) const
returns a 3D triangulation zone given its reference. returns NULL if the reference is not correct

void select(TriangulationPoint *p)
select given point
Parameters:
p - point to select

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

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

void select(TriangulationTriangle3D *t)
select given face
Parameters:
f - face to select

void select(TriangulationZone3D *z)
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 selectTriangle(int ref)
select given face
Parameters:
ref - face unique reference

void selectPoint(int ref, const Vec3 &eye, const Vec3 &dir)
select given face
Parameters:
ref - face unique reference
eye - the optical center of the camera
dir - the direction of 3D line selected by the user

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

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

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

TriangulationLandmarkIterator firstLandmark(void) const
the first landmark on the triangulation

TriangulationLandmarkIterator lastLandmark(void) const
the last landmark on the triangulation

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

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

TriangulationTriangle3DIterator firstTriangle(void) const
returns an iterator on triangles, initialized on first face

returns an iterator on the contour list

TriangulationVertex3D* getFirstVertex(void) const
returns first mesh vertex

TriangulationTriangle3D* getFirstTriangle(void) const
returns first mesh face

TriangulationVertex3D* getLastVertex(void) const
returns last mesh vertex

TriangulationTriangle3D* getLastTriangle(void) const
returns last mesh face

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

void apply(void (TriangulationVertex3D::*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 (TriangulationVertex3D::*ptr)(unsigned int), 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 (TriangulationVertex3D::*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 (TriangulationVertex3D::*ptr)(double), 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 (TriangulationVertex3D::*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 (TriangulationEdge::*ptr)(void))
apply member function on each mesh edge
Parameters:
ptr - edge member function without any arguments

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

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

virtual void surfaceHasChanged()
called when the geometry or mesh topology has changed

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 triangulation

TclTriangulation3D* getInterface(void) const
returns 3D triangulation interface


Direct child classes:
PrecomputedTriangulation3D
ActiveTriangulation3D

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