SubdivisionLevel Class Reference

#include <subdivision.h>

Class Description

Represents one level of subdivision details in a geometry.

+ Examples:

Definition at line 40 of file subdivision.h.

+ Inheritance diagram for SubdivisionLevel:

Public Member Functions

virtual class GeometryGeometry (void) const
 Returns the geometry that this mesh belongs to. More...
 
virtual SubdivisionLevelNextLevel (void)
 Returns the next (one detail higher) level. More...
 
virtual SubdivisionLevelPrevLevel (void) const
 Returns the previous (one detail lower) level. More...
 
virtual unsigned int Index (void) const
 Returns the index in the level list of the geometry. More...
 
virtual unsigned int TotalFaceCount (void) const
 Returns the maximum reachable face count on the level. Equals to the total face count of the previous level * 4. More...
 
virtual SubdivisionLevelSubdivide (bool bProcessUV=true, bool bSmoothPositions=true, bool bSmoothUV=false, bool bPreserveHardEdges=true, bool bCreaseHardEdges=true, bool bEnableCreasing=true, bool bPreserveBorders=false)
 Subdivides the level to a higher detail. More...
 
virtual SubdivisionInfo GetSubdivisionInfo (void) const
 Get subdivision infos used when subdivide from previous level. More...
 
virtual void ApplyChanges (bool bToLowerLevel=true)
 Updates the higher/lower level with all the changes on the current level. More...
 
virtual void RecreateUVs (bool bForced=false)
 Creates the UV layout if not exists or recreates if forced. More...
 
virtual bool ConvertSurfacePoint (SurfacePoint &p, bool bUniform=false) const
 Returns ture if succeed in converting a surface point from another subdivision level to this level. More...
 
virtual unsigned int NextLevelQuadCount (void) const
 This function returns the number of quads on the next subdivision level. More...
 
virtual Vector LocalPolygonPointPosition (const SurfacePoint &p) const
 This function returns the position of the given surface point on the polygon. More...
 
virtual void InitEdgeSharpness ()
 Cleans all the edges crease weight. More...
 
virtual bool HasEdgeSharpness () const
 Returns ture if this level has edge sharpness (creasing) information. More...
 
virtual void SetEdgeSharpness (unsigned int iFaceIndex, unsigned int iSideIndex, float fEdgeWeight)
 Sets the crease weight of a specific edge. More...
 
virtual float EdgeSharpness (unsigned int iFaceIndex, unsigned int iSideIndex) const
 Returns the crease weight of a specific edge. More...
 
virtual unsigned int VertexCreaseType (unsigned int iVertexIndex)
 Returns the vertex crease type, it is also the number of crease edges shared this vertex. More...
 
unsigned int QuadVertexCreaseType (unsigned int iFaceIndex, unsigned int iCornerIndex)
 Returns the vertex crease type of the specified face corner of a quad. More...
 
unsigned int TriangleVertexCreaseType (unsigned int iFaceIndex, unsigned int iCornerIndex)
 Returns the vertex crease type of the specified face corner of a triangle. More...
 
virtual void InitEdgeSoftness ()
 Initailize all edges to be soft edges. More...
 
virtual bool HasEdgeSoftness () const
 Returns ture if this level has information about soft/hard edge, smoothing group. More...
 
virtual void SetEdgeSoftness (unsigned int iFaceIndex, unsigned int iSideIndex, unsigned int iSoftness)
 Soften or Harden the specific edge. iSoftness = 0: hard edge; iSoftness = 1: soft edge. More...
 
virtual unsigned int EdgeSoftness (unsigned int iFaceIndex, unsigned int iSideIndex) const
 Returns the softness of the specific edge. More...
 
virtual unsigned int VertexHardness (unsigned int iVertexIndex)
 Returns the number of harded edges shared this vertex. More...
 
unsigned int QuadVertexHardness (unsigned int iFaceIndex, unsigned int iCornerIndex)
 Returns the hardness of the specified face corner of a quad. More...
 
unsigned int TriangleVertexHardness (unsigned int iFaceIndex, unsigned int iCornerIndex)
 Returns the hardness of the specified face corner of a triangle. More...
 
virtual void CheckValidity (DiagnosticLevel iLevel=dgnLevel2) const
 See the documentation for Node::CheckValidity. More...
 
virtual void SetUseCustomIndices (bool b)
 
virtual void CheckMeshGrid (unsigned int iBaseFaceIndex, unsigned int iLevel) const
 
virtual void ConvertToRelative ()
 
virtual void ConvertToAbsolute ()
 
- Public Member Functions inherited from Mesh
virtual class MeshRendererRenderer (float fLODLevel=1.0f)
 Returns a pointer to a MeshRenderer with the desired level-of-detail (see MeshRenderer for more information) More...
 
virtual void CopyTo (Node *pNode) const
 Copy the content of this mesh to another one. More...
 
virtual class MaterialMaterial (void) const
 Returns a pointer to the Material associated with this mesh. More...
 
virtual class MaterialMaterialOverride (void) const
 Material override. More...
 
unsigned int VertexCount (void) const
 Returns the number of vertices in the mesh. More...
 
void SetVertexCount (unsigned int iVertexCount)
 Sets the number of vertices in the mesh. Any existing data (that fits) will be kept. More...
 
unsigned int TCCount (void) const
 Returns the number of texture coordinates in the mesh. More...
 
