94 int m_eFaceComponents;
95 unsigned int m_iFaceCount;
109 void MoveTo(
Topology *pDestination );
118 void CopyTo(
Node *pNode )
const;
124 void SetType( FaceType eType );
126 int SideCount(
void )
const {
return Type() == typeTriangular ? 3 : 4; };
130 inline unsigned int FaceCount(
void )
const {
return m_iFaceCount; };
132 virtual Vector FaceNormal(
unsigned int iFaceIndex )
const;
134 inline void SetFaceID(
unsigned int iFaceIndex,
unsigned int iID ) { m_pFaceIDs[iFaceIndex] = iID; };
136 inline unsigned int FaceID(
unsigned int iFaceIndex )
const {
return m_pFaceIDs[iFaceIndex]; };
140 virtual void SetFakeTriangleCount(
unsigned int iFakeTriangleCount );
144 inline unsigned int QuadIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex )
const {
return m_pIndices[iFaceIndex*4+iCornerIndex]; };
147 inline void SetQuadIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex,
unsigned int iValue ) { m_pIndices[iFaceIndex*4+iCornerIndex] = iValue; };
152 inline unsigned int QuadCreaseNormalIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex )
const {
return m_pNormalIndices[iFaceIndex*4+iCornerIndex]; }
154 inline void SetQuadCreaseNormalIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex,
unsigned int iValue ) { m_pNormalIndices[iFaceIndex*4+iCornerIndex] = iValue; }
156 inline unsigned int QuadTCI(
unsigned int iFaceIndex,
unsigned int iCornerIndex )
const {
return m_pTCI[iFaceIndex*4+iCornerIndex]; }
158 inline void SetQuadTCI(
unsigned int iFaceIndex,
unsigned int iCornerIndex,
unsigned int iValue ) { m_pTCI[iFaceIndex*4+iCornerIndex] = iValue; }
162 virtual inline unsigned int QuadAdjacency(
unsigned int iFaceIndex,
unsigned int iSideIndex )
const {
return m_pAdjacency[iFaceIndex*4+iSideIndex]; }
163 inline unsigned int QuadAdjacency_ForcedInline(
unsigned int iFaceIndex,
unsigned int iSideIndex )
const {
return m_pAdjacency[iFaceIndex*4+iSideIndex]; }
165 virtual inline void SetQuadAdjacency(
unsigned int iFaceIndex,
unsigned int iSideIndex,
unsigned int iValue )
166 { m_pAdjacency[iFaceIndex*4+iSideIndex] = iValue; }
168 inline bool HasAdjacentQuad(
unsigned int iFaceIndex,
unsigned int iSideIndex )
const {
return QuadAdjacency( iFaceIndex, iSideIndex ) < 0x80000000; };
173 inline unsigned int TriangleIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex )
const {
return m_pIndices[iFaceIndex*3+iCornerIndex]; };
175 inline void SetTriangleIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex,
unsigned int iValue ) { m_pIndices[iFaceIndex*3+iCornerIndex] = iValue; };
180 inline unsigned int TriangleCreaseNormalIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex )
const {
return m_pNormalIndices[iFaceIndex*3+iCornerIndex]; }
182 inline void SetTriangleCreaseNormalIndex(
unsigned int iFaceIndex,
unsigned int iCornerIndex,
unsigned int iValue ) { m_pNormalIndices[iFaceIndex*3+iCornerIndex] = iValue; }
184 inline unsigned int TriangleTCI(
unsigned int iFaceIndex,
unsigned int iCornerIndex )
const {
return m_pTCI[iFaceIndex*3+iCornerIndex]; }
187 inline void SetTriangleTCI(
unsigned int iFaceIndex,
unsigned int iCornerIndex,
unsigned int iValue ) { m_pTCI[iFaceIndex*3+iCornerIndex] = iValue; }
191 virtual inline unsigned int TriangleAdjacency(
unsigned int iFaceIndex,
unsigned int iSideIndex )
const {
return m_pAdjacency[iFaceIndex*3+iSideIndex]; }
193 virtual inline void SetTriangleAdjacency(
unsigned int iFaceIndex,
unsigned int iSideIndex,
unsigned int iValue )
194 { m_pAdjacency[iFaceIndex*3+iSideIndex] = iValue; }
197 {
return TriangleAdjacency( iFaceIndex, iSideIndex ) < 0x80000000; };
200 inline unsigned char &
FaceState(
unsigned int iFaceIndex ) {
return m_pFaceState[iFaceIndex]; };
202 inline unsigned char FaceState(
unsigned int iFaceIndex )
const {
return m_pFaceState[iFaceIndex]; };
210 virtual void SetFaceSelected(
unsigned int iFaceIndex,
bool bSelected =
true,
bool bUpdateVertexSelection =
false,
bool bBatchSelection =
false );
213 virtual unsigned int SelectedFaceCount()
const;
218 inline virtual void SetFaceVisible(
unsigned int iFaceIndex,
bool bVisible =
true )
219 {
if ( bVisible )
FaceState( iFaceIndex ) |= fsVisible;
else FaceState( iFaceIndex ) &= 0xff-fsVisible; };
222 {
if ( bSelected )
FaceState( iFaceIndex ) |= fsActive;
else FaceState( iFaceIndex ) &= 0xff-fsActive; };
227 {
if ( bSelected )
FaceState( iFaceIndex ) |= fsMapped;
else FaceState( iFaceIndex ) &= 0xff-fsMapped; };
232 {
if ( bIsolated )
FaceState( iFaceIndex ) |= fsIsolated;
else FaceState( iFaceIndex ) &= 0xff-fsIsolated; };
240 {
return iTriangleIndex < FaceCount() && (
FaceState( iTriangleIndex ) & fsFake); };
242 {
if( iTriangleIndex < FaceCount() ) {
243 if ( b )
FaceState( iTriangleIndex ) |= fsFake;
244 else FaceState( iTriangleIndex ) &= 0xff-fsFake;
248 inline bool IsFaceTemp(
unsigned int iFaceIndex )
const {
return m_pFaceTemp[iFaceIndex]; };
249 inline void SetFaceTemp(
unsigned int iFaceIndex,
bool bSelected =
true )
250 { m_pFaceTemp[iFaceIndex] = bSelected; }
256 if( m_iFaceCount <= m_pFaceTemp.
ItemCount() &&
258 memset(&m_pFaceTemp[0], 0, m_iFaceCount);
263 virtual void AddFaceComponent( FaceComponent eComponentToAdd );
266 virtual void RemoveFaceComponent( FaceComponent eComponentToRemove );
270 virtual void SetFaceCount(
unsigned int iFaceCount );
272 virtual bool SetAdjacencyCount(
unsigned int iCount,
bool bKeepContent =
true,
bool bForced =
false );
277 virtual bool HasTShape()
const;
283 virtual void SetTopologyHint( TopologyHint eHint );
285 virtual enum TopologyHint TopologyHint()
const;
287 virtual void CheckValidity( DiagnosticLevel iLevel = dgnLevel2 )
const;
291 friend class ::XMesh;
void SetQuadTCI(unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
Sets the vertex texture coordinate index of a corner of a quad.
unsigned char FaceState(unsigned int iFaceIndex) const
Sets the state of a face.
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...
Represents a 3D vector or point with S23E8 floating point elements.
Store< unsigned int > m_pIndices
#define MB_ASSERT(condition)
bool IsFaceActive(unsigned int iFaceIndex) const
unsigned int FaceCount(void) const
Returns the number of faces in the topology.
FaceType Type(void) const
Returns the type of the topology. Can be full triangular or full quadric.
void SetQuadCreaseNormalIndex(unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
Sets the vertex normal index of a corner of a quad.
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.
unsigned int AdjacencyCount(void) const
Returns the size of the adjacency matrix.
virtual void SetFaceIsolated(unsigned int iFaceIndex, bool bIsolated=true)
Sets the Isolation state of a given face.
virtual unsigned int QuadAdjacency(unsigned int iFaceIndex, unsigned int iSideIndex) const
Returns the vertex adjacency information index of a side of a quad.
int SideCount(void) const
Returns the number of sides in the faces. This is three if the topology is triangle based...
Normal vector with 16 bit components.
This is the base class for most classes in the Mudbox SDK.
unsigned long long tnormalv
Type of the whole normal vector.
unsigned int QuadIndex(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex position index of a corner of a quad.
bool IsFaceVisible(unsigned int iFaceIndex) const
Returns true if the given face is visible.
short int tnormal
Type of one component in a normal vector.
void SetFakeTriangle(unsigned int iTriangleIndex, bool b)
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.
void SetTriangleIndex(unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
Sets the vertex position 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.
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 o...
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 th...
Store< unsigned int > m_pTCI
void SetTriangleCreaseNormalIndex(unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
Sets the vertex normal index of a corner of a triangle.
bool IsFakeTriangle(unsigned int iTriangleIndex) const
This function can only be used for triangular meshes.
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.
virtual void SetFaceVisible(unsigned int iFaceIndex, bool bVisible=true)
Sets the visibility of a given face.
void SetQuadIndex(unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
Sets the vertex position index of a corner of a quad.
unsigned int ItemCount(void) const
Returns the number of items in the array.
bool IsFaceMapped(unsigned int iFaceIndex) const
Used only internally.
bool IsFaceTemp(unsigned int iFaceIndex) const
TopologyHint m_eTopologyHint
Store< unsigned int > m_pAdjacency
Class: ConvolutionKernel.
This class is the base of all node types that can be structured in a hierarchy.
unsigned char & FaceState(unsigned int iFaceIndex)
Returns the state of a face. See FaceState.
void SetFaceMapped(unsigned int iFaceIndex, bool bSelected=true)
Used only internally.
unsigned int TriangleIndex(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex position 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.
unsigned int FaceID(unsigned int iFaceIndex) const
This function is used only internally.
void SetFaceTemp(unsigned int iFaceIndex, bool bSelected=true)
unsigned int FaceComponents(void) const
Returns the current face components for the object.
unsigned int TriangleTCI(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex texture coordinate index of a corner of a triangle.
Streams are used to read information from a file, or to write it to a file.
void SetFaceActive(unsigned int iFaceIndex, bool bSelected=true)
void SetFaceID(unsigned int iFaceIndex, unsigned int iID)
This function is used only internally.
bool IsFaceSelected(unsigned int iFaceIndex) const
Returns true if the given face is selected.
Store< unsigned int > m_pNormalIndices
Represents the topology data of a mesh, providing information about the structure of a surface...
unsigned int QuadTCI(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex texture coordinate index of a corner of a quad.
bool IsFaceIsolated(unsigned int iFaceIndex) const
Returns true if the given face is in the set of Isolated faces.
void ClearFaceTempStates()
unsigned int QuadAdjacency_ForcedInline(unsigned int iFaceIndex, unsigned int iSideIndex) const