BrushBase Class Reference Library » Character Animation

#include <lib_ca.h>

详细描述

Helper class for the BrushToolData hook.

私有成员函数

  BrushBase ()
  ~BrushBase ()

Private Attributes

_BrushToolBase *  m_pBase

Alloc/Free

static BrushBase *  Alloc ()
static void  Free ( BrushBase *&p)

Base Implementations

Bool   InitTool ( BaseDocument *doc, BaseContainer &data, BaseThread *bt, BrushToolData *tool)
void  FreeTool ( BaseDocument *doc, BaseContainer &data)
void  InitDefaultSettings ( BaseDocument *doc, BaseContainer &data)
Bool   GetDEnabling ( BaseDocument *doc, BaseContainer &data, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
Bool   SetDParameter ( BaseDocument *doc, BaseContainer &data, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
Bool   GetDDescription ( BaseDocument *doc, BaseContainer &data, 描述 *description, DESCFLAGS_DESC &flags)
Bool   消息 ( BaseDocument *doc, BaseContainer &data, Int32 type, void *t_data)
Bool   GetCursorInfo ( BaseDocument *doc, BaseContainer &data, BaseDraw *bd, Float x, Float y, BaseContainer &bc)
Bool   MouseInput ( BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg)

Helpers

BrushVertexData *  GetSelected ( BaseDocument *doc, BaseContainer &data, BaseDraw *bd, Int32 &vcnt, Int32 x, Int32 y, Float rad, BaseObject *op)
Float   GetCursor ( Int32 &x, Int32 &y)
void  GetObjectInfo (BrushObjectData *data, BrushObjectInfo &info)
Bool   GetObjectInfo ( BaseObject *op, BrushObjectInfo &info)
Bool   ValidateObjects ( BaseDocument *doc, BaseContainer &data)
BrushPixelData *  GetObjectAt ( Int32 x, Int32 y)
Float   GetFalloff ( Float dst, Int32 flags) const
Float   GetStrength () const
Float   GetStrengthMultiplier () const
Bool   GetObjects ( BaseDocument *doc, AtomArray *objects)
Bool   UpdateCache ( BaseDocument *doc, BaseContainer &data, BaseDraw *bd, Bool force)
Float *  CalcSurfaceDistances ( PolygonObject *pObject, BaseSelect *selected, Neighbor *pNeighbor=nullptr, 向量 *pNormals=nullptr, 向量 *pGlobalPoints=nullptr, Float *pDistance=nullptr)
Float *  CalcSurfaceDistancesFromPoint ( PolygonObject *pObject, Int32 pindex, Neighbor *pNeighbor=nullptr, 向量 *pNormals=nullptr, 向量 *pGlobalPoints=nullptr, Float *pDistance=nullptr)

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

◆  BrushBase()

BrushBase () private

◆  ~BrushBase()

~ BrushBase () private

成员函数文档编制

◆  Alloc()

static BrushBase * Alloc ( )
static

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

返回
The allocated brush base, or nullptr if the allocation failed.

◆  Free()

static void Free ( BrushBase *&  p )
static

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

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

◆  InitTool()

Bool InitTool ( BaseDocument *  doc ,
BaseContainer &  data ,
BaseThread *  bt ,
BrushToolData *  tool  
)

Base implementation for BrushToolData .

◆  FreeTool()

void FreeTool ( BaseDocument *  doc ,
BaseContainer &  data  
)

Base implementation for BrushToolData .

◆  InitDefaultSettings()

void InitDefaultSettings ( BaseDocument *  doc ,
BaseContainer &  data  
)

Base implementation for BrushToolData .

◆  GetDEnabling()

Bool GetDEnabling ( BaseDocument *  doc ,
BaseContainer &  data ,
const DescID &  id ,
const GeData &  t_data ,
DESCFLAGS_ENABLE   flags ,
const BaseContainer *  itemdesc  
)

Base implementation for BrushToolData .

◆  SetDParameter()

Bool SetDParameter ( BaseDocument *  doc ,
BaseContainer &  data ,
const DescID &  id ,
const GeData &  t_data ,
DESCFLAGS_SET &  flags  
)

Base implementation for BrushToolData .

◆  GetDDescription()

Bool GetDDescription ( BaseDocument *  doc ,
BaseContainer &  data ,
描述 *  description ,
DESCFLAGS_DESC &  flags  
)

Base implementation for BrushToolData .

◆  Message()

Bool 消息 ( BaseDocument *  doc ,
BaseContainer &  data ,
Int32   type ,
void *  t_data  
)

Base implementation for BrushToolData .

◆  GetCursorInfo()

Bool GetCursorInfo ( BaseDocument *  doc ,
BaseContainer &  data ,
BaseDraw *  bd ,
Float   x ,
Float   y ,
BaseContainer &  bc  
)

Base implementation for BrushToolData .

◆  MouseInput()

Bool MouseInput ( BaseDocument *  doc ,
BaseContainer &  data ,
BaseDraw *  bd ,
EditorWindow *  win ,
const BaseContainer &  msg  
)

Base implementation for BrushToolData .

◆  GetSelected()

BrushVertexData * GetSelected ( BaseDocument *  doc ,
BaseContainer &  data ,
BaseDraw *  bd ,
Int32 &  vcnt ,
Int32   x ,
Int32   y ,
Float   rad ,
BaseObject *  op  
)

Performs a selection at ( x , y ) with radius rad .

警告
Call ValidateObjects() before this function.
参数
[in] doc The document.
[in] data The data container.
[in] bd The base draw view.
[out] vcnt Assigned the selected vertex count.
[in] x The X coordinate.
[in] y The Y coordinate.
[in] rad The radius.
[in] op The object.
返回
The selected vertices.

◆  GetCursor()

Float GetCursor ( Int32 &  x ,
Int32 &  y  
)

Gets the cursor position and radius.

参数
[out] x Assigned the cursor X position.
[out] y Assigned the cursor Y position.
返回
The radius.

◆  GetObjectInfo() [1/2]

void GetObjectInfo ( BrushObjectData *  data ,
BrushObjectInfo &  info  
)

Retrieves object information for data .

参数
[in] data The brush object data.
[out] info Assigned the brush object information.

◆  GetObjectInfo() [2/2]

Bool GetObjectInfo ( BaseObject *  op ,
BrushObjectInfo &  info  
)

Retrieves the cached object data from op .

参数
[in] op The object.
[out] info Assigned the brush object information.
返回
true if successful, otherwise false .
false if object op is not found in the cache.

◆  ValidateObjects()

Bool ValidateObjects ( BaseDocument *  doc ,
BaseContainer &  data  
)

Validate objects.

参数
[in] doc The document.
[in] data The data container.
返回
true if successful, otherwise false .

◆  GetObjectAt()

BrushPixelData * GetObjectAt ( Int32   x ,
Int32   y  
)

Get the objects at ( x , y ).

警告
Call ValidateObjects() before this function.
参数
[in] x The X coordinate.
[in] y The Y coordinate.
返回
The brush pixel data.

◆  GetFalloff()

Float GetFalloff ( Float   dst ,
Int32   flags  
) const

Gets the falloff factor.

注意
Only valid within MouseInput() 函数。
参数
[in] dst The distance.
[in] flags The flags: BRUSHBASE_FALLOFF
返回
The falloff factor.

◆  GetStrength()

Float GetStrength ( ) const

Gets the strength (percentage).

返回
The strength percentage.

◆  GetStrengthMultiplier()

Float GetStrengthMultiplier ( ) const

Gets the strength multiplier. Should be 1.0 unless pen pressure affects strength.

返回
The multiplier.

◆  GetObjects()

Bool GetObjects ( BaseDocument *  doc ,
AtomArray *  objects  
)

Fills in the atom array with the cached (should be active) objects.

参数
[in] doc The document.
[out] 对象 The cached objects.
返回
true if successful, otherwise false .

◆  UpdateCache()

Bool UpdateCache ( BaseDocument *  doc ,
BaseContainer &  data ,
BaseDraw *  bd ,
Bool   force  
)

Update the cache if object pointers have been changed during mouse drag.
It should not be needed to set force if the object has been made dirty ( MSG_UPDATE ).

参数
[in] doc The document.
[in] data The data container.
[in] bd The base draw view.
[in] force Set to true to force the cache update.
返回
true if successful, otherwise false .

◆  CalcSurfaceDistances()

Float * CalcSurfaceDistances ( PolygonObject *  pObject ,
BaseSelect *  selected ,
Neighbor *  pNeighbor = nullptr ,
向量 *  pNormals = nullptr ,
向量 *  pGlobalPoints = nullptr ,
Float *  pDistance = nullptr  
)

Used internally for surface distance calculations. Creates an array with an element for each point in pObject set to the distance to selected.
若 pDistance is passed this array is used instead.
Either pass the various pointers (those with the nullptr default parameters) or let them be calculated automatically if nullptr .

参数
[in] pObject The object to calculate.
[in] selected The point selection to calculate.
[in] pNeighbor The neighbor information.
[in] pNormals The point normals.
[in] pGlobalPoints The global points.
[out] pDistance The pre-allocated distance array to be filled.
返回
The distance array.

◆  CalcSurfaceDistancesFromPoint()

Float * CalcSurfaceDistancesFromPoint ( PolygonObject *  pObject ,
Int32   pindex ,
Neighbor *  pNeighbor = nullptr ,
向量 *  pNormals = nullptr ,
向量 *  pGlobalPoints = nullptr ,
Float *  pDistance = nullptr  
)

Used internally for surface distance calculations. Creates an array with an element for each point in pObject set to the distance to selected.
若 pDistance is passed this array is used instead.
Either pass the various pointers (those with the nullptr default parameters) or let them be calculated automatically if nullptr .

参数
[in] pObject The object to calculate.
[in] pindex The point to calculate.
[in] pNeighbor The neighbor information.
[in] pNormals The point normals.
[in] pGlobalPoints The global points.
[out] pDistance The pre-allocated distance array to be filled.
返回
The distance array.

Member Data Documentation

◆  m_pBase

_BrushToolBase* m_pBase private