virtual void SetTCCount (unsigned int iTCCount)
 Sets the number of texture coordinate vertices in the mesh. More...
 
bool HasTC (bool bIgnorePtexUV=false) const
 Returns true if the mesh has texture coordinates. More...
 
virtual unsigned int UVlessPaintingStatus (void) const
 Return the status of UV-less setup. 0 means no uv-less setup, 1 means the mesh is being set up, 2 means the mesh is uv-less setup. More...
 
virtual void SetUVlessPaintingStatus (unsigned int iStatus)
 Setup the status of UV-less setup. More...
 
const VertexVertexArray (void) const
 This method returns a pointer to the actual array data. More...
 
const VertexVertexData (unsigned int iVertexIndex) const
 Returns a vertex. More...
 
VertexVertexData (unsigned int iVertexIndex)
 Returns a vertex. More...
 
const VectorVertexPosition (unsigned int iVertexIndex) const
 Returns the x,y,z position of the vertex with the given index. More...
 
VectorVertexPosition (unsigned int iVertexIndex)
 Returns the x,y,z position of the vertex with the given index. More...
 
virtual const VectorVertexOriginalPosition (unsigned int iVertexIndex) const
 Returns the position of the vertex before the current sculpting-brush stroke. More...
 
const TCVertexTC (unsigned int iVertexTCIndex) const
 Returns the specified texture coordinate. More...
 
Vector VertexNormal (unsigned int iVertexIndex) const
 Returns the normal of the vertex with the given index. More...
 
unsigned int VertexStrokeID (unsigned int iVertexIndex) const
 Internal use only. Do not call this method. More...
 
float VertexMask (unsigned int iVertexIndex) const
 Returns the layer mask of the vertex with the given index for the current sculpt layer. More...
 
float VertexFreeze (unsigned int iVertexIndex) const
 Returns the freeze value of the vertex with the given index. More...
 
virtual unsigned int FrozenVertexCount (void) const
 Returns the number of vertices having a non-zero freeze value. More...
 
const tnormalVertexNormalArray (unsigned int iVertexIndex) const
 Returns the normal of the vertex with the given index as an array of 16-bit signed values. More...
 
tnormalv VertexNormalValue (unsigned int iVertexIndex) const
 Returns the normal of the vertex with the given index as a single 64-bit signed value. More...
 
const NormalVertexNormalArray (void) const
 
unsigned int VertexNormalCount (void) const
 
virtual AxisAlignedBoundingBox BoundingBox (bool bRecalculate=false) const
 Returns the bounding box of the mesh in local space. More...
 
virtual void SetBoundingBox (const AxisAlignedBoundingBox &cBox)
 
virtual AxisAlignedBoundingBox StrokeBoundingBox () const
 Returns region of the mesh that has changed in the current brush stroke in local space. More...
 
virtual void SetStrokeBoundingBox (const AxisAlignedBoundingBox &cBox)
 
virtual AxisAlignedBoundingBox TCBoundingBox (void) const
 Returns the bounding box of the UV shell of the mesh. More...
 
void SetVertexPosition (unsigned int iVertexIndex, const Vector &vPosition)
 Sets the position of the vertex with the given index. More...
 
void AddVertexPosition (unsigned int iVertexIndex, const Vector &vPosition)
 Adds vPosition to the current position of the vertex with the given index. More...
 
void SetVertexNormal (unsigned int iVertexIndex, int *pNormal)
 Internal use only. Do not call. More...
 
void SetVertexNormal (unsigned int iVertexIndex, const Vector &vNormal)
 Sets the normal of the vertex with the given index. More...
 
void SetVertexTC (unsigned int iTCIndex, const TC &tc)
 Sets the Texture Coordinated(UV) value at the given index. More...
 
virtual void SetVertexFreeze (unsigned int iVertexIndex, unsigned int iFaceIndex, float fFreeze)
 Sets the freeze value for the vertex with the given index. More...
 
virtual void SetFreezeValues (Store< float > &aNewFreeze)
 Sets the freeze values for the whole mesh from the given array. More...
 
void SetVertexMask (unsigned int iVertexIndex, unsigned int iFaceIndex, float fFMask)
 Internal use only. Do not call. More...
 
void SetVertexStrokeID (unsigned int iVertexIndex, unsigned int iStrokeID) const
 Internal use only. Do not call. More...
 
unsigned intGetVertexID (unsigned int iIndex)
 Not part of the Mesh API – used internally. More...
 
void MarkVertex (unsigned int iVertexIndex)
 Mark a particular vertex. More...
 
bool IsVertexMarked (unsigned int iVertexIndex)
 Returns true if a particular vertex is marked. More...
 
void ClearVertexMarks (void)
 Clears all vertex marks. More...
 
virtual unsigned int VertexExternalIndex (unsigned int iVertexIndex) const
 Returns the external vertex index for a given vertex. More...
 
virtual void SetVertexExternalIndex (unsigned int iVertexIndex, unsigned int iExternalVertexIndex)
 Sets the external vertex index for a given internal vertex index in the Mudbox mesh. More...
 
