BrushToolData Class Reference

#include <lib_ca.h>

Inheritance diagram for BrushToolData:

Detailed Description

Lets implement custom CA brushes. Normally it is only needed to implement MouseInputStart(), MouseInputDrag() and MouseInputEnd() functions, since the rest have default implementations in BrushBase.
There are other helper functions in BrushBase as well, available through the m_pBrushBase pointer.

Public Member Functions

 BrushToolData ()
 
 ~BrushToolData ()
 
- Public Member Functions inherited from DescriptionToolData
virtual Bool TranslateDescID (BaseDocument *doc, BaseContainer &data, const DescID &id, DescID &res_id, C4DAtom *res_at)
 
virtual const String GetResourceSymbol ()=0
 
virtual Int32 GetToolPluginId ()=0
 
Bool InteractiveModeling_Restart (BaseDocument *doc)
 
- Public Member Functions inherited from ToolData
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)
 
virtual Bool InitDisplayControl (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, const AtomArray *active)
 
virtual void FreeDisplayControl (void)
 
virtual SubDialogAllocSubDialog (BaseContainer *bc)
 
virtual Bool DoCommand (ModelingCommandData &mdat)
 
virtual Int32 GetState (BaseDocument *doc)
 
virtual Bool GetDParameter (BaseDocument *doc, BaseContainer &data, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData (void)
 
void Destructor (void)
 

Public Attributes

BrushBasem_pBrushBase
 

Overloads

virtual Bool InitTool (BaseDocument *doc, BaseContainer &data, BaseThread *bt)
 
virtual void FreeTool (BaseDocument *doc, BaseContainer &data)
 
virtual void InitDefaultSettings (BaseDocument *doc, BaseContainer &data)
 
virtual Bool GetDEnabling (BaseDocument *doc, BaseContainer &data, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
 
virtual Bool SetDParameter (BaseDocument *doc, BaseContainer &data, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 
virtual Bool GetDDescription (BaseDocument *doc, BaseContainer &data, Description *description, DESCFLAGS_DESC &flags)
 
virtual Bool Message (BaseDocument *doc, BaseContainer &data, Int32 type, void *t_data)
 
virtual Bool GetCursorInfo (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, Float x, Float y, BaseContainer &bc)
 
virtual Bool MouseInput (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg)
 

Mouse Input

virtual Bool MouseInputStart (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg, Int32 &flags)
 
virtual Bool MouseInputDrag (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg, BrushVertexData *vdata, Int32 vcnt, Float x, Float y, Int32 &flags)
 
virtual Bool MouseInputEnd (BaseDocument *doc, BaseContainer &data, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg)
 

Additional Inherited Members

- Protected Attributes inherited from DescriptionToolData
Bool firstaction
 
Int32 last_dirty
 

Constructor & Destructor Documentation

§ BrushToolData()

§ ~BrushToolData()

Member Function Documentation

§ InitTool()

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

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from DescriptionToolData.

§ FreeTool()

virtual void FreeTool ( BaseDocument doc,
BaseContainer data 
)
virtual

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from DescriptionToolData.

§ InitDefaultSettings()

virtual void InitDefaultSettings ( BaseDocument doc,
BaseContainer data 
)
virtual

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from DescriptionToolData.

§ GetDEnabling()

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

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from DescriptionToolData.

§ SetDParameter()

virtual Bool SetDParameter ( BaseDocument doc,
BaseContainer data,
const DescID id,
const GeData t_data,
DESCFLAGS_SET flags 
)
virtual

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from ToolData.

§ GetDDescription()

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

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from DescriptionToolData.

§ Message()

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

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from DescriptionToolData.

§ GetCursorInfo()

virtual Bool GetCursorInfo ( BaseDocument doc,
BaseContainer data,
BaseDraw bd,
Float  x,
Float  y,
BaseContainer bc 
)
virtual

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from ToolData.

§ MouseInput()

virtual Bool MouseInput ( BaseDocument doc,
BaseContainer data,
BaseDraw bd,
EditorWindow win,
const BaseContainer msg 
)
virtual

Implemented by BrushBase. Normally there is no need to overload this function.

Reimplemented from ToolData.

§ MouseInputStart()

virtual Bool MouseInputStart ( BaseDocument doc,
BaseContainer data,
BaseDraw bd,
EditorWindow win,
const BaseContainer msg,
Int32 flags 
)
virtual

Called at the start of mouse input. Initialize any data needed for the drag and set any flags needed.

Parameters
[in]docThe document.
[in]dataThe data.
[in]bdThe base draw.
[in]winThe editor window.
[in]msgThe input message.
[in]flagsThe flags. Add the flags needed with the |= operator: BRUSHBASE_MOUSE_FLAG
Returns
true if successful, otherwise false.

§ MouseInputDrag()

virtual Bool MouseInputDrag ( BaseDocument doc,
BaseContainer data,
BaseDraw bd,
EditorWindow win,
const BaseContainer msg,
BrushVertexData vdata,
Int32  vcnt,
Float  x,
Float  y,
Int32 flags 
)
virtual

Called during mouse drag.

Parameters
[in]docThe document.
[in]dataThe data.
[in]bdThe base draw.
[in]winThe editor window.
[in]msgThe input message.
[in]vdataThe brush vertex data.
[in]vcntThe brush vertex count.
[in]xThe mouse X position.
[in]yThe mouse Y position.
[in]flagsThe flags. Add the flags needed with the |= operator: BRUSHBASE_MOUSE_FLAG
Returns
true if successful, otherwise false.

§ MouseInputEnd()

virtual Bool MouseInputEnd ( BaseDocument doc,
BaseContainer data,
BaseDraw bd,
EditorWindow win,
const BaseContainer msg 
)
virtual

Called after mouse drag. Free any data no longer needed.

Parameters
[in]docThe document.
[in]dataThe data.
[in]bdThe base draw.
[in]winThe editor window.
[in]msgThe input message.
Returns
true if successful, otherwise false.

Member Data Documentation

§ m_pBrushBase

BrushBase* m_pBrushBase