User manual:   Main Page   Overview   Installation   User Interface   Tutorial   Example   FAQ   Version Updates
Reference manual:   Class List   Class Members   Globals, enums and defines

Mesh Class Reference

Handles the mesh functions, such as I/O, VRML export, mesh geometry functions etc. More...

List of all members.

I/O Operations

RESULT openVRMLFile (const char *fileName)
RESULT saveVRMLFile (const char *fileName=NULL)
RESULT VRMLExport (const char *fileName)
RESULT getFileName (char *fileName)

IFS/model

RESULT getBoundingBox (Coord &bBoxMin, Coord &bBoxMax, Coord &bBoxDim, Coord &center)
RESULT getIFS (VRIndexedFaceSet *IFS)
RESULT setIFS (const VRIndexedFaceSet *IFS)
RESULT startNewModel ()

Line drawing

RESULT addLine (Line line, LineID &lineID, const Color *color=NULL)
RESULT setLine (LineID lineID, Line line)
RESULT getLine (LineID lineID, Line &line)
RESULT setLineWidth (LineID lineID, double width=DEFAULT_LINE_WIDTH)
RESULT getLineWidth (LineID lineID, double &width)
RESULT removeLine (LineID lineID)
RESULT removeAllLines ()

Sphere drawing

RESULT addSphere (Sphere sphere, SphereID &sId, const Color *color=NULL)
RESULT setSphere (SphereID sId, Sphere sphere)
RESULT getSphere (SphereID sId, Sphere &sphere)
RESULT removeSphere (SphereID sId)
RESULT removeAllSpheres ()

Cylinder drawing

RESULT addCylinder (Cylinder cylinder, CylinderID &cId, const Color *color=NULL)
RESULT setCylinder (CylinderID cId, Cylinder cylinder)
RESULT getCylinder (CylinderID cId, Cylinder &cylinder)
RESULT removeCylinder (CylinderID cId)
RESULT removeAllCylinders ()

Mesh Geometry

RESULT getVerticesCount (VertexID &count)
RESULT getEdgesCount (EdgeID &count)
RESULT getEdgesIDsCount (EdgeID &count)
RESULT getFacesCount (FaceID &count)
RESULT getLinesCount (LineID &count)
RESULT getSpheresCount (SphereID &count)
RESULT getCylindersCount (SphereID &count)
RESULT setCoord (VertexID vID, Coord coord)
RESULT setCoords (const LinkedList< VertexID > *vertices, const LinkedList< Coord > *coords)
RESULT getCoord (VertexID vID, Coord &coord)
RESULT getCoords (const LinkedList< VertexID > *vertices, LinkedList< Coord > *coords)
RESULT getAllCoords (LinkedList< VertexID > *vertices, LinkedList< Coord > *coords)
RESULT getEdge (EdgeID eID, Edge &edge)
RESULT getFace (FaceID fID, Face &face)
RESULT getFaces (const LinkedList< FaceID > *facesids, LinkedList< Face > *faces)
RESULT getAllFaces (LinkedList< FaceID > *facesids, LinkedList< Face > *faces)
RESULT getOtherEdgeID (EdgeID eID, EdgeID &otherEdgeID)
RESULT getJoinedFacesEdge (FaceID fID1, FaceID fID2, EdgeID &eID1, EdgeID &eID2)
RESULT getJoinedVerticesEdge (VertexID vID1, VertexID vID2, EdgeID &eID1, EdgeID &eID2)
RESULT getJoinedVerticesFace (VertexID vID1, VertexID vID2, VertexID vID3, FaceID &fID)
RESULT getJoinedEdgesVertex (EdgeID eID1, EdgeID eID2, VertexID &vID)
RESULT getVerticesOfEdge (EdgeID eID, VertexID &vID1, VertexID &vID2)
RESULT getFaceOfEdge (EdgeID eID, FaceID &fID)
RESULT getFaceNeighborhood (FaceID fID, LinkedList< VertexID > *vertices=NULL, LinkedList< EdgeID > *edges=NULL, LinkedList< FaceID > *faces=NULL)
RESULT getNeighborhood (VertexID vID, LinkedList< VertexID > *vertices=NULL, LinkedList< EdgeID > *edges=NULL, LinkedList< FaceID > *faces=NULL)
RESULT removeVertex (VertexID vID, LinkedList< FaceID > *removedFaces=NULL, LinkedList< EdgeID > *removedEdges=NULL)
RESULT removeVertexTriangulate (VertexID vID, const LinkedList< Face > *newFaces, LinkedList< FaceID > *newFacesIDs=NULL, LinkedList< FaceID > *removedFaces=NULL, LinkedList< EdgeID > *removedEdges=NULL)
RESULT removeFace (FaceID fID, LinkedList< VertexID > *affectedVertices=NULL, LinkedList< EdgeID > *removedEdges=NULL)
RESULT edgeCollapse (VertexID vID1, VertexID vID2, const Coord *coordinate=NULL, LinkedList< FaceID > *removedFaces=NULL, LinkedList< EdgeID > *removedEdges=NULL)
RESULT edgeCollapseGraphic (VertexID vID1, VertexID vID2, int steps, const Coord *coordinate=NULL, LinkedList< FaceID > *removedFaces=NULL, LinkedList< EdgeID > *removedEdges=NULL)
RESULT vertexSplit (VertexID vID, Coord coordinate, VertexID left, VertexID right, VertexID &newVertex, LinkedList< FaceID > *newFacesIDs=NULL, LinkedList< FaceID > *removedFaces=NULL, LinkedList< EdgeID > *removedEdges=NULL)
RESULT addVertex (Coord coordinate, VertexID &vID, const LinkedList< Edge > *neighbouringVertices=NULL, LinkedList< FaceID > *newFacesIDs=NULL)
RESULT addFace (Face face, FaceID &fID, bool check=false, const Color *color=NULL)