const VectorTriangleVertexPosition (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the position of a corner of a mesh face. More...
 
const VectorQuadVertexPosition (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the position of a corner of a mesh face. Can be used for quadric meshes only. More...
 
const TCTriangleVertexTC (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the texture coordinates of a corner of a mesh face. More...
 
const TCQuadVertexTC (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the texture coordinates of a corner of a mesh face. Can be used for quadric meshes only. More...
 
Vector TriangleVertexNormal (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the normal of a corner of a mesh face. Can be used for triangular meshes only. More...
 
Vector QuadVertexNormal (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the normal of a corner of a mesh face. Can be used for quad meshes only. More...
 
Vector TriangleVertexCreaseNormal (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the normal of a corner of a mesh face. Can be used for triangular meshes only. More...
 
Vector QuadVertexCreaseNormal (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the normal of a corner of a mesh face. Can be used for quad meshes only. More...
 
float TriangleVertexFreeze (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the freeze value of a corner of a mesh face. Can be used for triangular meshes only. More...
 
float QuadVertexFreeze (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the freeze value of a corner of a mesh face. More...
 
const tnormalTriangleVertexNormalArray (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the normal of a corner of a triangle mesh face as an array of 16-bit signed values. More...
 
const tnormalQuadVertexNormalArray (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the normal of a corner of a quad mesh face as an array of 16-bit signed values. More...
 
tnormalv TriangleVertexNormalValue (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
 Returns the normal a corner of a triangle mesh face as a single 64-bit signed value. More...
 
tnormalv QuadVertexNormalValue (unsigned int iQuadIndex, unsigned int iCornerIndex) const
 Returns the normal a corner of a quad mesh face as a single 64-bit signed value. More...
 
virtual void EnumerateFaces (unsigned int iFaceIndex, FaceEnumerator *pEnumerator, bool bSymmetry=false)
 This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its neighbors, then the neighbors of those faces, until the mesh has been covered. More...
 
virtual void EnumerateNearestFaces (unsigned int iFaceIndex, FaceEnumerator *pOperation)
 This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its immediate neighbours. More...
 
virtual void EnumerateNeighboringFaces (unsigned int iFaceIndex, FaceEnumerator *pOperation)
 This method takes an operation that you define (derived from FaceEnumerator) and applies it to faces that are neighbors to the given face. More...
 
virtual void EnumerateFaces (FaceEnumerator *pEnumerator, SpatialGrid *pGrid, const AxisAlignedBoundingBox &cVolume)
 Enumerate all of the faces contained within the volume given by cVolume. More...
 
virtual void EnumerateVertices (unsigned int iFaceIndex, VertexEnumerator *pEnumerator)
 This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices of the specified face. More...
 
unsigned int EnumerateAdjacentVertices (AdjacentVertexEnumerator *pEnumerator, unsigned int iVertexIndex, unsigned int iFaceIndex)
 This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices adjacent to the specified one. More...
 
virtual void EnumerateVertices (VertexEnumerator *pEnumerator, SpatialGrid *pGrid, const AxisAlignedBoundingBox &cVolume)
 Enumerate all of the vertices contained within the volume given by cVolume. More...
 
virtual int MeshVersion (void) const
 Obsolete method; do not use. More...
 
virtual void SmoothTextureCoordinates (float fStrength)
 Obsolete method; do not use. More...
 
virtual void RecalculateNormals (bool bKeep=false)
 Recalculates all the vertex normals. This is called after the mesh shape has changed. More...
 
virtual bool RecalculateAdjacency (bool bForce=true, bool bCheckTShapes=true)
 Causes the mesh to build internal adjacency tables, if they don't exist already. Returns false if the operation failed, true otherwise. More...
 
unsigned int CollectionID (void) const
 Obsolete method; do not use. More...
 
void SetCollectionID (unsigned int id)
 
void IncreaseCollectionID (void)
 Obsolete method; do not use. More...
 
virtual bool IsSelected (void)
 Returns true if the whole mesh is selected. More...
 
virtual void SetSelected (bool bOn=true, bool bMerge=false)
 Selects or unselects the whole mesh. It can merge the operation with the current undo stack. More...
 
virtual class LayerMeshDataAddLayer (Layer *pLayer=NULL)
 Add a sculpt layer for this mesh, and makes it current. More...
 
virtual void RemoveLayer (LayerMeshData *pLayer)
 Removes a sculpt layer from the mesh and deletes it. More...
 
virtual class LayerMeshDataActiveLayer (void) const
 Returns a pointer to the current sculpt layer for this mesh. More...
 
virtual bool IsActiveLevel (void) const
 Returns true if this mesh is the currently displayed mesh of the Geometry object it is part of. More...
 
virtual bool Lock (class MeshUnlocker *pUnlocker=NULL )
 Locks the mesh for exclusive modifications. More...
 
virtual bool Unlock (void)
 Unlock the mesh. More...
 
virtual bool IsLocked (void)
 Returns true if the mesh is locked. More...
 
virtual class MeshChangeStartChange (void)
 This method must be called by any plugin before it modifies vertex data. More...
 
virtual void EndChange (bool bUndo=true, bool bMerge=false)
 This method must be called after a plugin has finished modifying data with StartChange() More...
 
virtual bool IsNSided (void) const
 Returns if the mesh contains non tri or quad faces. More...
 
virtual GenericFaceFace (unsigned int iIndex)
 Returns a polygon from generic face representation of the mesh. More...
 
virtual unsigned int GenericFaceCount (void)
 Returns the number of original faces. More...
 
virtual void ClearGenericFaces ()
 
virtual bool HasExpandedTCs (void) const
 Returns if the mesh has edge bleeded TC layout. More...
 
virtual void CreateExpandedTCs (void)
 Calculates the edge bleeded TC layout. More...
 
virtual TCExpandedTC (unsigned int index)
 Returns the Expanded TC value for the given vertex. More...
 
virtual bool SupportsTangentMirror () const
 Returns if the mesh supports tangent mirror mode. More...
 
virtual unsigned int TangentMirroredFaceIndex (unsigned int iFaceIndex) const
 Returns the index of tangent mirrored face. More...
 
virtual unsigned int TangentMirroredVertexIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int &iOppositeFaceIndex, unsigned int &iOppositeCornerIndex) const
 Returns the index of tangent mirrored vertex. More...
 
virtual bool InitializeTopologicalSymmetry (unsigned int iFaceIndex0, unsigned int iFaceIndex1, bool bSelectWhenFailed=true)
 This function initializes the topological symmetry for the mesh. More...
 
virtual bool IsTopologicalSymmetryInitialized (unsigned int &iFaceIndex0, unsigned int &iFaceIndex1) const
 This function returns true if topological symmetry is initialized properly for the mesh. More...
 
virtual void RecalculateTopologicalSymmetry (void)
 This function recalculates topological symmetry information from the lower subdivision levels if has any. More...
 
virtual SurfacePoint MirrorSurfacePoint (const SurfacePoint &cPoint)
 Mirrors a surface point using the topological symmetry. More...
 
virtual int TopologicalSide (unsigned int iFaceIndex)
 Retuns the index of side where the given face index is. More...
 
virtual unsigned int PrimaryCount (bool bNeedToUseTC)
 
virtual unsigned int QuadPrimaryIndex (bool bNeedToUseTC, unsigned int iFaceIndex, unsigned int iCornerIndex)
 Returns the primary index of a corner of a quad. More...
 
virtual unsigned int TrianglePrimaryIndex (bool bNeedToUseTC, unsigned int iFaceIndex, unsigned int iCornerIndex)
 Returns the primary index of a corner of a triangle. More...
 
virtual bool RecalculateVertexAdjacency (bool bForce=true)
 Causes the mesh to build internal vertex adjacency tables, if they don't exist already. Returns false if the operation failed, true otherwise. More...
 
void SetVertexAdjacency (unsigned int iVertexIndex, unsigned int iFaceIndex, unsigned int iCornerIndex)
 Sets the adjacency data for a specified vertex. If this vertex is not touching any faces, the face index and corner index should be set to 0xffffffff. More...
 
struct mudbox::VertexAdjacency VertexAdjacency (unsigned int iVertexIndex) const
 Returns the adjacency data for a specified vertex. If this vertex is not touching any face in the mesh the returned face index will be set to 0xffffffff. More...
 
virtual void Transform (const Matrix &mMatrix)
 
unsigned int GetRestoreCount () const
 
const StoredVertexInfoGetRestoreVertexInfo (unsigned int i) const
 This is not part of the API – do not use. (it is here for performance reasons.) More...
 
unsigned intGetRestoreCountRef ()
 This is not part of the API – do not use. (it is here for performance reasons.) More...
 
Store< StoredVertexInfo > & GetRestoreBufferRef ()
 This is not part of the API – do not use. (it is here for performance reasons.) More...
 
SpatialGridGrid ()
 
- Public Member Functions inherited from Topology
void MoveTo (Topology *pDestination)
 Move the content of this object to another one. This is a fast function. More...
 
void CopyTo (Node *pNode) const
 Copy the content of this object to another one, while keeps the content of the current object. More...
 
void Serialize (Stream &s)
 serializes the content of the object into/from a stream. More...
 
FaceType Type (void) const
 Returns the type of the topology. Can be full triangular or full quadric. More...
 
void SetType (FaceType eType)
 Sets the type of the object. This call also clears all the content of the object. More...
 
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. More...
 
unsigned int FaceCount (void) const
 Returns the number of faces in the topology. More...
 
virtual Vector FaceNormal (unsigned int iFaceIndex) const
 Returns the normal vector for a face in the topology. More...
 
void SetFaceID (unsigned int iFaceIndex, unsigned int iID)
 This function is used only internally. More...
 
unsigned int FaceID (unsigned int iFaceIndex) const
 This function is used only internally. More...
 
virtual void SetFakeTriangleCount (unsigned int iFakeTriangleCount)
 Call this method to indicate how many fake triangles are in the topology. More...
 
unsigned int QuadIndex (unsigned int iFaceIndex, unsigned int iCornerIndex) const
 Returns the vertex position index of a corner of a quad. More...
 
void SetQuadIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
 Sets the vertex position index of a corner of a quad. More...
 
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. More...
 
void SetQuadCreaseNormalIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
 Sets the vertex normal index of a corner of a quad. More...
 
unsigned int QuadTCI (unsigned int iFaceIndex, unsigned int iCornerIndex) const
 Returns the vertex texture coordinate index of a corner of a quad. More...
 
void SetQuadTCI (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
 Sets the vertex texture coordinate index of a corner of a quad. More...
 
virtual unsigned int QuadAdjacency (unsigned int iFaceIndex, unsigned int iSideIndex) const
 Returns the vertex adjacency information index of a side of a quad. More...
 
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. More...
 
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. More...
 
unsigned int TriangleIndex (unsigned int iFaceIndex, unsigned int iCornerIndex) const
 Returns the vertex position index of a corner of a triangle. More...
 
void SetTriangleIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
 Sets the vertex position index of a corner of a triangle. More...
 
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. More...
 
void SetTriangleCreaseNormalIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
 Sets the vertex normal index of a corner of a triangle. More...
 
unsigned int TriangleTCI (unsigned int iFaceIndex, unsigned int iCornerIndex) const
 Returns the vertex texture coordinate index of a corner of a triangle. More...
 
void SetTriangleTCI (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int iValue)
 Sets the vertex texture coordinate index of a corner of a triangle. More...
 
virtual unsigned int TriangleAdjacency (unsigned int iFaceIndex, unsigned int iSideIndex) const
 Returns the vertex adjacency information index of a side of a triangle. More...
 
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. More...
 
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. More...
 
unsigned char & FaceState (unsigned int iFaceIndex)
 Returns the state of a face. See FaceState. More...
 
unsigned char FaceState (unsigned int iFaceIndex) const
 Sets the state of a face. More...
 
bool IsFaceSelected (unsigned int iFaceIndex) const
 Returns true if the given face is selected. More...
 
virtual void SetFaceSelected (unsigned int iFaceIndex, bool bSelected=true, bool bUpdateVertexSelection=false, bool bBatchSelection=false)
 Sets selection state for a face. More...
 
virtual unsigned int SelectedFaceCount () const
 Returns the number of selected faces. More...
 
bool IsFaceVisible (unsigned int iFaceIndex) const
 Returns true if the given face is visible. More...
 
virtual void SetFaceVisible (unsigned int iFaceIndex, bool bVisible=true)
 Sets the visibility of a given face. More...
 
bool IsFaceActive (unsigned int iFaceIndex) const
 
void SetFaceActive (unsigned int iFaceIndex, bool bSelected=true)
 
bool IsFaceMapped (unsigned int iFaceIndex) const
 Used only internally. More...
 
void SetFaceMapped (unsigned int iFaceIndex, bool bSelected=true)
 Used only internally. More...
 
bool IsFaceIsolated (unsigned int iFaceIndex) const
 Returns true if the given face is in the set of Isolated faces. More...
 
virtual void SetFaceIsolated (unsigned int iFaceIndex, bool bIsolated=true)
 Sets the Isolation state of a given face. More...
 
bool IsFakeTriangle (unsigned int iTriangleIndex) const
 This function can only be used for triangular meshes. More...
 
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. More...
 
virtual void RemoveFaceComponent (FaceComponent eComponentToRemove)
 Removes face component(s) from the object. This might delete some data from the memory. More...
 
unsigned int FaceComponents (void) const
 Returns the current face components for the object. More...
 
virtual void SetFaceCount (unsigned int iFaceCount)
 Sets the number of faces in the object. Existing face data will be kept. More...
 
virtual bool SetAdjacencyCount (unsigned int iCount, bool bKeepContent=true, bool bForced=false)
 Sets the size of the adjacency array. More...
 
unsigned int AdjacencyCount (void) const
 Returns the size of the adjacency matrix. More...
 
virtual bool HasTShape () const
 Returns true if these is edge shared by more than two faces. More...
 
virtual const Store< unsigned int > & TShapeFaces (void) const
 Returns the list of faces contained in T-shapes. More...
 
virtual void SetTopologyHint (TopologyHint eHint)
 Sets the usage hint for this Topology. More...
 
virtual enum TopologyHint TopologyHint () const
 
- Public Member Functions inherited from TreeNode
 TreeNode (void)
 
 ~TreeNode (void)
 
virtual void AddChild (TreeNode *pChild, bool bFirst=false) const
 Adds a node/subtree to the list of children. The added node will be removed from the current parent if it has one. More...
 
virtual void RemoveChild (TreeNode *pChild) const
 Removes a node/subtree from the list of children. More...
 
virtual TreeNodeFirstChild (void) const
 Returns the first node from the child list. More...
 
virtual TreeNodeParent (void) const
 Returns the parent node. More...
 
virtual TreeNodeNextSibling (void) const
 Returns the next linked node with the same parent. More...
 
virtual TreeNodePrevSibling (void) const
 Returns the previous linked node with the same parent. More...
 
virtual void MoveChild (TreeNode *pChild, TreeNode *pAfter)
 Moves the child after the given node in order. More...
 
virtual TreeNodeChildByClass (const ClassDesc *pClass, bool bAutoCreate=true) const
 Returns the first child with the specified type. When the bAutoCreate parameter is true and such a child does not exists, it creates it with the preferred descedant type. More...
 
template<typename type >
typeChildByClass (bool bAutoCreate=true) const
 Same as above, a most confortable version. More...
 
virtual TreeNodeChildByClass (const ClassDesc *pClass, unsigned int iIndex=0) const
 Returns the first child with the specified type, or returns zero if no child found. More...
 
template<typename type >
typeChildByClass (unsigned int iIndex=0) const
 Same as above, a most confortable version. More...
 
virtual void DeleteChildByClass (const ClassDesc *pClass)
 Deletes all child which is derived from a specific class. More...
 
virtual QString Info (void) const
 Returns descriptive information about the node. More...
 
virtual bool Visible (void) const
 Returns if the node is visible. Should be overridden in derived classes. More...
 
virtual void SetVisible (bool b)
 Sets the node visibility Should be overridden in derived classes. More...
 
virtual bool Locked (void) const
 Returns if the node is locked. Should be overridden in derived classes. More...
 
virtual void SetLocked (bool b)
 Sets the locking of the node. Should be overridden in derived classes. More...
 
virtual bool HiddenFromUI (void) const
 Returns true if the node cannot be seen from UI. More...
 
virtual void SetHiddenFromUI (bool b)
 Sets visibility in UI. More...
 
virtual void OnLinked (const TreeNode *pOldParent)
 This function is called then the node is linked to a new parent. More...
 
QString UniqueChildName (const TreeNode *pChild, const QString &sPrefix="") const
 Finds a node name that is unique among the children of this node. More...
 
virtual void SetStringID (const QString &sName)
 This method does the same thing as Node::SetStringID, except it ensures the name is unique among this node's siblings. More...
 
- Public Member Functions inherited from Node
 Node (const QString &sStringID="", const QString &sDisplayName="")
 Standard constructor. More...
 
virtual ~Node (void)
 
virtual void Initialize (void)
 
void LoadTemplate (const QString &sFileName="", bool bStartEvent=false)
 Use an external XML file to initialize the attributes. More...
 
void SaveTemplate (const QString &sFileName="", bool bSaveOnlyVisible=false)
 Save current attributes as an XML template. More...
 
unsigned int Version (void) const
 Returns the current version of the node. This number increases when the content of the node changed (when ContentChanged() called). More...
 
void SetVersion (unsigned int iVersion)
 Sets the current version number for the node. More...
 
unsigned int ReferenceCount (void) const
 Returns the number of pointers referencing this node. More...
 
AttributeReferencePointer (unsigned int iIndex) const
 Returns the address of an attribute which refers to this node. The type of the attribute is always aptr. More...
 
NodeReferenceNode (unsigned int iIndex) const
 Returns the address of a node referencing this node. More...
 
virtual QString Name (const ClassDesc *pClass=0) const
 Deprecated. More...
 
virtual void SetName (const QString &sName)
 Deprecated. More...
 
virtual QString StringID (const ClassDesc *pClass=0) const
 Returns the string id of the node. More...
 
virtual QString DisplayName (void) const
 Returns the display name of the node. More...
 
virtual void SetDisplayName (const QString &sDisplayName)
 Sets the display name of the node. More...
 
virtual QString HelpID (void) const
 Returns the help entry id of the node. Can be overwritten in derived classes. More...
 
virtual void SetHelpID (const QString &sHelpID)
 Sets the help entry id of the node. More...
 
void Annex (Node *pSource, const QString &sCategory="")
 Relink all the attributes of the source node to this one. More...
 
bool IsKindOf (const ClassDesc *pClass) const
 Returns true if this node is derived from the pClass class. More...
 
void ContentChanged (void) const
 This function must be called if the content of the node is changed. More...
 
virtual NodeDuplicate (void) const
 
virtual void OnNodeEvent (const Attribute &cAttribute, NodeEventType cType)
 This function is called if an event occurs with any of the attributes of the node. More...
 
virtual void OnEvent (const EventGate &cEvent)
 This function is called when a generic event occurs. See EventGate class. More...
 
void RequestDeferredEvent (Attribute &cAttribute)
 Request for a deferred event, which will occur only in the main loop. More...
 
unsigned int AttributeCount (void) const
 Returns the number of attributes owned by the node. More...
 
AttributeAttributeByIndex (int iIndex) const
 Returns a specified attribute (or 0 if iIndex is greater than the number of attributes). More...
 
AttributeAttributeByName (const QString &sName) const
 Returns a specified attribute by its name. Returns 0 if the attribute not found. More...
 
AttributeAttributeByID (const QString &sID) const
 Returns a specified attribute by its ID. Returns 0 if the attribute not found. More...
 
void SetAttributeValue (const QString &sAttributeID, const QString &sNewValue)
 Set the value of an attribute from a string. More...
 
QString AttributeValue (const QString &sAttributeID) const
 Returns the current value of an attribute as a string. More...
 
void LogAttributes (void) const
 Write all attributes into the log file. More...
 
virtual QWidgetCreatePropertiesWindow (QWidget *pParent)
 Create a window which displays the attributes of the node. Can be overriden to provide a custom interface. More...
 
AttributeAddAttribute (Attribute::AttributeType type, const QString &id)
 Allows SDK users to add attributes at runtime. More...
 
NodeNext (void) const
 Returns the next node in the chain. Used to enumerate the current nodes. See also First(). More...
 
int ID (void) const
 Returns an ID for the node. The ID is unique in the whole application life. More...
 
bool SetID (int iID)
 Set ID for the node. More...
 

Static Public Member Functions

static void ConvertFaceIndices (const SubdivisionLevel *pFrom, const Store< unsigned int > &aFromFaces, const SubdivisionLevel *pTo, Store< unsigned int > &aToFaces)
 Converts a set of faces from one subdivision level to another subdivision level. More...
 
static void SetUVCreation (bool bCreateUV)
 
static const Store< unsigned int > & QuadIndexTable (unsigned int iLevel)
 
static const Store< unsigned int > & QuadVertexIndexTable (unsigned int iLevel)
 
static const Store< unsigned int > & InvertedQuadIndexTable (unsigned int iLevel)
 
- Static Public Member Functions inherited from Node
static void StartHashing ()
 This is called once in main once static ctors are done. More...
 
static NodeFirst (void)
 This function will return the first node in the memory. Used to enumerate all the current nodes. See also Next(). More...
 
static NodeByID (int iID)
 Returns the node with the specified ID, or zero if such a node does not exists. More...
 
static NodeByName (const QString &sClass, const QString &sName)
 Search for a node with the name sName. More...
 

Protected Member Functions

 SubdivisionLevel (FaceType eFaceType=typeQuadric)
 Do not use constructors directly. Use CreateInstances() instead. More...
 
- Protected Member Functions inherited from Mesh
 Mesh (FaceType eFaceType=typeQuadric)
 Constructor. More...
 
- Protected Member Functions inherited from Topology
 Topology (void)
 Do not use constructors directly. Use CreateInstances() instead. More...
 
 Topology (FaceType eType)
 Constructs the object with zero faces. More...
 

Additional Inherited Members

- Public Types inherited from Topology
enum  FaceState {
  fsSelected = 0x01, fsVisible = 0x02, fsFake = 0x04, fsActive = 0x08,
  fsMapped = 0x10, fsIsolated = 0x20
}
 
enum  FaceComponent {
  fcIndex = 1, fcAdjacency = 2, fcTCIndex = 4, fcNormal = 8,
  fcID = 16, fcOctree = 32, fcFreeze = 64, fcState = 128
}
 
enum  FaceType { typeTriangular, typeQuadric }
 
enum  TopologyHint { eStaticTopology, eDynamicTopology }
 
- Public Types inherited from Node
enum  DiagnosticLevel { dgnLevel1, dgnLevel2, dgnLevel3 }
 Indicates the level of validity checking that is performed in CheckValidity() More...
 
- Public Attributes inherited from Mesh
aptr< LayerMeshDataActiveSculptLayer
 This is a readonly pointer containing the address of the active sculpt layer or null if there is no active layer. More...
 
Store< TCm_pTCs
 
aevent Modified
 This event is triggered when the mesh has been editer. During a sculpt stroke this event is only triggered once at the end. More...
 
aevent TopologyChange
 This event is triggered when the mesh's topology has been editer. More...
 
- Public Attributes inherited from Topology
Store< unsigned intm_pIndices
 
- Public Attributes inherited from TreeNode
 DECLARE_CLASS
 
- Public Attributes inherited from Node
AttributeThisPointer m_pThis
 
 DECLARE_CLASS
 
- Protected Attributes inherited from Mesh
unsigned int m_iVertexCount
 
unsigned int m_iCollectionID
 
Store< Vertexm_pVertices
 
Store< Normalm_pVertexNormals
 
Store< mudbox::VertexAdjacencym_aVertexAdjacency
 
bool m_bHasVertexAdjacency
 
bool m_bBuildVertexAdjacency
 
unsigned int m_iRestoreCount
 
Store< StoredVertexInfom_aRestoreBuffer
 
SpatialGridm_pGrid
 
- Protected Attributes inherited from Topology
Store< unsigned intm_pTCI
 
Store< unsigned intm_pAdjacency
 
Store< unsigned intm_pNormalIndices
 
TopologyHint m_eTopologyHint
 

Constructor & Destructor Documentation

SubdivisionLevel ( FaceType  eFaceType = typeQuadric)
protected

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

Member Function Documentation

virtual class Geometry* Geometry ( void  ) const
virtual

Returns the geometry that this mesh belongs to.

Reimplemented from Mesh.

virtual SubdivisionLevel* NextLevel ( void  )
virtual

Returns the next (one detail higher) level.

virtual SubdivisionLevel* PrevLevel ( void  ) const
virtual

Returns the previous (one detail lower) level.

virtual unsigned int Index ( void  ) const
virtual

Returns the index in the level list of the geometry.

virtual unsigned int TotalFaceCount ( void  ) const
virtual

Returns the maximum reachable face count on the level. Equals to the total face count of the previous level * 4.

virtual SubdivisionLevel* Subdivide ( bool  bProcessUV = true,
bool  bSmoothPositions = true,
bool  bSmoothUV = false,
bool  bPreserveHardEdges = true,
bool  bCreaseHardEdges = true,
bool  bEnableCreasing = true,
bool  bPreserveBorders = false 
)
virtual

Subdivides the level to a higher detail.

+ Examples:
virtual SubdivisionInfo GetSubdivisionInfo ( void  ) const
virtual

Get subdivision infos used when subdivide from previous level.

virtual void ApplyChanges ( bool  bToLowerLevel = true)
virtual

Updates the higher/lower level with all the changes on the current level.

virtual void RecreateUVs ( bool  bForced = false)
virtual

Creates the UV layout if not exists or recreates if forced.

The calculation is based on the uv layout of the previous level; if it does not exist it will be created recursively down to level0. If level 0 has no UV the funcion does nothing.

virtual bool ConvertSurfacePoint ( SurfacePoint p,
bool  bUniform = false 
) const
virtual

Returns ture if succeed in converting a surface point from another subdivision level to this level.

If true is returned, the surface point p is at the same level as this subdivision level.

virtual unsigned int NextLevelQuadCount ( void  ) const
virtual

This function returns the number of quads on the next subdivision level.

This function can be called even if there is no next level created yet. For full quad meshes, this number is 4 times the number of quads on the current level. This function is thread safe.

virtual Vector LocalPolygonPointPosition ( const SurfacePoint p) const
virtual

This function returns the position of the given surface point on the polygon.

virtual void InitEdgeSharpness ( )
virtual

Cleans all the edges crease weight.

virtual bool HasEdgeSharpness ( ) const
virtual

Returns ture if this level has edge sharpness (creasing) information.

virtual void SetEdgeSharpness ( unsigned int  iFaceIndex,
unsigned int  iSideIndex,
float  fEdgeWeight 
)
virtual

Sets the crease weight of a specific edge.

virtual float EdgeSharpness ( unsigned int  iFaceIndex,
unsigned int  iSideIndex 
) const
virtual

Returns the crease weight of a specific edge.

virtual unsigned int VertexCreaseType ( unsigned int  iVertexIndex)
virtual

Returns the vertex crease type, it is also the number of crease edges shared this vertex.

0: smooth vertex; 1: dart vertex; 2: crease vertex; >= 3: corner vertex.

unsigned int QuadVertexCreaseType ( unsigned int  iFaceIndex,
unsigned int  iCornerIndex 
)
inline

Returns the vertex crease type of the specified face corner of a quad.

Definition at line 91 of file subdivision.h.

91 { return VertexCreaseType(QuadIndex(iFaceIndex, iCornerIndex)); }
unsigned int QuadIndex(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex position index of a corner of a quad.
Definition: topology.h:144
virtual unsigned int VertexCreaseType(unsigned int iVertexIndex)
Returns the vertex crease type, it is also the number of crease edges shared this vertex...
unsigned int TriangleVertexCreaseType ( unsigned int  iFaceIndex,
unsigned int  iCornerIndex 
)
inline

Returns the vertex crease type of the specified face corner of a triangle.

Definition at line 93 of file subdivision.h.

93 { return VertexCreaseType(TriangleIndex(iFaceIndex, iCornerIndex)); }
virtual unsigned int VertexCreaseType(unsigned int iVertexIndex)
Returns the vertex crease type, it is also the number of crease edges shared this vertex...
unsigned int TriangleIndex(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex position index of a corner of a triangle.
Definition: topology.h:173
virtual void InitEdgeSoftness ( )
virtual

Initailize all edges to be soft edges.

virtual bool HasEdgeSoftness ( ) const
virtual

Returns ture if this level has information about soft/hard edge, smoothing group.

virtual void SetEdgeSoftness ( unsigned int  iFaceIndex,
unsigned int  iSideIndex,
unsigned int  iSoftness 
)
virtual

Soften or Harden the specific edge. iSoftness = 0: hard edge; iSoftness = 1: soft edge.

virtual unsigned int EdgeSoftness ( unsigned int  iFaceIndex,
unsigned int  iSideIndex 
) const
virtual

Returns the softness of the specific edge.

virtual unsigned int VertexHardness ( unsigned int  iVertexIndex)
virtual

Returns the number of harded edges shared this vertex.

unsigned int QuadVertexHardness ( unsigned int  iFaceIndex,
unsigned int  iCornerIndex 
)
inline

Returns the hardness of the specified face corner of a quad.

Definition at line 106 of file subdivision.h.

106 { return VertexHardness(QuadIndex(iFaceIndex, iCornerIndex)); }
virtual unsigned int VertexHardness(unsigned int iVertexIndex)
Returns the number of harded edges shared this vertex.
unsigned int QuadIndex(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex position index of a corner of a quad.
Definition: topology.h:144
unsigned int TriangleVertexHardness ( unsigned int  iFaceIndex,
unsigned int  iCornerIndex 
)
inline

Returns the hardness of the specified face corner of a triangle.

Definition at line 108 of file subdivision.h.

108 { return VertexHardness(TriangleIndex(iFaceIndex, iCornerIndex)); }
virtual unsigned int VertexHardness(unsigned int iVertexIndex)
Returns the number of harded edges shared this vertex.
unsigned int TriangleIndex(unsigned int iFaceIndex, unsigned int iCornerIndex) const
Returns the vertex position index of a corner of a triangle.
Definition: topology.h:173
virtual void CheckValidity ( DiagnosticLevel  iLevel = dgnLevel2) const
virtual

See the documentation for Node::CheckValidity.

Reimplemented from Mesh.

virtual void SetUseCustomIndices ( bool  b)
virtual
static void ConvertFaceIndices ( const SubdivisionLevel pFrom,
const Store< unsigned int > &  aFromFaces,
const SubdivisionLevel pTo,
Store< unsigned int > &  aToFaces 
)
static

Converts a set of faces from one subdivision level to another subdivision level.

This is useful when you have a set of faces on level n and need to find the corresponding faces on level m for any values of n and m.

Parameters
[in]pFromThe source subdivision level to convert the face set from
[in]aFromFacesThe set of faces to convert
[in]pToThe target subdivision level to convert the face set to
[in]aToFacesThe converted faces will be stored in this array
static void SetUVCreation ( bool  bCreateUV)
static
static const Store<unsigned int>& QuadIndexTable ( unsigned int  iLevel)
static
static const Store<unsigned int>& QuadVertexIndexTable ( unsigned int  iLevel)
static
static const Store<unsigned int>& InvertedQuadIndexTable ( unsigned int  iLevel)
static
virtual void CheckMeshGrid ( unsigned int  iBaseFaceIndex,
unsigned int  iLevel 
) const
virtual
virtual void ConvertToRelative ( )
virtual
virtual void ConvertToAbsolute ( )
virtual

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