DescriptionToolData Class Reference

abstract

#include <c4d_descriptiondialog.h>

Inheritance diagram for DescriptionToolData:
Inheritance graph
[ legend ]

详细描述

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

Protected Attributes

Bool   firstaction
Int32   last_dirty

Init/Free Tool

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

描述

virtual Bool   GetDDescription ( BaseDocument *doc, BaseContainer &data, 描述 *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)

消息

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

杂项

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

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 (void)
virtual SubDialog AllocSubDialog ( 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)
void  Destructor (void)

成员函数文档编制

◆  InitTool()

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

Called each time the tool is selected.

参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.
[in] bt The calling thread. Can be nullptr . Cinema 4D owns the pointed thread.
返回
true if successful, otherwise false .

Reimplemented from ToolData .

Reimplemented in BrushToolData ,和 SculptBrushToolData .

◆  FreeTool()

virtual void FreeTool ( BaseDocument doc ,
BaseContainer data  
)
virtual

Called each time the user chooses another tool.

参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.

Reimplemented from ToolData .

Reimplemented in BrushToolData ,和 SculptBrushToolData .

◆  GetDDescription()

virtual Bool GetDDescription ( BaseDocument doc ,
BaseContainer data ,
描述 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);
参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.
[in,out] description The node's description to add the parameters to. Cinema 4D owns the pointed description.
[in,out] flags The flags for the description operation: DESCFLAGS_DESC
返回
true if successful, otherwise false . It is recommended to include a call to the parent function as last return.

Reimplemented from ToolData .

Reimplemented in BrushToolData ,和 SculptBrushToolData .

◆  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);
参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.
[in] id The ID of the parameter.
[in] t_data The parameter data. Cinema 4D owns the pointed data.
[in] flags Not used.
[in] itemdesc The parameter's description, encoded to a container as described in 描述 .
返回
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 BrushToolData ,和 SculptBrushToolData .

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

参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.
[in] id The source description ID.
[out] res_id Assign the target description ID.
[out] res_at Assign the target object.
返回
true if successful, otherwise false .

Reimplemented from ToolData .

Reimplemented in SculptBrushToolData .

◆  Message()

virtual Bool 消息 ( 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.

另请参阅
C4DAtom::Message
注意
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.
参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.
[in] type The message type: MSG
[in,out] t_data The message data. The sender owns the pointed data.
返回
true or false depending on the message type .

Reimplemented from ToolData .

Reimplemented in BrushToolData ,和 SculptBrushToolData .

◆  GetResourceSymbol()

virtual const String GetResourceSymbol ( )
pure virtual

Called to return the resource symbol of the tool.

返回
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 描述 Resource for more information.

Reimplemented from ToolData .

◆  GetToolPluginId()

virtual Int32 GetToolPluginId ( )
pure virtual

Called to return the plugin ID of the tool.

返回
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 .

参数
[in] pDoc The active document. Cinema 4D owns the pointed document.
[in] data The tool settings container.

Reimplemented from ToolData .

Reimplemented in BrushToolData ,和 SculptBrushToolData .

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

警告
Be sure to call the parent method as last return if overridden.
参数
[in] doc The active document. Cinema 4D owns the pointed document.
返回
true if successful, otherwise false .

Member Data Documentation

◆  firstaction

Bool firstaction
protected

◆  last_dirty

Int32 last_dirty
protected