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

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.