This reference page is linked to from the following overview topics: Scene Graph, Layers and Viewport Filters, Sculpt Layers.
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().
#include <layer.h>
Public Member Functions |
|
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 mudbox::Mesh * | Mesh () const |
Returns the mesh that this layer affects.
|
|
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 | LayerVertexIndex (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 iGlobalVertexIndex, const Vector &vDelta, bool bUpdate=true) |
Set the delta position stored for a vertex
in the layer. |
|
virtual void | SetVertexMask (unsigned int iVertexLayerIndex, float fMask) |
Sets the mask of 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
LayerVertexIndex with bCreate set to true) call this. |
virtual void SetName | ( | const QString & | sName | ) | [virtual] |
virtual QString Name | ( | void | ) | const [virtual] |
Gets the name of the layer.
virtual bool Visible | ( | ) | const [virtual] |
virtual void SetVisible | ( | bool | bVisible | ) | [virtual] |
virtual mudbox::Mesh* Mesh | ( | ) | const [virtual] |
Returns the mesh that this layer affects.
virtual void SetTransparency | ( | float | fTransparency | ) | [virtual] |
Sets the transparency of the layer.
[in] | fTransparency | Transparency value, between 0 and 1. 0 is fully transparent, 1 is opaque. |
virtual float Transparency | ( | void | ) | const [virtual] |
Returns the current transparency of the layer. 0 is fully transparent, 1 is opaque.
virtual unsigned int LayerVertexIndex | ( | 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.
[in] | iVertexIndex | Index of the vertex inside the mesh. |
[in] | bCreate | Create the index if it doesn't exist |
virtual void 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.
[in] | iVertexCount | The desired number of vertices for the layer |
virtual unsigned int VertexCount | ( | ) | const [virtual] |
virtual unsigned int MeshVertexIndex | ( | unsigned int | iLayerVertexIndex | ) | const [virtual] |
Returns the mesh's vertex index for the corresponding layer vertex index.
See SetVertexCount()
[in] | iLayerVertexIndex | The index inside the layer. Valid range is 0 to VertexCount() - 1 |
virtual void SetVertexData | ( | unsigned int | iVertexLayerIndex, |
unsigned int | iGlobalVertexIndex, | ||
float | fMask | ||
) | [virtual] |
Set the mask value belonging to a vertex in the layer.
[in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex(). |
[in] | iGlobalVertexIndex | Index of the vertex inside the mesh. |
[in] | fMask | New mask value for the vertex, which must be between 0 and 1. 0 means no mask; 1 is completely masked. |
virtual Vector SetVertexDelta | ( | unsigned int | iVertexLayerIndex, |
unsigned int | iGlobalVertexIndex, | ||
const Vector & | vDelta, | ||
bool | bUpdate =
true |
||
) | [virtual] |
Set the delta position stored for a vertex in the layer.
[in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex(). |
[in] | iGlobalVertexIndex | Index of the vertex inside the mesh. |
[in] | vDelta | New delta vector for the vertex. This vector will be added to the world space position of the vertex when the layer becomes visible. |
[in] | bUpdate | True to automatically update the mesh's corresponding vertex positions, false to only update the sculpt layer's delta. |
virtual void SetVertexMask | ( | unsigned int | iVertexLayerIndex, |
float | fMask | ||
) | [virtual] |
Sets the mask of a vertex in the layer.
[in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex(). |
[in] | fMask | New mask value for the vertex, which must be between 0 and 1. 0 means no mask; 1 is completely masked. |
virtual float VertexMask | ( | unsigned int | iVertexLayerIndex | ) | [virtual] |
Returns the mask of a vertex in the layer.
[in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex(). |
virtual Vector VertexDelta | ( | unsigned int | iVertexLayerIndex | ) | [virtual] |
Returns the current delta value associated to a vertex.
[in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex(). |
virtual bool FinishChanges | ( | ) | [virtual] |
After creating new vertex deltas (by calling LayerVertexIndex 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.