DescriptionToolData Class Referenceabstract

#include <c4d_descriptiondialog.h>

Inheritance diagram for DescriptionToolData:

Detailed Description

A specialized data class for creating modeling tool plugins.
Implements InitDefaultSettings, GetDDescription, GetDEnabling and Message to support stuff like Transform/Apply. Be sure to call the parent versions if these functions are overridden.
Use RegisterToolPlugin() to register a description tool plugin.

Protected Attributes

Bool modeChanged
 
Bool firstaction
 
Int32 last_dirty
 

Miscellaneous

static constexpr Int32 MSG_TOOL_SYSTEM_HOOK_INIT
 
static constexpr Int32 MSG_TOOL_SYSTEM_HOOK_FREE
 
virtual const String GetResourceSymbol ()=0
 
virtual Int32 GetToolPluginId ()=0
 
virtual void InitDefaultSettings (BaseDocument *pDoc, BaseContainer &data)
 
Bool InteractiveModeling_Restart (BaseDocument *doc)
 

Init/Free Tool

virtual Bool InitTool (BaseDocument *doc, BaseContainer &data, BaseThread *bt)
 
virtual void FreeTool (BaseDocument *doc, BaseContainer &data)
 

Description

virtual Bool GetDDescription (BaseDocument *doc, BaseContainer &data, Description *description, DESCFLAGS_DESC &flags)
 
