- 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

# Geometry Class Reference

This reference page is linked to from the following overview topics: Mudbox Scenes, Scene Graph, Transformations and Coordinate Space Conversions, Subdivision.

Search for all occurrences

## Detailed Description

Represents a 3d object in the scene.

Examples:

  MeshBuilder/MeshBuilder.cpp.

Definition at line 18 of file geometry.h.

`#include <geometry.h>`

Inheritance diagram for Geometry:
[legend]

List of all members.

## Public Types
enum | MatchMode { matchByVertexID, matchByUV, matchByVertexPosition }
## Public Member Functions
virtual unsigned int | LevelCount (void) const
| Returns the number of the subdivision levels in the object.
virtual SubdivisionLevel * | LowestLevel (void) const
| Returns a pointer to the lowest subdivision level (the one with the fewest faces).
virtual SubdivisionLevel * | HighestLevel (void) const
| Returns a pointer to the highest subdivision level (the one with the most faces).
virtual SubdivisionLevel * | Level (unsigned int iIndex) const
| Returns a subdivision level by index. Returns NULL if index is out-of-range.
virtual void | AddLevel (SubdivisionLevel *pLevel, bool bFirst=false)
| Adds a subdivision level to the object.
virtual bool | RemoveHighestLevel ()
| Removes the highest subdivision level from this geometry and deletes it.
virtual SubdivisionLevel * | ActiveLevel (void) const
| Returns the active subdivision level.
virtual bool | ChangeActiveLevel (const SubdivisionLevel *pNewLevel)
| Changes the active subdivision level.
virtual unsigned int | LayerCount () const
| Returns the number of sculpt layers in this geometry.
virtual LayerMeshData * | LayerData (const QString &sLayerName) const
| Convenience method to return a pointer to the layer delta/mask data for the specified layer.
virtual LayerMeshData * | LayerData (unsigned int iLayer, const SubdivisionLevel *pLevel=NULL) const
| Returns a pointer to the layer delta/mask data for the specified layer.
virtual mudbox::Material * | Material (void) const
| Returns the material associated with this geometry.
virtual void | SetMaterial (mudbox::Material *pMaterial)
| Sets the material associated with this geometry.
virtual mudbox::Material * | MaterialOverride (void) const
| Returns the material override associated with this geometry.
virtual void | SetMaterialOverride (mudbox::Material *pMaterialOverride)
| Sets the override material.
virtual void | SetActiveLevel (SubdivisionLevel *pNewActiveLevel)
| Obsolete. Do not use this method. Use ChangeActiveLevel instead.
virtual int | GeometryID (void) const
| Returns the geometry ID. Geometry ID is used to make the operations that contain deleting and undo deleting geometry correct.
virtual void | ImportUVs (const Geometry *pSource, MatchMode eMode=matchByVertexID, float fTolerance=0.001f)
| Imports a UV set from pSource to this Geometry.
virtual void | Transform (const Matrix &mMatrix)
## Public Attributes
aptr< SubdivisionLevel > | m_pActiveLevel
| This variable contains the address of the active level.
## Protected Member Functions
| Geometry (void)
| Constructor. Do not use this directly; use CreateInstance() instead.

## Member Enumeration Documentation

enum MatchMode

Search for all occurrences

Enumerator:

  matchByVertexID | Match vertices by their vertex IDs. Search for all occurrences
  matchByUV | Match vertices by using their UV coordinates. Search for all occurrences
  matchByVertexPosition | Match vertices by their position in world space. Search for all occurrences

Definition at line 28 of file geometry.h.

        {
            matchByVertexID,
            matchByUV,
            matchByVertexPosition
        };

## Constructor & Destructor Documentation

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

Constructor. Do not use this directly; use CreateInstance() instead.

## Member Function Documentation

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

Search for all occurrences

Returns the number of the subdivision levels in the object.

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

Search for all occurrences

Returns a pointer to the lowest subdivision level (the one with the fewest faces).

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

Search for all occurrences

Returns a pointer to the highest subdivision level (the one with the most faces).

virtual SubdivisionLevel* Level | ( | unsigned int | iIndex | ) | const `[virtual]`

Search for all occurrences

Returns a subdivision level by index. Returns NULL if index is out-of-range.

Parameters:

  [in] | iIndex | Index of the subdivision level to be returned

virtual void AddLevel | ( | SubdivisionLevel * | pLevel,
|  | bool | bFirst = `false`
| ) |  | `[virtual]`

Search for all occurrences

Adds a subdivision level to the object.

Parameters:

  [in] | pLevel | The subdivision level.
  [in] | bFirst | true to add as the first level. (if there are no levels, this parameter is ignored)

Examples:
  MeshBuilder/MeshBuilder.cpp.

virtual bool RemoveHighestLevel | ( |  | ) | `[virtual]`

Search for all occurrences

Removes the highest subdivision level from this geometry and deletes it.

Note that the active level cannot be removed. Returns true on success, false otherwise.

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

Search for all occurrences

Returns the active subdivision level.

The active subdivision level is the level that is shown in the 3d viewport in Mudbox, and is the only level that is sculptable/paintable. Only one subdivision level is active at any time.

virtual bool ChangeActiveLevel | ( | const SubdivisionLevel * | pNewLevel | ) | `[virtual]`

Search for all occurrences

Changes the active subdivision level.

For example, to step up levels, you can do this: pGeometry->ChangeActiveLevel( pGeometry->ActiveLevel()->NextLevel() ); Assuming you are not already on the highest level. This is equivalent to pressing Page Up in the Mudbox UI to step up to the next subdivision level. Returns true on success, false otherwise.

Parameters:

  [in] | pNewLevel | A pointer to the subdivision level to be made active.

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

Search for all occurrences

Returns the number of sculpt layers in this geometry.

virtual LayerMeshData* LayerData | ( | const QString & | sLayerName | ) | const `[virtual]`

Search for all occurrences

Convenience method to return a pointer to the layer delta/mask data for the specified layer.

Returns NULL if there is no layer with the given name.

Parameters:

  [in] | sLayerName | The layer name

virtual LayerMeshData* LayerData | ( | unsigned int | iLayer,
|  | const SubdivisionLevel * | pLevel = `NULL`
| ) |  | const `[virtual]`

Search for all occurrences

Returns a pointer to the layer delta/mask data for the specified layer.

Returns NULL if there is no layer data for the given subdivision level or if the layer index is out of range.

Parameters:

  [in] | iLayer | Index to a sculpt layer.
  [in] | pLevel | Pointer to the subdivision level for the layer data. If NULL, the level locked to the layer is used.

virtual mudbox::Material* Material | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the material associated with this geometry.

virtual void SetMaterial | ( | mudbox::Material * | pMaterial | ) | `[virtual]`

Search for all occurrences

Sets the material associated with this geometry.

virtual mudbox::Material* MaterialOverride | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the material override associated with this geometry.

The override material is to be used as a temporary material in place of the normal material. Usage is typically as a highlight

virtual void SetMaterialOverride | ( | mudbox::Material * | pMaterialOverride | ) | `[virtual]`

Search for all occurrences

Sets the override material.

If set to NULL then normal material is used for rendering. If set then this material is used instead. used for temporary switching of materials.

virtual void SetActiveLevel | ( | SubdivisionLevel * | pNewActiveLevel | ) | `[virtual]`

Search for all occurrences

Obsolete. Do not use this method. Use ChangeActiveLevel instead.

Examples:
  MeshBuilder/MeshBuilder.cpp.

virtual int GeometryID | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the geometry ID. Geometry ID is used to make the operations that contain deleting and undo deleting geometry correct.

virtual void ImportUVs | ( | const Geometry * | pSource,
|  | MatchMode | eMode = `matchByVertexID`,
|  | float | fTolerance = `0.001f`
| ) |  | `[virtual]`

Search for all occurrences

Imports a UV set from pSource to this Geometry.

Note this method fails if the active level of this geometry is not equal to level 0.

Parameters:

  [in] | pSource | The source geometry to copy the UV set from
  [in] | eMode | The matching mode that will be used. Only matchByVertexID, and matchByVertexPosition are valid for this method.
  [in] | fTolerance | The tolerance when matching by vertex position

virtual void Transform | ( | const Matrix & | mMatrix | ) | `[virtual]`

Search for all occurrences

## Member Data Documentation

aptr<SubdivisionLevel> m_pActiveLevel

Search for all occurrences

This variable contains the address of the active level.

Plugins can use this attribute to catch level change events by connecting their own attribute of the same type.

See also:
  Attribute::Connect()
  Node::OnNodeEvent()

Definition at line 111 of file geometry.h.

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

- Mudbox/geometry.h

Geometry Geometry Geometry Geometry Geometry Geometry Geometry Geometry Geometry Geometry
Geometry Geometry Geometry Geometry Geometry Geometry Geometry Geometry Geometry Geometry