SculptModifierInterface Class Reference 雕刻

| Library » Sculpt Brush

#include <lib_sculptbrush.h>

详细描述

This interface lets apply the affects of a sculpting modifier to any polygon object.
It allows to use the same algorithms outside of the sculpting system itself and deform a polygon object using the same brush algorithms that the sculpt brushes use.

公共成员函数

Bool   Init ( PolygonObject *poly)
void  清零 ()
BaseContainer   GetDefaultData ()
Int32   GetModifierCount ()
Bool   GetModifierInfo ( Int32 index, Int32 &modifierId, String &name)
Bool   SetData (const BaseContainer &brushData, const BaseContainer &modifierData)
Bool   ApplyModifier ( Int32 modifierId, Int32 vertex, const BaseContainer &brushData, const BaseContainer &modifierData, 向量 *pHitPoint=nullptr, 向量 *pLastHitPoint=nullptr, Bool respectSelections=false)

静态公共成员函数

static SculptModifierInterface Alloc ()
static void  Free ( SculptModifierInterface *&brush)

私有成员函数

  SculptModifierInterface ()
  ~SculptModifierInterface ()

构造函数 & 析构函数文档编制

◆  SculptModifierInterface()

SculptModifierInterface () private

◆  ~SculptModifierInterface()

~ SculptModifierInterface () private

成员函数文档编制

◆  Alloc()

static SculptModifierInterface * Alloc ( )
static

Allocates a SculptModifierInterface object. Destroy the allocated SculptModifierInterface object with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated SculptModifierInterface object, or nullptr if the allocation failed.

◆  Free()

static void Free ( SculptModifierInterface *&  brush )
static

Destructs SculptModifierInterface objects allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] brush The SculptModifierInterface object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  Init()

Bool Init ( PolygonObject poly )

Initializes the interface to apply modifiers to the given polygon object.

参数
[in] poly The polygon object to apply modifiers to.
返回
true if successful, otherwise false .

◆  Clear()

void Clear ( )

Clears the interface. Frees up any internal data that was required to apply modifiers to the initialized polygon object.

◆  GetDefaultData()

BaseContainer GetDefaultData ( )

Gets the default brush data setting. These settings can be found in toolsculptbrushbase.h

返回
The container containing all the default brush settings.

◆  GetModifierCount()

Int32 GetModifierCount ( )

Gets the number of available modifiers that are currently registered and able to be used.

返回
The number of modifiers.

◆  GetModifierInfo()

Bool GetModifierInfo ( Int32   index ,
Int32 modifierId ,
String name  
)

Gets the information about a modifier given its index .

参数
[in] index The index into the list of available modifiers: 0 <= index < GetModifierCount()
[out] modifierId Assigned the plugin ID of the modifier.
[out] name Assigned the name of the modifier.
返回
true if a modifier was found at the given index, otherwise false .

◆  SetData()

Bool SetData ( const BaseContainer brushData ,
const BaseContainer modifierData  
)

Sets the brush data and modifier data for the the next dab to be drawn.
Initializes any time consuming data before making repeated calls to ApplyModifier() . Operations that take time are things such as enabling stamps, changing a stamps texture, calculation of the falloff values etc.

参数
[in] brushData The brush data container settings. By default just use what is returned from calling GetDefaultData() .
[in] modifierData The container for the modifier itself. Each modifier is a BaseList2D node and could have its own settings. Refer to each modifiers BM file ( BMknife.h as an example).
返回
true if the data was correctly set, otherwise false .

◆  ApplyModifier()

Bool ApplyModifier ( Int32   modifierId ,
Int32   vertex ,
const BaseContainer brushData ,
const BaseContainer modifierData ,
向量 pHitPoint = nullptr ,
向量 pLastHitPoint = nullptr ,
Bool   respectSelections = false  
)

Applies a modifier to the PolygonObject near the specified vertex.

Precondition
SetData() must be called before.
注意
If a hit point is given then it must be on the surface of a polygon that is attached to the specified vertex.
参数
[in] modifierId The plugin ID of the modifier to apply. This is retrieved from a call to GetModifierInfo() .
[in] vertex The index of the vertex on the PolygonObject where to apply the modifier to.
[in] brushData The brush data container settings. By default just use what is returned from calling GetDefaultData() ;
[in] modifierData The container for the modifier itself. Each modifier is a BaseList2D node and could have its own settings. Refer to each modifiers BM file ( BMknife.h as an example).
[in] pHitPoint The exact hit point on the surface of a polygon that is connected to the vertex.
[in] pLastHitPoint The last hit point from the previous call to ApplyModifier() .
This is used to determine the direction of the dab for modifiers such as the knife and pinch modifier.
[in] respectSelections true to tell the modifier to respect any Polygon or Point selections on the PolygonObject .
返回
true if the data was correctly set, otherwise false .