a2dCanvasObject Class Reference
[a2dCanvasObject related objects]

a2dCanvasObject is the base class for Canvas Objects. More...

#include <canobj.h>

Inheritance diagram for a2dCanvasObject:

Inheritance graph
[legend]
Collaboration diagram for a2dCanvasObject:

Collaboration graph
[legend]

List of all members.

Bounding box

Each a2dCanvasObject has a Bounding box for efficient drawing and hit testing. The bounding box is always the bounding box of the vertices. It is extended in pixels or would units to cope for stroke width and decorations like handles.

enum  a2dBboxFlag { a2dCANOBJ_BBOX_NON = 0x0000, a2dCANOBJ_BBOX_EDIT = 0x0001, a2dCANOBJ_BBOX_CHILDREN = 0x0002 }
 flags for calculating boundingbox of derived object More...
typedef unsigned int a2dBboxFlags
double GetBboxMinX ()
 get minimum X of the boundingbox in world coordinates relative to its parents
double GetBboxMinY ()
 get minimum Y of the boundingbox in world coordinates relative to its parents
double GetBboxMaxX ()
 get maximum X of the boundingbox in world coordinates relative to its parents
double GetBboxMaxY ()
 get maximum Y of the boundingbox in world coordinates relative to its parents
double GetBboxWidth ()
 get width of the boundingbox in world coordinates relative to its parents
double GetBboxHeight ()
 get height of the boundingbox in world coordinates relative to its parents
a2dBoundingBoxGetBbox ()
 get boundingbox in world coordinates exclusive stroke width relative to its parent
virtual a2dBoundingBox GetUnTransformedBbox (a2dBboxFlags flags=a2dCANOBJ_BBOX_CHILDREN) const
 Get boundingbox without the affine matrix transform included.
a2dBoundingBox GetCalculatedBoundingBox (int nChildLevels)
 Like GetBbox, but it always calculcates the bounding box from scratch.
a2dBoundingBox GetMappedBbox (a2dIterC &ic, bool withExtend=true)
 first translate boundingbox with cworld and recalculate at new position
a2dBoundingBox GetMappedBbox (const a2dAffineMatrix &cworld)
 first translate boundingbox with cworld and recalculate at new position
wxRect GetAbsoluteArea (a2dIterC &ic, int inflate=2)
 Get absolute occupied area in the device coordinates.
float GetWorldExtend () const
 get world extend
int GetPixelExtend () const
 get pixel extend
OVERLAP GetClipStatus (a2dIterC &ic, OVERLAP clipparent)
 used for deciding if the object needs to be rendered against the current clipping area of the active drawer.
a2dBoundingBox GetClipBox (a2dIterC &ic)
 returns boundingbox clipping object if clipping property is set

Update and Pending

enum  UpdateMode {
  update_save = 0x0001, update_includebboxprop = 0x0002, updatemask_save_includebboxprop, updatemask_force,
  updatemask_normal
}
 Various mode flags for Update. More...
virtual bool Update (UpdateMode mode)
 Update the state of the object according to its current position etc.
virtual void UpdateImmediate (bool final, a2dBaseTool *tool, a2dCanvasObject *parent=0, a2dDoUpdateImmediateData *data=0)
 Like Update, but this is called not on OnIdle, but at well defined points.
virtual void DoUpdateImmediate (a2dDoUpdateImmediateData *data)
 See UpdateImediate().
bool GetPending () const
 is this object pending for update?
virtual void SetPending (bool pending)
 set this object pending for update
void AddPending (a2dIterC &ic)
 search objects ( if nested recursive ) that have the pending flag Set
virtual void DependencyPending (a2dWalkerIOHandler *handler)
 called by to check if this object becomes pending as a result of other objects

Event processing

Windows events are routed to the canvas objects under the mouse

a2dCanvasObjectChildIsHitWorld (a2dIterC &ic, a2dHitEvent &hitEvent, bool filterSelectableLayers=false)
 Do hittest on children.
a2dCanvasObjectIsHitWorld (a2dIterC &ic, a2dHitEvent &hitEvent)
 If the position (x,y) is within the object return this.
void SetHitFlags (a2dCanvasObjectFlagsMask mask)
 set hit flags
virtual bool ProcessCanvasObjectEvent (a2dIterC &ic, a2dHitEvent &hitEvent)
 Hit objects will receive the event.
void OnCanvasObjectMouseEvent (a2dCanvasObjectMouseEvent &event)
 default handler for mouse events, sent to the object from the a2dCanvasView.
void OnChar (wxKeyEvent &event)
 default handler for character events
void OnPopUpEvent (a2dCanvasObjectMouseEvent &event)
 called on Right Down by default.
void OnEnterObject (a2dCanvasObjectMouseEvent &event)
 called when the mouse enters the object
void OnLeaveObject (a2dCanvasObjectMouseEvent &event)
 called when the mouse leaves the object
void LeaveInObjects (a2dIterC &ic, a2dHitEvent &hitEvent)
void OnHandleEvent (a2dHandleMouseEvent &event)
 called if a mouse event occured on a child object, that is a handle
a2dCanvasObjectIsHitWorldChildObjects (a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
 This is an internal function used by IsHitWorld(). Don't use it directly.
virtual bool DoIsHitWorld (a2dIterC &ic, a2dHitEvent &hitEvent)
 Does hit test on the object (exclusif child objects).
a2dCanvasObjectHitChildObjectsOneLayer (a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
 This is an internal function used by IsHitWorldChildObjects(). Don't use it directly.

Rendering and style

virtual void Render (a2dIterC &ic, OVERLAP clipparent)
 Render this object to the active a2dCanvasView.
void UpdateViewDependentObjects (a2dIterC &ic)
 update the transform matrix for objects with property 'PROPID_viewDependent'
virtual void DrawHighLighted (a2dIterC &ic)
 called by Render() if m_flags.m_HighLight is set
void SetVisible (bool visible)
 set if this object will visible (be rendered or not)
bool GetVisible () const
 get visibility (rendering depends on layer settings also)
bool IsVisible () const
 get visibility (rendering depends on layer settings also)
void SetFill (const a2dFill &fill)
 Set a fill for the object which will be used instead of the layer fill.
a2dFill GetFill () const
void SetFill (const wxColour &fillcolor, a2dFillStyle style=a2dFILL_SOLID)
 Set a fill color for the object which will be used instead of the layer fill.
void SetFill (const wxColour &fillcolor, const wxColour &fillcolor2, a2dFillStyle style=a2dFILL_SOLID)
 Set a fill color for the object which will be used instead of the layer fill.
void SetFillColour (const wxColour &colour)
 set first colour of fill
wxColour GetFillColour () const
 get first colour of fill
void SetStroke (const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
 Set a stroke for the object which will be used instead of the layer stroke.
void SetStroke (const wxColour &strokecolor, int width, a2dStrokeStyle style=a2dSTROKE_SOLID)
 Set a stroke for the object which will be used instead of the layer stroke.
void SetStroke (const a2dStroke &stroke)
 Set stroke using pointer to a stroke.
a2dStroke GetStroke () const
void SetStrokeColour (const wxColour &colour)
 set first colour of stroke
wxColour GetStrokeColour () const
 get first colour of stroke
virtual void SetContourWidth (double width)
 set the Contour width of the shape
virtual double GetContourWidth () const
 get the Contour width of the shape
void SetDrawerStyle (a2dIterC &ic, a2dStyleProperty *style)
 sets fill and stroke of object to a2dCanvasView
void SetChildrenOnSameLayer (bool samelayer)
 if set children are rendered on the same layer as this object.
bool GetChildrenOnSameLayer () const
 are children rendered on the same layer as this object?
void SetViewDependent (a2dCanvasView *aView, bool viewdependent, bool viewspecific=false, bool onlyinternalarea=false, bool deep=false)
 set the object view dependent and maybe process all children to set these flags
void SetChildOnlyTranslate (bool onlytranslate)
 How a child is placed towards its parent object.
bool GetChildOnlyTranslate () const
 are children rendered using just the translation of the parent or also rotation and scale.
void SetPreRenderAsChild (bool prerender)
 If set, this object has a higher priority in rendering than other children objects.
bool GetPreRenderAsChild () const
 Returns if this object should be rendered before other children objects.
bool GetFilled () const
void SetFilled (bool filled)
 set the filled flag to render only outlines
bool GetShowShadow () const
 If True shadow object is visible (if property is there).
void SetShowShadow (bool showshadow)
 If True shadow object is visible (if property is there).
bool GetResizeOnChildBox () const
 see SetResizeOnChildBox()
void SetResizeOnChildBox (bool resizeToChilds)
 If True resize to child boundingbox.
const a2dShadowStylePropertyGetShadowStyle () const
 quick way to get the style property containing Shadow property
void CallDoRender (a2dIterC &ic, OVERLAP clipparent)
const a2dFillMX_GetFill () const
void MX_SetFill (const a2dFill &value)
const a2dStrokeMX_GetStroke () const
void MX_SetStroke (const a2dStroke &value)
virtual void DoRender (a2dIterC &ic, OVERLAP clipparent)
 render derived object
virtual void DoUpdateViewDependentTransform (a2dIterC &ic)
 update transform matrix klion: I'm not sure that this function necessary as virtual
virtual void DoUpdateViewDependentObjects (a2dIterC &ic)
 update derived objects
virtual void RenderChildObjects (a2dIterC &ic, RenderChild &whichchilds, OVERLAP clipparent)
 render only the child objects
virtual void RenderChildObjectsOneLayer (a2dIterC &ic, RenderChild &whichchilds, OVERLAP clipparent)
 to render the child objects

Connection via Pins and Wires

  • a a2dCanvasObject can have a2dPin objects as childs. These objects can connect to other a2dPin's and thus to other objects.

  • There are wire objects, that connect pins in objects and modify themselfes if the objects they connect move. A wire object overloads "IsConnect" to return true.

  • Note: There are two quite different wire classes: a2dWires and a2dWirePolylineL. a2dWires is more like a least-distance "airline" network used e.g. in routing applications to show unconnected nets. a2dWirePolylineL is a usual polyline with wire functioanlity. Some of the functions apply to one type, one to the other type.


virtual bool IsConnect () const
 return true, if this object is used to connect other object's using rubberband like structures.
virtual bool NeedsUpdateWhenConnected () const
 used in case of flexible canvas objects (wires).
bool DoConnect ()
 if return true, connection with other object on this object its pins is allowed.
void DoConnect (bool doconnect)
 If set to true this object may be connected to other object on its pins.
bool CanConnectWith (a2dIterC &ic, a2dCanvasObject *toConnect, bool autocreate)
 check connect to other object
a2dPinCanConnectWith (a2dIterC &ic, a2dPin *pin, double margin, bool autocreate)
 is the given pin close enough to another a2dPin to allow connection?
bool IsConnected (bool needsupdate, a2dCanvasObject *toConnect=0)
 Is the object connected ( Optinal to specific object ) ?
bool GetConnected (a2dCanvasObjectList *connected, bool needsupdate)
 get connected objects that are connected to this object via its pins.
virtual bool ConnectWith (a2dCanvasObject *parent, a2dCanvasObject *toconnect, const wxString &pinname=wxT(""), double margin=1, bool undo=false)
 Do connect with another a2dCanvasObject by pinname.
virtual bool ConnectWith (a2dCanvasObject *parent, a2dPin *pin, double margin=1, bool undo=false)
 Do connect with another a2dCanvasObject by pin pointer.
virtual void ConnectPinsCreateConnect (a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
 connect two pins
void ConnectPins (a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
 connect two pins which must be unconnected and at the same position
virtual bool DisConnectWith (a2dCanvasObject *parent, a2dCanvasObject *toConnect=NULL, const wxString &pinname=wxT(""))
 Do Disconnect from another a2dCanvasObject by pin name.
virtual bool DisConnectAt (a2dCanvasObject *parent, a2dPin *pin)
 Do Disconnect from another a2dCanvasObject by pin pointer.
void ReWireConnected (a2dCanvasObject *parent, bool undo=false)
 rewire the object to keep connection or to make connection with other objects
bool CreateWiresOnPins (a2dCanvasObject *parent, bool undo)
 create wires on pins which do not have wires, but directly are connected to other objects.
bool SetConnectedPending (bool onoff, bool needsupdateonly)
 set connected pending or not pending
bool HasPins (bool realcheck=false)
 are there a2dPin derived children
a2dPinHasPinNamed (const wxString pinName, bool NotConnected=false)
 are there a2dPin derived children which matches the given pin name?
int GetPinCount ()
 How many a2dPin derived children are there.
virtual bool GeneratePins (a2dPinClass *toConnectTo, a2dConnectTask task, double x, double y)
 create pins in derived objects.
virtual bool AdjustPinLocation ()
 Allow change in pin location when wiring things up.
virtual bool GeneratePinsPossibleConnections (a2dPinClass *pinClass, a2dConnectTask task, double x, double y)
 generates pins on all possible locations where the object can be connected.
virtual a2dCanvasObjectGetConnectTemplate (a2dPinClass *mapThis, a2dCanvasObject *other, a2dPinClass *mapOther) const
 based on the a2dPinClass's of eventually a2dPin's wanted in both objects, a
virtual a2dCanvasObjectCreateConnectObject (a2dCanvasObject *parent, a2dPin *pinThis, a2dPin *pinOther, bool undo=false) const
 generates a connection object with pins and all.
a2dPinAddPin (const wxString name, double x, double y, wxUint32 a2dpinFlags, a2dPinClass *pinClass)
 add a a2dPin as child
void RemovePins (bool NotConnected=false, bool onlyTemporary=false, bool now=false)
 Remove all a2dPin children.
void ShowPins (bool onoff)
 Set a2dPin children visible or not.
void SetRenderConnectedPins (bool onoff)
 Calls a2dPin::SetRenderConnected() for all pins.
void CreateWireEditCopies (a2dCanvasObjectList *originals, a2dCanvasObjectList *copies)
 Find and clone all wires ( IsConnect()==true ) connected to this object or to such wires.
virtual void RestoreConnectionsAfterCloning (class a2dCanvasCommandProcessor *cp=0)
 Restore connections after cloning.
virtual void ClearAllPinConnections (class a2dCanvasCommandProcessor *cp)
 Remove all pin connections by issuing a2dCommand_ConnectPins commands.
virtual void SetParent (a2dCanvasObject *parent)
 set parent object of the pin or some other objects that needs a parent
virtual bool DoCanConnectWith (a2dIterC &ic, a2dPin *pin, double margin, bool autocreate)
 prepare an object for being connected to a given pin

Flags

a a2dCanvasObject has some falgs for general and algorithmic use. Other flags have special meaning or are used internally. The flags with special meaning (e.g. m_visible) are detailed in the proper sections.

void SetSpecificFlags (bool setOrClear, a2dCanvasObjectFlagsMask which)
 set all bit flags in object that or true in mask to true or false
bool CheckMask (a2dCanvasObjectFlagsMask mask) const
 Compares all flags in object to the given mask and return true is the same.
void SetFlags (a2dCanvasObjectFlagsMask newmask)
 set bit flags of object (true or false) to given newmask values
bool GetFlag (const a2dCanvasObjectFlagsMask which) const
 get specific bitflag value
a2dCanvasObjectFlagsMask GetFlags () const
 get bitflags as an integer
void SetBin (bool bin)
 general flag use at will.
bool GetBin () const
 general flag use at will.
bool GetGroupA () const
 get the groupA flag
void SetGroupA (bool value)
 set the groupA flag
bool GetGroupB () const
 get the groupA flag
void SetGroupB (bool value)
 set the groupA flag
bool GetGeneratePins () const
 get the GeneratePins flag
void SetGeneratePins (bool value)
 set the GeneratePins flag
void SetIgnoreSetpending (bool value=true)
 set IgnoreSetpending flag
bool GetIgnoreSetpending () const
 get IgnoreSetpending flag
void SetIgnoreLayer (bool value=true)
bool GetIgnoreLayer () const
void SetSubEdit (bool value)
bool GetSubEdit () const
void SetSubEditAsChild (bool value)
bool GetSubEditAsChild () const
void SetShowshadow (bool value)
bool GetShowshadow () const
void SetPushin (bool value)
bool GetPushin () const
void SetBin2 (bool value)
bool GetBin2 () const
void SetPrerenderaschild (bool value)
bool GetPrerenderaschild () const
void SetVisiblechilds (bool value)
bool GetVisiblechilds () const
void SetEditing (bool value)
bool GetEditing () const
void SetEditingRender (bool value)
bool GetEditingRender () const
void SetDoConnect (bool value)
bool GetDoConnect () const
void SetIsOnCorridorPath (bool value)
bool GetIsOnCorridorPath () const
void SetHasPins (bool value)
bool GetHasPins () const
void SetMouseInObject (bool value)
bool GetMouseInObject () const
void SetHighLight (bool value)
bool GetHighLight () const
void SentChangeLayerEvent (wxUint16 layer)
 sents a layer change event around.
static void SetIgnoreAllSetpending (bool value=true)
 set static IgnoreAllSetpending flag
static bool GetIgnoreAllSetpending ()
 get static IgnoreSetpending flag

Application specific extensions.

The functions in this section can be used to extend the functionality of a2dCanvasObject without adding new virtual member functions to the base class.

void foreach_f (void(*fp)(a2dCanvasObject *item))
 call fp for each object
void foreach_mf (void(a2dCanvasObject::*mfp)())
 call fp for each object
virtual bool UserBaseFunction ()
 can be used by the user to implement a function that affects all a2dCanvas derived objects
virtual bool UserBaseFunctionEx (int function, a2dIOHandler *handler=NULL)
 can be used by the user to implement a function that affects all a2dCanvas derived objects
virtual bool UserBaseFunctionVar (...)
 can be used by the user to implement a function using a variable argument list that affects all a2dCanvas derived objects
virtual bool UserBaseFunctionFormat (wxString format,...)
 can be used by the user to implement a function using a variable argument list and format string that affects all a2dCanvas derived objects
void WalkerWithContext (a2dIterC &ic, wxObject *parent, a2dWalkerIOHandlerWithContext &handler)
 This is used to recursively walk through an object tree.
virtual void DoWalker (wxObject *parent, a2dWalkerIOHandler &handler)
 iterate over this object and its children
virtual void DoWalkerWithContext (a2dIterC &ic, wxObject *parent, a2dWalkerIOHandlerWithContext &handler)

Public Member Functions

virtual a2dCanvasObjectList * GetAsCanvasVpaths (bool transform=true)
 when implemented the object without its children, is converted to
void SetTemplate (bool b=true)
void SetExternal (bool b=true)
void SetUsed (bool b=true)
bool GetTemplate () const
bool GetExternal () const
bool GetUsed () const
virtual bool DoStartEdit (wxUint16 editmode, wxEditStyle editstyle)
 only used for editable objects and under control of a editing tool.
Construction and reference counting
 a2dCanvasObject (double x=0, double y=0)
 constructor called by derived objects
 a2dCanvasObject (const a2dCanvasObject &other, CloneOptions options)
 constructor using reference to existing canvas object
virtual a2dObjectClone (CloneOptions options) const
 Clone this object and return a pointer to the new object.
a2dCanvasObjectTClone (CloneOptions options)
virtual ~a2dCanvasObject ()
 destructor called by derived objects
virtual bool IsRecursive ()
 returns if this object does have nested objects
virtual void MakeReferencesUnique ()
 All direct a2dCanvasObject which are part of this one are made unique.
Affine Transformation
Each a2dCanvasObject has an affine Transformation to translate, rotate, scale, and skew it. The Transformations are mutiplied with the transformations of all parent objects up the show object of teh current view.

void Rotate (double rotation)
 Rotates this object clockwise.
void SetRotation (double rotation)
 Sets a rotation of this object.
void Scale (double scalex, double scaley)
 Scale in x and y ( > zero).
void Mirror (bool x=true, bool y=false)
 Mirrors this object in x or y orientation.
void SkewX (double angle)
 Skew in X.
void SkewY (double angle)
 Skew in Y.
const a2dAffineMatrixGetTransformMatrix () const
 get the matrix used to position the object
a2dAffineMatrix GetTransform () const
void SetTransform (a2dAffineMatrix mat=a2dIDENTITY_MATRIX)
void SetTransformMatrix (const a2dAffineMatrix &mat=a2dIDENTITY_MATRIX)
 Returns the matrix used to position the object.
void SetTransformMatrix (double xt, double yt, double scalex=1, double scaley=1, double degrees=0)
 Sets the matrix used to position the object.
double GetPosX () const
 get x position from affine matrix
double GetPosY () const
 get y position from affine matrix
a2dPoint2D GetPosXY () const
 get position of object
void SetPosXY (double x, double y, bool restrict=false)
 set position to x,y
void SetPosXyPoint (const a2dPoint2D &pos)
 set position to x,y
bool SetPosXYRestrict (double &x, double &y)
 set position to x,y but restricted, returns new values
void Translate (double x, double y)
 relative translate the object to position x,y in world coordinates
void Transform (const a2dAffineMatrix &tworld)
 transform the object using the given matrix
virtual bool RestrictToObject (a2dRestrictionEngine *engine, a2dSnapToWhatMask snapToWhat)
 called from an a2dRestrictionEngine, to restrict vertexes, lines, object to this object.
virtual a2dCanvasObjectList * GetSnapVpath (a2dSnapToWhatMask snapToWhat)
 return a vectorpath indicating on which point/segments the object likes to be snap.
virtual bool EliminateMatrix ()
 reduce matrix to identity
Child tree and document structure
Every a2dCanvasObject has a list of child objects. One a2dCanvasObject can be element of multiple child lists and can thus have multiple parents. Reference counting is used to control the life time of a a2dCanvasObject. Because a a2dCanvasObject can have multiple parents, it has no parent pointer. A a2dCanvasObject has a pointer to the a2dCanvasDocument it belongs to.

a2dCanvasDocumentGetCanvasDocument () const
 get a2dCanvasDocument of the object.
void SetCanvasDocument (a2dCanvasDocument *root, bool recurse=true)
 Sets this object to a a2dCanvasDocument.
void Prepend (a2dCanvasObject *obj)
 prepend a a2dCanvasObject to the childobjects
void Append (a2dCanvasObject *obj)
 append a a2dCanvasObject to the childobjects
void Insert (size_t before, a2dCanvasObject *obj, bool ignoreReleased=true)
 insert a a2dCanvasObject to the childobjects
a2dCanvasObjectList * GetChildObjectList ()
 get the list where the child objects are stored in.
const a2dCanvasObjectList * GetChildObjectList () const
a2dCanvasObjectList * CreateChildObjectList ()
 create and get the list where the child objects are stored in.
unsigned int GetChildObjectsCount () const
 get number of child objects
a2dCanvasObjectCreateHierarchy (a2dCanvasObjectFlagsMask mask, bool createref=true)
 object with the same given mask are made into a group.
virtual void RemoveHierarchy ()
 move childs of childs and members which have hierarchy one level up to this object its child list.
int ReleaseChild (a2dCanvasObject *obj, bool backwards=false, bool all=false, bool now=false)
 remove the given object from the childobjects
bool ReleaseChildObjects (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
 removes and release only from the childobjects the objects with the given mask
int IndexOf (a2dCanvasObject *obj) const
 returns index of the given a2dCanvasObject in this childobjects
a2dCanvasObjectFind (const wxString &objectname, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *propid=NULL, const wxString &valueAsString=wxT(""), wxUint32 id=0) const
 return the object which fits the filter.
a2dCanvasObjectFind (a2dCanvasObject *obj) const
 return the child object if it is part of this object
bool SwitchChildNamed (const wxString &objectname, a2dCanvasObject *newobject)
 the object with the given name is released and switched in place to newobject
int CollectObjects (a2dCanvasObjectList *total, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=0, const a2dBoundingBox &bbox=wxNonValidBbox) const
 Copy objects with the right conditions to the total list.
Editing and Highlighting
void SetEditable (bool editable)
 Sets if this object may be edited.
bool GetEditable () const
 get if the object may be edited
bool IsEditable () const
 get if the object may be edited
bool GetSelected () const
 is the object selected flag set
bool IsSelected () const
 Is the object selected flag set.
void SetSelected (bool selected)
 Set the object selected flag if allowed.
bool GetSelectable () const
 is the object selectable flag set
bool IsSelectable () const
 Is the object selectable flag set.
void SetSelectable (bool selectable)
 Allows to select this object.
void SetDraggable (bool draggable)
 Sets if this object may be dragged.
bool GetDraggable () const
 get if the object can be dragged
bool IsDraggable () const
 get if the object can be dragged
bool GetSnap () const
 is snap flag set?
void SetSnap (bool snap)
 Sets snap flag.
void SetSnapTo (bool snap)
 Sets snap_to flag.
bool GetSnapTo () const
 is snap_to flag set?
virtual void SetMode (int mode)
 you may use it to modify rendering of the object depending on setting
virtual int GetMode () const
 get the rendering mode of the object.
virtual a2dCanvasObjectStartEdit (a2dBaseTool *tool, wxUint16 editmode, wxEditStyle editstyle=wxEDITSTYLE_COPY)
 create an editcopy and initialize editing of the editcopy
virtual void EndEdit ()
 cleanup an editcopy object
void ReStartEdit (wxUint16 editmode)
 to restart editing in a different mode
a2dCanvasObjectGetOriginal ()
 if this is an editcopy, return the orginal else NULL
a2dHandleSetHandlePos (wxString name, double x, double y)
 set a2dHandle position with the given name
void CaptureMouse (a2dIterC &ic)
 redirect all mouse events for the canvas to this object
void ReleaseMouse (a2dIterC &ic)
 release the mouse capture for this object
bool IsCapturedMouse (a2dIterC &ic) const
 is the mouse captured for this object
bool GetHasSelectedObjectsBelow () const
 selected object itself or one of its recursive children
void SetHasSelectedObjectsBelow (bool value)
 selected object itself or one of its recursive children
bool GetHasToolObjectsBelow () const
 tool object itself or one of its recursive children
void SetHasToolObjectsBelow (bool value)
 selected object itself or one of its recursive children
virtual void EditFeedback (a2dIterC &ic, const a2dFeedbackId *id, a2dCanvasObject *currentEdit=0, int depth=INT_MAX, a2dCanvasObjectFlagsMask flags=a2dCanvasOFlags::NON, double x=0, double y=0)
 tool editing feedback
Serialization, IDs and references
In the CVG format one can store multiple references to one and the same object. The object that is referenced is only written once, for the rest only the reference id is written to the CVG file. When loading a file in CVG, such references are resolved inside the document. So in the end the old reference is restored via by searching the object having that id. As such the refid attribute is just a place holder for a reference to the actual referenced object. The reason behind all this, is that the actual object might to be read yet, when a reference is encountered in the CVG file, and therefore the link can not be directly created. In other formats references are used in a simular manner, and to resolve them the same mechanism is used.

virtual bool IsTemporary_DontSave () const
 Check if this is a temporary object, which should not be saved.
virtual void DoSave (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
 write object specific CVGL data
virtual void DoLoad (wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
 load object specific CVG data
void DoLoadOneObject (wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
 load one canvas object from a CVG file.
Properties
a a2dCanvasObject has a list of general named properties

void SetIsProperty (bool IsProperty)
bool GetIsProperty () const
a2dTextSetObjectTip (const wxString &tip, double x, double y, double size=30, double angle=0, const a2dFont &font=*a2dDEFAULT_CANVASFONT)
 quickly set a property name __OBJECTTIP__
void SetTipWindow (const wxString &tip)
 quickly set a property a2dTipWindowProperty
a2dObjectGetObjectTip ()
 quickly get first property with name __OBJECTTIP__
virtual bool EditProperties (const a2dPropertyId *id, bool withUndo)
 edit properties of the object
void OnPropertyChanged (const a2dPropertyId *id)
 This function is called after a property changed.
Layers
a a2dCanvasDocument is rendered in layers. Every canvas object belongs to excatly one layer.

wxUint16 GetLayer () const
 Returns the layer index where this object is drawn upon.
virtual void SetLayer (wxUint16 layer)
 set layer index where this object is drawn upon.

Static Public Attributes

static bool m_ignoreAllSetpending = false
 when set all SetPending() calss are supressed.
static a2dPropertyIdMatrixPROPID_TransformMatrix = NULL
static a2dPropertyIdPoint2DPROPID_Position = NULL
static a2dPropertyIdUint16PROPID_Layer = NULL
static a2dPropertyIdBoolPROPID_Selected = NULL
static a2dPropertyIdBoolPROPID_Selectable = NULL
static a2dPropertyIdBoolPROPID_SubEdit = NULL
static a2dPropertyIdBoolPROPID_SubEditAsChild = NULL
static a2dPropertyIdBoolPROPID_Visible = NULL
static a2dPropertyIdBoolPROPID_Draggable = NULL
static a2dPropertyIdBoolPROPID_Showshadow = NULL
static a2dPropertyIdBoolPROPID_Filled = NULL
static a2dPropertyIdBoolPROPID_GroupA = NULL
static a2dPropertyIdBoolPROPID_GroupB = NULL
static a2dPropertyIdBoolPROPID_GeneratePins = NULL
static a2dPropertyIdBoolPROPID_Bin = NULL
static a2dPropertyIdBoolPROPID_Bin2 = NULL
static a2dPropertyIdBoolPROPID_Pending = NULL
static a2dPropertyIdBoolPROPID_Snap = NULL
static a2dPropertyIdBoolPROPID_SnapTo = NULL
static a2dPropertyIdBoolPROPID_Pushin = NULL
static a2dPropertyIdBoolPROPID_Prerenderaschild = NULL
static a2dPropertyIdBoolPROPID_Visiblechilds = NULL
static a2dPropertyIdBoolPROPID_Editable = NULL
static a2dPropertyIdBoolPROPID_Editing = NULL
static a2dPropertyIdBoolPROPID_EditingRender = NULL
static a2dPropertyIdBoolPROPID_ChildrenOnSameLayer = NULL
static a2dPropertyIdBoolPROPID_DoConnect = NULL
static a2dPropertyIdBoolPROPID_IsOnCorridorPath = NULL
static a2dPropertyIdBoolPROPID_HasPins = NULL
static a2dPropertyIdBoolPROPID_IsProperty = NULL
static a2dPropertyIdBoolPROPID_MouseInObject = NULL
static a2dPropertyIdBoolPROPID_HighLight = NULL
static a2dPropertyIdBoolPROPID_Template = NULL
static a2dPropertyIdBoolPROPID_External = NULL
static a2dPropertyIdBoolPROPID_Used = NULL
static a2dPropertyIdBoolPROPID_Release = NULL
static a2dPropertyIdCanvasObjectPROPID_Begin = NULL
static a2dPropertyIdCanvasObjectPROPID_End = NULL
static a2dPropertyIdDoublePROPID_EndScaleX = NULL
static a2dPropertyIdDoublePROPID_EndScaleY = NULL
static a2dPropertyIdBoolPROPID_Spline = NULL
static a2dPropertyIdDoublePROPID_ContourWidth = NULL
static a2dPropertyIdBoolPROPID_Allowrotation = NULL
static a2dPropertyIdBoolPROPID_Allowsizing = NULL
static a2dPropertyIdBoolPROPID_Allowskew = NULL
static a2dPropertyIdBoolPROPID_IncludeChildren = NULL
static
a2dPropertyIdRefObjectAutoZero
PROPID_Controller = NULL
static a2dPropertyIdCanvasObjectPROPID_Original = NULL
static a2dPropertyIdCanvasObjectPROPID_Editcopy = NULL
static a2dPropertyIdCanvasObjectPROPID_Parent = NULL
static a2dPropertyIdCanvasObjectPROPID_Objecttip = NULL
static a2dPropertyIdUint16PROPID_Editmode = NULL
static a2dPropertyIdUint16PROPID_Editstyle = NULL
static a2dPropertyIdUint16PROPID_Index = NULL
static
a2dPropertyIdCanvasShadowStyle
PROPID_Shadowstyle = NULL
static a2dPropertyIdFillPROPID_Fill = NULL
static a2dPropertyIdStrokePROPID_Stroke = NULL
static a2dPropertyIdInt32PROPID_UpdateImmediatePriority = NULL
static a2dPropertyIdUint32PROPID_RefDesCount = NULL
static a2dPropertyIdUint32PROPID_RefDesNr = NULL
static a2dPropertyIdBoolPROPID_ToolDecoration = NULL
 set for objects that act as tool decorations, when a tool is in action.
static a2dPropertyIdVoidPtrPROPID_ToolObject = NULL
 set for objects that act as tool object, when a tool is in action.
static a2dPropertyIdBoolPROPID_TemporaryObject = NULL
 set for objects that do not have to be saved
static a2dPropertyIdBoundingBoxPROPID_BoundingBox = NULL
 used to store state ( redraw area) of the object as it was before a change
static a2dPropertyIdColourPROPID_StrokeColour = NULL
static a2dPropertyIdColourPROPID_FillColour = NULL
static a2dPropertyIdRefObjectPROPID_ViewSpecific = NULL
static a2dPropertyIdBoolPROPID_FirstEventInObject = NULL
 set in Startedit(), to be used to detect first (mouse)event sent to object.
static a2dPropertyIdUint16PROPID_Datatype = NULL
 used in GDSII and KEY format to specify the DATATYPE of elements
static a2dPropertyIdRefObjectPROPID_ViewDependent = NULL
 used for objects that depend on 'aView' view when it comes to size.
static a2dPropertyIdMatrixPROPID_IntViewDependTransform = NULL
 used for objects with* PROPID_viewDependent but only for internal area
static const wxEventType sm_changedLayer
 when an object is removed from a layer,
static a2dPropertyIdDateTimePROPID_DateTime = NULL
 some time property which a user wants to store
static a2dPropertyIdDateTimePROPID_ModificationDateTime = NULL
static a2dPropertyIdDateTimePROPID_AccessDateTime = NULL
static a2dPropertyIdMenuPROPID_PopupMenu = NULL
 when set used for popup menu by default in OnPopUpEvent()
static a2dPropertyIdWindowPROPID_TipWindow = NULL
 when set used for tip window by default in OnCanvasMouseEvent()

Protected Member Functions

bool ProcessCanvasEventChild (a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
bool ProcessCanvasEventChildOneLayer (a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
virtual bool DoIgnoreIfNotMember (const a2dPropertyId &id)
bool ParseCvgTransForm (a2dAffineMatrix &result, a2dIOHandlerXmlSerIn &parser)
 parse Cvg transform of object
virtual void DoAddPending (a2dIterC &ic)
 called by addPending
virtual a2dBoundingBox DoGetUnTransformedBbox (a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
 In derived object this should be overriden to calculate the boundingbox of the object without its children.
virtual bool DoUpdate (UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
 Update derived Object specific things ( mainly boundingbox).
virtual void DoEndEdit ()
 only used for editable objects and under control of a editing tool.

Protected Attributes

a2dCanvasDocumentm_root
 root group for rendering and accessing the canvas's also contains layer settings
a2dCanvasOFlags m_flags
 holds flags for objects
a2dCanvasOHitFlags m_hitflags
 allow hits on basis of those flags
a2dBoundingBox m_bbox
 boundingbox in world coordinates
float m_worldExtend
 world extend in world coordinates.
wxUint16 m_pixelExtend
 Pixel extend.
wxUint16 m_layer
 layer of object, default wxLAYER_DEFAULT
a2dAffineMatrix m_lworld
 used for positioning the object (x,y,ang,scale etc.)
a2dCanvasObjectList * m_childobjects
 holds child objects

Static Protected Attributes

static a2dCanvasOFlags m_flagsInit
 holds value for flags to initialize m_flags

Friends

class a2dCanvasObjectFilter
class a2dCanvasObjectFilterLayerMask
class a2dCanvasObjectFilterLayerMaskNoToolNoEdit

Classes

class  a2dDoUpdateImmediateData
 A data structure for DoUpdateImmediate. More...
class  a2dFeedbackId
 provide visual feedback by other objects that might participate in an editing More...
class  a2dFeedbackIdPinMapping
 feed back information of pins which can connect according to the More...
struct  RenderChild
 used to tell which child object to render and to detect the need for it. More...


Detailed Description

a2dCanvasObject is the base class for Canvas Objects.

All objects for drawing on the a2dCanvas are derived from this class. A a2dCanvasDocument is filled with instances of this object. a2dCanvasObject can have children, which are also a2dCanvasObjects. A a2dCanvasObject itself can be a child of more than one parent a2dCanvasObject. The reference counter takes care of deleting the object when all references are released.

Child objects are stored in a2dCanvasObjectList m_childobjects, which is only created when the first child is added to the a2dCanvasObject. Else it points to wxNullCanvasObjectList.

Each a2dCanvasObject can also have a list of a2dObject objects. They are stored in the a2dObjectList m_properties.

Asking for the GetCount() of the above two lists, is save, since wxNullCanvasObjectList will return 0.

Traversing a a2dCanvasDocument is mainly by traversing of the child list of each a2dCanvasObject in the document in a recursive manner. Many functions in a2dCanvasObject need to traverse the document, therefore there is often a DoSomething function called from the base a2dCanvasObject, in order to do the object specific job while traversing the document.

Rendering of a2dCanvasObject's is via the base Render function, which takes care of rendering child objects. It also does the clipping of objects to the area to be drawn. First it searches for style properties in the property list, if found they will be used to set the drawing style of the active a2dCanvasView which is used to draw on a device. If no style properties are available, the layer settings are used to set the style of the a2dCanvasView. Next to style properties, there can be other properties which influence the rendering of the object in general; e.g. the a2dClipPathProperty, is pushed into the a2dCanvasView to clip the child objects. After setting the style the rendering can start. First the children which have the flag m_prerenderaschild set are rendered. Next the a2dCanvasObject derived object itself is rendered via the virtual DoRender() method. After that the rest of the child objects are rendered. In the end visible properties are rendered, via their a2dCanvasObject, which they may use for displaying themselfs.

It is possible to intercept mouse event on a a2dCanvasObject. a2dCanvasObject's receive there events after a hit of the mouse pointer was detected from within a a2dCanvasView or a2dCanvas object. The lowest object seen from the a2dCanvasView::ShowObject() receives the events first, and if skipped there and no othere child proesses the event, its parent will get the event etc.

Remarks:
When a style (fill or stroke) is set it will be used instead of the layer fill and stroke

fill style is inherited by children

Definition at line 773 of file canobj.h.


Member Enumeration Documentation

Various mode flags for Update.

It doesn't make sense to bit-or these, but these are bitflags anyway for quick multi-testing (e.g. ( mode & (mode1|mode2|mode3) )

Enumerator:
update_save  saves old valid boundingbox as boundingbox property
update_includebboxprop  includes boundingbox properties in object its boundingbox
updatemask_save_includebboxprop  update_save and update_includebboxprop combined
updatemask_force  All updates of these modes force an update (e.g. update non-pending valid bounding boxes).
updatemask_normal  object with invalid boundingbox or pending objects their boundingbix is recalculated. When boundingbox properties are found, theye will be include in the box.

Definition at line 1449 of file canobj.h.


Member Function Documentation

bool a2dCanvasObject::IsRecursive (  )  [virtual]

returns if this object does have nested objects

If the object has children it is nested, but if not it can still have nested objects. This is when a derived a2dCanvasObject does have a2dCanvasObject's members itself. This function should return true if an object does have nested children or members.

Reimplemented in a2dCurvesArea, and a2dCanvasObjectReference.

Definition at line 5992 of file canobj.cpp.

void a2dCanvasObject::MakeReferencesUnique (  )  [virtual]

All direct a2dCanvasObject which are part of this one are made unique.

The base implementation check all child objects in m_childobjects for being more then single referenced. If not a clone is created in put in place of the one there, leving the origenal to the other objects which owned that child too. Derived a2dCanvasObject must implement this, if it has members which can be multiple referenced.

Reimplemented in a2dCanvasObjectReference.

Definition at line 5997 of file canobj.cpp.

void a2dCanvasObject::Rotate ( double  rotation  ) 

Rotates this object clockwise.

Rotates this object clockwise: If you call Rotate(20); Rotate(10); the absolute rotation will be 30 degrees (if initially rotation was 0 degrees)

See also:
a2dAffineMatrix::Rotate

SetRotation

Parameters:
rotation rotate by this angle in degrees

Definition at line 3122 of file canobj.cpp.

void a2dCanvasObject::SetRotation ( double  rotation  ) 

Sets a rotation of this object.

Sets in opposite to Rotate the absolute rotation of this object.

See also:
a2dAffineMatrix::SetRotation

Rotate

Parameters:
rotation set rotation angle in degrees

Reimplemented in a2dTextGDS.

Definition at line 3116 of file canobj.cpp.

void a2dCanvasObject::Scale ( double  scalex,
double  scaley 
)

Scale in x and y ( > zero).

Parameters:
scalex scalling in X
scaley scalling in Y

Definition at line 3140 of file canobj.cpp.

void a2dCanvasObject::Mirror ( bool  x = true,
bool  y = false 
)

Mirrors this object in x or y orientation.

Parameters:
x mirror at X-axis (horizontally orientation)
y mirror at Y-axis (vertically orientation)

Definition at line 3146 of file canobj.cpp.

void a2dCanvasObject::SkewX ( double  angle  ) 

Skew in X.

Parameters:
angle angle to skew in X

Definition at line 3128 of file canobj.cpp.

void a2dCanvasObject::SkewY ( double  angle  ) 

Skew in Y.

Parameters:
angle angle to skew in Y

Definition at line 3134 of file canobj.cpp.

void a2dCanvasObject::SetTransformMatrix ( const a2dAffineMatrix mat = a2dIDENTITY_MATRIX  )  [inline]

Returns the matrix used to position the object.

Parameters:
mat matrix set for transforming the object

Definition at line 901 of file canobj.h.

void a2dCanvasObject::SetTransformMatrix ( double  xt,
double  yt,
double  scalex = 1,
double  scaley = 1,
double  degrees = 0 
)

Sets the matrix used to position the object.

A new matrix will be constructed for transforming this object.

See also:
SetTransformMatrix

a2dAffineMatrix::a2dAffineMatrix

Parameters:
xt x translation
yt y translation
scalex x scale factor
scaley y scale factor
degrees rotation in degrees

Definition at line 3111 of file canobj.cpp.

void a2dCanvasObject::SetPosXY ( double  x,
double  y,
bool  restrict = false 
)

set position to x,y

translation is set to x,y, rest of the affine matrix is preserved.

Parameters:
x x position
y y position
restrict use a2dCanvasGlobals->GetRestrictionEngine() to snap position

Definition at line 2153 of file canobj.cpp.

void a2dCanvasObject::SetPosXyPoint ( const a2dPoint2D pos  )  [inline]

set position to x,y

translation is set to x,y, rest of the affine matrix is preserved.

Parameters:
pos position

Definition at line 939 of file canobj.h.

bool a2dCanvasObject::SetPosXYRestrict ( double &  x,
double &  y 
)

set position to x,y but restricted, returns new values

translation is set to x,y, rest of the affine matrix is preserved.

Same as SetPoXY(), but returneing restricted values

Parameters:
x x position
y y position
Returns:
true of point was restricted/changed

Definition at line 2135 of file canobj.cpp.

void a2dCanvasObject::Translate ( double  x,
double  y 
) [inline]

relative translate the object to position x,y in world coordinates

this function may be defined for each derived object, to move other object with this object. it is used internally for dragging and moving objects.

Parameters:
x delta x for translation
y delta y for translation

Definition at line 961 of file canobj.h.

void a2dCanvasObject::Transform ( const a2dAffineMatrix tworld  )  [inline]

transform the object using the given matrix

If the object can not rotate or scale those will be ignored and only translation will take place. If totally transformed it will return true else false.

Parameters:
tworld matrix for transform

Definition at line 969 of file canobj.h.

bool a2dCanvasObject::RestrictToObject ( a2dRestrictionEngine engine,
a2dSnapToWhatMask  snapToWhat 
) [virtual]

called from an a2dRestrictionEngine, to restrict vertexes, lines, object to this object.

When other object, vertexes or lines are moved (e.g. by a tool), the restriction engine can be set to snap/restrict to neighbouring objects. Here you can define to which parts of those neighbour objects something can be snapped. For a simple polygon this will be its vertexes, for an ellipse its extremes. For complex objects, it can be anything. For objects with pins, it will be the pins if that is asked for. For the various types of snap, you only implement what is useful for the object.

The default can snap to:

Reimplemented in a2dWH, a2dSLine, a2dPolygonL, and a2dVectorPath.

Definition at line 4758 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::GetSnapVpath ( a2dSnapToWhatMask  snapToWhat  )  [virtual]

return a vectorpath indicating on which point/segments the object likes to be snap.

If a drag of this object is on going, one may want to snap itself to other objects, while dragging. This member functions will tell the a2dRestrictionEngine on which points this object likes to snap to others.

The default implementation for a2dRestrictionEngine::snapToObjectVertexes tries to convert to a Vpath, and if so, uses that as return, if not, it takes the boundingbox its points. For a2dRestrictionEngine::snapToObjectPos its is the position of the object that is added. For a2dRestrictionEngine::snapToBoundingBox its is the BoundingBox points of the object that are added.

Definition at line 4850 of file canobj.cpp.

bool a2dCanvasObject::EliminateMatrix (  )  [virtual]

reduce matrix to identity

Override if possible to eliminate matrix of the object For a non Derived a2dCanvasObject this function multiplies its children with this object matrix, and reduces its own matrix to identity.

Reimplemented in a2dVertexCurve, a2dSweepCurve, a2dBandCurve, a2dVertexListCurve, a2dSLine, a2dPolygonL, a2dSurface, and a2dVectorPath.

Definition at line 6659 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::ChildIsHitWorld ( a2dIterC ic,
a2dHitEvent hitEvent,
bool  filterSelectableLayers = false 
)

Do hittest on children.

Ignores this object its m_layer and drawing for the object and properties. Only does a hit test on the children. When hitEvent.m_option & a2dCANOBJHITOPTION_LAYERS is true, iteration on layers is performed, by setting ic.SetPerLayerMode( true ). When hitEvent.m_xyRelToChildren is true, hit test is done relative to child objects, realized by adding inverse matrix of object to the a2dIterC first. The a2dIterC can contain a a2dIterC::SetObjectFilter() but this is only used when not iterating layers. When iterating layers, first normal objects are tested for a hit in reverse order of drawing the layers. So last drawn layer displayed on top, is tested first. At last the edit and tool object are tested.

Parameters:
ic iterative context, relative to this testing is performed.
hitEvent contains x,y to test, and other hit info is assembled here
filterSelectableLayers if true layers should not only be visible but also selectable

Definition at line 3890 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::IsHitWorld ( a2dIterC ic,
a2dHitEvent hitEvent 
)

If the position (x,y) is within the object return this.

First a simple bounding box test is done, if that hit is positive, a recursive call on child objects and properties which are normarmally rendered id done. The hit test is in reverse order of the rendering order of the object and its nested child objects.

For an accurate hittest one needs to implement DoIsHitWorld() for the derived a2dCanvasObject, in that function one should test the object accurate, and also additional object which are not in the childslist but real members of the derived object. DoIsHitWorld() should return the way the object is hit by filling a2dHitEvent::m_how with the correct info.

Parameters:
ic contains iteration context
hitEvent stores hit information
Returns:
this pointer if there is a hit on this object or its children or its properties.

Definition at line 4015 of file canobj.cpp.

void a2dCanvasObject::SetHitFlags ( a2dCanvasObjectFlagsMask  mask  ) 

set hit flags

Based on these flags the object will generate a hit true.

Parameters:
mask set hit flags in object according to given mask.

Definition at line 3177 of file canobj.cpp.

bool a2dCanvasObject::ProcessCanvasObjectEvent ( a2dIterC ic,
a2dHitEvent hitEvent 
) [virtual]

Hit objects will receive the event.

The event is first sent to the child objects, and if not processes there, testing for a hit on the object itself is done, and if true a2dEvtHandler::ProcessEvent is called. The function goes through the whole hierarchy, even if event is already processed. It maybe be that other events are generated while iterating over the document.

Parameters:
ic iteration context
hitEvent stores hit information
Returns:
true if Object (or a child ) did process the event and did not call event.Skip()

Reimplemented in a2dCurvesArea, and a2dCanvasXYDisplayGroupAreas.

Definition at line 4478 of file canobj.cpp.

void a2dCanvasObject::OnCanvasObjectMouseEvent ( a2dCanvasObjectMouseEvent event  ) 

default handler for mouse events, sent to the object from the a2dCanvasView.

Mouse events are sent to the object when the mouse pointer is hiting the object. The default is used when the object is in edit mode. Else it will detect if the special object tip property named __OBJECTTIP__ is available, and switch it on or off when the mouse eneter or leaves the object.

&& m_flags.m_subEditAsChild )

Reimplemented in a2dDrawingFrame, a2dVertexCurve, a2dSweepCurve, a2dBandCurve, a2dVertexListCurve, a2dPieCurve, a2dCanvasXYDisplayGroupAreas, a2dAxisMarker, a2dMarker, a2dMarkerShow, a2dCurveGroupLegend, a2dHandle, a2dText, a2dWidgetButton, a2dPolygonL, a2dSurface, and a2dMultiSelectGroup.

Definition at line 2906 of file canobj.cpp.

void a2dCanvasObject::LeaveInObjects ( a2dIterC ic,
a2dHitEvent hitEvent 
)

object with mouse in flag set, will sent a leave event, and set flag off. recursive for children.

Definition at line 2561 of file canobj.cpp.

bool a2dCanvasObject::DoIsHitWorld ( a2dIterC ic,
a2dHitEvent hitEvent 
) [protected, virtual]

Does hit test on the object (exclusif child objects).

DoIsHitWorld() should return the way the object is hit by filling a2dHitEvent::m_how with the correct info.

Parameters:
ic iterative context ( e.g. current transform WITH the local transform applied )
hitEvent stores hit information
Returns:
true if hit

Reimplemented in a2dDrawingFrame, a2d3DShape, a2dRenderImage, a2dFunctionCurve, a2dVertexCurve, a2dSweepCurve, a2dBandCurve, a2dVertexListCurve, a2dPieCurve, a2dCanvasXYDisplayGroupAreas, a2dBaseMarker, a2dMarkerShow, a2dCurveGroupLegend, a2dImage, a2dImageMM, a2dOrigin, a2dHandle, a2dRectC, a2dArrow, a2dWH, a2dRect, a2dCircle, a2dEllipse, a2dEllipticArc, a2dArc, a2dSLine, a2dEndsLine, a2dEndsEllipticChord, a2dControl, a2dText, a2dWidgetButton, a2dLayerInfo, a2dPolygonL, a2dPolylineL, a2dSurface, a2dRectMM, a2dCanvasObjectReference, a2dLibraryReference, and a2dVectorPath.

Definition at line 4296 of file canobj.cpp.

a2dCanvasDocument* a2dCanvasObject::GetCanvasDocument (  )  const [inline]

get a2dCanvasDocument of the object.

Root (a2dCanvasDocument) needs to be known to each object for the following reasons:

  • It is used to inform the document that there are pending objects in the document.
  • To reach the layer setup of the document.
  • To reach the command processor of the document, which is used to submit commands to, that can be undone if needed.

Definition at line 1311 of file canobj.h.

void a2dCanvasObject::SetCanvasDocument ( a2dCanvasDocument root,
bool  recurse = true 
)

Sets this object to a a2dCanvasDocument.

Parameters:
root set the a2dCanvasDocument for this object to this (if appropriate recursive)
recurse default true, which uses a2dWalker_SetCanvasDocument for doing the same recursive for nested object and nested object in derived classes.

Definition at line 6402 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::GetChildObjectList (  ) 

get the list where the child objects are stored in.

Returns:
A pointer to the childlist. If there is no child list yet, it returns wxNullCanvasObjectList.
Remarks:
wxNullCanvasObjectList has no children and therefore one can use GetChildObjectList()->GetCount() to test for children.

Definition at line 3066 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::CreateChildObjectList (  ) 

create and get the list where the child objects are stored in.

If there is no childlist yet (wxNullCanvasObjectList), a new childlist will be created. Else the existing one will be returned.

Returns:
A pointer to the childlist.

Definition at line 3076 of file canobj.cpp.

unsigned int a2dCanvasObject::GetChildObjectsCount (  )  const

get number of child objects

Returns:
number of child objects

Definition at line 3085 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::CreateHierarchy ( a2dCanvasObjectFlagsMask  mask,
bool  createref = true 
)

object with the same given mask are made into a group.

Parameters:
mask,: mask for objects to assemble for creating a group of child objects
createref,: next to a new a2dCanvasObject, create a reference to the new object.
Returns:
return newly created object only if objects where found else NULL

Definition at line 6568 of file canobj.cpp.

void a2dCanvasObject::RemoveHierarchy (  )  [virtual]

move childs of childs and members which have hierarchy one level up to this object its child list.

The base implementation takes child object in m_childobjects to the parent object. The child object are transformed by the parent its transform.

Reimplemented in a2dCanvasObjectReference, and a2dCanvasObjectArrayReference.

Definition at line 6628 of file canobj.cpp.

int a2dCanvasObject::ReleaseChild ( a2dCanvasObject obj,
bool  backwards = false,
bool  all = false,
bool  now = false 
)

remove the given object from the childobjects

The object will be Realeased. if its refcount is 0 it will be deleted else its refcount decremented.

Parameters:
obj object to release
backwards start at the end
all if true remove all references to object
now if true remove all references to object now!, else only delete flag is set, and Update() takes care of it.
Returns:
number of released objects

Definition at line 6726 of file canobj.cpp.

bool a2dCanvasObject::ReleaseChildObjects ( a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL  ) 

removes and release only from the childobjects the objects with the given mask

Returns:
true if some object were released

Definition at line 6763 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::Find ( const wxString &  objectname,
const wxString &  classname = wxT(""),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId propid = NULL,
const wxString &  valueAsString = wxT(""),
wxUint32  id = 0 
) const

return the object which fits the filter.

Parameters:
objectname object with this name to search for
classname If classname is empty it collects all objects else only object with this class name.
mask object must have this mask.
propid if a property id is given, the object must have a property with this id
valueAsString StringValueRepresentation of the property that is required (if not empty).
id GetUniqueSerializationId() should be this unless 0

Definition at line 4954 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::Find ( a2dCanvasObject obj  )  const

return the child object if it is part of this object

Parameters:
obj object to search for

Definition at line 4962 of file canobj.cpp.

bool a2dCanvasObject::SwitchChildNamed ( const wxString &  objectname,
a2dCanvasObject newobject 
)

the object with the given name is released and switched in place to newobject

Returns:
true if object was found else false

Definition at line 4936 of file canobj.cpp.

int a2dCanvasObject::CollectObjects ( a2dCanvasObjectList *  total,
const wxString &  classname = wxT(""),
a2dCanvasObjectFlagsMask  mask = a2dCanvasOFlags::ALL,
const a2dPropertyId id = 0,
const a2dBoundingBox bbox = wxNonValidBbox 
) const

Copy objects with the right conditions to the total list.

Parameters:
total list of object found (may already contain elements found in earlier call)
classname If classname is empty it collects all objects else only object with this class name.
mask object must have this mask.
id If property id is set the object needs to have this property.
bbox only find objects within this box.
Remarks:
only searches this object and its children, not deeper.
Returns:
number of objects found

Definition at line 4944 of file canobj.cpp.

bool a2dCanvasObject::Update ( UpdateMode  mode  )  [virtual]

Update the state of the object according to its current position etc.

This usually does the following:

  • calculates the new bounding box in world coordinates relative to parents.
  • Release childs that have m_release set

This function is usually called in a2dCanvasDocument::AddPendingUpdatesOldNew between adding the old and the new bounding box to the pending area. You should NOT do any change here that issues commands to the command processor, because such commands wouldn't have a proper context. Such things should be done in UpdateImmediate. Other things like updating the cache data need to be done here.

Takes into account associated child, properties and derived objects. If a2dCanvasObject::UpdateMode = updatemask_force all boundingboxes are invalidated and recalculated, else it only recalculates if invalid or one of the children is invalid.

This function calls DoUpdate(), when needed. The idea is to minimize the number of recalculated boudingboxes. So if an object is setpending or a child became pending, the boudingbox needs to be recalculated, but since this is a combination of property, child and derived object boundingboxes, this is optimized.

Returns:
true if the bounding box did change and the parent has to recalculate
Remarks:
The object its layers is set in the layersetup as being available in the document.

if overridden in derived class, also call baseclass Update

in derived classes DoUpdate() should be implemented to at least calculate the boundingbox of the object without children in m_childobjects, but including any referenced objects in the derived objects. Like arrow point objects on a line or polyline.

Reimplemented in a2dCurvesArea, a2dPolygonLClipper, and a2dPolygonLClipper2.

Definition at line 5551 of file canobj.cpp.

void a2dCanvasObject::UpdateImmediate ( bool  final,
a2dBaseTool tool,
a2dCanvasObject parent = 0,
a2dDoUpdateImmediateData data = 0 
) [virtual]

Like Update, but this is called not on OnIdle, but at well defined points.

Use this function to adjust objects to a changing environment (e.g. wires to moving objects) when the changes are done by commands and need a proper command context. This function calls DoUpdateImmediate.

The DoUpdateImmediateData structure, contains data which controls the recursive/repeating calls to this function. The idea is that objects which change can request more phases. Which eventually leads to extra calls until no more is requested.

Parameters:
final signals last update that will be called in a row.
tool tool from which update is called, may be NULL
parent parent of which the object need to be updated, if NULL, m_tool->GetCanvasView()->GetShowObject() is taken as m_parent
data a structure with data controlling the update process

Definition at line 5949 of file canobj.cpp.

bool a2dCanvasObject::GetPending ( void   )  const [inline]

is this object pending for update?

(overruled by parent object in some cases during rendering)

Remarks:
set the object its pending flag and inform root about this

Definition at line 1602 of file canobj.h.

void a2dCanvasObject::SetPending ( bool  pending  )  [virtual]

set this object pending for update

This flag is set when an object has changed, which means that it needs to be redrawn. Since an object can be Referenced also, it can be drawn at several positions. Therefore the redrawing needs to be done indirectly from the top, and for each a2dCanvasView displaying the object. In general old and new boundingbox areas are updated on the display.

  • Step 1 add pending objects occupied areas to drawer.
  • Step 2 The new boundingbox is calculated.
  • Step 3 add pending objects occupied areas to draweronce more.
  • Step 4 reset all pending flags for objects.
Remarks:
Does also inform the a2dCanvasDocument that there are pending objects.

If because of this object becoming pending other objects should become pending also, one should override this function to set those other objects pending.

If redefined in derived object always call base also.

See also:
DependencyPending()
Parameters:
pending if true set object pending

Reimplemented in a2dCursor, a2dPin, and a2dLayers.

Definition at line 3093 of file canobj.cpp.

void a2dCanvasObject::AddPending ( a2dIterC ic  ) 

search objects ( if nested recursive ) that have the pending flag Set

And add the current absolute boudingbox of the object to the pendingareas in the active a2dCanvasView for update/redrawing that area later. After a this normally the boundingbox of this object will be recalculated in a2dCanvasObject::Update(), followed by one more call to this function here, in order to also redraw the new boundingbox its area. When all pending areas are combined to a minimum in a2dCanvasView, the areas will be redrawn.

The area currently occupied by the object in the active a2dCanvasView is added for update in case the object was pending. Next to that the a2dCanvasView is informed that the object its layer is available in the document and should be rendered. In case the object will be released ( m_Release is set ), the a2dCanvasView::SetLayerCheck( objectlayer ) is called, in order to recheck if there or still object on that layer as seen from that view.

Remarks:
this method is fast if many objects need an update.

You are responsible for setting and resetting the pending flag.

Not valid boundingbox in the object, means the object and its children will be ignored.

Parameters:
ic iterative context, contains cumulative matrix for transforming object to absolute position

Definition at line 4970 of file canobj.cpp.

void a2dCanvasObject::DependencyPending ( a2dWalkerIOHandler handler  )  [virtual]

called by to check if this object becomes pending as a result of other objects

You can Override DependencyPending() to set your object pending, when another object was set pending.

Reimplemented in a2dCurvesArea, a2dCanvasXYDisplayGroupAreas, a2dAxisMarker, a2dMarker, a2dMarkerShow, a2dCurveGroupLegend, and a2dCanvasDocumentReference.

Definition at line 5123 of file canobj.cpp.

void a2dCanvasObject::Render ( a2dIterC ic,
OVERLAP  clipparent 
) [virtual]

Render this object to the active a2dCanvasView.

This function is called via the a2dCanvasDocument class or its nested children. The active a2dCanvasView which is set for the document is used to draw to (either on its buffer or directly on the device) All rendering goes through this function to be able to render specific things in the base class first (like a2dCanvasObject its properties.) Somewhere internal DoRender will be called to really render the derived object itself. Next to that nested a2dCanvasObject's will be rendered too.

If wanted only the canvas objects with a certain mask set, will be rendered. Mask example: Checking visible and selected

use: mask=(a2dCANOBJ_VISIBLE | a2dCANOBJ_SELECTED)

Remarks:
Do not use directly from outside the containing document of this object. Normally only used directly in derived classes
See also:
a2dCanvasDocument
Remarks:
The active clipping rectangle is set within the active drawer. It can be used to decide which parts of the object need to be re-drawn or not. This may speed up drawing in sepcial cases, but in general the active a2dCanvasView, simply clips all that is drawn on it to active clipping rectangle. The fact that the object is called to redrawn itself, is not decided here, instead it is part of the pending object mechanism. Which uses the object its boundingbox to request redrawing.

Normally an object will be rendered if the given layer is equal to the object its layer.

wxLAYER_ALL has a special meaning. If the given input layer is wxLAYER_ALL, then the m_layer of objects is not tested. So the child objects their own layer settings are ignored/not checked in that case. All child objects are drawn at once, still the style of the layers settings is used when needed.

If the flag "m_flags.m_childrenOnSameLayer" is set, a new iteration over layers will take place. The effect is that all children will be drawn at once ( not only objects on the given layer ), but the order of the layers will be taken into account to draw the children. If the flag "m_flags.m_childrenOnSameLayer" is NOT set, a new iteration on layers is NOT done, and only the objects on the given layer will be drawn.

Remarks:
ic.GetPerLayerMode() is true, then only ic.GetLayer() is rendered, which can not be wxLAYER_ALL.
Parameters:
ic iteration context (has a2dCanvasView accumulative matrix to calculate absolute position of the object)
clipparent this must be the clip status of parent object, it is used to optimize drawing speed. e.g If parent is completely within the current clipping rectangle of the a2dCanvasView, there is no need to check child objects.

Reimplemented in a2dWidgetButton, a2dPolygonLClipper, and a2dPolygonLClipper2.

Definition at line 5151 of file canobj.cpp.

void a2dCanvasObject::UpdateViewDependentObjects ( a2dIterC ic  ) 

update the transform matrix for objects with property 'PROPID_viewDependent'

will recursive call the UpdateViewDependentObjects routines of all the child objects (TODO for optimize: with flag 'm_childpixelsize=true').

Parameters:
ic iteration context (has a2dCanvasView accumulative matrix to calculate absolute position of the object)
Remarks:
Check all child objects with (TODO for optimize: flag 'm_childpixelsize=true').

Definition at line 5048 of file canobj.cpp.

void a2dCanvasObject::DrawHighLighted ( a2dIterC ic  )  [virtual]

called by Render() if m_flags.m_HighLight is set

Parameters:
ic iteration context (has a2dCanvasView accumulative matrix to calculate absolute position of the object)

Reimplemented in a2dPin, and a2dWidgetButton.

Definition at line 5459 of file canobj.cpp.

void a2dCanvasObject::SetVisible ( bool  visible  )  [inline]

set if this object will visible (be rendered or not)

(overruled by parent object in some cases during rendering)

Remarks:
set the object its pending flag and inform root about this
Parameters:
visible if true set object visible

Reimplemented in a2dLayerInfo.

Definition at line 1735 of file canobj.h.

bool a2dCanvasObject::IsVisible (  )  const [inline]

get visibility (rendering depends on layer settings also)

Alias for GetVisible

See also:
GetVisible

Definition at line 1748 of file canobj.h.

void a2dCanvasObject::SetFill ( const a2dFill fill  ) 

Set a fill for the object which will be used instead of the layer fill.

The fill is for filling the object. Use a2dCanvasNullFill or 0 to remove the fill from a object. Use a2dTRANSPARENT_FILL to not fill the object.

Remarks:
m_flags.m_filled flag overrules the fill to fill TRANSPARENT

inheritance to children of object

object is free to use style or not

a style resulting in wxLAYER_FILL means property will be removed

See also:
a2dStyleProperty

Definition at line 3369 of file canobj.cpp.

void a2dCanvasObject::SetFill ( const wxColour &  fillcolor,
a2dFillStyle  style = a2dFILL_SOLID 
)

Set a fill color for the object which will be used instead of the layer fill.

Parameters:
fillcolor color to fill object with
style style for one colour fill
Remarks:
creates a a2dOneColourFill internal

inheritance to children of object

object is free to use style or not

See also:
a2dStyleProperty

a2dOneColourFill

Definition at line 3377 of file canobj.cpp.

void a2dCanvasObject::SetFill ( const wxColour &  fillcolor,
const wxColour &  fillcolor2,
a2dFillStyle  style = a2dFILL_SOLID 
)

Set a fill color for the object which will be used instead of the layer fill.

Parameters:
fillcolor color to fill object with
fillcolor2 color to fill object with
style style for one colour fill
Remarks:
inheritance to children of object

object is free to use style or not

See also:
a2dStyleProperty

a2dTwoColourFill

Definition at line 3384 of file canobj.cpp.

void a2dCanvasObject::SetStroke ( const wxColour &  strokecolor,
double  width = 0,
a2dStrokeStyle  style = a2dSTROKE_SOLID 
)

Set a stroke for the object which will be used instead of the layer stroke.

Parameters:
strokecolor color to stroke object with
width width of stroke in world coordinates
style style for one colour stroke
Remarks:
a style resulting in wxLAYER_STROKE means property will be removed

inheritance to children of object

object is free to use style or not

See also:
a2dStyleProperty

Definition at line 3419 of file canobj.cpp.

void a2dCanvasObject::SetStroke ( const wxColour &  strokecolor,
int  width,
a2dStrokeStyle  style = a2dSTROKE_SOLID 
)

Set a stroke for the object which will be used instead of the layer stroke.

Parameters:
strokecolor color to stroke object with
width width of stroke in device coordinates
style style for one colour stroke
Remarks:
creates a a2dOneColourStroke property internal

inheritance to children of object

object is free to use style or not

See also:
a2dStyleProperty

Definition at line 3426 of file canobj.cpp.

void a2dCanvasObject::SetStroke ( const a2dStroke stroke  ) 

Set stroke using pointer to a stroke.

The stroke is for drawing outlines of the object. Use a2dNullStroke to remove the stroke from a object. Use a2dTRANSPARENT_STROKE to not fill the object.

Remarks:
a style resulting in wxLAYER_STROKE means property will be removed

Definition at line 3433 of file canobj.cpp.

virtual void a2dCanvasObject::SetContourWidth ( double  width  )  [inline, virtual]

set the Contour width of the shape

Next to the stroke width one can sometimes set a contour width e.g. a circular donut.

Reimplemented in a2dRect, a2dCircle, a2dEllipse, a2dEllipticArc, a2dArc, a2dSLine, a2dPolygonL, a2dSurface, a2dRectMM, and a2dVectorPath.

Definition at line 1840 of file canobj.h.

void a2dCanvasObject::SetDrawerStyle ( a2dIterC ic,
a2dStyleProperty style 
)

sets fill and stroke of object to a2dCanvasView

sets local fill and pen into a2dCanvasView if available, else they will be set on basis of the layer index.

See also:
a2dCanvasView

Definition at line 3580 of file canobj.cpp.

void a2dCanvasObject::SetChildrenOnSameLayer ( bool  samelayer  )  [inline]

if set children are rendered on the same layer as this object.

Children will be rendered at the same moment as the object itself, the effect is that they appear at the same layer. The rendering style of the children will be based on their own layer id's or style properties.

Parameters:
samelayer if true render children on same layer

Definition at line 1861 of file canobj.h.

void a2dCanvasObject::SetViewDependent ( a2dCanvasView aView,
bool  viewdependent,
bool  viewspecific = false,
bool  onlyinternalarea = false,
bool  deep = false 
)

set the object view dependent and maybe process all children to set these flags

Parameters:
aView view for adding next properties on this object and maybe its children.
viewdependent if true, then add property 'PROPID_viewDependent' to objects that are depending on 'aView' view when it comes to size. Else to remove this property.
viewspecific if true then add property 'PROPID_viewSpecific' to objects that are only visible on 'aView' view. Else to remove this property to make visible on all views.
onlyinternalarea removing scale for children
deep if true then set flags for all nested children objects

Definition at line 3312 of file canobj.cpp.

void a2dCanvasObject::SetChildOnlyTranslate ( bool  onlytranslate  )  [inline]

How a child is placed towards its parent object.

If set true this object as a child object is placed only relative to the position of the parent object. Rotation and scaling of parent object are ignored.

Definition at line 1885 of file canobj.h.

void a2dCanvasObject::SetPreRenderAsChild ( bool  prerender  )  [inline]

If set, this object has a higher priority in rendering than other children objects.

This method sets a priority in rendering: All children which have set the property m_prerenderaschild will be rendered before other children objects.

As default the a2dCanvasObject has no priority in rendering, you have to set this property to true, if you want prerendering.

Parameters:
prerender true to prerender this object, else false

Definition at line 1901 of file canobj.h.

bool a2dCanvasObject::GetFilled (  )  const [inline]

is the object filled flag set Rendering is only outline when set.

Definition at line 1908 of file canobj.h.

void a2dCanvasObject::SetFilled ( bool  filled  )  [inline]

set the filled flag to render only outlines

Rendering is only outline when set.

Remarks:
set the object its pending flag and inform root about this
Parameters:
filled if true set object filled

Definition at line 1915 of file canobj.h.

void a2dCanvasObject::SetResizeOnChildBox ( bool  resizeToChilds  )  [inline]

If True resize to child boundingbox.

In a2dCanvasObject::Update() a wxEVT_CANVASOBJECT_RESIZE_EVENT will be sent to this object. Default there is no handler for the event.

Definition at line 1931 of file canobj.h.

const a2dShadowStyleProperty * a2dCanvasObject::GetShadowStyle (  )  const

quick way to get the style property containing Shadow property

style is maintained within an object as a a2dStyleProperty called __SHADOW__

Remarks:
object is free to use style or not
See also:
a2dShadowStyleProperty

Definition at line 3364 of file canobj.cpp.

void a2dCanvasObject::DoRender ( a2dIterC ic,
OVERLAP  clipparent 
) [protected, virtual]

render derived object

if the object has sub objects (apart from the childobject which are handled here), those subobject most rendered by iterating on layer when needed/wanted, simular to child objects. We do not iterate here, since that is only needed if indeed there or subobjects. This will be know in a "wxDerivedCanvasObject DoRender".

SO parent objects that call this function, must:

  • 1- clip object against area to redraw.
  • 2- iterate on layers when needed.
A a2dCanvasObject is rendered as a + (plus sign) when there or no children.

Reimplemented in a2dDrawingFrame, a2d3DShape, a2dRenderImage, a2dCurveAxisLin, a2dFunctionCurve, a2dVertexCurve, a2dSweepCurve, a2dBandCurve, a2dBarCurve, a2dVertexListCurve, a2dPieCurve, a2dCanvasXYDisplayGroupAreas, a2dBaseMarker, a2dMarkerShow, a2dCursor, a2dPlot, a2dCurveGroupLegend, a2dImage, a2dRgbaImage, a2dImageMM, a2dOrigin, a2dHandle, a2dPin, a2dRectC, a2dArrow, a2dRect, a2dCircle, a2dEllipse, a2dEllipticArc, a2dArc, a2dSLine, a2dEndsLine, a2dScaledEndLine, a2dEndsEllipticChord, a2dControl, a2dWires, a2dText, a2dWidgetButton, a2dWidgetButtonGroup, a2dLayerInfo, a2dPolygonL, a2dPolylineL, a2dSurface, a2dPolygonLClipper, a2dPolygonLClipper2, a2dRectMM, a2dWindowMM, a2dCanvasObjectReference, a2dLibraryReference, and a2dVectorPath.

Definition at line 5134 of file canobj.cpp.

void a2dCanvasObject::RenderChildObjects ( a2dIterC ic,
RenderChild whichchilds,
OVERLAP  clipparent 
) [protected, virtual]

render only the child objects

Parameters:
ic iteration context (has a2dCanvasView accumulative matrix to calculate absolute position of the object)
whichchilds defined which childs will be rendered now, and detects while rendering other types.
clipparent this must be the clip status of parent object.

Definition at line 6419 of file canobj.cpp.

void a2dCanvasObject::RenderChildObjectsOneLayer ( a2dIterC ic,
RenderChild whichchilds,
OVERLAP  clipparent 
) [protected, virtual]

to render the child objects

Parameters:
ic iteration context (has a2dCanvasView accumulative matrix to calculate absolute position of the object)
whichchilds defined which childs will be rendered now, and detects while rendering other types.
clipparent this must be the clip status of parent object.

detect specific objects, to prevent extra rendering calls for child objects, if they do not exist.

Definition at line 6471 of file canobj.cpp.

void a2dCanvasObject::SetEditable ( bool  editable  )  [inline]

Sets if this object may be edited.

If editable is set to true the object may be edited by an user. The default behaviour of this object is to allow modifications (editable).

Parameters:
editable true to allow modifications, else false

Definition at line 2007 of file canobj.h.

bool a2dCanvasObject::IsEditable (  )  const [inline]

get if the object may be edited

Alias for GetEditable

See also:
GetEditable

Definition at line 2017 of file canobj.h.

bool a2dCanvasObject::GetSelected (  )  const [inline]

is the object selected flag set

Rendering is different when set, it will use a special layer in this case.

Definition at line 2023 of file canobj.h.

bool a2dCanvasObject::IsSelected (  )  const [inline]

Is the object selected flag set.

Alias for GetSelected

See also:
GetSelected

Definition at line 2030 of file canobj.h.

void a2dCanvasObject::SetSelected ( bool  selected  )  [inline]

Set the object selected flag if allowed.

When set the second rendering cycle from the document a2dCanvasDocument::Render() etc. will draw this object selected.

Remarks:
sets the object its pending flag and inform root about this
Parameters:
selected if true set object selected

Definition at line 2040 of file canobj.h.

bool a2dCanvasObject::GetSelectable (  )  const [inline]

is the object selectable flag set

Returns:
true if object is selectable, else false

Definition at line 2047 of file canobj.h.

bool a2dCanvasObject::IsSelectable (  )  const [inline]

Is the object selectable flag set.

Alias for GetSelectable

See also:
GetSelectable

Definition at line 2054 of file canobj.h.

void a2dCanvasObject::SetSelectable ( bool  selectable  )  [inline]

Allows to select this object.

If selectable is set to true the object may be selected by an user. The default behaviour of this object is to allow selection.

Parameters:
selectable true to allow selection, else false

Reimplemented in a2dLayerInfo.

Definition at line 2063 of file canobj.h.

void a2dCanvasObject::SetDraggable ( bool  draggable  )  [inline]

Sets if this object may be dragged.

If draggable is set to true the object may be dragged by an user. The default behaviour of this object is to allow dragg-operations.

Parameters:
draggable true to allow selection, else false

Definition at line 2072 of file canobj.h.

bool a2dCanvasObject::IsDraggable (  )  const [inline]

get if the object can be dragged

Alias for GetDraggable

See also:
GetDraggable

Definition at line 2082 of file canobj.h.

void a2dCanvasObject::SetSnap ( bool  snap  )  [inline]

Sets snap flag.

If snap is set to true this object is snapped by the restriction engine of a2dCanvasGlobal, when it is edited/moved etc.

See also:
Restrict

Definition at line 2094 of file canobj.h.

void a2dCanvasObject::SetSnapTo ( bool  snap  )  [inline]

Sets snap_to flag.

If snap is set to true others objects may snap to this object by the restriction engine of a2dCanvasGlobal.

See also:
Restrict

Definition at line 2103 of file canobj.h.

virtual void a2dCanvasObject::SetMode ( int  mode  )  [inline, virtual]

you may use it to modify rendering of the object depending on setting

Override this function to define a way to modify rendering for a derived object.

e.g. When hiting an object you could modify the rendering to notify it to the user.

Reimplemented in a2dHandle.

Definition at line 2114 of file canobj.h.

a2dCanvasObject * a2dCanvasObject::StartEdit ( a2dBaseTool tool,
wxUint16  editmode,
wxEditStyle  editstyle = wxEDITSTYLE_COPY 
) [virtual]

create an editcopy and initialize editing of the editcopy

This is called for an original object and creates an editcopy object.

Calls DoStartEdit() in the end

Parameters:
tool tool from which this function is called. Currently this is the a2dObjectEditTool
editmode tobe used in derived object to switch between different way of editing ( 0 means matrix mode of a2dCanvasObject )
editstyle style of editing e.g. filled and stroked or with a wire frame.

Reimplemented in a2dMultiSelectGroup.

Definition at line 2169 of file canobj.cpp.

void a2dCanvasObject::EndEdit (  )  [virtual]

cleanup an editcopy object

This will Remove the editcopy from its parent. If editstyle is not wxEDITSTYLE_COPY, EditEnd is called for an original object, which is deprecated. The only tool using non wxEDITSTYLE_COPY is the wxMultEditTool, which will be changed. Calls DoEndEdit() first

call virtual to do object specific ending

set invisible, deletion is done by tool later.

Definition at line 2359 of file canobj.cpp.

void a2dCanvasObject::EditFeedback ( a2dIterC ic,
const a2dFeedbackId id,
a2dCanvasObject currentEdit = 0,
int  depth = INT_MAX,
a2dCanvasObjectFlagsMask  flags = a2dCanvasOFlags::NON,
double  x = 0,
double  y = 0 
) [virtual]

tool editing feedback

Parameters:
ic iteration context
id the id for the editing situation.
currentEdit the currently edited object or another hint object
depth recursion depth (0=this object, 1=this object+childs, ...)
flags objects with this flag set ignore the depth limit
x x world coordinate of mouse
y y world coordinate of mouse

Reimplemented in a2dRect, a2dRectMM, and a2dWirePolylineL.

Definition at line 3665 of file canobj.cpp.

void a2dCanvasObject::DoLoad ( wxObject *  parent,
a2dIOHandlerXmlSerIn parser,
a2dXmlSer_flag  xmlparts 
) [virtual]

virtual bool a2dCanvasObject::NeedsUpdateWhenConnected (  )  const [inline, virtual]

used in case of flexible canvas objects (wires).

If another object connected to this object changes, and that has an effect on this object, return true;

Reimplemented in a2dWires, and a2dWirePolylineL.

Definition at line 2327 of file canobj.h.

bool a2dCanvasObject::DoConnect (  )  [inline]

if return true, connection with other object on this object its pins is allowed.

This is usually used for temporarily disabling connectivity

Definition at line 2331 of file canobj.h.

void a2dCanvasObject::DoConnect ( bool  doconnect  )  [inline]

If set to true this object may be connected to other object on its pins.

This is usually used for temporarily disabling connectivity

Definition at line 2335 of file canobj.h.

bool a2dCanvasObject::CanConnectWith ( a2dIterC ic,
a2dCanvasObject toConnect,
bool  autocreate 
)

check connect to other object

After the call Pin objects which can connect, have their bin flag set.

Definition at line 7124 of file canobj.cpp.

a2dPin * a2dCanvasObject::CanConnectWith ( a2dIterC ic,
a2dPin pin,
double  margin,
bool  autocreate 
)

is the given pin close enough to another a2dPin to allow connection?

The default searches for a2dPin children in this object, and a pointer to the one which can connect with the given pin is returned. If non, returns NULL.

Before trying to connect to the object DoCanConnectWith() is called, here the object can be prepared to be able to connect to the given pin here. The default implementation asks the object to GeneratePins() if autoccreate is set true.

Parameters:
ic iteration context
pin pin to check for connection to this object
margin pin as to be this close.
autocreate when true, pins maybe be created at the position in a derived object.

Definition at line 7169 of file canobj.cpp.

bool a2dCanvasObject::IsConnected ( bool  needsupdate,
a2dCanvasObject toConnect = 0 
)

Is the object connected ( Optinal to specific object ) ?

Parameters:
needsupdate if true, only return true when connected Object(s) need an update.
toConnect when not ( NULL ), the object needs to be connected with toConnect.

Definition at line 7095 of file canobj.cpp.

bool a2dCanvasObject::GetConnected ( a2dCanvasObjectList *  connected,
bool  needsupdate 
)

get connected objects that are connected to this object via its pins.

Parameters:
connected list to which connected objects will be added.
needsupdate if true only connected objects which need updating will be added.

Definition at line 7565 of file canobj.cpp.

bool a2dCanvasObject::ConnectWith ( a2dCanvasObject parent,
a2dCanvasObject toconnect,
const wxString &  pinname = wxT(""),
double  margin = 1,
bool  undo = false 
) [virtual]

Do connect with another a2dCanvasObject by pinname.

If pinname is an empty string the pins that lie on top of each-other will be connected. Zero Length wires or objects (having pins on top of eachother) are not connected if already a connection exists. If needed (eg pin was already connected to another object) extra wires will be added to keep connection intact.

Reimplemented in a2dWires.

Definition at line 7215 of file canobj.cpp.

bool a2dCanvasObject::ConnectWith ( a2dCanvasObject parent,
a2dPin pin,
double  margin = 1,
bool  undo = false 
) [virtual]

Do connect with another a2dCanvasObject by pin pointer.

Searches this object for a pin, which is at the same position as the one given. If that pin allows connection, those pins will be connected.

Reimplemented in a2dWires.

Definition at line 7197 of file canobj.cpp.

void a2dCanvasObject::ConnectPinsCreateConnect ( a2dCanvasObject parent,
a2dPin pinc,
a2dPin pinother,
bool  undo = false 
) [virtual]

connect two pins

by creating a a2dWires object in between, unless already connected and they are exactly at the same position. They idea is to connect pins without changing there position, and keep already connected objects at the given pins connected also (to the wire object that is created ).

Definition at line 7342 of file canobj.cpp.

void a2dCanvasObject::ConnectPins ( a2dCanvasObject parent,
a2dPin pinc,
a2dPin pinother,
bool  undo = false 
)

connect two pins which must be unconnected and at the same position

This is a simple straight forward connection of the two pins. When Undo is true proper commands are issued to connect the pins. If the pins are already connected with something, they will be first disconnected.

Definition at line 7323 of file canobj.cpp.

bool a2dCanvasObject::DisConnectWith ( a2dCanvasObject parent,
a2dCanvasObject toConnect = NULL,
const wxString &  pinname = wxT("") 
) [virtual]

Do Disconnect from another a2dCanvasObject by pin name.

If toConnect = NULL all objects will be disconnected. If pinname is an empty string the pins connected to toConnect will be dis-connected, else only the ones with the pinname will be disconnected.

Definition at line 7446 of file canobj.cpp.

bool a2dCanvasObject::DisConnectAt ( a2dCanvasObject parent,
a2dPin pin 
) [virtual]

Do Disconnect from another a2dCanvasObject by pin pointer.

Disconnect at pin (of object or of connected object).

Definition at line 7486 of file canobj.cpp.

bool a2dCanvasObject::CreateWiresOnPins ( a2dCanvasObject parent,
bool  undo 
)

create wires on pins which do not have wires, but directly are connected to other objects.

This prepares the object for dragging/moving, while preserving the connection, since then wires will be rerouted when dragging.

Definition at line 7538 of file canobj.cpp.

bool a2dCanvasObject::SetConnectedPending ( bool  onoff,
bool  needsupdateonly 
)

set connected pending or not pending

Parameters:
onoff set connected object pending or not pending
needsupdateonly if true only connected object which need updating will treated.

Definition at line 7592 of file canobj.cpp.

bool a2dCanvasObject::HasPins ( bool  realcheck = false  ) 

are there a2dPin derived children

Parameters:
realcheck if true checks all children else the flag m_flags.m_hasPins is returned
Remarks:
if realcheck is true also the m_flags.m_hasPins will be updated.

Definition at line 6965 of file canobj.cpp.

a2dPin * a2dCanvasObject::HasPinNamed ( const wxString  pinName,
bool  NotConnected = false 
)

are there a2dPin derived children which matches the given pin name?

Parameters:
pinName the name of the pin to search for ( uses wxString::Matches() ).
NotConnected if true the pin must be unconnected too.
Returns:
the a2dPin object found or NULL
Remarks:
the m_flags.m_hasPins is ignored here for the moment

Definition at line 6987 of file canobj.cpp.

virtual bool a2dCanvasObject::GeneratePins ( a2dPinClass toConnectTo,
a2dConnectTask  task,
double  x,
double  y 
) [inline, virtual]

create pins in derived objects.

When wanting to connect to shapes which at construction have no pins, but still make sence to connect too, this function generates pins for the object, when connection is asked for by a tool. This is via EditFeedBack()

The idea is to generate temporary pins for the tools, so the user sees where connection are possible.

Parameters:
toConnectTo the pinClass to which the generated pin must be able to connect.
task what/how to connect
x x position of mouse or pin which wants/needs connection
y y position of mouse or pin which wants/needs connection

Reimplemented in a2dRect, a2dCircle, a2dEllipse, a2dText, a2dPolylineL, a2dRectMM, and a2dWirePolylineL.

Definition at line 2469 of file canobj.h.

bool a2dCanvasObject::GeneratePinsPossibleConnections ( a2dPinClass pinClass,
a2dConnectTask  task,
double  x,
double  y 
) [virtual]

generates pins on all possible locations where the object can be connected.

Default calls pinClass->GetConnectionGenerator()->GeneratePossibleConnections() And that leads to calling a2dCanvasObject::GeneratePins() This way a a2dConnectionGenerator can limit the pins which are generated.

Parameters:
pinClass if not NULL, only generate temporary pins that may connect to this pinClass.
task what/how to connect
x can be used to create pins depending on the poition of the mouse inside the object.
y can be used to create pins depending on the poition of the mouse inside the object.

Definition at line 3650 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::GetConnectTemplate ( a2dPinClass mapThis,
a2dCanvasObject other,
a2dPinClass mapOther 
) const [virtual]

based on the a2dPinClass's of eventually a2dPin's wanted in both objects, a

connection object will be delivered as a template to be cloned by the caller. In principle calling this->GetConnectTemplate() and other->GetConnectTemplate() should result in the same. The default implementation uses a2dCanvasGlobals->GetPinClassMaps() which is a simple system to supply a template object based ob the two entry maps. You can override this function to define your own way of connections.

Definition at line 3655 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::CreateConnectObject ( a2dCanvasObject parent,
a2dPin pinThis,
a2dPin pinOther,
bool  undo = false 
) const [virtual]

generates a connection object with pins and all.

Default calls pinThis->GetConnectionGenerator()->CreateConnectObject() This way a a2dConnectionGenerator can decide on the type of object to generate as a plugin.

Definition at line 3660 of file canobj.cpp.

a2dPin * a2dCanvasObject::AddPin ( const wxString  name,
double  x,
double  y,
wxUint32  a2dpinFlags,
a2dPinClass pinClass 
)

add a a2dPin as child

Parameters:
name name which the pin will get
x x-position of pin
y y-position of pin
a2dpinFlags 
pinClass pinClass of the pin, created pin cloned from a2dPinClass->GetPin()
Returns:
the pin that was created and added to the object.

Definition at line 7025 of file canobj.cpp.

void a2dCanvasObject::RemovePins ( bool  NotConnected = false,
bool  onlyTemporary = false,
bool  now = false 
)

Remove all a2dPin children.

Parameters:
NotConnected when true only pins which are not connected tp another pin will be deleted
onlyTemporary when true only pins with the temporary flag set using a2dPin::SetTemporaryPin() will be deleted. These type of pins are used in automatic connection situations, and often after an editing attempt of other objects need to be deleted in the end.
now if true remove pin object now!, else only delete flag is set, and it will be deleted in idle time.

Definition at line 7049 of file canobj.cpp.

void a2dCanvasObject::SetRenderConnectedPins ( bool  onoff  ) 

Calls a2dPin::SetRenderConnected() for all pins.

By default connected pins are not rendered, you can set it true for all pins here. But you can also set each pin individual.

Definition at line 6863 of file canobj.cpp.

void a2dCanvasObject::CreateWireEditCopies ( a2dCanvasObjectList *  originals,
a2dCanvasObjectList *  copies 
)

Find and clone all wires ( IsConnect()==true ) connected to this object or to such wires.

After this function you must call copies->RestoreConnectionsAfterCloning()

Parameters:
originals list of original wire objects
copies list of wire object edit copies

todo this flag for pins should be right always!

Definition at line 6877 of file canobj.cpp.

void a2dCanvasObject::RestoreConnectionsAfterCloning ( class a2dCanvasCommandProcessor cp = 0  )  [virtual]

Restore connections after cloning.

After cloning a tree of connected objects, this will restore the connections in the clone as they have been in the original

Parameters:
cp if not 0, the connections are created by issuing a2dCommand_ConnectPins commands

Reimplemented in a2dPin.

Definition at line 6943 of file canobj.cpp.

void a2dCanvasObject::ClearAllPinConnections ( class a2dCanvasCommandProcessor cp  )  [virtual]

Remove all pin connections by issuing a2dCommand_ConnectPins commands.

This should be done before a a2dCommand_ReleaseObject is issued.

Parameters:
cp the command processor receiving the commands

Reimplemented in a2dPin.

Definition at line 6954 of file canobj.cpp.

bool a2dCanvasObject::DoCanConnectWith ( a2dIterC ic,
a2dPin pin,
double  margin,
bool  autocreate 
) [protected, virtual]

prepare an object for being connected to a given pin

Before trying to connect in CanConnectWith() to the object DoCanConnectWith() is called, here thy object can be prepared to be able to connect to the given pin here. The default implementation ask the object to GeneratePins() if autoccreate is set true.

In a derived class one can do more complicated to decide if a pin needs to be created or not.

Reimplemented in a2dPolylineL.

Definition at line 7150 of file canobj.cpp.

void a2dCanvasObject::SetIsProperty ( bool  IsProperty  )  [inline]

a2dCanvasObject set as property will be rendered after all other child objects when it is rendreed from a parent a2dCanvasObject

Definition at line 2588 of file canobj.h.

bool a2dCanvasObject::GetIsProperty (  )  const [inline]

a2dCanvasObject set as property will be rendered after all other child objects when it is rendreed from a parent a2dCanvasObject

Definition at line 2592 of file canobj.h.

a2dText * a2dCanvasObject::SetObjectTip ( const wxString &  tip,
double  x,
double  y,
double  size = 30,
double  angle = 0,
const a2dFont font = *a2dDEFAULT_CANVASFONT 
)

quickly set a property name __OBJECTTIP__

This function stores an OBJECTTIP property which will be shown when mouse is within an object.

Parameters:
tip the tip which should be shown
x x-pos of the tip
y y-pos of the tip
size font-size in world coordinates (font size of the font-param will be ignored, see a2dText documentation)
angle rotation in degrees
font the font to use
Returns:
a pointer to the a2dText object used to show the tip.

Definition at line 3277 of file canobj.cpp.

void a2dCanvasObject::SetTipWindow ( const wxString &  tip  ) 

quickly set a property a2dTipWindowProperty

This function stores a a2dTipWindowProperty property which will be shown when mouse is within an object. The function a2dCanvasObject::OnEnterObject() will show it.

Parameters:
tip the tip which should be shown

Definition at line 3294 of file canobj.cpp.

bool a2dCanvasObject::EditProperties ( const a2dPropertyId id,
bool  withUndo 
) [virtual]

edit properties of the object

This default implementation distributes the a2dPropertyEditEvent with id wxEVT_PROPOBJECT_EDITPROPERTIES_EVENT, to a2dDocviewGlobals->GetEventDistributer().

This can be intercepted by any registrated class in order to edit the properties. When after return, the event its GetEdited() returns true, this indicates that the properties where indeed edited.

Parameters:
id If property id is set only matching properties are selected
withUndo If true, the changes can be undone later.

Reimplemented from a2dPropObject.

Definition at line 3216 of file canobj.cpp.

void a2dCanvasObject::OnPropertyChanged ( const a2dPropertyId id  )  [virtual]

This function is called after a property changed.

This is overloaded to set e.g. a pending flag

Reimplemented from a2dObject.

Reimplemented in a2dMarkerShow, and a2dLayerInfo.

Definition at line 3258 of file canobj.cpp.

void a2dCanvasObject::SetSpecificFlags ( bool  setOrClear,
a2dCanvasObjectFlagsMask  which 
)

set all bit flags in object that or true in mask to true or false

set specific flags to true or false

Remarks:
the object is not setpending when something changed ( actually the pending flag can be set here also )
Parameters:
setOrClear if true sets the flag to true else to false
which set only those flags in object to true or false

Definition at line 3152 of file canobj.cpp.

void a2dCanvasObject::SetFlags ( a2dCanvasObjectFlagsMask  newmask  ) 

set bit flags of object (true or false) to given newmask values

Remarks:
does not recurse into children
Parameters:
newmask mask to set flags to in object (either true or false)

Definition at line 3157 of file canobj.cpp.

void a2dCanvasObject::SetBin ( bool  bin  )  [inline]

general flag use at will.

Remarks:
This flag should only be used for temporarly purposes. This object uses this flag too and you might run into problems if you use this flag. It's a good practice to set this flag if you need it and reset this flag to false if you don't need it anymore. Another possibility might be to add a new property to this object if you want to be on the secure side.
Parameters:
bin temporarely status information

Definition at line 2692 of file canobj.h.

bool a2dCanvasObject::GetGroupA (  )  const [inline]

get the groupA flag

used to define operands in operation on two groups of objects

Definition at line 2700 of file canobj.h.

void a2dCanvasObject::SetGroupA ( bool  value  )  [inline]

set the groupA flag

used to define operands in operation on two groups of objects

Parameters:
value true to set group flag A

Definition at line 2706 of file canobj.h.

bool a2dCanvasObject::GetGroupB (  )  const [inline]

get the groupA flag

used to define operands in operation on two groups of objects

Definition at line 2711 of file canobj.h.

void a2dCanvasObject::SetGroupB ( bool  value  )  [inline]

set the groupA flag

used to define operands in operation on two groups of objects

Parameters:
value true to set group flag B

Definition at line 2717 of file canobj.h.

bool a2dCanvasObject::GetGeneratePins (  )  const [inline]

get the GeneratePins flag

used to define operands in operation on two groups of objects

Definition at line 2722 of file canobj.h.

void a2dCanvasObject::SetGeneratePins ( bool  value  )  [inline]

set the GeneratePins flag

used to define operands in operation on two groups of objects

Parameters:
value true to set group flag C

Definition at line 2728 of file canobj.h.

void a2dCanvasObject::SetIgnoreSetpending ( bool  value = true  )  [inline]

set IgnoreSetpending flag

If this flag is set, the object will be not be set pending in SetPending()

Definition at line 2732 of file canobj.h.

bool a2dCanvasObject::GetIgnoreSetpending (  )  const [inline]

get IgnoreSetpending flag

If this flag is set, the object will be not be set pending in SetPending()

Definition at line 2736 of file canobj.h.

static void a2dCanvasObject::SetIgnoreAllSetpending ( bool  value = true  )  [inline, static]

set static IgnoreAllSetpending flag

If this flag is set, all a2dCanvasObject will be not be set pending in SetPending()

Definition at line 2740 of file canobj.h.

static bool a2dCanvasObject::GetIgnoreAllSetpending (  )  [inline, static]

get static IgnoreSetpending flag

If this flag is set, all a2dCanvasObject will be not be set pending in SetPending()

Definition at line 2744 of file canobj.h.

wxUint16 a2dCanvasObject::GetLayer (  )  const [inline]

Returns the layer index where this object is drawn upon.

The order of the a2dLayers in the root object decides if and when it will be drawn.

See also:
a2dCanvasDocument::SetLayerSetup

a2dLayers

Definition at line 2802 of file canobj.h.

void a2dCanvasObject::SetLayer ( wxUint16  layer  )  [virtual]

set layer index where this object is drawn upon.

Default is layer wxLAYER_DEFAULT (colours etc taken from layer list) Some layers are predefined and used for special purposes (i.e. for selection of an object etc.). Please refer to wxLayerNames. If you want to define your own layer you should give it a value between wxLAYER_USER_FIRST and wxLAYER_USER_LAST (wxLAYER_USER_FIRST <= myLayerIndex <= wxLAYER_USER_LAST)

See also:
wxLayerNames

a2dLayerInfo

a2dLayers

Parameters:
layer the index of the layer

Definition at line 6389 of file canobj.cpp.

virtual bool a2dCanvasObject::UserBaseFunctionEx ( int  function,
a2dIOHandler handler = NULL 
) [inline, virtual]

can be used by the user to implement a function that affects all a2dCanvas derived objects

a2dIOHandler can be used to transfer data to the function, for example a a2dWalkerIOHandler handler can be used to iterate the document, and calll this function on every object wanted.

Parameters:
function function id, to be able to use this function for more tasks.
handler a2dIOHandler which was use to iterate the document

Definition at line 2849 of file canobj.h.

void a2dCanvasObject::DoWalker ( wxObject *  parent,
a2dWalkerIOHandler handler 
) [protected, virtual]

iterate over this object and its children

This function allows you to extend the functionality of all a2dCanvasObject classes in a a2dCanvasDocument, without adding extra members to these objects.

Default functions are called on the a2dWalkerIOHandler, which redirect the calls to other functions based on this object its classname. On can register classes to a2dWalkerIOHandler or derived classes. This way for each unique object in the document there can be a function in a2dWalkerIOHandler.

Returns:
false if some object did not have a function attached via a2dWalkerIOHandler.
See a2dWalkerIOHandler for more.

Reimplemented from a2dPropObject.

Reimplemented in a2dDrawingFrame, a2d3DShape, a2dBarCurve, a2dCurvesArea, a2dCanvasXYDisplayGroupAreas, a2dAxisMarker, a2dMarker, a2dMarkerShow, a2dCurveGroupLegend, a2dEndsLine, a2dEndsEllipticChord, a2dWidgetButton, a2dPolylineL, a2dCanvasObjectReference, a2dLibraryReference, and a2dExternalReference.

Definition at line 6060 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::GetAsCanvasVpaths ( bool  transform = true  )  [virtual]

when implemented the object without its children, is converted to

to a list of a2dVectorPath's. Else wxNullCanvasObjectList is returned.

Reimplemented in a2dRectC, a2dArrow, a2dWH, a2dRect, a2dCircle, a2dEllipse, a2dEllipticArc, a2dArc, a2dSLine, a2dText, a2dPolygonL, a2dPolylineL, a2dSurface, a2dRectMM, and a2dVectorPath.

Definition at line 2130 of file canobj.cpp.

bool a2dCanvasObject::DoStartEdit ( wxUint16  editmode,
wxEditStyle  editstyle 
) [virtual]

only used for editable objects and under control of a editing tool.

If object is editable this function is used to initialize the object for editing. In general this means adding editing handles to the child list. In the event handling of the object those handles are hit and moved, the object itself is changed accordingly.

Returns:
true is this object can be edited and is initialized for that.

Todo:
edit of bbox ( children or not included )

Reimplemented in a2dDrawingFrame, a2dVertexCurve, a2dSweepCurve, a2dBandCurve, a2dVertexListCurve, a2dPieCurve, a2dCanvasXYDisplayGroupAreas, a2dBaseMarker, a2dMarkerShow, a2dImage, a2dImageMM, a2dWH, a2dRect, a2dCircle, a2dEllipse, a2dEllipticArc, a2dArc, a2dSLine, a2dControl, a2dText, a2dPolygonL, a2dSurface, and a2dRectMM.

Definition at line 2270 of file canobj.cpp.

a2dBoundingBox a2dCanvasObject::DoGetUnTransformedBbox ( a2dBboxFlags  flags = a2dCANOBJ_BBOX_NON  )  const [protected, virtual]

In derived object this should be overriden to calculate the boundingbox of the object without its children.

The default return a non Valid boundingbox.

The real boundingbox of the object is often less desirable for editing. e.g. a rectangle with a contour, one does not want editing handles on the contour, instead they should still be on the basic rectangle.

Definition at line 5470 of file canobj.cpp.

bool a2dCanvasObject::DoUpdate ( UpdateMode  mode,
const a2dBoundingBox childbox,
const a2dBoundingBox clipbox,
const a2dBoundingBox propbox 
) [protected, virtual]

Update derived Object specific things ( mainly boundingbox).

Calculates the boundingbox of the object (exclusif base class child objects but with other nested objects).

Parameters:
mode way to update the objects
childbox size of children boundingbox
clipbox clip to this
propbox size of properties boundingbox
Remarks:
in a derived class this function can also be used to update object specific cache data.

force may or may not have direct influence on the object itself, if this function is called directly for some reason (e.g from derived objects), you must invalidate the boudingbox yourself. GetDrawerBox()->SetValid( false );

Reimplemented in a2d3DShape, a2dRenderImage, a2dCurveObject, a2dFunctionCurve, a2dVertexCurve, a2dSweepCurve, a2dBandCurve, a2dVertexListCurve, a2dPieCurve, a2dCurvesArea, a2dCanvasXYDisplayGroupAreas, a2dAxisMarker, a2dMarker, a2dMarkerShow, a2dPlot, a2dCurveGroupLegend, a2dHandle, a2dPin, a2dWH, a2dCircle, a2dEllipse, a2dEllipticArc, a2dArc, a2dEndsLine, a2dScaledEndLine, a2dEndsEllipticChord, a2dControl, a2dWires, a2dVisibleProperty, a2dText, a2dWidgetButton, a2dLayers, a2dPolygonL, a2dPolylineL, a2dSurface, a2dRectMM, a2dWindowMM, a2dCanvasObjectReference, a2dLibraryReference, and a2dVectorPath.

Definition at line 5537 of file canobj.cpp.

virtual void a2dCanvasObject::DoEndEdit (  )  [inline, protected, virtual]

only used for editable objects and under control of a editing tool.

Do a clean up at the end of an editing sesion of the object. In general this means, remove editing handles from child list.

Reimplemented in a2dControl, a2dVisibleProperty, and a2dText.

Definition at line 3018 of file canobj.h.


Member Data Documentation

float a2dCanvasObject::m_worldExtend [protected]

world extend in world coordinates.

Normally contains at least the stroke width when this is in world coordinates.

Definition at line 2962 of file canobj.h.

wxUint16 a2dCanvasObject::m_pixelExtend [protected]

Pixel extend.

In case of pixel object or partial pixel object or pixel strokes, this will contain the needed oversize on top of the boundingbox. It is to be set in Update() or OnUpdate()

Definition at line 2970 of file canobj.h.

when an object should only be rendered in the view pointed to by this property. This is tipically used when using tool object.

Definition at line 3108 of file canobj.h.

used in GDSII and KEY format to specify the DATATYPE of elements

GDSII compatible to sub identify this object. you can use it as a special tagged object

Definition at line 3117 of file canobj.h.


The documentation for this class was generated from the following files:
a2dCanvasObject Class Reference -- Tue Aug 31 18:13:02 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation