#include <sttool.h>


Public Types | |
| enum | a2dOpaqueMode { a2dOpaqueMode_Off = 0x00000000, a2dOpaqueMode_Tool = 0x00000001, a2dOpaqueMode_Tool_FixedStyle = 0x00000002, a2dOpaqueMode_Controller = 0x00000004 } |
| how editing transparency will be handled More... | |
Public Member Functions | |
| a2dStTool (a2dStToolContr *controller) | |
| a2dStTool (const a2dStTool &other, CloneOptions options) | |
| constructor | |
| virtual | ~a2dStTool () |
| destructor | |
| virtual bool | OnPushNewTool (a2dBaseTool *newtool) |
| halts the tool is busy | |
| virtual void | SetActive (bool active=true) |
| set the tool active or inactive. | |
| virtual bool | EnterBusyMode () |
| starts a new action (e.g drawing something ) in a tool that is already pushed. | |
| virtual void | FinishBusyMode (bool closeCommandGroup=true) |
| Called when the user finishes editing a distinct object */. | |
| virtual void | AbortBusyMode () |
| Called when the user aborts editing a distinct object */. | |
| void | AddCurrent (a2dCanvasObject *objectToAdd) |
| add the current canvas object to parent as child | |
| virtual void | Render () |
| implement rendering | |
| void | RenderAnotation () |
| to render the tools its anotation text. | |
| a2dStToolContr * | GetStToolContr () |
| return the staacked tool controller | |
| a2dObjectEditTool * | StartEditTool (a2dCanvasObject *objecttoedit) |
| to start editing tool when wanted | |
| void | SetEditAtEnd (bool editatend) |
| flag for setting editing tool after drawing a primitive. | |
| bool | GetEditAtEnd () |
| see SetEditAtEnd | |
| void | SetOpacityFactorEditcopy (wxUint8 editOpacity) |
| when enabling m_useEditOpaque, this is how transparent the editcopy will be made. | |
| void | SetUseOpaqueEditcopy (a2dOpaqueMode editOpaque) |
| When set true, instead of using a special style for editcopies, a clone of the. | |
| void | SetConnectionGenerator (a2dConnectionGenerator *connectionGenerator) |
| Set class for generating new connection objects between object and pins. | |
| a2dConnectionGenerator * | GetConnectionGenerator () const |
| Get class for generating new connection objects between object and pins. | |
| a2dCanvasObject * | GetOriginal () |
| object to draw or edit | |
| bool | SetContext (a2dIterC &ic, a2dCanvasObject *startObject=NULL) |
| defines the context, relative to which this tools works. | |
Static Public Attributes | |
| static const wxEventType | sm_toolComEventAddObject |
| static const wxEventType | sm_toolComEventSetEditObject |
Protected Member Functions | |
| a2dPin * | FindUnConnectedPin (a2dCanvasObject *root, double x, double y, a2dPinClass *withPinClass=NULL) |
| return the first pin which is not connected at position. | |
| void | MouseToToolWorld (int x, int y, double &xWorldLocal, double &yWorldLocal) |
| calculate world coordinates from devide coordinates | |
| wxRect | GetAbsoluteArea (a2dCanvasObject *object) |
| area occupied by this object | |
| void | GetTextExtent (const wxString &string, wxCoord *w, wxCoord *h, wxCoord *descent=NULL, wxCoord *externalLeading=NULL) |
| return text extends of string | |
| void | OnPaint (wxPaintEvent &event) |
| handler for paint event | |
| void | OnIdle (wxIdleEvent &event) |
| handler for idle events | |
| void | OnUndoEvent (a2dCommandProcessorEvent &event) |
| handler for Undo event | |
| void | OnDoEvent (a2dCommandProcessorEvent &event) |
| handler for Do event | |
| void | OnComEvent (a2dComEvent &event) |
| called when a tool has changed (fill stroke layer spline ) | |
| virtual void | GenerateAnotation () |
| to display a string along with a tool drawing. | |
| void | AddAnotationToPendingUpdateArea () |
| after calculating anotation position and string, extend the boundingbox of the tools with it. | |
| void | GetKeyIncrement (double *xIncr, double *yIncr, bool altDown) |
| get the increments used when moving is done with cursor keys | |
| void | OnKeyDown (wxKeyEvent &event) |
| called on key down events | |
| void | OnKeyUp (wxKeyEvent &event) |
| called on key up events | |
| void | OnChar (wxKeyEvent &event) |
| called on key events | |
| void | OnMouseEvent (wxMouseEvent &event) |
| called on mouse events | |
| virtual void | AdjustRenderOptions () |
| Adjust the rendering options to the needs of this tool. | |
| virtual bool | CreateToolObjects () |
| Create the editcopy and other tool objects (e.g. decorations). | |
| virtual void | CleanupToolObjects () |
| Cleanup the editcopy other tool objects (e.g. decorations). | |
Protected Attributes | |
| wxString | m_anotation |
| anotation string, which is in general modified by the tools to display position etc. | |
| int | m_xanotation |
| x position of anotation text | |
| int | m_yanotation |
| y position of anotation text | |
| int | m_prevxanotation |
| int | m_prevyanotation |
| int | m_x |
| x of mouse in device | |
| int | m_y |
| y of mouse in device | |
| int | m_xprev |
| previous x of mouse in device | |
| int | m_yprev |
| previous y of mouse in device | |
| double | m_xwprev |
| x world coordinates old or new value of mouse | |
| double | m_ywprev |
| y world coordinates old or new value of mouse | |
| int | m_dragstartx |
| x of mouse in device at start drag | |
| int | m_dragstarty |
| y of mouse in device at start drag | |
| bool | m_dragStarted |
| used to indicate that a first drag event has arrived. | |
| a2dCanvasObjectPtr | m_canvasobject |
| This is the object currently edited. | |
| a2dCanvasObjectPtr | m_original |
| This is the original object selected for editing. | |
| a2dStToolContr * | m_stcontroller |
| controller for canvas | |
| a2dConnectionGenerator * | m_connectionGenerator |
| Use this connection generator for wires and pins. | |
| bool | m_renderOriginal |
| if yes, the original object is rendered in place | |
| bool | m_renderEditcopy |
| if yes, the editcopy is rendered in place | |
| bool | m_renderEditcopyOnTop |
| if yes, the editcopy is rendered on top in usual style | |
| bool | m_renderEditcopyEdit |
| if yes, the editcopy is rendered on top in edit style | |
| bool | m_renderEditcopyRectangle |
| if yes, the editcopy is rendered on top as bounding box rectangle | |
| bool | m_editatend |
| when drawing something editing must follow, using the a2dRecursiveEditTool | |
| wxUint8 | m_editOpacityFactor |
| when using cloned style for editcopy, use this opacity. | |
| a2dOpaqueMode | m_useEditOpaque |
| when true editcopies are using a half transparent cloned style. | |
Friends | |
| class | a2dStToolEvtHandler |
| class | a2dStToolFixedToolStyleEvtHandler |
Those are controlled by a a2dStToolContr class. Those type of tools understand zooming and stacked redraw.
Definition at line 113 of file sttool.h.
how editing transparency will be handled
| a2dStTool::a2dStTool | ( | a2dStToolContr * | controller | ) |
| controller | Pointer to a a2dStToolContr controller. |
Definition at line 795 of file sttool.cpp.
| void a2dStTool::SetActive | ( | bool | active = true |
) | [virtual] |
set the tool active or inactive.
If the tool needs initializing after it was inactive for a while, override this function to re-initialize the tool. This function can be used to distribute its settings for style etc. to the documents
Reimplemented from a2dBaseTool.
Reimplemented in a2dObjectEditTool, a2dMultiEditTool, and a2dDrawWirePolylineLTool.
Definition at line 903 of file sttool.cpp.
| bool a2dStTool::EnterBusyMode | ( | ) | [virtual] |
starts a new action (e.g drawing something ) in a tool that is already pushed.
Opens a new a2dCommandGroup, which will be closed at the end of an action. This is normally in FinishBusyMode(), but might be delayed when other tools are pushed, like the edit tool to further edit the drawn figure. This should become part of the same command group.
Reimplemented from a2dBaseTool.
Reimplemented in a2dObjectEditTool, a2dSimpleEditPolygonTool, a2dStDrawTool, a2dDragTool, a2dDragNewTool, a2dRotateTool, a2dDrawWirePolylineLTool, a2dDragMultiTool, and a2dFastDragMultiTool.
Definition at line 950 of file sttool.cpp.
| void a2dStTool::FinishBusyMode | ( | bool | closeCommandGroup = true |
) | [virtual] |
Called when the user finishes editing a distinct object */.
GetActive You should call the base class (this) version at the END of your function
Reimplemented from a2dBaseTool.
Reimplemented in a2dStDrawTool, a2dDragTool, a2dDragNewTool, a2dRotateTool, a2dDrawWirePolylineLTool, and a2dDragMultiTool.
Definition at line 964 of file sttool.cpp.
| void a2dStTool::AbortBusyMode | ( | ) | [virtual] |
Called when the user aborts editing a distinct object */.
Reimplemented from a2dBaseTool.
Reimplemented in a2dObjectEditTool, a2dSimpleEditPolygonTool, a2dStDrawTool, a2dDragTool, a2dRotateTool, a2dDrawWirePolylineLTool, a2dDragMultiTool, and a2dFastDragMultiTool.
Definition at line 980 of file sttool.cpp.
| void a2dStTool::AddCurrent | ( | a2dCanvasObject * | objectToAdd | ) |
add the current canvas object to parent as child
| objectToAdd | this is the object to add to the current parentobject |
Definition at line 890 of file sttool.cpp.
| void a2dStTool::Render | ( | ) | [virtual] |
implement rendering
in general is rendering for tools just to draw/render m_canvasobject when set.
Reimplemented from a2dBaseTool.
Reimplemented in a2dObjectEditTool, a2dMasterDrawZoomFirst, a2dDragTool, a2dDragMultiTool, a2dStDrawToolFast, a2dZoomFast, a2dFastSelect, and a2dFastDragMultiTool.
Definition at line 1186 of file sttool.cpp.
| void a2dStTool::RenderAnotation | ( | ) |
to render the tools its anotation text.
Tools can have a line of text displayed while in action, this is done in pixel size.
Definition at line 1263 of file sttool.cpp.
| a2dStToolContr* a2dStTool::GetStToolContr | ( | ) | [inline] |
return the staacked tool controller
this cast is save, because a2dStTool takes a a2dStToolContr as constructor argument
| void a2dStTool::SetEditAtEnd | ( | bool | editatend | ) | [inline] |
| void a2dStTool::SetOpacityFactorEditcopy | ( | wxUint8 | editOpacity | ) | [inline] |
| void a2dStTool::SetUseOpaqueEditcopy | ( | a2dOpaqueMode | editOpaque | ) | [inline] |
When set true, instead of using a special style for editcopies, a clone of the.
fill and stroke of the original are made, and used for the editcopy, but its transparancy is set using m_editOpacityFactor. The effect is that when dragging such an object, that in the editcopy mode, a half transparent object is shown.
| bool a2dStTool::SetContext | ( | a2dIterC & | ic, | |
| a2dCanvasObject * | startObject = NULL | |||
| ) |
defines the context, relative to which this tools works.
The more advanged usage of tools is in situation where the tools is used inside a2dCanvasObjects. So the context a2dIterC is in such a situation relative to that object its position.
Reimplemented in a2dObjectEditTool.
Definition at line 855 of file sttool.cpp.
| a2dPin * a2dStTool::FindUnConnectedPin | ( | a2dCanvasObject * | root, | |
| double | x, | |||
| double | y, | |||
| a2dPinClass * | withPinClass = NULL | |||
| ) | [protected] |
return the first pin which is not connected at position.
if withPinClass is set, the pin must have this pinclass. Else m_connectionGenerator->GetPinClassForTask( pin->GetPinClass(), obj ) must be oke, or if no m_connectionGenerator was set, the pin is returned without a check.
Definition at line 1445 of file sttool.cpp.
| bool a2dStTool::CreateToolObjects | ( | ) | [protected, virtual] |
Create the editcopy and other tool objects (e.g. decorations).
m_original must be set before this function is called
Reimplemented in a2dObjectEditTool, a2dSimpleEditPolygonTool, a2dStDrawTool, a2dSelectTool, a2dDragTool, a2dCopyTool, a2dDragMultiTool, a2dStDrawToolFast, a2dFastDragMultiTool, a2dDrawRectangleToolFast, a2dDrawCircleToolFast, a2dDrawPolygonLToolFast, and a2dDrawPolylineLToolFast.
Definition at line 1053 of file sttool.cpp.
a2dCanvasObjectPtr a2dStTool::m_canvasobject [protected] |
a2dCanvasObjectPtr a2dStTool::m_original [protected] |
bool a2dStTool::m_renderEditcopy [protected] |