wxArt2D
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
a2dObjectEditTool Class Reference

This tool is for editing a single object. More...

#include <edit.h>

Inheritance diagram for a2dObjectEditTool:
Inheritance graph
[legend]
Collaboration diagram for a2dObjectEditTool:
Collaboration graph
[legend]

Public Member Functions

 a2dObjectEditTool (a2dStToolContr *controller, int editmode=1, bool SingleClickToEnd=true)
 constructor More...
 
 a2dObjectEditTool (a2dStToolContr *controller, a2dIterC &ic, int editmode=1, bool SingleClickToEnd=true)
 constructor More...
 
 ~a2dObjectEditTool ()
 destuctor
 
bool SetContext (a2dIterC &ic, a2dCanvasObject *startObject)
 start editing object within the given iteration context its coordinate system More...
 
void StartToEdit (a2dCanvasObject *startObject)
 start editing this object
 
bool ReStartEdit (wxUint16 editmode)
 restart editing (after undo event or when changing editing mode )
 
a2dCanvasObjectGetEditObjectCopy ()
 
virtual void TriggerReStartEdit (wxUint16 editmode)
 trigger restart editing (after undo event or when changing editing mode )
 
bool ZoomSave ()
 save to zoom
 
void SetMode (int mode)
 set editing mode to start editing objects
 
void SetActive (bool active)
 used extarnal by controller to activate or deactivate this tool. More...
 
void SetSingleClickToEnd (bool SingleClickToEnd)
 a single non hit Left Down click is enough to end editing of an object. More...
 
void SetDisableOtherViews (bool disableOtherViews)
 when set true, other views on the document are disabled when editing a object. More...
 
void Render ()
 implement rendering More...
 
- Public Member Functions inherited from a2dStTool
 a2dStTool (a2dStToolContr *controller)
 
 a2dStTool (const a2dStTool &other, CloneOptions options, a2dRefMap *refs)
 constructor
 
virtual ~a2dStTool ()
 destructor
 
virtual bool OnPushNewTool (a2dBaseTool *newtool)
 halts the tool is busy
 
void AddCurrent (a2dCanvasObject *objectToAdd)
 add the current canvas object to parent as child More...
 
void RenderAnotation ()
 to render the tools its anotation text. More...
 
a2dStToolContrGetStToolContr ()
 return the staacked tool controller More...
 
a2dObjectEditToolStartEditTool (a2dCanvasObject *objecttoedit)
 to start editing tool when wanted
 
void SetEditAtEnd (bool editatend)
 flag for setting editing tool after drawing a primitive. More...
 
bool GetEditAtEnd ()
 see SetEditAtEnd
 
void SetOpacityFactorEditcopy (wxUint8 editOpacity)
 when enabling m_useEditOpaque, this is how transparent the editcopy will be made. More...
 
void SetUseOpaqueEditcopy (a2dOpaqueMode editOpaque)
 When set true, instead of using a special style for editcopies, a clone of the. More...
 
void SetConnectionGenerator (a2dConnectionGenerator *connectionGenerator)
 Set class for generating new connection objects between object and pins.
 
a2dConnectionGeneratorGetConnectionGenerator () const
 Get class for generating new connection objects between object and pins.
 
a2dCanvasObjectGetOriginal ()
 object to draw or edit
 
bool SetContext (a2dIterC &ic, a2dCanvasObject *startObject=NULL)
 defines the context, relative to which this tools works. More...
 
void SetStateString (const wxString &message=wxEmptyString, size_t field=0)
 
void SetSnapSourceFeatures (wxUint32 snapSourceFeatures)
 
void SetSnapSourceFeature (a2dRestrictionEngine::a2dSnapToWhat snapSourceFeature, bool value=true)
 set one of the snapping features for the source to true or false, leaf others as is
 
a2dSnapToWhatMask GetSnapSourceFeatures () const
 
void SetSnapTargetFeatures (wxUint32 snapTargetFeatures)
 
void SetSnapTargetFeature (a2dRestrictionEngine::a2dSnapToWhat snapTargetFeature, bool value=true)
 set one of the snapping features for targets to true or false, leaf others as is
 
bool GetSnapTargetFeature (a2dRestrictionEngine::a2dSnapToWhat snapTargetFeature) const
 return the setting of a specific snapping feature
 
a2dSnapToWhatMask GetSnapTargetFeatures () const
 
a2dCanvasObjectGetCanvasObject () const
 
a2dCanvasObjectGetOriginalObject () const
 
- Public Member Functions inherited from a2dBaseTool
bool ProcessEvent (wxEvent &event)
 events recieved from controller processed here More...
 
void SetEvtHandler (a2dObject *handler)
 to reroute events to this event handler
 
a2dObjectGetEventHandler ()
 
 a2dBaseTool (a2dToolContr *controller, const a2dMenuIdItem &initiatingMenuId=CmdMenu_NoMenu())
 construct a new tool for the given controller.
 
 a2dBaseTool (const a2dBaseTool &other, CloneOptions options, a2dRefMap *refs)
 constructor initializing partly from other tool
 
virtual ~a2dBaseTool ()
 destructor
 
a2dBaseToolTClone (CloneOptions options, a2dRefMap *refs=NULL)
 
virtual wxString GetToolString () const
 
virtual bool StartTool (a2dBaseTool *currenttool)
 called to initiate while pushing tool to toolcontroller More...
 
void SetOneShot ()
 Only one action of the tool, after that it will ask the controller to stop this tool.
 
virtual bool AllowPop ()
 tells if a tool can be poped from the stack. More...
 
void StopTool (bool abort=false)
 call to stop a tool, internal and external. More...
 
bool GetStopTool ()
 checked by controller to see if the tool needs to be stopped e.g. after a oneshot. More...
 
bool GetActive ()
 is the tool active? More...
 
bool GetBusy ()
 Check if the tool is busy editing a distinct object */. More...
 
virtual bool EnterBusyModeNoGroup ()
 
void SetFill (const a2dFill &fill)
 set fill if used inside a tool
 
const a2dFillGetFill () const
 get the current fill More...
 
void SetStroke (const a2dStroke &stroke)
 set stroke if used inside a tool
 
const a2dStrokeGetStroke () const
 get the current stroke More...
 
void SetLayer (wxUint16 layer)
 layer set for the object that is drawn using a tool
 
wxUint16 GetLayer ()
 layer set for new objects.
 
void SetShowAnotation (bool show)
 when true anotation will be shown, if used inside a tool More...
 
void SetAnotationFont (const wxFont &font)
 font to use for anotation
 
void SetCursorType (const wxCursor &cursor)
 Sets cursor which the tool should use when started. More...
 
void SetBusyCursorType (const wxCursor &cursor)
 Sets cursor which the tool should use when busy. More...
 
wxCursor GetCursorType ()
 what cursor is used when tool is started
 
wxCursor GetBusyCursorType ()
 what cursor is used when tool is busy
 
int GetMode ()
 can be used to modify the behaviour of the derived tool. More...
 
void SetPending (bool pending=true)
 a tool is set pending when it needs to be redrawn.
 
bool GetPending ()
 return if the tool is set pending for redraw.
 
a2dToolContrGetToolController ()
 to get the tool controller to which this tool is attached.
 
a2dDrawingPartGetDrawingPart ()
 Access to the tool controllers drawer.
 
a2dDrawer2DGetDrawer2D ()
 Access to the tool controllers drawers drawer2d.
 
wxWindow * GetDisplayWindow ()
 Access to the tool controllers drawers canvas.
 
a2dDrawingGetDrawing ()
 Returns a pointer to the drawing.
 
a2dCanvasCommandProcessorGetCanvasCommandProcessor ()
 Returns a pointer to the command processor associated with this document.
 
double GetHitMargin ()
 
virtual void OpenCommandGroup (bool restart)
 called when starting an editing operation (e.g. on mouse down) More...
 
virtual void OpenCommandGroupNamed (const wxString &name)
 called when starting an editing operation with another than the default name
 
virtual void CloseCommandGroup ()
 called when ending an editing operation (e.g. mouse up)
 
a2dCommandGroupGetCommandgroup ()
 return the command group that is open else NULL.
 
wxMenu * GetMousePopupMenu ()
 to get the current mouse menu of the tool More...
 
void SetMousePopupMenu (wxMenu *mousemenu)
 to set the current mouse menu of the tool More...
 
a2dCanvasObjectGetParentObject ()
 parent object relative to which the actions take place. More...
 
void AddEditobject (a2dCanvasObject *object)
 Add an editcopy object to the tool/document.
 
void RemoveEditobject (a2dCanvasObject *object)
 Remove an editcopy object to the tool/document.
 
