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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions

# SubdivisionLevel Class Reference

This reference page is linked to from the following overview topics: Mudbox 2013, Scene Graph, Mesh and Topology, Subdivision.

Search for all occurrences

## Detailed Description

Represents one level of subdivision details in a geometry.

Examples:

  MeshBuilder/MeshBuilder.cpp, and PtexExtractor/PtexLayout.h.

Definition at line 18 of file subdivision.h.

`#include <subdivision.h>`

Inheritance diagram for SubdivisionLevel:
[legend]

List of all members.

## Public Member Functions
virtual class Geometry * | Geometry (void) const
| Returns the geometry that this mesh belongs to.
virtual SubdivisionLevel * | NextLevel (void)
| Returns the next (one detail higher) level.
virtual SubdivisionLevel * | PrevLevel (void) const
| Returns the previous (one detail lower) level.
virtual unsigned int | Index (void) const
| Returns the index in the level list of the geometry.
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.
virtual SubdivisionLevel * | Subdivide (bool bProcessUV=true, bool bSmoothPositions=true, bool bSmoothUV=false, bool bPreserveHardEdges=true, bool bCreaseHardEdges=true, bool bEnableCreasing=true)
| Subdivides the level to a higher detail.
virtual void | ApplyChanges (bool bToLowerLevel=true)
| Updates the higher/lower level with all the changes on the current level.
virtual void | RecreateUVs (bool bForced=false)
| Creates the UV layout if not exists or recreates if forced.
virtual bool | ConvertSurfacePoint (SurfacePoint &p) const
| Returns ture if succeed in converting a surface point from another subdivision level to this level.
virtual unsigned int | NextLevelQuadCount (void) const
| This function returns the number of quads on the next subdivision level.
virtual void | InitEdgeSharpness ()
| Cleans all the edges crease weight.
virtual bool | HasEdgeSharpness () const
| Returns ture if this level has edge sharpness (creasing) information.
virtual void | SetEdgeSharpness (unsigned int iFaceIndex, unsigned int iSideIndex, float fEdgeWeight)
| Sets the crease weight of a specific edge.
virtual float | EdgeSharpness (unsigned int iFaceIndex, unsigned int iSideIndex) const
| Returns the crease weight of a specific edge.
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 | QuadVertexCreaseType (unsigned int iFaceIndex, unsigned int iCornerIndex)
| Returns the vertex crease type of the specified face corner of a quad.
unsigned int | TriangleVertexCreaseType (unsigned int iFaceIndex, unsigned int iCornerIndex)
| Returns the vertex crease type of the specified face corner of a triangle.
virtual void | InitEdgeSoftness ()
| Initailize all edges to be soft edges.
virtual bool | HasEdgeSoftness () const
| 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)
| 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
| Returns the softness of the specific edge.
virtual unsigned int | VertexHardness (unsigned int iVertexIndex)
| Returns the number of harded edges shared this vertex.
unsigned int | QuadVertexHardness (unsigned int iFaceIndex, unsigned int iCornerIndex)
| Returns the hardness of the specified face corner of a quad.
unsigned int | TriangleVertexHardness (unsigned int iFaceIndex, unsigned int iCornerIndex)
| Returns the hardness of the specified face corner of a triangle.
virtual void | CheckValidity (DiagnosticLevel iLevel=dgnLevel2) const
| See the documentation for Node::CheckValidity.
virtual void | CheckMeshGrid (unsigned int iBaseFaceIndex, unsigned int iLevel) const
virtual void | ConvertToRelative ()
virtual void | ConvertToAbsolute ()
## 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.
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)
## Protected Member Functions
| SubdivisionLevel (FaceType eFaceType=typeQuadric)
| Do not use constructors directly. Use CreateInstances() instead.

## 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]`

Search for all occurrences

Returns the geometry that this mesh belongs to.

Reimplemented from Mesh.

virtual SubdivisionLevel* NextLevel | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns the next (one detail higher) level.

virtual SubdivisionLevel* PrevLevel | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the previous (one detail lower) level.

virtual unsigned int Index | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the index in the level list of the geometry.

virtual unsigned int TotalFaceCount | ( | void |  | ) | const `[virtual]`

Search for all occurrences

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`
| ) |  | `[virtual]`

Search for all occurrences

Subdivides the level to a higher detail.

Examples:
  MeshBuilder/MeshBuilder.cpp.

virtual void ApplyChanges | ( | bool | bToLowerLevel = `true` | ) | `[virtual]`

Search for all occurrences

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

virtual void RecreateUVs | ( | bool | bForced = `false` | ) | `[virtual]`

Search for all occurrences

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 | ) | const `[virtual]`

Search for all occurrences

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]`

Search for all occurrences

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 void InitEdgeSharpness | ( |  | ) | `[virtual]`

Search for all occurrences

Cleans all the edges crease weight.

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

Search for all occurrences

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

virtual void SetEdgeSharpness | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex,
|  | float | fEdgeWeight
| ) |  | `[virtual]`

Search for all occurrences

Sets the crease weight of a specific edge.

virtual float EdgeSharpness | ( | unsigned int | iFaceIndex,
|  | unsigned int | iSideIndex
| ) |  | const `[virtual]`

Search for all occurrences

Returns the crease weight of a specific edge.

virtual unsigned int VertexCreaseType | ( | unsigned int | iVertexIndex | ) | `[virtual]`

Search for all occurrences

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]`

Search for all occurrences

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

Definition at line 65 of file subdivision.h.

    { return VertexCreaseType(QuadIndex(iFaceIndex, iCornerIndex)); }

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

Search for all occurrences

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

Definition at line 67 of file subdivision.h.

    { return VertexCreaseType(TriangleIndex(iFaceIndex, iCornerIndex)); }

virtual void InitEdgeSoftness | ( |  | ) | `[virtual]`

Search for all occurrences

Initailize all edges to be soft edges.

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

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

Returns the softness of the specific edge.

virtual unsigned int VertexHardness | ( | unsigned int | iVertexIndex | ) | `[virtual]`

Search for all occurrences

Returns the number of harded edges shared this vertex.

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

Search for all occurrences

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

Definition at line 80 of file subdivision.h.

    { return VertexHardness(QuadIndex(iFaceIndex, iCornerIndex)); }

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

Search for all occurrences

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

Definition at line 82 of file subdivision.h.

    { return VertexHardness(TriangleIndex(iFaceIndex, iCornerIndex)); }

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

Search for all occurrences

See the documentation for Node::CheckValidity.

Reimplemented from Mesh.

static void ConvertFaceIndices | ( | const SubdivisionLevel * | pFrom,
|  | const Store< unsigned int > & | aFromFaces,
|  | const SubdivisionLevel * | pTo,
|  | Store< unsigned int > & | aToFaces
| ) |  | `[static]`

Search for all occurrences

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] | pFrom | The source subdivision level to convert the face set from
  [in] | aFromFaces | The set of faces to convert
  [in] | pTo | The target subdivision level to convert the face set to
  [in] | aToFaces | The converted faces will be stored in this array

static void SetUVCreation | ( | bool | bCreateUV | ) | `[static]`

Search for all occurrences

static const Store<unsigned int>& QuadIndexTable | ( | unsigned int | iLevel | ) | `[static]`

Search for all occurrences

static const Store<unsigned int>& QuadVertexIndexTable | ( | unsigned int | iLevel | ) | `[static]`

Search for all occurrences

static const Store<unsigned int>& InvertedQuadIndexTable | ( | unsigned int | iLevel | ) | `[static]`

Search for all occurrences

virtual void CheckMeshGrid | ( | unsigned int | iBaseFaceIndex,
|  | unsigned int | iLevel
| ) |  | const `[virtual]`

Search for all occurrences

virtual void ConvertToRelative | ( |  | ) | `[virtual]`

Search for all occurrences

virtual void ConvertToAbsolute | ( |  | ) | `[virtual]`

Search for all occurrences

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

- Mudbox/subdivision.h

SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel
SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel SubdivisionLevel