- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends

# Topology Class Reference

This reference page is linked to from the following overview topics: Mesh and Topology.

Search for all occurrences

## Detailed Description

Represents the topology data of a mesh, providing information about the structure of a surface, e.g. how faces are layed down.

The class Mesh is inherited from this class, and provides information about the vertices. Since only full triangle or quad meshes are allowed in Mudbox, an instance of this class is basically an array of triangles and quads. When a mixed triangle-quad or n-sided mesh is imported into mudbox, then the mesh is converted to a full triangle topology, see the member functions IsFakeTriangle and SetFakeTriangle. The Topology class can hold different type of data for the polygons, like position indices, adjacency, texture coordinate indices etc. These are called face components. To save memory not every buffer is allocated at the beginning. You can control which buffers will be allocated by calling the AddFaceComponent() and RemoveFaceComponent() functions.

Definition at line 45 of file topology.h.

`#include <topology.h>`

Inheritance diagram for Topology:
[legend]

List of all members.

## Public Types
enum | FaceState { fsSelected = 0x01, fsVisible = 0x02, fsFake = 0x04, fsActive = 0x08, fsMapped = 0x10 }
enum | FaceComponent { fcIndex = 1, fcAdjacency = 2, fcTCIndex = 4, fcNormal = 8, fcID = 16, fcOctree = 32, fcFreeze = 64, fcState = 128 }
enum | FaceType { typeTriangular, typeQuadric }
## Public Member Functions
void | MoveTo (Topology *pDestination)
| Move the content of this object to another one. This is a fast function.
void | CopyTo (Node *pNode) const
| Copy the content of this object to another one, while keeps the content of the current object.
void | Serialize (Stream &s)
| serializes the content of the object into/from a stream.
FaceType | Type (void) const
| Returns the type of the topology. Can be full triangular or full quadric.
void | SetType (FaceType eType)
| Sets the type of the object. This call also clears all the content of the object.
int | SideCount (void) const
| Returns the number of sides in the faces. This is three if the topology is triangle based, and four if its quad based.
unsigned int | FaceCount (void) const
| Returns the number of faces in the topology.
virtual Vector | FaceNormal (unsigned int iFaceIndex) const
| Returns the normal vector for a face in the topology.
void | SetFaceID (unsigned int iFaceIndex, unsigned int iID)
| This function is used only internally.
unsigned int | FaceID (unsigned int iFaceIndex) const
| This function is used only internally.
virtual void | SetFakeTriangleCount (unsigned int iFakeTriangleCount)
| Call this method to indicate how many fake triangles are in the topology.
unsigned int | QuadIndex (unsigned int iFaceIndex, unsigned int iCornerIndex) const
| Returns the vertex position index of a corner of a quad.
void | SetQuadIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
| Sets the vertex position index of a corner of a quad.
unsigned int | QuadCreaseNormalIndex (unsigned int iFaceIndex, unsigned int iCornerIndex) const
| Returns the vertex crease/hard normal index of a corner of quad, if there is crease/hard normal of this corner, otherwise it is the vertex normal index.
void | SetQuadCreaseNormalIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
| Sets the vertex normal index of a corner of a quad.
unsigned int | QuadTCI (unsigned int iFaceIndex, unsigned int iCornerIndex) const
| Returns the vertex texture coordinate index of a corner of a quad.
void | SetQuadTCI (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
| Sets the vertex texture coordinate index of a corner of a quad.
virtual unsigned int | QuadAdjacency (unsigned int iFaceIndex, unsigned int iSideIndex) const
| Returns the vertex adjacency information index of a side of a quad.
unsigned int | QuadAdjacency_ForcedInline (unsigned int iFaceIndex, unsigned int iSideIndex) const
virtual void | SetQuadAdjacency (unsigned int iFaceIndex, unsigned int iSideIndex, unsigned int iValue)
| Sets the adjacency info for a side of a quad. See QuadAdjacency for details.
bool | HasAdjacentQuad (unsigned int iFaceIndex, unsigned int iSideIndex) const
| Returns true if the given edge of a quad has an adjacent quad on the other side.
unsigned int | TriangleIndex (unsigned int iFaceIndex, unsigned int iCornerIndex) const
| Returns the vertex position index of a corner of a triangle.
void | SetTriangleIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
| Sets the vertex position index of a corner of a triangle.
unsigned int | TriangleCreaseNormalIndex (unsigned int iFaceIndex, unsigned int iCornerIndex) const
| Returns the vertex crease/hard normal index of a corner of triangle, if there is crease/hard normal of this corner, otherwise it is the vertex normal index.
void | SetTriangleCreaseNormalIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
| Sets the vertex normal index of a corner of a triangle.
unsigned int | TriangleTCI (unsigned int iFaceIndex, unsigned int iCornerIndex) const
| Returns the vertex texture coordinate index of a corner of a triangle.
void | SetTriangleTCI (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
| Sets the vertex texture coordinate index of a corner of a triangle.
virtual unsigned int | TriangleAdjacency (unsigned int iFaceIndex, unsigned int iSideIndex) const
| Returns the vertex adjacency information index of a side of a triangle.
virtual void | SetTriangleAdjacency (unsigned int iFaceIndex, unsigned int iSideIndex, unsigned int iValue)
| Sets the adjacency info for a side of a triangle. See TriangleAdjacency for details.
bool | HasAdjacentTriangle (unsigned int iFaceIndex, unsigned int iSideIndex) const
| Returns true if the given edge of a triangle has an adjacent triangle on the other side.
unsigned char & | FaceState (unsigned int iFaceIndex)
| Returns the state of a face. See FaceState.
unsigned char | FaceState (unsigned int iFaceIndex) const
| Sets the state of a face.
bool | IsFaceSelected (unsigned int iFaceIndex) const
| Returns true if the given face is selected.
virtual void | SetFaceSelected (unsigned int iFaceIndex, bool bSelected=true, bool bUpdateVertexSelection=false, bool bBatchSelection=false)
| Sets selection state for a face.
virtual unsigned int | SelectedFaceCount () const
| Returns the number of selected faces.
bool | IsFaceVisible (unsigned int iFaceIndex) const
| Returns true if the given face is visible.
virtual void | SetFaceVisible (unsigned int iFaceIndex, bool bVisible=true)
| Sets the visibility of a given face.
bool | IsFaceActive (unsigned int iFaceIndex) const
void | SetFaceActive (unsigned int iFaceIndex, bool bSelected=true)
bool | IsFaceMapped (unsigned int iFaceIndex) const
| Used only internally.
void | SetFaceMapped (unsigned int iFaceIndex, bool bSelected=true)
| Used only internally.
bool | IsFakeTriangle (unsigned int iTriangleIndex) const
| This function can only be used for triangular meshes.
void | SetFakeTriangle (unsigned int iTriangleIndex, bool b)
bool | IsFaceTemp (unsigned int iFaceIndex) const
void | SetFaceTemp (unsigned int iFaceIndex, bool bSelected=true)
void | ClearFaceTempStates ()
virtual void | AddFaceComponent (FaceComponent eComponentToAdd)
| Adds new face component(s) to the object.
virtual void | RemoveFaceComponent (FaceComponent eComponentToRemove)
| Removes face component(s) from the object. This might delete some data from the memory.
unsigned int | FaceComponents (void) const
| Returns the current face components for the object.
void | SetFaceCount (unsigned int iFaceCount)
| Sets the number of faces in the object. Existing face data will be kept.
virtual bool | SetAdjacencyCount (unsigned int iCount, bool bKeepContent=true, bool bForced=false)
| Sets the size of the adjacency array.
unsigned int | AdjacencyCount (void) const
| Returns the size of the adjacency matrix.
virtual bool | HasTShape () const
| Return true if these is edge shared by more than two faces.
virtual void | SetHasTShape (bool bHasTShape)
virtual void | CheckValidity (DiagnosticLevel iLevel=dgnLevel2) const
| See the documentation for Node::CheckValidity.
## Public Attributes
Store< unsigned int > | m_pIndices
## Protected Member Functions
| Topology (void)
| Do not use constructors directly. Use CreateInstances() instead.
| Topology (FaceType eType)
| Constructs the object with zero faces.
## Protected Attributes
Store< unsigned int > | m_pTCI
Store< unsigned int > | m_pAdjacency
Store< unsigned int > | m_pNormalIndices
## Friends
class | ::XMesh

## Member Enumeration Documentation

enum FaceState

Search for all occurrences

Enumerator:

  fsSelected | Search for all occurrences
  fsVisible | Search for all occurrences
  fsFake | Search for all occurrences
  fsActive | Search for all occurrences
  fsMapped | Search for all occurrences

Definition at line 48 of file topology.h.

        {
            fsSelected = 0x01,
            fsVisible = 0x02,
            fsFake = 0x04,
            fsActive = 0x08,
            fsMapped = 0x10,
            // fsTemp = 0x20    // for performance reasons, the temp state is split into a seperate vector
        };

enum FaceComponent

Search for all occurrences

Enumerator:

  fcIndex | Search for all occurrences
  fcAdjacency | Search for all occurrences
  fcTCIndex | Search for all occurrences
  fcNormal | Search for all occurrences
  fcID | Search for all occurrences
  fcOctree | Search for all occurrences
  fcFreeze | Search for all occurrences
  fcState | Search for all occurrences

Definition at line 58 of file topology.h.

        {
            fcIndex = 1,
            fcAdjacency = 2,
            fcTCIndex = 4,
            fcNormal = 8,
            fcID = 16,
            fcOctree = 32,
            fcFreeze = 64,
            fcState = 128
        };

enum FaceType

Search for all occurrences

Enumerator:

  typeTriangular | Search for all occurrences
  typeQuadric | Search for all occurrences

Definition at line 69 of file topology.h.

        {
            typeTriangular,
            typeQuadric
        };

## Constructor & Destructor Documentation

Topology | ( | void |  | ) | `[protected]`

Do not use constructors directly. Use CreateInstances() instead.

Topology | ( | FaceType | eType | ) | `[protected]`

Constructs the object with zero faces.

## Member Function Documentation

void MoveTo | ( | Topology * | pDestination | ) |

Search for all occurrences

Move the content of this object to another one. This is a fast function.

This object will loose all data and become an empty topology.

void CopyTo | ( | Node * | pNode | ) | const `[virtual]`

Search for all occurrences

Copy the content of this object to another one, while keeps the content of the current object.

This function is similar to MoveTo, but since it is copying all the data, it is slower. You can use this function when you want to do some temporary change to a mesh (like you want to change the vertex ordering inside faces) but then you want to restore the original state. In that case you can simply create a copy of the mesh, do the modifications, and when you don't need it any longer, just delete it.

Reimplemented from TreeNode.

Reimplemented in Mesh.

void Serialize | ( | Stream & | s | ) | `[virtual]`

Search for all occurrences

serializes the content of the object into/from a stream.

Reimplemented from TreeNode.

FaceType Type | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the type of the topology. Can be full triangular or full quadric.

Definition at line 113 of file topology.h.

    { return m_eType; };

void SetType | ( | FaceType | eType | ) |

Search for all occurrences

Sets the type of the object. This call also clears all the content of the object.

int SideCount | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the number of sides in the faces. This is three if the topology is triangle based, and four if its quad based.

Definition at line 117 of file topology.h.

    { return Type() == typeTriangular ? 3 : 4; };

unsigned int FaceCount | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the number of faces in the topology.

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

Definition at line 121 of file topology.h.

    { return m_iFaceCount; };

virtual Vector FaceNormal | ( | unsigned int | iFaceIndex | ) | const `[virtual]`

Search for all occurrences

Returns the normal vector for a face in the topology.

void SetFaceID | ( | unsigned int | iFaceIndex,
|  | unsigned int | iID
| ) |  | `[inline]`

Search for all occurrences

This function is used only internally.

Definition at line 125 of file topology.h.

    { m_pFaceIDs[iFaceIndex] = iID; };

unsigned int FaceID | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

This function is used only internally.

Definition at line 127 of file topology.h.

    { return m_pFaceIDs[iFaceIndex]; };

virtual void SetFakeTriangleCount | ( | unsigned int | iFakeTriangleCount | ) | `[virtual]`

Search for all occurrences

Call this method to indicate how many fake triangles are in the topology.

Call SetFaceCount before calling this method. Note this has no effect on quadric meshes.

Examples:
  PtexImporter/PtexImporter.cpp.

unsigned int QuadIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the vertex position index of a corner of a quad.

The value returned by this call can be used as a parameter for the VertexPosition() function in class Mesh.

Definition at line 135 of file topology.h.

    { return m_pIndices[iFaceIndex*4+iCornerIndex]; };

void SetQuadIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int | iValue
| ) |  | `[inline]`

Search for all occurrences

Sets the vertex position index of a corner of a quad.

The value returned by this call can be used as parameter for the VertexTC() function in class Mesh.

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

Definition at line 138 of file topology.h.

    { m_pIndices[iFaceIndex*4+iCornerIndex] = iValue; };

unsigned int QuadCreaseNormalIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the vertex crease/hard normal index of a corner of quad, if there is crease/hard normal of this corner, otherwise it is the vertex normal index.

The value returned by this call can be used as a parameter for the VertexNormal() function in class Mesh. Or you can use QuadVertexCreaseNormal() function in class Mesh directly.

Definition at line 143 of file topology.h.

    { return m_pNormalIndices[iFaceIndex*4+iCornerIndex]; }

void SetQuadCreaseNormalIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int | iValue
| ) |  | `[inline]`