Validation

bool isModelEmpty ()
bool isTotallyEmpty ()
bool hasLines ()
bool hasSpheres ()
bool hasCylinders ()
bool isValidVertexIndex (VertexID vID)
bool isValidEdgeIndex (EdgeID eID)
bool isValidFaceIndex (FaceID fID)
bool isValidLineIndex (LineID lID)
bool isValidSphereIndex (SphereID sID)
bool isValidCylinderIndex (CylinderID cID)
RESULT isBoundaryVertex (VertexID vID, bool &boundary)
RESULT isBoundaryEdge (EdgeID eID, bool &boundary)
RESULT isBoundaryFace (FaceID fID, bool &boundary)


Detailed Description

Handles the mesh functions, such as I/O, VRML export, mesh geometry functions etc.


Member Function Documentation

RESULT Mesh::addCylinder Cylinder    cylinder,
CylinderID   cId,
const Color   color = NULL
 

Adds a cylinder to be drawn.

Parameters:
cylinder The cylinder to be added.
color The color of the new cylinder, or NULL for the default cylinder color
cId [output] The ID of the new added cylinder
Return values:
OK Operation succeeded

RESULT Mesh::addFace Face    face,
FaceID   fID,
bool    check = false,
const Color   color = NULL
 

Adds a face to the mesh.

Parameters:
face Specifies the new face to be added, according to its 3 vertices' IDs
fID [output] The ID of the new added face
check Whether to check the mesh for the existence of such a face
color The color of the new face, or NULL for the default face color
Return values:
OK Operation succeeded
FaceExists check is true, and the face already exists in the mesh (the new face was NOT added to the mesh as a result).
VertexNotFound No vertex was found with one of the given face's vertices' IDs

RESULT Mesh::addLine Line    line,
LineID   lineID,
const Color   color = NULL
 

Adds a line to be drawn.

Parameters:
line The line to be added.
color The color of the new line, or NULL for the default line color
lineID [output] The ID of the new added line
Return values:
OK Operation succeeded

RESULT Mesh::addSphere Sphere    sphere,
SphereID   sId,
const Color   color = NULL
 

Adds a sphere to be drawn.

Parameters:
sphere The sphere to be added.
color The color of the new sphere, or NULL for the default sphere color
sId [output] The ID of the new added sphere
Return values:
OK Operation succeeded

RESULT Mesh::addVertex Coord    coordinate,
VertexID   vID,
const LinkedList< Edge > *    neighbouringVertices = NULL,
LinkedList< FaceID > *    newFacesIDs = NULL
 

Adds a new vertex at the specified coordinate, and adds new faces to the model.

The new faces that will be created are: (in the correct orientation)
newVertex neighbouringVertices[0].v1 neighbouringVertices[0].v2
newVertex neighbouringVertices[1].v1 neighbouringVertices[1].v2
newVertex neighbouringVertices[2].v1 neighbouringVertices[2].v2
etc.
Which means that in each new face, the new added vertex is the first vertex, then the 2 other vertices are defined as an Edge in neighbouringVertices

Parameters:
coordinate Coordinate of the new vertex.
vID [output] The ID of the new added vertex
neighbouringVertices A list of Edges. Each Edge defines a new face (along with the new vertex) to be added.
newFacesIDs If not NULL, will contain the IDs of the new faces which were created during the process
Return values:
OK Operation succeeded
VertexNotFound One of the given neighboring vertices' IDs was not found.
Note:
if neighbouringVertices is NULL, the vertex is added with no adjacent vertices
The output list needs to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).

RESULT Mesh::edgeCollapse VertexID    vID1,
VertexID    vID2,
const Coord   coordinate = NULL,
LinkedList< FaceID > *    removedFaces = NULL,
LinkedList< EdgeID > *    removedEdges = NULL
 

Performs an "edge collapse": move the first vertex until it collapses with the second vertex.

Because of this action 2 edges will be joined and 2 faces will be removed

Parameters:
vID1 The ID of the vertex to move from
vID2 The ID of the vertex to move to
coordinate The new coordinate of the joined vertex.
removedFaces [output] If not NULL, will contain the IDs of the faces which were removed during the process
removedEdges [output] If not NULL, will contain the IDs of the edges which were removed during the process
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs
VerticesNotIncident The 2 vertices are not incident
SameVertexGiven The 2 given vertex IDs are the same
Note:
The ID of the merged vertex is vID2. If coordinate is not NULL, this vertex will be moved to the new coordinate. Otherwise, its coordinate will be the same as of vID2.
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).
See also:
edgeCollapseGraphic()

RESULT Mesh::edgeCollapseGraphic VertexID    vID1,
VertexID    vID2,
int    steps,
const Coord   coordinate = NULL,
LinkedList< FaceID > *    removedFaces = NULL,
LinkedList< EdgeID > *    removedEdges = NULL
 

Does the same operation as edgeCollapse(), but shows it nicely on the screen.

The first vertex is seen as moving towards the second vertex until they merge

Parameters:
vID1 The ID of the vertex to move from
vID2 The ID of the vertex to move to
steps The number of steps to show on the screen
coordinate The new coordinate of the joined vertex.
removedFaces [output] If not NULL, will contain the IDs of the faces which were removed during the process
removedEdges [output] If not NULL, will contain the IDs of the edges which were removed during the process
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs
VerticesNotIncident The 2 vertices are not incident
SameVertexGiven The 2 given vertex IDs are the same
Note:
The ID of the merged vertex is vID2. If coordinate is not NULL, this vertex will be moved to the new coordinate. Otherwise, its coordinate will be the same as of vID2.
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).
See also:
edgeCollapse()

RESULT Mesh::getAllCoords LinkedList< VertexID > *    vertices,
LinkedList< Coord > *    coords
 

Get the coordinates of all the valid mesh vertices, including their IDs.

Parameters:
vertices [output] All the valid vertices' IDs
coords [output] The corresponding vertices' coordinates
Return values:
OK Operation succeeded
NullPointerGiven One of the given lists is NULL
Note:
vertices contain all the valid mesh vertices' IDs.
The entries in coords correspond to the entries in the vertices. That is, the first entry in coords is the coordinate for the first entry in vertices, and so on.

RESULT Mesh::getAllFaces LinkedList< FaceID > *    facesids,
LinkedList< Face > *    faces
 

Get all valid mesh faces, including their IDs.

Parameters:
facesids [output] All the valid faces' IDs
faces [output] The corresponding faces
Return values:
OK Operation succeeded
NullPointerGiven One of the given lists is NULL
Note:
facesids contain all the valid faces' IDs.
The entries in faces correspond to the entries in the facesids. That is, the first entry in faces is the face of the first entry in facesids, and so on.

RESULT Mesh::getBoundingBox Coord   bBoxMin,
Coord   bBoxMax,
Coord   bBoxDim,
Coord   center
 

Get the current mesh's bounding box.

Parameters:
bBoxMin [output] The minimum coordinate of the bounding box
bBoxMax [output] The maximum coordinate of the bounding box
bBoxDim [output] The dimensions of the bounding box (=bBoxMax-bBoxMin)
center [output] The center coordinate of the bounding box
Return values:
OK Operation succeeded
MeshNotValid Mesh is either non valid or is not specified
Note:
If line/sphere/cylinder drawing is enabled, the bounding box is calculated according to the model as well as the lines/spheres/cylinders to draw. Otherwise, they lines are not added to the calculation

RESULT Mesh::getCoord VertexID    vID,
Coord   coord
 

Get the coordinate of the given vertex.

Parameters:
vID The ID of the vertex
coord [output] The coordinate of the vertex
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with the given ID

