-
首页
-
C4D R23.110 C++ SDK
ToolResizeData Struct Reference
#include <c4d_baselist.h>
详细描述
Message struct for the
MSG_TOOL_RESIZE
message.
Sent during MMB (Middle Mouse Button) dragging and the [ and ] shortcuts with brushes if
ToolAskMsgData::resize_allowed
被设为
true
by the developer.
Here is an example from the
Live Selection tool
to show how it works:
Bool
LiveSelectionTool::Message(
BaseDocument
*doc,
BaseContainer
&
data
,
Int32
type,
void
*t_data)
{
switch
(type)
{
case
MSG_TOOL_ASK
:
{
ToolAskMsgData
*a = (
ToolAskMsgData
*)t_data;
a->
resize_allowed
=
true
;
}
break
;
case
MSG_TOOL_RESIZE
:
{
ToolResizeData
*d = (
ToolResizeData
*)t_data;
if
(!d || !d->
data
)
return
false
;
switch
(d->
pass
)
{
case
ToolResizeData::RESIZE_PASS_INIT
:
{
d->
falloff
.
show
= d->
cross_type
= d->
data
->
GetInt32
(
MDATA_SELECTLIVE_MODE
) !=
MDATA_SELECTLIVE_MODE_NORMAL
;
d->
falloff
.
size
= d->
data
->
GetFloat
(
MDATA_SELECTLIVE_RADIUS
);
d->
falloff
.
opacity
= d->
data
->
GetFloat
(
MDATA_SOFT_STRENGTH
);
d->
falloff
.
position
.
off
=
向量
(mousex, mousey, 0.0);
}
break
;
case
ToolResizeData::RESIZE_PASS_RESIZE
:
{
if
(d->
horizontal
)
{
d->
falloff
.
size
= d->
data
->
GetFloat
(
MDATA_SELECTLIVE_RADIUS
);
d->
falloff
.
size
+= d->
delta
;
if
(d->
falloff
.
size
< 0.0) d->
falloff
.
size
= 0.0;
if
(d->
falloff
.
size
> 1000.0) d->
falloff
.
size
= 1000.0;
d->
data
->
SetFloat
(
MDATA_SELECTLIVE_RADIUS
, d->
falloff
.
size
);
}
else
{
if
(d->
data
->
GetInt32
(
MDATA_SELECTLIVE_MODE
) ==
MDATA_SELECTLIVE_MODE_SOFTSELECTION
)
{
d->
falloff
.
opacity
= d->
data
->
GetFloat
(
MDATA_SOFT_STRENGTH
);
d->
falloff
.
opacity
+=
Float
(d->
delta
) * 0.01;
d->
falloff
.
opacity
= FCut(d->
falloff
.
opacity
, 0.0, 1.0);
d->
data
->
SetFloat
(
MDATA_SOFT_STRENGTH
, d->
falloff
.
opacity
);
}
else
{
d->
falloff
.
opacity
= d->
data
->
GetFloat
(
MDATA_VERTEXPAINT_STRENGTH
);
d->
falloff
.
opacity
+=
Float
(d->
delta
) * 0.01;
d->
falloff
.
opacity
= FCut(d->
falloff
.
opacity
, 0.0, 1.0);
d->
data
->
SetFloat
(
MDATA_VERTEXPAINT_STRENGTH
, d->
falloff
.
opacity
);
}
}
}
break
;
default
:
break
;
}
}
break
;
}
...
}
Member Enumeration Documentation
◆
RESIZE_PASS
Enumerator
|
RESIZE_PASS_INIT
|
Called before resizing starts.
|
RESIZE_PASS_GENERATEFALLOFF
|
Called when a custom falloff needs to be generated.
|
RESIZE_PASS_RESIZE
|
Called during the resizing process.
|
RESIZE_PASS_END
|
Called to end the resizing process.
|
RESIZE_PASS_RESET
|
Called to reset resizing (user canceled action).
|
构造函数 & 析构函数文档编制
◆
ToolResizeData()
Default constructor.
Member Data Documentation
◆
pass
[Read-Only]
The resize pass:
RESIZE_PASS
◆
delta
[Read-Only]
The mouse movement delta.
◆
total_delta
[Read-Only]
The mouse movement delta.
◆
horizontal
[Read-Only]
true
if a horizontal movement is occurring and
cross_type
has been set to
true
在
RESIZE_PASS_INIT
pass by the user.
◆
data
[Read-Only]
A pointer to the tool's
BaseContainer
.
◆
cross_type
Set to
false
to disable cross type resizing, where the primary direction the mouse is moved in dictates movement afterwards.
◆
falloff
The radial falloff display preview settings.
◆
cursor_text
The text to display next to the mouse cursor.
maxon::Float Float
定义:
ge_sys_math.h:64
Float GetFloat(Int32 id, Float preset=0.0) const
定义:
c4d_basecontainer.h:335
maxon::Int32 Int32
定义:
ge_sys_math.h:58
#define MSG_TOOL_ASK
Sent to tools on mouse input to query them on whether they accept/use certain input such as modifier ...
定义:
c4d_baselist.h:487
void SetFloat(Int32 id, Float r)
定义:
c4d_basecontainer.h:533
maxon::Vec3< maxon::Float64, 1 > Vector
定义:
ge_math.h:145
#define MSG_TOOL_RESIZE
Sent during MMB (MMB (Middle Mouse Button) dragging and the [ and ] shortcuts with brushes if ToolAsk...
定义:
c4d_baselist.h:489
V off
The translation vector.
定义:
matrix.h:279
maxon::Bool Bool
定义:
ge_sys_math.h:53
Int32 GetInt32(Int32 id, Int32 preset=0) const
定义:
c4d_basecontainer.h:303
定义:
c4d_basedocument.h:490
定义:
c4d_basecontainer.h:46