mudbox::LayerMeshData Class Reference

#include <layer.h>

Inheritance diagram for mudbox::LayerMeshData:

Inheritance graph
[legend]
List of all members.

Detailed Description

This class represents a Sculpt Layer.

A sculpt layer stores offsets (deltas) to the vertex positions of a mesh. When the layer is visible, the offsets are added to the mesh (scaled according to the transparency factor). Sculpt layers also support Masking, where each vertex in the sculpt layer also has a mask value, which it is multiplied by. This allows the content of the layer to be attenuated locally (using the mask) or globally (using the transparency value) with no loss of data.

Sculpt layers only keep offset information for those vertices that have actually changed. For that reason, the index of a vertex within a sculpt layer is not the same as the index of a vertex within the model.

See also SubdivisionLevel::AddLayer().


Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
virtual void  SetName (const QString &sName)
  Set the name of the layer.
virtual QString  Name (void) const
  Gets the name of the layer.
virtual bool  Visible () const
  Gets the visibility of the layer.
virtual void  SetVisible (bool bVisible)
  Sets the visibility of the layer.
virtual void  SetTransparency (float fTransparency)
  Sets the transparency of the layer.
virtual float  Transparency (void) const
  Returns the current transparency of the layer. 0 is fully transparent, 1 is opaque.
virtual unsigned int  VertexIndex (unsigned int iVertexIndex, bool bCreate=true)
  Returns the index of a vertex in a sculpt layer.
virtual void  SetVertexCount (unsigned int iVertexCount)
  Set the number of vertices in the layer.
virtual unsigned int  VertexCount () const
  Returns the number of vertex deltas in this layer.
virtual unsigned int  MeshVertexIndex (unsigned int iLayerVertexIndex) const
  Returns the mesh's vertex index for the corresponding layer vertex index.
virtual void  SetVertexData (unsigned int iVertexLayerIndex, unsigned int iGlobalVertexIndex, float fMask)
  Set the mask value belonging to a vertex in the layer.
virtual Vector  SetVertexDelta (unsigned int iVertexLayerIndex, unsigned int iLocalVertexIndex, const Vector &vDelta, bool bUpdate=true)
  Set the delta position stored for a vertex in the layer.
virtual float  VertexMask (unsigned int iVertexLayerIndex)
  Returns the mask of a vertex in the layer.
virtual Vector  VertexDelta (unsigned int iVertexLayerIndex)
  Returns the current delta value associated to a vertex.
virtual bool  FinishChanges ()
  After creating new vertex deltas (by calling VertexIndex with bCreate set to true) call this method to commit the changes into the layer.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::LayerMeshData::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::TreeNode.

00127 :
const mudbox::ClassDesc* mudbox::LayerMeshData::StaticClass void   )  [static]
 

Reimplemented from mudbox::TreeNode.

mudbox::Node* mudbox::LayerMeshData::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::TreeNode.

virtual void mudbox::LayerMeshData::SetName const QString &  sName  )  [virtual]
 

Set the name of the layer.

Parameters:
sName  [in] the new layer name

Reimplemented from mudbox::Node.

virtual QString mudbox::LayerMeshData::Name void   )  const [virtual]
 

Gets the name of the layer.

virtual bool mudbox::LayerMeshData::Visible  )  const [virtual]
 

Gets the visibility of the layer.

Reimplemented from mudbox::TreeNode.

virtual void mudbox::LayerMeshData::SetVisible bool  bVisible  )  [virtual]
 

Sets the visibility of the layer.

Reimplemented from mudbox::TreeNode.

virtual void mudbox::LayerMeshData::SetTransparency float  fTransparency  )  [virtual]
 

Sets the transparency of the layer.

Parameters:
fTransparency  [in] Transparency value, between 0 and 1. 0 is fully transparent, 1 is opaque.
virtual float mudbox::LayerMeshData::Transparency void   )  const [virtual]
 

Returns the current transparency of the layer. 0 is fully transparent, 1 is opaque.

virtual unsigned int mudbox::LayerMeshData::VertexIndex unsigned int  iVertexIndex,
bool  bCreate = true
[virtual]
 

Returns the index of a vertex in a sculpt layer.

Vertices in a sculpt layer do not have the same index as vertices in a mesh. This method takes a mesh vertex index and finds the corresponding sculpt layer vertex index.

Note: This is a slow function, so return values should be cached if the index will be used multiple times to modify/get vertex data.

Parameters:
iVertexIndex  [in] Index of the vertex inside the mesh.
bCreate  [in] Create the index if it doesn't exist
virtual void mudbox::LayerMeshData::SetVertexCount unsigned int  iVertexCount  )  [virtual]
 

Set the number of vertices in the layer.

The number of vertices in a sculpt layer may be smaller than the number of vertices in a model level, because the sculpt layer only keeps information on vertices that have changed.

Parameters:
iVertexCount  [in] The desired number of vertices for the layer
virtual unsigned int mudbox::LayerMeshData::VertexCount  )  const [virtual]
 

Returns the number of vertex deltas in this layer.

See SetVertexCount()

virtual unsigned int mudbox::LayerMeshData::MeshVertexIndex unsigned int  iLayerVertexIndex  )  const [virtual]
 

Returns the mesh's vertex index for the corresponding layer vertex index.

See SetVertexCount()

Parameters:
iLayerVertexIndex  [in] The index inside the layer. Valid range is 0 to VertexCount() - 1
virtual void mudbox::LayerMeshData::SetVertexData unsigned int  iVertexLayerIndex,
unsigned int  iGlobalVertexIndex,
float  fMask
[virtual]
 

Set the mask value belonging to a vertex in the layer.

Parameters:
iVertexLayerIndex  [in] Index of the vertex inside the layer. See VertexIndex().
iGlobalVertexIndex  [in] Index of the vertex inside the mesh.
fMask  [in] New mask value for the vertex, which must be between 0 and 1. 0 means no mask; 1 is completely masked.
virtual Vector mudbox::LayerMeshData::SetVertexDelta unsigned int  iVertexLayerIndex,
unsigned int  iLocalVertexIndex,
const Vector vDelta,
bool  bUpdate = true
[virtual]
 

Set the delta position stored for a vertex in the layer.

Parameters:
iVertexLayerIndex  [in] Index of the vertex inside the layer. See VertexIndex().
iLocalVertexIndex  [in] Index of the vertex inside the mesh.
vDelta  [in] New delta vector for the vertex. This vector will be added to the world space position of the vertex when the layer becomes visible.
bUpdate  [in] True to automatically update the mesh's corresponding vertex positions, false to only update the sculpt layer's delta.
virtual float mudbox::LayerMeshData::VertexMask unsigned int  iVertexLayerIndex  )  [virtual]
 

Returns the mask of a vertex in the layer.

Parameters:
iVertexLayerIndex  [in] Index of the vertex inside the layer. See VertexIndex().
virtual Vector mudbox::LayerMeshData::VertexDelta unsigned int  iVertexLayerIndex  )  [virtual]
 

Returns the current delta value associated to a vertex.

Parameters:
iVertexLayerIndex  [in] Index of the vertex inside the layer. See VertexIndex().
virtual bool mudbox::LayerMeshData::FinishChanges  )  [virtual]
 

After creating new vertex deltas (by calling VertexIndex with bCreate set to true) call this method to commit the changes into the layer.

This method can be called once, after all vertex data has been set for the operation. Returns true on success, false otherwise.


mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData
mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData mudbox::LayerMeshData