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 ; }
... }

Classes

struct   ToolResizeFalloffData

公共成员函数

  ToolResizeData ()

Input Values

enum   RESIZE_PASS {
   RESIZE_PASS_INIT ,
   RESIZE_PASS_GENERATEFALLOFF ,
   RESIZE_PASS_RESIZE ,
   RESIZE_PASS_END ,
   RESIZE_PASS_RESET
}
enum ToolResizeData::RESIZE_PASS   pass
Int32   delta
Int32   total_delta
Int32   horizontal
BaseContainer data

Result Values

Bool   cross_type
ToolResizeFalloffData   falloff
String   cursor_text

Member Enumeration Documentation

◆  RESIZE_PASS

enum 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()

ToolResizeData ( )

Default constructor.

Member Data Documentation

◆  pass

enum ToolResizeData::RESIZE_PASS pass

[Read-Only]
The resize pass: RESIZE_PASS

◆  delta

Int32 delta

[Read-Only]
The mouse movement delta.

◆  total_delta

Int32 total_delta

[Read-Only]
The mouse movement delta.

◆  horizontal

Int32 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

BaseContainer * data

[Read-Only]
A pointer to the tool's BaseContainer .

◆  cross_type

Bool cross_type

Set to false to disable cross type resizing, where the primary direction the mouse is moved in dictates movement afterwards.

◆  falloff

ToolResizeFalloffData falloff

The radial falloff display preview settings.

◆  cursor_text

String cursor_text

The text to display next to the mouse cursor.

ToolResizeData::falloff
ToolResizeFalloffData falloff
The radial falloff display preview settings.
定义: c4d_baselist.h:317
MDATA_SELECTLIVE_RADIUS
@ MDATA_SELECTLIVE_RADIUS
定义: toolliveselection.h:10
ToolResizeData
定义: c4d_baselist.h:280
Float
maxon::Float Float
定义: ge_sys_math.h:64
MDATA_SOFT_STRENGTH
@ MDATA_SOFT_STRENGTH
定义: toolsoftselection.h:16
ToolResizeData::delta
Int32 delta
[Read-Only] The mouse movement delta.
定义: c4d_baselist.h:292
ToolResizeData::ToolResizeFalloffData::show
Bool show
Set to true to show the falloff for the brush increment to force dirtiness for falloff or custom_shap...
定义: c4d_baselist.h:306
ToolResizeData::data
BaseContainer * data
[Read-Only] A pointer to the tool's BaseContainer.
定义: c4d_baselist.h:295
MDATA_SELECTLIVE_MODE_SOFTSELECTION
@ MDATA_SELECTLIVE_MODE_SOFTSELECTION
定义: toolliveselection.h:26
ToolResizeData::ToolResizeFalloffData::opacity
Float opacity
The opacity of the brush display preview.
定义: c4d_baselist.h:307
BaseContainer::GetFloat
Float GetFloat(Int32 id, Float preset=0.0) const
定义: c4d_basecontainer.h:335
ToolResizeData::RESIZE_PASS_INIT
@ RESIZE_PASS_INIT
Called before resizing starts.
定义: c4d_baselist.h:286
ToolAskMsgData::resize_allowed
Bool resize_allowed
Set to true to accept sizing messages for brushes.
定义: c4d_baselist.h:172
MDATA_SELECTLIVE_MODE
@ MDATA_SELECTLIVE_MODE
定义: toolliveselection.h:23
ToolResizeData::horizontal
Int32 horizontal
[Read-Only] true if a horizontal movement is occurring and cross_type has been set to true in the RE...
定义: c4d_baselist.h:294
ToolAskMsgData
定义: c4d_baselist.h:151
MDATA_VERTEXPAINT_STRENGTH
@ MDATA_VERTEXPAINT_STRENGTH
定义: toolliveselection.h:19
ToolResizeData::pass
enum ToolResizeData::RESIZE_PASS pass
[Read-Only] The resize pass: RESIZE_PASS
ToolResizeData::RESIZE_PASS_RESIZE
@ RESIZE_PASS_RESIZE
Called during the resizing process.
定义: c4d_baselist.h:288
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
MSG_TOOL_ASK
#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
ToolResizeData::cross_type
Bool cross_type
Set to false to disable cross type resizing, where the primary direction the mouse is moved in dictat...
定义: c4d_baselist.h:300
BaseContainer::SetFloat
void SetFloat(Int32 id, Float r)
定义: c4d_basecontainer.h:533
向量
maxon::Vec3< maxon::Float64, 1 > Vector
定义: ge_math.h:145
MSG_TOOL_RESIZE
#define MSG_TOOL_RESIZE
Sent during MMB (MMB (Middle Mouse Button) dragging and the [ and ] shortcuts with brushes if ToolAsk...
定义: c4d_baselist.h:489
maxon::Mat3::off
V off
The translation vector.
定义: matrix.h:279
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
MDATA_SELECTLIVE_MODE_NORMAL
@ MDATA_SELECTLIVE_MODE_NORMAL
定义: toolliveselection.h:24
ToolResizeData::ToolResizeFalloffData::size
Float size
The size of the brush display preview.
定义: c4d_baselist.h:308
BaseContainer::GetInt32
Int32 GetInt32(Int32 id, Int32 preset=0) const
定义: c4d_basecontainer.h:303
BaseDocument
定义: c4d_basedocument.h:490
BaseContainer
定义: c4d_basecontainer.h:46
ToolResizeData::ToolResizeFalloffData::position
Matrix position
The center of the falloff, just use Matrix::off for 2D brushes.
定义: c4d_baselist.h:311