All Frameworks Class Hierarchy This Framework Indexes
PolyhedralInterfaces Interface CATIPolyMesh
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATIPolyMesh
Interface to a polyhedral triangular mesh.
A CATIPolyMesh is a polyhedral surface whose facets are triangular.
This interface provides additional iterators and methods to access and
edit the triangles.
Method Index
- o
AddTriangle(int[3],int&)
- Adds a triangle and returns its index.
- o
AddVertex(int&)
- Adds a vertex to the surface.
- o
AddVertex(CATMathPoint&,int&)
- Adds a vertex and returns its index.
- o
Compact()
- Compacts the arrays containing the mesh data.
- o
Compact(int*&,int*&)
- Compact the arrays containing the mesh data.
- o
FlipBar(int,int)
- Flips the bar between two triangles.
- o
GetBoundingBox(CATMathBox&)
- Returns the bounding box of the whole mesh.
- o
GetNbTriangles()
- Returns the total number of triangles in the mesh (explicit).
- o
GetTriangleIterator(CATIPolyMeshTriangleIterator*&)
- Returns a triangle iterator for the whole mesh (explicit).
- o
GetTriangle(int,int[3])
- Returns the vertices of a triangle given its index.
- o
MergeVertices(int,int)
- Merges the vertices by collapsing the bar connecting them, killing
associated triangles (a.
- o
RemoveTriangle(int,CATBoolean)
- Removes the triangle.
- o
RemoveVertex(int)
- Removes a vertex.
- o
Reserve(int,int)
- Ask for iNbVertices and iNbTriangles supplementary vertices and triangles.
- o
SplitBar(int,int,int&)
- Splits the bar connecting two vertices, refining the adjacent triangles A
new vertex is created whose position is undetermined.
Methods
o AddTriangle
| public virtual AddTriangle( | const | iIdxVertices, |
| | oIdxTriangle) |
-
Adds a triangle and returns its index.
- Parameters:
-
- iIdxVertices
- The indices of the three vertices.
- oIdxTriangle
- The index of the added triangle.
- Returns:
- S_OK if the triangle is added successfully, E_FAIL otherwise.
o AddVertex
| public virtual AddVertex( | | oIdxVertex) |
-
Adds a vertex to the surface.
- Parameters:
-
- v
- The index of the added vertex.
- Returns:
- S_OK on success or E_FAIL or another error otherwise.
o AddVertex
| public virtual AddVertex( | const | iPoint, |
| | oIdxVertex) |
-
Adds a vertex and returns its index.
- Parameters:
-
- iPoint
- The position of the vertex.
- oIdxVertex
- The index of the added vertex.
- Returns:
- S_OK on success or E_FAIL or another error otherwise.
o Compact
-
Compacts the arrays containing the mesh data.
The indices are not stationary during a compact operation since reference to deleted vertices and
triangles are removed.
o Compact
| public virtual Compact( | | ioIdxVertices, |
| | ioIdxTriangles) |
-
Compact the arrays containing the mesh data.
The indices are not stationary during a compact operation since reference to deleted vertices and
triangles are removed.
- Parameters:
-
- ioIdxVertices
- Array giving the relationship between the vertices indices before and after the compact operation:
NewIndex = ioIdxVertices (OldIndex);
// with:
// OldIndex is in the range [1,OldNbVertices]
// NewIndex is in the range [1,NewNbVertices]
// where:
// OldNbVertices is the value returned by GetNbVertices before the compact operation
// NewNbVertices is the value returned by GetNbVertices after the compact operation
If -1, the array is not request. If NULL, the array will be allocated by the called.
It must be deallocated by the caller. Otherwise, the array is allocated by the caller with a size
greater or equal to 1+GetNbVertices().
- ioIdxTriangles
- Array giving the relationship between the triangles indices before and after the compact operation:
NewIndex = ioIdxTriangles (OldIndex);
// with:
// OldIndex is in the range [1,OldNbTriangles]
// NewIndex is in the range [1,NewNbTriangles]
// where:
// OldNbTriangles is the value returned by GetNbTriangles before the compact operation
// NewNbTriangles is the value returned by GetNbTriangles after the compact operation
If -1, the array is not request. If NULL, the array will be allocated by the called.
It must be deallocated by the caller. Otherwise, the array is allocated by the caller with a size
greater or equal to 1+GetNbTriangles().
o FlipBar
| public virtual FlipBar( | const | iIdxVertex1, |
| const | iIdxVertex2) |
-
Flips the bar between two triangles.
The method can only flips a bar between two triangles.
It will fail otherwise.
Let T1 (n1, n2, n3) and T2 (n4, n2, n1) be two triangles.
They will be replaced by the triangles T'1 (n1, n4, n3) and T'2 (n4, n2, n3)
after a successful call to this method.
n4-----n2 n4-----n2
| /| |\ |
| T2 / | | \ T2'|
| / | | \ |
| / | ==> | \ |
| / T1 | |T1' \ |
|/ | | \|
n1-----n3 n1-----n3
- Parameters:
-
- iIdxVertex1
- The index of the first vertex.
- iIdxVertex2
- The index of the second vertex.
- Returns:
-
-
S_OK on success.
-
E_FAIL otherwise.
o GetBoundingBox
| public virtual GetBoundingBox( | | oBBox) |
-
Returns the bounding box of the whole mesh.
- Parameters:
-
- oBBox
- The returned bounding box.
- Returns:
-
-
S_OK if the bounding box is set.
-
S_FALSE if the bounding box is not set.
-
E_FAIL or any other error if an error occurs.
o GetNbTriangles
| public virtual GetNbTriangles( | ) |
-
Returns the total number of triangles in the mesh (explicit).
- Returns:
- The number of triangles.
o GetTriangleIterator
| public virtual GetTriangleIterator( | | oIterator) |
-
Returns a triangle iterator for the whole mesh (explicit).
- Parameters:
-
- oIterator
- The output iterator. The returned instance must be released. (ref-counted.)
- Returns:
- S_OK on success or E_FAIL or another error otherwise.
o GetTriangle
| public virtual GetTriangle( | const | iIdxTriangle, |
| | oIdxVertices) |
-
Returns the vertices of a triangle given its index.
- Parameters:
-
- iIdxTriangle
- The index of the triangle.
- oIdxVertices
- The indices of the triangle vertices.
- Returns:
- S_OK if the a triangle is successfully returned and E_FAIL otherwise.
o MergeVertices
| public virtual MergeVertices( | const | v0, |
| const | v1) |
-
Merges the vertices by collapsing the bar connecting them, killing
associated triangles (a.k.a. "bar collapse"). Replace v1 by v0
topologically:
- remove triangles connected to v0 and v1,
- replace v1 by v0 in remaining triangles connected to v1.
v2 is topologically disconnected but NOT removed from the mesh.
v0------v2 v0------v2
|\ t2 /| | /|
| \ / | | t0 / |
| \ / | | / |
|t0 v1 t3 ==> | / |
| / \ | | / |
| / \ | | / t1 |
|/ t1 \| |/ |
v4------v3 v4------v3
- Returns:
-
-
S_OK on success.
-
E_FAIL otherwise.
o RemoveTriangle
| public virtual RemoveTriangle( | const | iIdxTriangle, |
| const | iRemoveUnreferencedVertices | = FALSE) |
-
Removes the triangle.
- Parameters:
-
- idxTriangle
- The index of the triangle to remove.
- iRemoveUnreferencedVertices
- A flag indicating whether to remove vertices that are no longer referenced by any triangle.
The default value is set to FALSE. Vertices will not be implicitly removed.
- Returns:
- S_OK if the triangle is removed and E_FAIL otherwise.
o RemoveVertex
| public virtual RemoveVertex( | const | iIdxVertex) |
-
Removes a vertex.
- Parameters:
-
- iIdxVertex
- The index of the vertex to be removed.
- Returns:
- S_OK on success or E_FAIL or another error otherwise.
o Reserve
| public virtual Reserve( | | iNbVertices, |
| | iNbTriangles) |
-
Ask for iNbVertices and iNbTriangles supplementary vertices and triangles.
This is used to pre-allocate memory when a known number of cells will soon
be added to the mesh.
o SplitBar
| public virtual SplitBar( | const | v0, |
| const | v1, |
| | n) |
-
Splits the bar connecting two vertices, refining the adjacent triangles A
new vertex is created whose position is undetermined.
v2------v1 v2------v1
| /| |\ t2 /|
| t0 / | | \ / |
| / | | \ / |
| / | ==> |t0 n t3|
| / | | / \ |
| / t1 | | / \ |
|/ | |/ t1 \|
v0------v3 v0------v3
- Returns:
-
-
S_OK on success.
-
E_FAIL otherwise.
This object is included in the file: CATIPolyMesh.h
If needed, your Imakefile.mk should include the module: CATPolyhedralInterfaces