RESULT Mesh::getCoords const LinkedList< VertexID > *    vertices,
LinkedList< Coord > *    coords
 

Get the coordinates of the given vertices.

Parameters:
vertices A list of all the vertices IDs we want to get coords from
coords [output] The corresponding vertices' coordinates
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs
NullPointerGiven One of the given lists is NULL
Note:
The entries in coords correspond to the entries in the vertices. That is, the first entry in coords is the coordinate for the first entry in vertices, and so on.

RESULT Mesh::getCylinder CylinderID    cId,
Cylinder   cylinder
 

Get a copy of a cylinder with a given ID.

Parameters:
cId The ID of the cylinder
cylinder [output] A copy of the cylinder.
Return values:
OK Operation succeeded
CylinderNotFound No sphere was found with the given ID

RESULT Mesh::getCylindersCount SphereID   count
 

Get the number of cylinders to draw.

Parameters:
count [output] The number of cylinders
Return values:
OK Operation succeeded

RESULT Mesh::getEdge EdgeID    eID,
Edge   edge
 

Get the edge with the given ID.

Parameters:
eID The edge ID
edge [output] A copy of the edge
Return values:
OK Operation succeeded
EdgeNotFound No edge was found with the given ID

RESULT Mesh::getEdgesCount EdgeID   count
 

Get the total number of unique geometric edges in the mesh model.

If an edge has 2 EdgeID's, the edge is counted only once.

Parameters:
count [output] The number of vertices
Return values:
OK Operation succeeded

RESULT Mesh::getEdgesIDsCount EdgeID   count
 

Get the total number of edges ID's in the mesh model.

If an edge has 2 EdgeID's, both ID's will be counted.

Parameters:
count [output] The number of edges
Return values:
OK Operation succeeded

RESULT Mesh::getFace FaceID    fID,
Face   face
 

Get the face with the given ID.

Parameters:
fID The face ID
face [output] A copy of the face
Return values:
OK Operation succeeded
FaceNotFound No face was found with the given ID

RESULT Mesh::getFaceNeighborhood FaceID    fID,
LinkedList< VertexID > *    vertices = NULL,
LinkedList< EdgeID > *    edges = NULL,
LinkedList< FaceID > *    faces = NULL
 

Get the neighborhood of the given face (its vertices, edges, and neighboring faces).

Parameters:
fID The ID of the face
vertices [output] If not NULL, will contain the face vertices' IDs (in ccw order)
edges [output] If not NULL, will contain the face edges' IDs (in ccw order)
faces [output] If not NULL, will contain the face's neighboring faces IDs (in ccw order)
Return values:
OK Operation succeeded
FaceNotFound No face was found with the given ID
NullPointerGiven All 3 given lists are NULL
Note:
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).
Some of the lists can be NULL, if you don't want to get that data. For example, if you don't want to get the list of edges, just send NULL intead of edges

RESULT Mesh::getFaceOfEdge EdgeID    eID,
FaceID   fID
 

Get the face associated with this half edge.

Parameters:
eID The ID of the edge
fID [output] The ID of the associated face
Return values:
OK Operation succeeded
EdgeNotFound No edge was found with the given ID

RESULT Mesh::getFaces const LinkedList< FaceID > *    facesids,
LinkedList< Face > *    faces
 

Get the faces of the given faces IDs.

Parameters:
facesids A list of all the faces IDs we want to get faces from
faces [output] The corresponding faces
Return values:
OK Operation succeeded
FaceNotFound No face was found with one of the given IDs
NullPointerGiven One of the given lists is NULL
Note:
The entries in faces correspond to the entries in the facesids. That is, the first entry in faces is the face of the first entry in facesids, and so on.

RESULT Mesh::getFacesCount FaceID   count
 

Get the total number of faces in the mesh model.

Parameters:
count [output] The number of faces
Return values:
OK Operation succeeded

RESULT Mesh::getFileName char *    fileName
 

Get the name of the current VRML file.

