#include <c4d_snapdata.h>
详细描述
A data class for creating snap mode plugins. For example Polygon Snap, Edge Snap, Spline Snap, Vertex Snap and so on.
使用
RegisterSnapPlugin()
to register a snap mode plugin.
公共成员函数
|
virtual
Bool
|
Init
(void)
|
virtual void
|
Free
(void)
|
virtual
Bool
|
InitSnap
(const
SnapStruct
&ss)
|
virtual
Bool
|
Snap
(const
向量
&p, const
SnapStruct
&ss,
SnapPoint
&result)
|
virtual
Bool
|
Intersect
(const
向量
&p, const
向量
&n,
Bool
plane, const
SnapStruct
&ss,
SnapPoint
&result)
|
virtual void
|
FreeSnap
(const
SnapStruct
&ss)
|
virtual
Bool
|
Draw
(const
SnapStruct
&ss,
BaseDocument
*doc,
BaseDraw
*bd,
BaseDrawHelp
*bh,
BaseThread
*bt)
|
virtual
Bool
|
GetCursorInfo
(const
SnapStruct
&ss,
BaseDocument
*doc,
BaseDraw
*bd,
Float
x,
Float
y,
BaseContainer
&result)
|
virtual
Bool
|
MouseInput
(const
SnapStruct
&ss,
BaseDocument
*doc,
BaseDraw
*bd,
EditorWindow
*win, const
BaseContainer
&msg)
|
virtual
Bool
|
KeyboardInput
(const
SnapStruct
&ss,
BaseDocument
*doc,
BaseDraw
*bd,
EditorWindow
*win, const
BaseContainer
&msg)
|
|
BaseData
()
|
virtual
|
~BaseData
(void)
|
void
|
Destructor
(void)
|
成员函数文档编制
◆
Init()
virtual
Bool
Init
|
(
|
void
|
|
)
|
|
|
virtual
|
Called to initialize the snap plugin.
-
返回
-
true
if successful, otherwise
false
.
◆
Free()
virtual void Free
|
(
|
void
|
|
)
|
|
|
virtual
|
Called to free the snap plugin instance.
◆
InitSnap()
Called to prepare snapping to begin.
-
参数
-
[in]
|
ss
|
The passed snap context structure.
|
-
返回
-
true
if successful, otherwise
false
.
◆
Snap()
Called for 3D Snap detection.
-
参数
-
[in]
|
p
|
The position being snapped to in world coordinates.
|
[in]
|
ss
|
The passed Snap context structure.
|
[out]
|
result
|
Assign data about the resulting snap point if one is generated.
|
-
返回
-
true
if a snap occurred, otherwise
false
.
◆
Intersect()
Called for guide intersection.
-
参数
-
[in]
|
p
|
The position being snapped to in world coordinates.
|
[in]
|
n
|
The guide normal in world coordinates.
|
[in]
|
plane
|
true
if the guide is a plane,
false
if it is a ray/line.
|
[in]
|
ss
|
The passed Snap context structure.
|
[out]
|
result
|
Assign data about the resulting intersection points if they are generated.
|
-
返回
-
true
if an intersection occurred, otherwise
false
.
◆
FreeSnap()
Called to free any stored data after snapping has occurred.
-
参数
-
[in]
|
ss
|
The passed Snap context structure.
|
◆
Draw()
Called for custom draw during snap.
-
参数
-
[in]
|
ss
|
The passed Snap context structure.
|
[in]
|
doc
|
The current document passed by the tool. The caller owns the pointed document.
|
[in]
|
bd
|
The current
BaseDraw
passed by the tool. The caller owns the pointed
BaseDraw
.
|
[in]
|
bh
|
The current
BaseDrawHelp
passed by the tool. The caller owns the pointed
BaseDrawHelp
.
|
[in]
|
bt
|
The current
BaseThread
passed by the tool. The caller owns the pointed
BaseThread
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetCursorInfo()
Called to intercept the
GetCursorInfo
purely for the snap.
-
参数
-
[in]
|
ss
|
The passed Snap context structure.
|
[in]
|
doc
|
The current document passed by the tool. The caller owns the pointed document.
|
[in]
|
bd
|
The current
BaseDraw
passed by the tool. The caller owns the pointed
BaseDraw
.
|
[in]
|
x
|
The mouse x position passed by the tool.
|
[in]
|
y
|
The mouse y position passed by the tool.
|
[out]
|
result
|
The message container passed by the tool.
|
-
返回
-
true
if to override the active tool, otherwise
false
.
◆
MouseInput()
Called to intercept the
MouseInput
purely for the snap.
-
参数
-
[in]
|
ss
|
The passed Snap context structure.
|
[in]
|
doc
|
The current document passed by the tool. The caller owns the pointed document.
|
[in]
|
bd
|
The current
BaseDraw
passed by the tool. The caller owns the pointed
BaseDraw
.
|
[in]
|
win
|
The current
EditorWindow
passed by the tool. The caller owns the pointed
EditorWindow
.
|
[in]
|
msg
|
The message container passed by the tool.
|
-
返回
-
true
if to override the active tool, otherwise
false
.
◆
KeyboardInput()
Called to intercept the
KeyboardInput
purely for the snap.
-
参数
-
[in]
|
ss
|
The passed Snap context structure.
|
[in]
|
doc
|
The current document passed by the tool. The caller owns the pointed document.
|
[in]
|
bd
|
The current
BaseDraw
passed by the tool. The caller owns the pointed
BaseDraw
.
|
[in]
|
win
|
The current
EditorWindow
passed by the tool. The caller owns the pointed
EditorWindow
.
|
[in]
|
msg
|
The message container passed by the tool.
|
-
返回
-
true
if to override the active tool, otherwise
false
.