ToolResizeData Struct Reference

#include <c4d_baselist.h>

Detailed Description

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 is set to 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)
{
{
a->resize_allowed = true;
}
break;
{
if (!d || !d->data)
return false;
switch (d->pass)
{
{
d->falloff.position.off = Vector(mousex, mousey, 0.0);
}
break;
{
if (d->horizontal)
{
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;
}
else
{
{
d->falloff.opacity += Float(d->delta) * 0.01;
d->falloff.opacity = FCut(d->falloff.opacity, 0.0, 1.0);
}
else
{
d->falloff.opacity += Float(d->delta) * 0.01;
d->falloff.opacity = FCut(d->falloff.opacity, 0.0, 1.0);
}
}
}
break;
default: break;
}
}
break;
}
...
}
Definition: c4d_basecontainer.h:48
Float GetFloat(Int32 id, Float preset=0.0) const
Definition: c4d_basecontainer.h:380
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:615
Int32 GetInt32(Int32 id, Int32 preset=0) const
Definition: c4d_basecontainer.h:348
Definition: c4d_basedocument.h:497
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:141
maxon::Bool Bool
Definition: ge_sys_math.h:51
maxon::Int32 Int32
Definition: ge_sys_math.h:56
maxon::Float Float
Definition: ge_sys_math.h:62
#define MSG_TOOL_RESIZE
Sent during MMB (MMB (Middle Mouse Button) dragging and the [ and ] shortcuts with brushes if ToolAsk...
Definition: c4d_baselist.h:539
#define MSG_TOOL_ASK
Sent to tools on mouse input to query them on whether they accept/use certain input such as modifier ...
Definition: c4d_baselist.h:534
PyObject ** type
Definition: pycore_pyerrors.h:34
const char * doc
Definition: pyerrors.h:226
Definition: c4d_baselist.h:171
Bool resize_allowed
Set to true to accept sizing messages for brushes.
Definition: c4d_baselist.h:191
Bool show
Set to true to show the falloff for the brush increment to force dirtiness for falloff or custom_shap...
Definition: c4d_baselist.h:325
Float size
The size of the brush display preview.
Definition: c4d_baselist.h:327
Matrix position
The center of the falloff, just use Matrix::off for 2D brushes.
Definition: c4d_baselist.h:330
Float opacity
The opacity of the brush display preview.
Definition: c4d_baselist.h:326
Definition: c4d_baselist.h:300
ToolResizeFalloffData falloff
The radial falloff display preview settings.
Definition: c4d_baselist.h:336
enum ToolResizeData::RESIZE_PASS pass
[Read-Only] The resize pass: RESIZE_PASS
@ RESIZE_PASS_INIT
Called before resizing starts.
Definition: c4d_baselist.h:305
@ RESIZE_PASS_RESIZE
Called during the resizing process.
Definition: c4d_baselist.h:307
Int32 delta
[Read-Only] The mouse movement delta.
Definition: c4d_baselist.h:311
Int32 horizontal
[Read-Only] true if a horizontal movement is occurring and cross_type has been set to true in the RE...
Definition: c4d_baselist.h:313
BaseContainer * data
[Read-Only] A pointer to the tool's BaseContainer.
Definition: c4d_baselist.h:314
Bool cross_type
Set to false to disable cross type resizing, where the primary direction the mouse is moved in dictat...
Definition: c4d_baselist.h:319
V off
The translation vector.
Definition: matrix.h:263
@ MDATA_VERTEXPAINT_STRENGTH
Definition: toolliveselection.h:19
@ MDATA_SELECTLIVE_RADIUS
Definition: toolliveselection.h:10
@ MDATA_SELECTLIVE_MODE
Definition: toolliveselection.h:23
@ MDATA_SELECTLIVE_MODE_NORMAL
Definition: toolliveselection.h:24
@ MDATA_SELECTLIVE_MODE_SOFTSELECTION
Definition: toolliveselection.h:26
@ MDATA_SOFT_STRENGTH
Definition: toolsoftselection.h:16

Classes

struct  ToolResizeFalloffData
 

Public Member Functions

 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
 
BaseContainerdata
 

Result Values

Bool cross_type
 
ToolResizeFalloffData falloff
 
String cursor_text
 

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).

Constructor & Destructor Documentation

◆ ToolResizeData()

Default constructor.

Member Data Documentation

◆ 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 in the RESIZE_PASS_INIT pass by the user.

◆ 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

The radial falloff display preview settings.

◆ cursor_text

String cursor_text

The text to display next to the mouse cursor.