Search for all occurrences

Sets the vertex normal index of a corner of a quad.

Definition at line 145 of file topology.h.

    { m_pNormalIndices[iFaceIndex*4+iCornerIndex] = iValue; }

unsigned int QuadTCI | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the vertex texture coordinate index of a corner of a quad.

Definition at line 147 of file topology.h.

    { return m_pTCI[iFaceIndex*4+iCornerIndex]; }

void SetQuadTCI | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int | iValue
| ) |  | `[inline]`

Search for all occurrences

Sets the vertex texture coordinate index of a corner of a quad.

Definition at line 149 of file topology.h.

    { m_pTCI[iFaceIndex*4+iCornerIndex] = iValue; }

virtual unsigned int QuadAdjacency | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex
| ) |  | const `[inline, virtual]`

Search for all occurrences

Returns the vertex adjacency information index of a side of a quad.

If the returned value is x, then x/4 is the index of the adjacent quad, while x4 is the side in the adjacent quad which is common with the given one.

Definition at line 153 of file topology.h.

    { return m_pAdjacency[iFaceIndex*4+iSideIndex]; }

unsigned int QuadAdjacency_ForcedInline | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 154 of file topology.h.

    { return m_pAdjacency[iFaceIndex*4+iSideIndex]; }

virtual void SetQuadAdjacency | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex,
|  | unsigned int | iValue
| ) |  | `[inline, virtual]`

