#include <c4d_snapdata.h>
The Snap Interface, must be allocated either with AutoAlloc ,或 Alloc() and freed after use with Free() .
私有成员函数 |
|
SnapCore () |
Alloc/Free |
|
static SnapCore * | Alloc (void) |
static void | Free ( SnapCore *&p) |
Snap/Intersect |
|
Bool | Init ( BaseDocument *doc, BaseDraw *bd, AtomArray *exclude=nullptr) |
Bool | 更新 (void) |
Bool | Snap (const 向量 &p, SnapResult &result, SNAPFLAGS flags= SNAPFLAGS::NONE ) |
Bool | Intersect (const 向量 &p, const 向量 &n, Bool plane, SnapResult &result, SNAPFLAGS flags= SNAPFLAGS::NONE ) |
Inferred |
|
BaseObject * | AddInferred ( BaseDocument *doc, const 矩阵 &mat, INFERREDGUIDETYPE type) |
Bool | FlushInferred (void) |
杂项 |
|
void | SetToolObject ( BaseObject *op) |
void | SetCustomExcludeList ( maxon::BaseArray < SnapExclude > *snapExcludeList) |
|
|
static |
Allocates a snap core. Destroy the allocated snap core with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
|
static |
Destructs snap cores allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
[in] | p | The snap core to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
Bool Init | ( | BaseDocument * | doc , |
BaseDraw * | bd , | ||
AtomArray * |
exclude
=
nullptr
|
||
) |
Snap initialization routine.
[in] | doc | The current document. The caller owns the pointed document. |
[in] | bd | The BaseDraw to initialize. The caller owns the pointed BaseDraw . |
[in] | exclude | An array of objects to exclude from being snapped to. The caller owns the pointed array. |
Bool 更新 | ( | void | ) |
Updates the snaps to use the current settings.
Bool Snap | ( | const 向量 & | p , |
SnapResult & | result , | ||
SNAPFLAGS |
flags
=
SNAPFLAGS::NONE
|
||
) |
Snap routine.
[in] | p | The position to snap to in global space. |
[out] | result | The position to snap to in global space. |
[in] | flags | The flags to limit snapping on selection or to a specific type: SNAPFLAGS |
Bool Intersect | ( | const 向量 & | p , |
const 向量 & | n , | ||
Bool | plane , | ||
SnapResult & | result , | ||
SNAPFLAGS |
flags
=
SNAPFLAGS::NONE
|
||
) |
Snap intersection routine.
[in] | p | The position to snap to in global space. |
[in] | n | The normal of the guide being intersected with in global space. |
[in] | plane | true if the intersection should be with a plane, false if with a ray/line. |
[out] | result | The result of the successful intersection, user owns this. |
[in] | flags | The flags to limit snapping on selection or to a specific type: SNAPFLAGS |
BaseObject * AddInferred | ( | BaseDocument * | doc , |
const 矩阵 & | mat , | ||
INFERREDGUIDETYPE | type | ||
) |
Adds an inferred guide point, line or plane to the scene for snapping to.
[in] | doc | The current document. The caller owns the pointed document. |
[in] | mat | The matrix for the point (axis), line, or plane, z points along the line or as the normal for the plane. |
[in] | type | The type of inferred guide to add: INFERREDGUIDETYPE |
Bool FlushInferred | ( | void | ) |
Flushes inferred system guides and inferred elements.
void SetToolObject | ( | BaseObject * | op | ) |
Sets the active object and pass it to snap system if is created from current tool.
[in] | op | The new object created in the tool. The caller owns the pointed object. |
void SetCustomExcludeList | ( | maxon::BaseArray < SnapExclude > * | snapExcludeList | ) |
Passes to the snap a new exclusion list.
[in] | snapExcludeList | A pointer to a maxon::BaseArray of exclusion data or nullptr to clear internal pointer. The caller owns the pointed array. |