KerningVpGuiHelper Class Reference

#include <customgui_kerning.h>

详细描述

A helper class that does all the drawing and handle management.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

Alloc/Free

static KerningVpGuiHelper Alloc ()
static void  Free ( KerningVpGuiHelper *&pData)

Constructor/Destructor

  KerningVpGuiHelper ()
  ~KerningVpGuiHelper ()

Init

Bool   Init (const maxon::String &s, BaseContainer *generationresults, KerningData *kd, Int32 plane)

Draw

DRAWRESULT   Draw ( BaseObject *op, BaseDraw *bd, BaseDrawHelp *bh)

Handle

Int32   DetectHandle ( BaseObject *op, BaseDraw *bd, Int32 x, Int32 y, QUALIFIER qualifier)
Bool   MoveHandle ( BaseObject *op, BaseObject *undo, const 向量 &mouse_pos, Int32 hit_id, QUALIFIER qualifier, BaseDraw *bd)
void  GetHandle ( BaseObject *op, Int32 i, HandleInfo &info)

杂项

Bool   CopyTo ( KerningVpGuiHelper *dest)
Bool   ClickHandle ( Bool release, BaseObject *op)
void  SetZeroSize ()

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

◆  KerningVpGuiHelper()

KerningVpGuiHelper ( )

Constructor.

◆  ~KerningVpGuiHelper()

~ KerningVpGuiHelper ( )

Destructor.

成员函数文档编制

◆  Alloc()

static KerningVpGuiHelper * Alloc ( )
static

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

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

◆  Free()

static void Free ( KerningVpGuiHelper *&  pData )
static

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

参数
[in,out] pData The KerningVpGuiHelper objects to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  Init()

Bool Init ( const maxon::String s ,
BaseContainer generationresults ,
KerningData kd ,
Int32   plane  
)

Initializes the KerningVpGuiHelper .

注意
Must be called after each successful generation of a text spline, and before calling Draw() , GetHandleCount(), GetHandle() , SetHandle().
参数
[in] s The string that the text spline was generated from.
[in] generationresults A pointer to the BaseContainer with generation results (get the container with GetContainer(TEXTSPLINE_RESULTS) from the text spline's container).
[in] kd A pointer to the KerningData that was used for text spline generation.
[in] plane Indicates the spline generation plane. Value from PRIM_PLANE 可以使用。
返回
true if successful, otherwise false .

◆  Draw()

DRAWRESULT Draw ( BaseObject op ,
BaseDraw bd ,
BaseDrawHelp bh  
)

Draws the complete Kerning Viewport GUI into the current drawpass .

注意
Drawing is automatically skipped if the KerningData 's edit mode is inactive.
Call this from an ObjectData 's Draw() 函数。
警告
Init() must be called before calling this function.
参数
[in] op Pass op from an ObjectData::Draw .
[in] bd Pass bd from an ObjectData::Draw .
[in] bh Pass bh from an ObjectData::Draw .
返回
The draw result. It is possible to return this in an ObjectData 's Draw() 函数。

◆  DetectHandle()

Int32 DetectHandle ( BaseObject op ,
BaseDraw bd ,
Int32   x ,
Int32   y ,
QUALIFIER   qualifier  
)

Manages the Kerning handles.

注意
Call this from an ObjectData 's DetectHandle() 函数。
警告
Init() must be called before calling this function.
参数
[in] op Pass op from an ObjectData::DetectHandle .
[in] bd Pass bd from an ObjectData::DetectHandle .
[in] x Pass x from an ObjectData::DetectHandle .
[in] y Pass y from an ObjectData::DetectHandle .
[in] qualifier Pass qualifier from an ObjectData::DetectHandle .
返回
The handle ID. Return this in an ObjectData 's DetectHandle() 函数。

◆  MoveHandle()

Bool MoveHandle ( BaseObject op ,
BaseObject undo ,
const 向量 mouse_pos ,
Int32   hit_id ,
QUALIFIER   qualifier ,
BaseDraw bd  
)

Manages the Kerning handles.

注意
Call this from an ObjectData 's MoveHandle() 函数。
警告
Init() must be called before calling this function.
参数
[in] op Pass op from an ObjectData::MoveHandle .
[in] undo Pass undo from an ObjectData::MoveHandle .
[in] mouse_pos Pass mouse_pos from an ObjectData::MoveHandle .
[in] hit_id Pass hit_id from an ObjectData::MoveHandle .
[in] qualifier Pass qualifier from anObjectData::MoveHandle.
[in] bd Pass bd from an ObjectData::MoveHandle .
返回
true if the handle was moved, otherwise false . Return this in an ObjectData 's MoveHandle() 函数。

◆  GetHandle()

void GetHandle ( BaseObject op ,
Int32   i ,
HandleInfo info  
)

Manages the Kerning handles.

注意
Call this from an ObjectData 's GetHandle() 函数。
警告
Init() must be called before calling this function.
参数
[in] op Pass op from an ObjectData::GetHandle .
[in] i Pass i from an ObjectData::GetHandle .
[in] info Pass info from an ObjectData::GetHandle .

◆  CopyTo()

Bool CopyTo ( KerningVpGuiHelper dest )

Copies all data of the class to another KerningVpGuiHelper 对象。

参数
[in] dest A pointer to the destination KerningVpGuiHelper object. Must not be nullptr . The caller owns the pointed KerningVpGuiHelper .
返回
true if successful, otherwise false .

◆  ClickHandle()

Bool ClickHandle ( Bool   release ,
BaseObject op  
)

Used internally by HandleKerningMessages() to handle drag-less clicks on handles.

参数
[in] release false on MouseDown, true on MouseUp.
[in] op The BaseObject from which the HandleKerningMessages() call originated. The caller owns the pointed object.
返回
true if successful, otherwise false .

◆  SetZeroSize()

void SetZeroSize ( )

Sets all sizes but TEXTSPLINE_RESULT_HEIGHT_BASE to zero. Specially useful when scaling down kerning by handlers to zero until text spline is so small that text spline generator returns a null spline.

另请参阅
TEXTSPLINE_RESULT