virtual Bool GetDEnabling (BaseDocument *doc, BaseContainer &data, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
 
virtual Bool TranslateDescID (BaseDocument *doc, BaseContainer &data, const DescID &id, DescID &res_id, C4DAtom *&res_at)
 

Message

virtual Bool Message (BaseDocument *doc, BaseContainer &data, Int32 type, void *t_data)
 

Additional Inherited Members

- Public Member Functions inherited from ToolData
virtual Bool MouseInput (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg)
 
virtual Bool KeyboardInput (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg)
 
virtual TOOLDRAW Draw (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, BaseDrawHelp *bh, BaseThread *bt, TOOLDRAWFLAGS flags)
 
virtual Bool DisplayControl (BaseDocument *doc, BaseObject *op, BaseObject *chainstart, BaseDraw *bd, BaseDrawHelp *bh, ControlDisplayStruct &cds) const
 
virtual Bool InitDisplayControl (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, const AtomArray *active)
 
virtual void FreeDisplayControl ()
 
virtual SubDialogAllocSubDialog (BaseContainer *bc)
 
virtual Bool DoCommand (ModelingCommandData &mdat)
 
virtual Bool GetCursorInfo (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, Float x, Float y, BaseContainer &bc)
 
virtual Int32 GetState (BaseDocument *doc)
 
virtual Bool GetDParameter (BaseDocument *doc, BaseContainer &data, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
 
virtual Bool SetDParameter (BaseDocument *doc, BaseContainer &data, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData ()
 
void Destructor ()
 

Member Function Documentation

◆ InitTool()

virtual Bool InitTool ( BaseDocument doc,
BaseContainer data,
BaseThread bt 
)
virtual

Called each time the tool is selected.

Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.
[in]btThe calling thread. Can be nullptr. Cinema 4D owns the pointed thread.
Returns
true if successful, otherwise false.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData, and BrushToolData.

◆ FreeTool()

virtual void FreeTool ( BaseDocument doc,
BaseContainer data 
)
virtual

Called each time the user chooses another tool.

Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData, and BrushToolData.

◆ GetDDescription()

virtual Bool GetDDescription ( BaseDocument doc,
BaseContainer data,
Description description,
DESCFLAGS_DESC flags 
)
virtual

Called to add parameters to the description for the tool.
Modify the passed description as needed, set the appropriate flags and then make sure to include a call to the parent at the end:

return SUPER::GetDescription(data, description, flags, parentdescription);
PyCompilerFlags * flags
Definition: ast.h:14
Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.
[in,out]descriptionThe node's description to add the parameters to. Cinema 4D owns the pointed description.
[in,out]flagsThe flags for the description operation: DESCFLAGS_DESC
Returns
true if successful, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData, and BrushToolData.

◆ GetDEnabling()

virtual Bool GetDEnabling ( BaseDocument doc,
BaseContainer data,
const DescID id,
const GeData t_data,
DESCFLAGS_ENABLE  flags,
const BaseContainer itemdesc 
)
virtual

Called to decide which description parameters should be enabled or disabled.
Can be used both for parameters that are stored in the tool's description and for dynamic parameters.
Read the passed t_data if the right id was provided, and return true to enable the parameter or false to disable it. Then make sure to include a call to the parent at the end:

return SUPER::GetDEnabling(data, id, t_data, flags, itemdesc);
Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.
[in]idThe ID of the parameter.
[in]t_dataThe parameter data. Cinema 4D owns the pointed data.
[in]flagsNot used.
[in]itemdescThe parameter's description, encoded to a container as described in Description.
Returns
true if the parameter should be enabled, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData, and BrushToolData.

◆ TranslateDescID()

virtual Bool TranslateDescID ( BaseDocument doc,
BaseContainer data,
const DescID id,
DescID res_id,
C4DAtom *&  res_at 
)
virtual

Called by the Attribute Manager for every object and every description ID.
Gives the opportunity to route a description ID in the description of a tool to another one.

Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.
[in]idThe source description ID.
[out]res_idAssign the target description ID.
[out]res_atAssign the target object.
Returns
true if successful, otherwise false.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData.

◆ Message()

virtual Bool Message ( BaseDocument doc,
BaseContainer data,
Int32  type,
void *  t_data 
)
virtual

Called when a tool receives messages.
For example description messages such as MSG_DESCRIPTION_COMMAND are sent here.

See also
C4DAtom::Message
Note
Some notification messages are automatically passed along to branches: MSG_POINTS_CHANGED, MSG_POLYGONS_CHANGED and MSG_SEGMENTS_CHANGED. This is for convenience and historical reasons.
Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.
[in]typeThe message type: MSG
[in,out]t_dataThe message data. The sender owns the pointed data.
Returns
true or false depending on the message type.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData, and BrushToolData.

◆ GetResourceSymbol()

virtual const String GetResourceSymbol ( )
pure virtual

Called to return the resource symbol of the tool.

Returns
The name of the description resource file to use for the plugin without .res extension, for example "Toolname".
The name has to be unique, i.e. "Tdisplay" cannot be used for two different descriptions. See Description Resource for more information.

Reimplemented from ToolData.

◆ GetToolPluginId()

virtual Int32 GetToolPluginId ( )
pure virtual

Called to return the plugin ID of the tool.

Returns
The tool plugin ID. This should be the same as the ID used with RegisterToolPlugin.

◆ InitDefaultSettings()

virtual void InitDefaultSettings ( BaseDocument pDoc,
BaseContainer data 
)
virtual

Called to initialize the default tool settings in data.

Parameters
[in]pDocThe active document. Cinema 4D owns the pointed document.
[in]dataThe tool settings container.

Reimplemented from ToolData.

Reimplemented in SculptBrushToolData, and BrushToolData.

◆ InteractiveModeling_Restart()

Bool InteractiveModeling_Restart ( BaseDocument doc)

Called when the interactive modeling is restarted.
Applies the last modeling undo so that new values of the modeling tool can be applied (by calling the global function InteractiveModeling_Restart()).

Warning
Be sure to call the parent method as last return if overridden.
Parameters
[in]docThe active document. Cinema 4D owns the pointed document.
Returns
true if successful, otherwise false.

Member Data Documentation

◆ modeChanged

Bool modeChanged
protected

◆ firstaction

Bool firstaction
protected

◆ last_dirty

Int32 last_dirty
protected

◆ MSG_TOOL_SYSTEM_HOOK_INIT

constexpr Int32 MSG_TOOL_SYSTEM_HOOK_INIT
staticconstexpr

@markprivate

Since
S26.000

◆ MSG_TOOL_SYSTEM_HOOK_FREE

constexpr Int32 MSG_TOOL_SYSTEM_HOOK_FREE
staticconstexpr

@markprivate

Since
S26.000