Search for all occurrences

Sets the adjacency info for a side of a quad. See QuadAdjacency for details.

Definition at line 156 of file topology.h.

            { m_pAdjacency[iFaceIndex*4+iSideIndex] = iValue; }

bool HasAdjacentQuad | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns true if the given edge of a quad has an adjacent quad on the other side.

Definition at line 159 of file topology.h.

    { return QuadAdjacency( iFaceIndex, iSideIndex ) < 0x80000000; };

unsigned int TriangleIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the vertex position index of a corner of a triangle.

The value returned by this call can be used as a parameter for the VertexPosition() function in class Mesh.

Definition at line 164 of file topology.h.

    { return m_pIndices[iFaceIndex*3+iCornerIndex]; };

void SetTriangleIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int | iValue
| ) |  | `[inline]`

Search for all occurrences

Sets the vertex position index of a corner of a triangle.

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

Definition at line 166 of file topology.h.

    { m_pIndices[iFaceIndex*3+iCornerIndex] = iValue; };

unsigned int TriangleCreaseNormalIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the vertex crease/hard normal index of a corner of triangle, if there is crease/hard normal of this corner, otherwise it is the vertex normal index.

The value returned by this call can be used as a parameter for the VertexNormal() function in class Mesh. Or you can use TriangleVertexCreaseNormal() function in class Mesh directly.

Definition at line 171 of file topology.h.

    { return m_pNormalIndices[iFaceIndex*3+iCornerIndex]; }

void SetTriangleCreaseNormalIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int | iValue
| ) |  | `[inline]`

Search for all occurrences

Sets the vertex normal index of a corner of a triangle.

Definition at line 173 of file topology.h.

    { m_pNormalIndices[iFaceIndex*3+iCornerIndex] = iValue; }

unsigned int TriangleTCI | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the vertex texture coordinate index of a corner of a triangle.

Definition at line 175 of file topology.h.

    { return m_pTCI[iFaceIndex*3+iCornerIndex]; }

void SetTriangleTCI | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int | iValue
| ) |  | `[inline]`

Search for all occurrences

Sets the vertex texture coordinate index of a corner of a triangle.

The value returned by this call can be used as parameter for the VertexTC() function in class Mesh.

Examples:
  MeshBuilder/MeshBuilder.cpp.

Definition at line 178 of file topology.h.

    { m_pTCI[iFaceIndex*3+iCornerIndex] = iValue; }

virtual unsigned int TriangleAdjacency | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex
| ) |  | const `[inline, virtual]`

Search for all occurrences

Returns the vertex adjacency information index of a side of a triangle.

If the returned value is x, then x/3 is the index of the adjacent triangle, while x3 is the side in the adjacent triangle which is common with the given one.

Definition at line 182 of file topology.h.

    { return m_pAdjacency[iFaceIndex*3+iSideIndex]; }

virtual void SetTriangleAdjacency | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex,
|  | unsigned int | iValue
| ) |  | `[inline, virtual]`

Search for all occurrences

Sets the adjacency info for a side of a triangle. See TriangleAdjacency for details.

Definition at line 184 of file topology.h.

            { m_pAdjacency[iFaceIndex*3+iSideIndex] = iValue; }

bool HasAdjacentTriangle | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns true if the given edge of a triangle has an adjacent triangle on the other side.

Definition at line 187 of file topology.h.

            { return TriangleAdjacency( iFaceIndex, iSideIndex ) < 0x80000000; };

unsigned char& FaceState | ( | unsigned int | iFaceIndex | ) | `[inline]`

Search for all occurrences

Returns the state of a face. See FaceState.

Definition at line 191 of file topology.h.

    { return m_pFaceState[iFaceIndex]; };

unsigned char FaceState | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

Sets the state of a face.

Definition at line 193 of file topology.h.

    { return m_pFaceState[iFaceIndex]; };

bool IsFaceSelected | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

Returns true if the given face is selected.

Definition at line 196 of file topology.h.

    { return (FaceState( iFaceIndex ) & fsSelected) != 0; };

virtual void SetFaceSelected | ( | unsigned int | iFaceIndex,
|  | bool | bSelected = `true`,
|  | bool | bUpdateVertexSelection = `false`,
|  | bool | bBatchSelection = `false`
| ) |  | `[virtual]`

Search for all occurrences

Sets selection state for a face.

The parameter bUpdateVertexSelection controls if the internal buffers should be updated or not. Passing true as this parameter makes the function slow, so do that only if you want to change the selection status for a few faces only. Otherwise use false, and after you changed all the vertices, update the buffers once only. [HOW? OPEN QUESTION]

virtual unsigned int SelectedFaceCount | ( |  | ) | const `[virtual]`

Search for all occurrences

Returns the number of selected faces.

bool IsFaceVisible | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

Returns true if the given face is visible.

Definition at line 207 of file topology.h.

    { return (FaceState( iFaceIndex ) & fsVisible) != 0; };

virtual void SetFaceVisible | ( | unsigned int | iFaceIndex,
|  | bool | bVisible = `true`
| ) |  | `[inline, virtual]`

Search for all occurrences

Sets the visibility of a given face.

Definition at line 209 of file topology.h.

            { if ( bVisible ) FaceState( iFaceIndex ) |= fsVisible; else FaceState( iFaceIndex ) &= 0xff-fsVisible; };

bool IsFaceActive | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

Definition at line 211 of file topology.h.

    { return (FaceState( iFaceIndex ) & fsActive) != 0; };

void SetFaceActive | ( | unsigned int | iFaceIndex,
|  | bool | bSelected = `true`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 212 of file topology.h.

            { if ( bSelected ) FaceState( iFaceIndex ) |= fsActive; else FaceState( iFaceIndex ) &= 0xff-fsActive; };

bool IsFaceMapped | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

Used only internally.

Definition at line 215 of file topology.h.

    { return (FaceState( iFaceIndex ) & fsMapped) != 0; };

void SetFaceMapped | ( | unsigned int | iFaceIndex,
|  | bool | bSelected = `true`
| ) |  | `[inline]`

Search for all occurrences

Used only internally.

Definition at line 217 of file topology.h.

            { if ( bSelected ) FaceState( iFaceIndex ) |= fsMapped; else FaceState( iFaceIndex ) &= 0xff-fsMapped; };

bool IsFakeTriangle | ( | unsigned int | iTriangleIndex | ) | const `[inline]`

Search for all occurrences

This function can only be used for triangular meshes.

If the mesh only contains triangles, then this function always return false. When the original mesh was a mixed tri-quad or n-sided one, then during import it gets converted into a triangular mesh. Each polygon which has more than three sides are converted into N-2 triangles where N is the number of sides in the polygon. The first triangle is marked as real, but the other ones are marked as fake by this function. So this function makes it possible to restore the original polygon structure of the mesh.

Definition at line 225 of file topology.h.

            { return iTriangleIndex < FaceCount() && (FaceState( iTriangleIndex ) & fsFake); };

void SetFakeTriangle | ( | unsigned int | iTriangleIndex,
|  | bool | b
| ) |  | `[inline]`

Search for all occurrences

Examples:
  PtexImporter/PtexImporter.cpp.

Definition at line 227 of file topology.h.

            { if( iTriangleIndex < FaceCount() ) {
                if ( b ) FaceState( iTriangleIndex ) |= fsFake;
                else     FaceState( iTriangleIndex ) &= 0xff-fsFake;
              };
            };

bool IsFaceTemp | ( | unsigned int | iFaceIndex | ) | const `[inline]`

Search for all occurrences

Definition at line 234 of file topology.h.

    { return m_pFaceTemp[iFaceIndex]; };

void SetFaceTemp | ( | unsigned int | iFaceIndex,
|  | bool | bSelected = `true`
| ) |  | `[inline]`

Search for all occurrences

Definition at line 235 of file topology.h.

            { m_pFaceTemp[iFaceIndex] = bSelected; }

void ClearFaceTempStates | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 239 of file topology.h.

        {
            MB_ASSERT(m_iFaceCount <= m_pFaceTemp.ItemCount());
            memset(&m_pFaceTemp[0], 0, m_iFaceCount);  // memset is the fastest way to clear the array.
        }

virtual void AddFaceComponent | ( | FaceComponent | eComponentToAdd | ) | `[virtual]`

Search for all occurrences

Adds new face component(s) to the object.

If the specified components did not exist yet, memory will be allocated for them.

virtual void RemoveFaceComponent | ( | FaceComponent | eComponentToRemove | ) | `[virtual]`

Search for all occurrences

Removes face component(s) from the object. This might delete some data from the memory.

unsigned int FaceComponents | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the current face components for the object.

Definition at line 252 of file topology.h.

    { return m_eFaceComponents; };

void SetFaceCount | ( | unsigned int | iFaceCount | ) |

Search for all occurrences

Sets the number of faces in the object. Existing face data will be kept.

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

virtual bool SetAdjacencyCount | ( | unsigned int | iCount,
|  | bool | bKeepContent = `true`,
|  | bool | bForced = `false`
| ) |  | `[virtual]`

Search for all occurrences

Sets the size of the adjacency array.

unsigned int AdjacencyCount | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the size of the adjacency matrix.

Definition at line 258 of file topology.h.

    { return m_pAdjacency.ItemCount(); };

virtual bool HasTShape | ( |  | ) | const `[virtual]`

Search for all occurrences

Return true if these is edge shared by more than two faces.

virtual void SetHasTShape | ( | bool | bHasTShape | ) | `[virtual]`

Search for all occurrences

virtual void CheckValidity | ( | DiagnosticLevel | iLevel = `dgnLevel2` | ) | const `[virtual]`

Search for all occurrences

See the documentation for Node::CheckValidity.

Reimplemented from TreeNode.

Reimplemented in Mesh, and SubdivisionLevel.

## Friends And Related Function Documentation

friend class ::XMesh `[friend]`

Search for all occurrences

Definition at line 268 of file topology.h.

## Member Data Documentation

Store<unsigned int> m_pTCI `[protected]`

Search for all occurrences

Definition at line 76 of file topology.h.

Store<unsigned int> m_pAdjacency `[protected]`

Search for all occurrences

Definition at line 77 of file topology.h.

Store<unsigned int> m_pNormalIndices `[protected]`

Search for all occurrences

Definition at line 78 of file topology.h.

Store<unsigned int> m_pIndices

Search for all occurrences

Definition at line 80 of file topology.h.

The documentation for this class was generated from the following file:

- Mudbox/topology.h

Topology Topology Topology Topology Topology Topology Topology Topology Topology Topology
Topology Topology Topology Topology Topology Topology Topology Topology Topology Topology