Parameters:
fileName [output] A pointer to a string to which the file name will be copied
Return values:
OK Operation succeeded
NullPointerGiven fileName is NULL and there is no predefined VRML file (the mesh wasn't saved before).
MeshNotValid Mesh is either non valid or is not specified

RESULT Mesh::getIFS VRIndexedFaceSet *    IFS
 

Get a copy of the current IndexedFaceSet which represents the mesh.

Parameters:
IFS [output] A copy of the IndexedFaceSet of the mesh
Return values:
OK Operation succeeded
NullPointerGiven IFS is NULL
MeshNotValid Mesh is either non valid or is not specified
Note:
IFS should be allocated by the user before the call to the function. The structure itself is changed inside the function to be a copy of the mesh. This means that changing the updated structure returned to the user, won't change the data structure used by the API, only the user's local copy

RESULT Mesh::getJoinedEdgesVertex EdgeID    eID1,
EdgeID    eID2,
VertexID   vID
 

Get the ID of the joined vertex between the two given edges.

Parameters:
eID1 The ID of the first edge
eID2 The ID of the second edge
vID [output] The ID of the joined vertex
Return values:
OK Operation succeeded
EdgeNotFound No edge was found with one of the given IDs
EdgesNotIncident The 2 edges are not incident (do not share a vertex)
SameEdgeGiven The 2 given edge IDs represent the same edge

RESULT Mesh::getJoinedFacesEdge FaceID    fID1,
FaceID    fID2,
EdgeID   eID1,
EdgeID   eID2
 

Get the ID of the edge joining the 2 given faces.

Since the edge actually has 2 IDs (one when appearing in the first face, and another when appearing in the second face), this function actually returns both of the IDs

Parameters:
fID1 The ID of the first face
fID2 The ID of the second face
eID1 [output] The ID of the joined edge (associated with the first face)
eID2 [output] The ID of the joined edge (associated with the second face)
Return values:
OK Operation succeeded
FaceNotFound No face was found with one of the given IDs
FacesNotIncident The 2 faces are not incident.
SameFaceGiven The 2 given face IDs are the same

RESULT Mesh::getJoinedVerticesEdge VertexID    vID1,
VertexID    vID2,
EdgeID   eID1,
EdgeID   eID2
 

Get the ID of the joined edge between the 2 given vertices.

If the joined edge has 2 IDs, this function returns both of them. If it has only one (there's only one face connecting the two vertices), the ID is returned in eID1, and eID2 is -1

Parameters:
vID1 The ID of the first vertex
vID2 The ID of the second vertex
eID1 [output] The ID of the joined edge
eID2 [output] The other ID of the joined edge
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs
VerticesNotIncident The 2 vertices are not incident.
SameVertexGiven The 2 given vertex IDs are the same

RESULT Mesh::getJoinedVerticesFace VertexID    vID1,
VertexID    vID2,
VertexID    vID3,
FaceID   fID
 

Get the ID of the joined face of the 3 given vertices.

Parameters:
vID1 The ID of the first vertex
vID2 The ID of the second vertex
vID3 The ID of the third vertex
fID [output] The ID of the joined face
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs
VerticesNotIncident The 3 vertices are not incident (do not form a face)
SameVertexGiven At least 2 of the given vertex IDs are the same

RESULT Mesh::getLine LineID    lineID,
Line   line
 

Get a copy of a line with a given ID.

Parameters:
lineID The ID of the line
line [output] A copy of the line.
Return values:
OK Operation succeeded
LineNotFound No line was found with the given ID

RESULT Mesh::getLinesCount LineID   count
 

Get the number of lines to draw.

Parameters:
count [output] The number of lines
Return values:
OK Operation succeeded

RESULT Mesh::getLineWidth LineID    lineID,
double &    width
 

Get the width of a line with a given ID.

Parameters:
lineID The ID of the line
width [output] The width of the line
Return values:
OK Operation succeeded
LineNotFound No line was found with the given ID

RESULT Mesh::getNeighborhood VertexID    vID,
LinkedList< VertexID > *    vertices = NULL,
LinkedList< EdgeID > *    edges = NULL,
LinkedList< FaceID > *    faces = NULL
 

Get the neighborhood of the given vertex (adjacent vertices, edges, and neighboring faces).

Parameters:
vID The ID of the vertex
vertices [output] If not NULL, will contain the IDs of the vertices which are adjacent to the given vertex (in ccw order)
edges [output] If not NULL, will contain the IDs of the edges which are adjacent to the given vertex (in ccw order)
faces [output] If not NULL, will contain the IDs of the faces which are adjacent to the given vertex (in ccw order)
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with the given ID
VertexIsOrphan The given vertex is an orphan (is not associated with any face).
NullPointerGiven All 3 given lists are NULL
Note:
This function does not work well if the vertex is complex.
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).
Some of the lists can be NULL, if you don't want to get that data. For example, if you don't want to get the list of edges, just send NULL intead of edges

RESULT Mesh::getOtherEdgeID EdgeID    eID,
EdgeID   otherEdgeID
 

Get the other edgeID of the edge with the given edgeID.

Since each edge is actually made of 2 half-edges, each edge can have 2 EdgeID's (if there are 2 triangles attached to it).

Parameters:
eID The edge ID
otherEdgeID [output] The other edgeID of the given edge. If equals '-1', there is only one ID for the given edge
Return values:
OK Operation succeeded
EdgeNotFound No edge was found with the given ID

RESULT Mesh::getSphere SphereID    sId,
Sphere   sphere
 

Get a copy of a sphere with a given ID.

Parameters:
sId The ID of the sphere
sphere [output] A copy of the sphere.
Return values:
OK Operation succeeded
SphereNotFound No sphere was found with the given ID

RESULT Mesh::getSpheresCount SphereID   count
 

Get the number of spheres to draw.

Parameters:
count [output] The number of spheres
Return values:
OK Operation succeeded

RESULT Mesh::getVerticesCount VertexID   count
 

Get the total number of vertices in the mesh model.

Parameters:
count [output] The number of vertices
Return values:
OK Operation succeeded

RESULT Mesh::getVerticesOfEdge EdgeID    eID,
VertexID   vID1,
VertexID   vID2
 

Get the 2 vertices which define the given edge.

Parameters:
eID The ID of the edge
vID1 [output] The ID of the first vertex
vID2 [output] The ID of the second vertex
Return values:
OK Operation succeeded
EdgeNotFound No edge was found with the given ID

bool Mesh::hasCylinders  
 

Checks whether there are any cylinders to draw.

Return values:
true There are cylinders to draw
false There aren't any cylinders to draw

bool Mesh::hasLines  
 

Checks whether there are any lines to draw.

Return values:
true There are lines to draw
false There aren't any lines to draw

bool Mesh::hasSpheres  
 

Checks whether there are any spheres to draw.

Return values:
true There are spheres to draw
false There aren't any spheres to draw

RESULT Mesh::isBoundaryEdge EdgeID    eID,
bool &    boundary
 

Checks whether the given edge is on a boundary.

Parameters:
eID The edge ID
boundary [output] If true, the edge is on a boundary. Otherwise, false.
Return values:
OK Operation succeeded
EdgeNotFound No edge was found with one of the given IDs

RESULT Mesh::isBoundaryFace FaceID    fID,
bool &    boundary
 

Checks whether the given face is on a boundary.

Parameters:
fID The face ID
boundary [output] If true, the face is on a boundary. Otherwise, false.
Return values:
OK Operation succeeded
FaceNotFound No face was found with one of the given IDs

RESULT Mesh::isBoundaryVertex VertexID    vID,
bool &    boundary
 

Checks whether the given vertex is on a boundary.

Parameters:
vID The vertex ID
boundary [output] If true, the vertex is on a boundary. Otherwise, false.
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs

bool Mesh::isModelEmpty  
 

Checks whether the model is empty (no vertices).

Return values:
true The model is empty (contains no vertices)
false The model is not empty (has at least one vertex)

bool Mesh::isTotallyEmpty  
 

Checks whether the data structures are empty (model is empty, and there are no lines, spheres and cylinders to draw).

Return values:
true The data structures are empty
false The data structures are not empty

bool Mesh::isValidCylinderIndex CylinderID    cID
 

Checks whether the given cylinder id is valid.

Return values:
true cID is valid
false cID is not valid

bool Mesh::isValidEdgeIndex EdgeID    eID
 

Checks whether the given edge id is valid.

Return values:
true eID is valid
false eID is not valid

bool Mesh::isValidFaceIndex FaceID    fID
 

Checks whether the given face id is valid.

Return values:
true fID is valid
false fID is not valid

bool Mesh::isValidLineIndex LineID    lID
 

Checks whether the given line id is valid.

Return values:
true lID is valid
false lID is not valid

bool Mesh::isValidSphereIndex SphereID    sID
 

Checks whether the given sphere id is valid.

Return values:
true sID is valid
false sID is not valid

bool Mesh::isValidVertexIndex VertexID    vID
 

Checks whether the given vertex id is valid.

Return values:
true vid is valid
false vid is not valid

RESULT Mesh::openVRMLFile const char *    fileName
 

Loads a VRML file and renders it.

Parameters:
fileName The path of the *.wrl file to load
Return values:
OK Operation succeeded
NullPointerGiven fileName is NULL.
OversizedString fileName is longer than MAX_STRING_SIZE.
FileNotFound File isn't found in given path.
WrongFileFormat VRML is not in the right format (has no IndexedFaceSets or has other geometry shapes (Box etc.)).
Note:
fileName should be shorter than MAX_STRING_SIZE characters.
The vertices' IDs are initialized according to each vertex's index in the IFS->coord->point array.
The faces' IDs are initialized according to the face's position in the IFS->coordIndex array, such that each face is defined by 4 values in the coordIndex array (the 3 vertices and an extra '-1'). The first face (with FaceID=0) is defined by the first 4 values in the array, the second face (with FaceID=1) by the next 4 and so on

RESULT Mesh::removeAllCylinders  
 

Remove all cylinders.

Return values:
OK Operation succeeded

RESULT Mesh::removeAllLines  
 

Remove all lines.

Return values:
OK Operation succeeded

RESULT Mesh::removeAllSpheres  
 

Remove all spheres.

Return values:
OK Operation succeeded

RESULT Mesh::removeCylinder CylinderID    cId
 

Remove the given cylinder.

Parameters:
cId The ID of the cylinder to remove
Return values:
OK Operation succeeded
CylinderNotFound No sphere was found with the given ID

RESULT Mesh::removeFace FaceID    fID,
LinkedList< VertexID > *    affectedVertices = NULL,
LinkedList< EdgeID > *    removedEdges = NULL
 

Removes the given face.

Parameters:
fID The ID of the face to remove
affectedVertices [output] If not NULL, will contain the IDs of the vertices affected by this operation (the removed face's vertices)
removedEdges [output] If not NULL, will contain the IDs of the edges which were removed by this operation (the removed face's edges)
Return values:
OK Operation succeeded
FaceNotFound No face was found with the given ID
Note:
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).

RESULT Mesh::removeLine LineID    lineID
 

Remove the given line.

Parameters:
lineID The ID of the line to remove
Return values:
OK Operation succeeded
LineNotFound No line was found with the given ID

RESULT Mesh::removeSphere SphereID    sId
 

Remove the given sphere.

Parameters:
sId The ID of the sphere to remove
Return values:
OK Operation succeeded
SphereNotFound No sphere was found with the given ID

RESULT Mesh::removeVertex VertexID    vID,
LinkedList< FaceID > *    removedFaces = NULL,
LinkedList< EdgeID > *    removedEdges = NULL
 

Remove the given vertex and all its incident edges and faces, leaving a hole where the faces were.

Parameters:
vID The ID of the vertex to remove
removedFaces [output] If not NULL, will contain the IDs of the faces which were removed during the process
removedEdges [output] If not NULL, will contain the IDs of the edges which were removed by this operation (the removed faces' edges)
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with the given ID
Note:
The output list needs to be allocated before use. Also, the function does not empty the list before use, so make sure the list is empty (unless you want the new data to be added to previous list elements).
See also:
removeVertexTriangulate()

RESULT Mesh::removeVertexTriangulate VertexID    vID,
const LinkedList< Face > *    newFaces,
LinkedList< FaceID > *    newFacesIDs = NULL,
LinkedList< FaceID > *    removedFaces = NULL,
LinkedList< EdgeID > *    removedEdges = NULL
 

Remove the given vertex and all its associated faces, then retriangulate the hole that was created, according to newFacesIndices.

Each element in the list is a Face, which represents a new face to be created.

Parameters:
vID The ID of the vertex to remove
newFaces A list of new faces which represents new faces to be created
newFacesIDs [output] If not NULL, will contain the IDs of the new faces which were created during the retriangulation
removedFaces [output] If not NULL, will contain the IDs of the faces which were removed during the process
removedEdges [output] If not NULL, will contain the IDs of the edges which were removed by this operation (the removed faces' edges)
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with the given ID
NullPointerGiven newFaces is NULL
Note:
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).
See also:
removeVertex()

RESULT Mesh::saveVRMLFile const char *    fileName = NULL
 

Saves the current mesh to a VRML file.

Parameters:
fileName The path of the *.wrl file to be saved. If NULL, the mesh will be saved to the predefined VRML file (when previously saved or loaded)
Return values:
OK Operation succeeded
NullPointerGiven fileName is NULL and there is no predefined VRML file (the mesh wasn't saved before).
OversizedString fileName is longer than MAX_STRING_SIZE.
FileNotFound File isn't found in given path.
MeshNotValid Mesh is either non valid or is not specified
Note:
fileName should be shorter than MAX_STRING_SIZE characters.
The file saved contains only the geometry and connectivity (i.e. vertices and faces), and disregards colors, highlights, spheres, lines and cylinders

RESULT Mesh::setCoord VertexID    vID,
Coord    coord
 

Move given vertex to a given location.

Parameters:
vID The ID of the vertex to move.
coord The new vertex coordinate
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with the given ID

RESULT Mesh::setCoords const LinkedList< VertexID > *    vertices,
const LinkedList< Coord > *    coords
 

Move given vertices to given locations.

Parameters:
vertices A list of the IDs of the vertices to move
coords The new vertices coordinates
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with one of the given IDs
NullPointerGiven One of the given lists is NULL
Note:
The entries in coords list should correspond to the entries in vertices. That is, the first entry in coords should be the new coordinate for the first entry in vertices, and so on.
The changes will be visible on the screen only after all vertices are moved (or if a problem occurs before that).
If the lists have different lengths (meaning there are extra vertices IDs or extra coordinates), the extra data in the longer list will be ignored.

RESULT Mesh::setCylinder CylinderID    cId,
Cylinder    cylinder
 

Set the cylinder's parameters.

Parameters:
cId The ID of the cylinder
cylinder The Cylinder object with the new parameters
Return values:
OK Operation succeeded
CylinderNotFound No cylinder was found with the given ID

RESULT Mesh::setIFS const VRIndexedFaceSet *    IFS
 

Sets the current model to be a copy of the given IndexedFaceSet.

Parameters:
IFS The IndexedFaceSet of the mesh
Return values:
OK Operation succeeded
NullPointerGiven IFS is NULL

RESULT Mesh::setLine LineID    lineID,
Line    line
 

Set the line's coordinates.

Parameters:
lineID The ID of the line
line The Line object with the new coordinates
Return values:
OK Operation succeeded
LineNotFound No line was found with the given ID

RESULT Mesh::setLineWidth LineID    lineID,
double    width = DEFAULT_LINE_WIDTH
 

Set the width of a line with a given ID.

Parameters:
lineID The ID of the line
width The new width of the line
Return values:
OK Operation succeeded
LineNotFound No line was found with the given ID

RESULT Mesh::setSphere SphereID    sId,
Sphere    sphere
 

Set the sphere's parameters (center and radius).

Parameters:
sId The ID of the sphere
sphere The Sphere object with the new parameters
Return values:
OK Operation succeeded
SphereNotFound No sphere was found with the given ID

RESULT Mesh::startNewModel  
 

Starts a new empty model (clears the current mesh and the screen).

Return values:
OK Operation succeeded
Note:
This function is usually followed by a call to Renderer::setAutoScale()
See also:
Renderer::setAutoScale()

RESULT Mesh::vertexSplit VertexID    vID,
Coord    coordinate,
VertexID    left,
VertexID    right,
VertexID   newVertex,
LinkedList< FaceID > *    newFacesIDs = NULL,
LinkedList< FaceID > *    removedFaces = NULL,
LinkedList< EdgeID > *    removedEdges = NULL
 

Split the given vertex to a new vertex, then move it to the given location.

The left and right vertices define the vertices which will be attached to the new vertex. All the vertices between left and right (in ccw order) will become the adjacent vertices of the split vertex

Parameters:
vID The ID of the vertex to split
coordinate The coordinate of the new vertex.
left ID of the vertex to the left of the original vertex.
right ID of the vertex to the right of the original vertex
newVertex [output] The ID of the new vertex.
newFacesIDs [output] If not NULL, will contain the ID's of the new faces which were created
removedFaces [output] If not NULL, will contain the ID's of the faces which were removed during the process
removedEdges [output] If not NULL, will contain the IDs of the edges which were removed during the process
Return values:
OK Operation succeeded
VertexNotFound No vertex was found with the given ID
VerticesNotIncident One of the left and right vertices is not incident to the given vertex to be split
Note:
The output lists need to be allocated before use. Also, the function does not empty the lists before use, so make sure the lists are empty (unless you want the new data to be added to previous list elements).

RESULT Mesh::VRMLExport const char *    fileName
 

Saves the current mesh to a VRML file, saving all the highlighted vertices/edges/faces and their colors.

Return values:
OK Operation succeeded
NullPointerGiven fileName is NULL and there is no predefined VRML file (the mesh wasn't saved before).
OversizedString fileName is longer than MAX_STRING_SIZE.
FileNotFound File isn't found in given path.
MeshNotValid Mesh is either non valid or is not specified
Note:
fileName should be shorter than MAX_STRING_SIZE characters.
The file saved contains the geometry and connectivity (i.e. vertices and faces), as well as colors, highlights, spheres, lines and cylinders


The documentation for this class was generated from the following file:
MeshMaker 5.2 Manual
This software library was written by Roni Raab, ronir@cs.technion.ac.il.
Last updated on May 2003.
This software is for academic and research use only.