void AddDecorationObject (a2dCanvasObject *object)
 Add a decoration object to be rendered by the tool. More...
 
void RemoveAllDecorations ()
 remove all object that were added as decorations.
 
void SetIgnorePendingObjects (bool onoff)
 Switches ignorance of pending objects on and off. More...
 
bool GetIgnorePendingObjects ()
 get setting of ignore pending objects /sa GetUpdatesPending()
 
a2dCorridorGetCorridor ()
 get reference to the corridor list
 
void SetCorridor (const a2dCorridor &corridor)
 set a corridor from a list of objects
 
void SetContourWidth (double width)
 
double GetContourWidth () const
 get the Contour width of the shape
 
void ResetContext ()
 context like corridor and parentobject are reset
 
virtual bool RotateObject90LeftRight (bool right)
 rotate object of first tool on the stack, when appropriate.
 
void SetIsEditTool (bool isEditTool)
 
bool GetIsEditTool ()
 
void SetInitiatingMenuId (const a2dMenuIdItem &initiatingMenuId)
 
const a2dMenuIdItemGetInitiatingMenuId ()
 
- Public Member Functions inherited from a2dObject
bool SearchDynamicEventTable (wxEvent &event)
 
void Connect (int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
bool Disconnect (int winid, int lastId, wxEventType eventType, wxObjectEventFunction func=NULL, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
void ProcessConnectedEvent (wxEvent &event)
 wxCHECK_VERSION(2,9,0) More...
 
void ConnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEventAll (wxEvtHandler *eventSink)
 Remove all dynamic events in classA, going to classB (eventSink) More...
 
 a2dObject ()
 constructor
 
virtual ~a2dObject ()
 destructor
 
void operator= (const a2dObject &other)
 assignment operator
 
int GetOwnedBy ()
 like it to be protected, but this does not work with wxList macros More...
 
virtual a2dObjectSetNonDynamic ()
 Call to mark this object as non-dynamic (static/local/auto) More...
 
void CheckReferences ()
 Check zero reference count and delete if count is 0. More...
 
a2dObjectClone (CloneOptions options, a2dRefMap *refs=NULL) const
 create an exact copy of this property
 
 a2dObject (const a2dObject &other, CloneOptions options, a2dRefMap *refs)
 
virtual wxString GetName () const
 Returns the name of this object, if no name is given the internal id will be returned. More...
 
virtual void SetName (const wxString &name)
 Creates the a2dStringProperty PROPID_Name. More...
 
virtual bool IsTemporary_DontSave () const
 Check if this is a temporary object, which should not be saved.
 
void SaveAsDocument (a2dIOHandlerXmlSerOut &out)
 Save this object and all below as an XML document. More...
 
virtual void Save (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
 write all needed to an XML type of file called the CVG format More...
 
void LoadFromDocument (a2dIOHandlerXmlSerIn &parser)
 Load this object and all below from an XML document. More...
 
virtual void Load (wxObject *parent, a2dIOHandlerXmlSerIn &parser)
 load object from CVG file More...
 
wxInt64 GetUniqueSerializationId () const
 return a unique id for this object More...
 
virtual bool AlwaysWriteSerializationId () const
 If true, always write an id. More...
 
virtual bool LinkReference (a2dObject *other)
 link a reference in the object to the given value More...
 
virtual void ResolveInform ()
 inform an object that reference resolution was done More...
 
void Walker (wxObject *parent, a2dWalkerIOHandler &handler)
 This is used to recursively walk through an object tree.
 
void SetCheck (bool check)
 general flag use at will. More...
 
bool GetCheck () const
 general flag use at will.
 
void SetRelease (bool value)
 set release flag More...
 
bool GetRelease () const
 get release flag More...
 
a2dAutoZeroPtr< a2dObject > ** GetAutoZeroPtrList ()
 return the list head pointer for autozero pointers to this object More...
 
 DECLARE_PROPERTIES ()
 
a2dNamedPropertyGetProperty (const a2dPropertyId *propertyId, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 get property on this object More...
 
void SetProperty (a2dNamedProperty *propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object. More...
 
void SetProperty (const a2dNamedProperty &propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object and if enabled, to all childs and object members. More...
 
virtual a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none)
 Find a dynamic property with given id in the property list. More...
 
virtual const a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 Find a dynamic property with given id in the property list. More...
 
virtual bool HasProperty (const a2dPropertyId *id, const wxString &stringvalue=wxEmptyString) const
 Check if the object has a property with given id and string representation. More...
 
virtual void OnPropertyChanged (const a2dPropertyId *id)
 This function is called after a property changed. More...
 
virtual bool EditProperties (const a2dPropertyId *id, bool withUndo=true)
 edit properties of the object More...
 
void TakeOverProperties (a2dObject *from, a2dPropertyIdList *listOfIds)
 Properties in the id list are taken from the given object, en set to this. More...
 
wxURI GetURI () const
 quick way to get to PROPID_URI property More...
 
void SetURI (const wxURI &url)
 quickly set a property PROPID_URI More...
 
const a2dNamedPropertyListGetPropertyList () const
 Get the Property List. More...
 
bool HasDynamicProperties () const
 test if there are dynamic properties in the m_propertylist
 
virtual bool RemoveProperty (const a2dPropertyId *id, bool all=true)
 This function is called by a2dPropertyId to remove a property from the list. More...
 
void RemoveTemporaryProperties ()
 remove all temporary properties
 
virtual bool AddProperty (a2dNamedProperty *property)
 This function is called by a2dPropertyId to add a property to the list. More...
 

Static Public Attributes

static const a2dCommandId COMID_PushTool_ObjectEdit
 push this tool on the tools stack
 
static const a2dSignal sig_toolStartEditObject
 when starting editing an object, this event is sent to tool
 
- Static Public Attributes inherited from a2dStTool
static const a2dSignal sig_toolComEventAddObject = wxNewId()
 
static const a2dSignal sig_toolComEventSetEditObject = wxNewId()
 
- Static Public Attributes inherited from a2dBaseTool
static const a2dSignal sig_toolPushed = wxNewId()
 sent to new first tool when tool was pushed
 
static const a2dSignal sig_toolPoped = wxNewId()
 sent to new first tool when last first tool was poped
 
static const a2dSignal sig_toolBeforePush = wxNewId()
 
static const a2dSignal sig_toolDoPopBeforePush = wxNewId()
 return id after a sig_toolBeforePush, to tell current tool needs to be poped.
 
static const a2dSignal sig_toolComEvent = wxNewId()
 not yet used.
 
static a2dPropertyIdBoolPROPID_Oneshot = NULL
 
static a2dPropertyIdBoolPROPID_Stop = NULL
 
static a2dPropertyIdFillPROPID_Fill = NULL
 
static a2dPropertyIdStrokePROPID_Stroke = NULL
 
static a2dPropertyIdUint16PROPID_Layer = NULL
 
- Static Public Attributes inherited from a2dObject
static a2dPropertyIdBoolPROPID_Check = NULL
 used for linking multiple referenced objects when serializing
 
static a2dPropertyIdUriPROPID_URI = NULL
 attach an URL to the object
 
static a2dPropertyIdStringPROPID_Name = NULL
 Name property, to return name of this object.
 
static a2dPropertyIdVoidPtrPROPID_autozeroptrlist = NULL
 
static const a2dSignal sm_Edit_properties = wxNewId()
 edit properties event, see EditProperties()
 

Protected Member Functions

void DoStopTool (bool abort)
 To stop this tools from inside or from the outside, sets m_stop = true. More...
 
void OnUndoEvent (a2dCommandProcessorEvent &event)
 
void OnRedoEvent (a2dCommandProcessorEvent &event)
 
void OnKeyDown (wxKeyEvent &event)
 
void OnKeyUp (wxKeyEvent &event)
 
void OnChar (wxKeyEvent &event)
 
virtual void AdjustRenderOptions ()
 Adjust the rendering options to the needs of this tool.
 
virtual bool EnterBusyMode ()
 starts a new action (e.g drawing something ) in a tool that is already pushed. More...
 
virtual void FinishBusyMode (bool closeCommandGroup=true)
 Called when the user finishes editing a distinct object */. More...
 
virtual void AbortBusyMode ()
 Called when the user aborts editing a distinct object */. More...
 
void SetEditObject (a2dCanvasObject *objectToEdit)
 send an event with id sig_toolComEventSetEditObject to this tool. More...
 
bool RedirectToEditObject (wxMouseEvent &event)
 redirect event to editng object or to a captured object ( handle or object itself. ) More...
 
virtual bool CreateToolObjects ()
 start editing at m_canvasobject More...
 
virtual void CleanupToolObjects ()
 stop editing of m_canvasobject if busy editing
 
void OnIdle (wxIdleEvent &event)
 
void OnComEvent (a2dComEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void OnDoEvent (a2dCommandProcessorEvent &event)
 
virtual wxString GetCommandGroupName ()
 return the command group name for commands of a derived class More...
 
- Protected Member Functions inherited from a2dStTool
void PrepareForRewire (a2dCanvasObjectList &dragList, bool walkWires=true, bool selected=false, bool stopAtSelectedWire=false, bool CreateExtraWires=true, a2dRefMap *=NULL)
 
void DeselectAll ()
 
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)
 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
 
a2dCanvasObjectFindTaggedObject ()
 
- Protected Member Functions inherited from a2dBaseTool
void OnComEvent (a2dComEvent &event)
 default handler for a2dComEvent event More...
 
void OnDoEvent (a2dCommandProcessorEvent &event)
 
void OnUndoEvent (a2dCommandProcessorEvent &event)
 
void OnRedoEvent (a2dCommandProcessorEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 called on mouse events
 
void OnChar (wxKeyEvent &event)
 called on key events
 
void OnKeyDown (wxKeyEvent &event)
 called on keydown events
 
void OnKeyUp (wxKeyEvent &event)
 called on keyup events
 
- Protected Member Functions inherited from a2dObject
virtual bool DoIgnoreIfNotMember (const a2dPropertyId *id) const
 used to decide if a property shall be ignored, if it is not a member More...
 
virtual void DoWalker (wxObject *parent, a2dWalkerIOHandler &handler)
 iterate over this object and its children More...
 
virtual void DoSave (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
 Save settings.
 
virtual void DoLoad (wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
 Load settings.
 

Protected Attributes

bool m_preserve_select
 preserve the a2dCANVAS_SELECT flag after editing.
 
bool m_SingleClickToEnd
 a single non hit Left Down click is enough to end editing of an object.
 
bool m_disableOtherViews
 
bool m_triggerRestart
 
- Protected Attributes inherited from a2dStTool
a2dSnapToWhatMask m_snapSourceFeatures
 set to the a2dSnapToWhat features enabled by the engine for the source object
 
a2dSnapToWhatMask m_snapTargetFeatures
 set to the a2dSnapToWhat target features enabled by the engine and/or snap source object
 
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. More...
 
a2dCanvasObjectPtr m_original
 This is the original object selected for editing. More...
 
a2dStToolContrm_stcontroller
 controller for canvas
 
a2dConnectionGeneratorm_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 More...
 
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.
 
- Protected Attributes inherited from a2dBaseTool
const a2dMenuIdItemm_initiatingMenuId
 command which initiated the tool, used to seperate commands using the tool
 
wxCursor m_toolcursor
 cursor to use
 
wxCursor m_toolBusyCursor
 cursor to use when the tool is busy doing something.
 
a2dToolContrm_controller
 under control of this toolcontroller, to give me events.
 
bool m_active
 tool is operational
 
wxUint8 m_bussyStopping
 if > 0, the tool is in the process of stopping, which means it can not be poped yet by controller.
 
a2dSmrtPtr< a2dObjectm_eventHandler
 when set called before own event handler More...
 
bool m_ignorePendingObjects
 if set ignore all setting for pendingobjects
 
a2dCorridor m_corridor
 
bool m_isEditTool
 if tool does change drawing
 
- Protected Attributes inherited from a2dObject
a2dNamedPropertyList m_propertylist
 properties
 
int m_refcount
 how many references to this object do exist
 
bool m_check: 1
 used for linking multiple referenced objects when serializing
 
bool m_release: 1
 when set object is treated as being deleted, and wil be deleted in idle time.
 
bool m_recursion_active: 1
 this is used as a recursion stopper
 
bool m_pendingDisconnects: 1
 
unsigned int m_iteratorCount
 
a2dAutoZeroPtr< a2dObject > * m_autozeroptrlist
 this is a list of all a2dAutoZeroPtr object pointing to this object
 

Additional Inherited Members

- Public Types inherited from a2dStTool
enum  a2dOpaqueMode { a2dOpaqueMode_Off = 0x00000000, a2dOpaqueMode_Tool = 0x00000001, a2dOpaqueMode_Tool_FixedStyle = 0x00000002, a2dOpaqueMode_Controller = 0x00000004 }
 how editing transparency will be handled More...
 
- Public Types inherited from a2dObject
enum  CloneOptions {
  clone_members = 0x00000001, clone_properties = 0x00000002, clone_childs = 0x00000004, clone_unused = 0x00000008,
  clone_setoriginal = 0x00000010, clone_seteditcopy = 0x00000020, clone_noReference = 0x00000040, clone_noCameleonRef = 0x00000080,
  clone_toDrag = 0x00000100, clone_flat = 0x00000000, clone_deep = clone_members | clone_properties | clone_childs
}
 options for cloning More...
 
typedef a2dAutoZeroPtr< a2dObjectTAutoZeroPtrListClass
 this is needed inside the smart pointer template code
 
- Public Attributes inherited from a2dBaseTool
bool m_halted
 if a tool is deactivated while m_busy is true, this flag is set
 
bool m_pending
 set when tool needs an redraw (after a a2dCanvas Repaint etc.) More...
 
bool m_oneshot
 do it only once
 
bool m_stop
 stop the tool
 
a2dFill m_fill
 fill for new object
 
a2dStroke m_stroke
 stroke for new object
 
double m_contourwidth
 if != 0 the polygon is contoured at distance m_contourwidth/2
 
wxUint16 m_layer
 layer for a new object
 
bool m_canvas_mouseevents_restore
 used to save the a2dCanvas mouse event setting. More...
 
bool m_anotate
 when true anotation will be shown, if used inside a tool
 
wxFont m_annotateFont
 font to use for anotation
 
int m_mode
 general operation mode setting for a tool.
 
a2dCommandGroupm_commandgroup
 the command group of the command processor
 
wxMenu * m_mousemenu
 popup menu
 
a2dCanvasObjectPtr m_parentobject
 ( if needed ) parent a2dCanvasObject relative to which the tool actions take place.
 
- Protected Types inherited from a2dObject
enum  { refcount_nondynamic = 0x76543210 }
 special refcount value for non-dynamic objects
 

Detailed Description

This tool is for editing a single object.

The object its EditStart member is called, this generates a Clone of the object to be edited. And event processing is redirected to the Cloned object to edit it.

The cloned edit copy, issues commands to the command processor of the document, and this changes the original a2dCanvasObject that is being edited. This then changes to make it in sync with editing clone. Undo is possible because of this, but it is possible to not use commands and choose to directly modify the original object.

After editing is done a double click will call the EditEnd member of the a2dCanvasObject. In the end the Cloned editing object is Released.

If SetSingleClickToEnd() is set, a Left Down mouse event outside the object being edited, also stops editing of the current object, and if subediting it even ends this tool. This makes it easy to go to sublevel editing and back with just one click.

The object itself is in control of all editing facilities of that specific object. This might mean that other tools will be pushed on the tool stack, for editing of subobjects.

The EditStart member initializes the a2dCanvasObject for editing, but only if editing is allowed by it.

The editing Clone will have as children editing handles, which can be dragged in order to modify the object. Those handles depend on the object its editing implementation. Rendering of the Cloned editing object can be changed on the basis of the m_editingCopy flag if needed.

The default editing functionality of a2dCanvasObject, is just editing its local matrix.

The TAB charecter should be used to switch between this mode and the object specific editing mode.

Adding editing functionality to an object is implemented by intercepting events using a static event table. When the m_editingCopy is set, we know it is the cloned edit copy we are dealing with. The events in this case should be handled in such a manner that the edit clone and the original object will be modified. Hits on child objects of the editing clone ( e.g a2dHandle ), may generate new events for the editng clone object itself. a2dHandleMouseEvent is such an event. You can intercept this event in the parent event table like this EVT_CANVASHANDLE_MOUSE_EVENT( OnHandleEvent ). In the OnHandleEvent you can define what change a specific handle will have on the object that is edited.

Definition at line 73 of file edit.h.

Constructor & Destructor Documentation

a2dObjectEditTool::a2dObjectEditTool ( a2dStToolContr controller,
int  editmode = 1,
bool  SingleClickToEnd = true 
)

constructor

Parameters
controllercontroller to which the editing tool was pushed.
editmodestarting editing mode for objects
SingleClickToEndstop editing with a single Left Down, else double click.

Definition at line 1402 of file edit.cpp.

a2dObjectEditTool::a2dObjectEditTool ( a2dStToolContr controller,
a2dIterC ic,
int  editmode = 1,
bool  SingleClickToEnd = true 
)

constructor

Parameters
controllercontroller to which the editing tool was pushed.
iciteration context to setup the corridor
editmodestarting editing mode for objects
SingleClickToEndstop editing with a single Left Down, else double click.

Definition at line 1375 of file edit.cpp.

Member Function Documentation

void a2dObjectEditTool::AbortBusyMode ( )
protectedvirtual

Called when the user aborts editing a distinct object */.

See Also
EnterBusyMode This is supposed to undo aeverything the tool did since entering busy mode

Reimplemented from a2dStTool.

Definition at line 1578 of file edit.cpp.

bool a2dObjectEditTool::CreateToolObjects ( )
protectedvirtual

start editing at m_canvasobject

event to make it possible to set style in for instance modeless style dialog

Reimplemented from a2dStTool.

Definition at line 1733 of file edit.cpp.

void a2dObjectEditTool::DoStopTool ( bool  abort)
protectedvirtual

To stop this tools from inside or from the outside, sets m_stop = true.

The a2dStToolContr will test this with GetStopTool()

Reimplemented from a2dBaseTool.

Reimplemented in a2dMultiEditTool.

Definition at line 1513 of file edit.cpp.

bool a2dObjectEditTool::EnterBusyMode ( )
protectedvirtual

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

Definition at line 1564 of file edit.cpp.

void a2dObjectEditTool::FinishBusyMode ( bool  closeCommandGroup = true)
protectedvirtual

Called when the user finishes editing a distinct object */.

See Also
EnterBusyMode,
GetActive You should call the base class (this) version at the END of your function

Reimplemented from a2dStTool.

Definition at line 1569 of file edit.cpp.

virtual wxString a2dObjectEditTool::GetCommandGroupName ( )
inlineprotectedvirtual

return the command group name for commands of a derived class

this defaults to the class name

Reimplemented from a2dBaseTool.

Reimplemented in a2dRecursiveEditTool.

Definition at line 198 of file edit.h.

bool a2dObjectEditTool::RedirectToEditObject ( wxMouseEvent &  event)
protected

redirect event to editng object or to a captured object ( handle or object itself. )

return if event is processed or not.

Definition at line 1649 of file edit.cpp.

void a2dObjectEditTool::Render ( )
virtual

implement rendering

in general is rendering for tools just to draw/render m_canvasobject when set.

Reimplemented from a2dStTool.

Definition at line 1837 of file edit.cpp.

void a2dObjectEditTool::SetActive ( bool  active)
virtual

used extarnal by controller to activate or deactivate this tool.

If deactivated this tool, m_halted is set true.

Reimplemented from a2dStTool.

Reimplemented in a2dMultiEditTool.

Definition at line 2071 of file edit.cpp.

bool a2dObjectEditTool::SetContext ( a2dIterC ic,
a2dCanvasObject startObject 
)

start editing object within the given iteration context its coordinate system

Start editing the object within the coordinate system defined by ic (iterative context). Parent of startobject is defined in ic.

The ic is used to calculate the editworld matrix, meaning relative to what coordinates system the editing takes place. This becomes important when editing children of objects directly.

Remarks
at the top level (ShowObject of view) the editorWorld is always a2dIDENTITY_MATRIX else it depends on the structure of the document.

Definition at line 1432 of file edit.cpp.

void a2dObjectEditTool::SetDisableOtherViews ( bool  disableOtherViews)
inline

when set true, other views on the document are disabled when editing a object.

This option is default set true, this prevents from showing editing handles in other views while editing an object in a view.

Definition at line 148 of file edit.h.

void a2dObjectEditTool::SetEditObject ( a2dCanvasObject objectToEdit)
protected

send an event with id sig_toolComEventSetEditObject to this tool.

Use this event to do actions when a specific object was clicked for editing.

Definition at line 1493 of file edit.cpp.

void a2dObjectEditTool::SetSingleClickToEnd ( bool  SingleClickToEnd)
inline

a single non hit Left Down click is enough to end editing of an object.

If set false, a double click is needed.

Definition at line 141 of file edit.h.


The documentation for this class was generated from the following files:
a2dObjectEditTool Class Reference -- Sun Oct 12 2014 17:04:44 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation