wxArt2D
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
a2dCanvasObject Class Reference

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]

Classes

struct  RenderChild
 used to tell which child object to render and to detect the need for it. More...
 

Public Member Functions

virtual a2dCanvasObjectListGetAsCanvasVpaths (bool transform=true) const
 when implemented the object without its children, is converted to More...
 
virtual a2dCanvasObjectListGetAsPolygons (bool transform=true) const
 convert to a list of polygons. More...
 
virtual a2dCanvasObjectListGetAsPolylines (bool transform=true) const
 convert to a list of polylines. More...
 
virtual a2dVertexListGetAsVertexList (bool &returnIsPolygon) const
 convert to a polygon. More...
 
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. More...
 
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. More...
 
void SetRotation (double rotation)
 Sets a rotation of this object. More...
 
void Scale (double scalex, double scaley)
 Scale in x and y ( > zero) More...
 
void Mirror (bool x=true, bool y=false)
 Mirrors this object in x or y orientation. More...
 
void SkewX (double angle)
 Skew in X. More...
 
void SkewY (double angle)
 Skew in Y. More...
 
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. More...
 
void SetTransformMatrix (double xt, double yt, double scalex=1, double scaley=1, double degrees=0)
 Sets the matrix used to position the object. More...
 
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 More...
 
void SetPosXyPoint (const a2dPoint2D &pos)
 set position to x,y More...
 
bool SetPosXYRestrict (double &x, double &y)
 set position to x,y but restricted, returns new values More...
 
void Translate (double x, double y)
 relative translate the object to position x,y in world coordinates More...
 
void Transform (const a2dAffineMatrix &tworld)
 transform the object using the given matrix More...
 
virtual bool EliminateMatrix ()
 reduce matrix to identity More...
 
Snap and Alignment
  • Functions to deal with snapping the objects to the grid or other objects.
  • Alignment of objects using a calculated boundingbox.
virtual bool RestrictToObject (a2dIterC &ic, const a2dPoint2D &pointToSnapTo, a2dPoint2D &bestPointSofar, a2dSnapToWhatMask snapToWhat, double thresHoldWorld)
 called from an a2dRestrictionEngine, to restrict vertexes, lines, object to this object. More...
 
virtual a2dCanvasObjectListGetSnapVpath (a2dSnapToWhatMask snapToWhat)
 return a vectorpath indicating on which point/segments the object likes to be snapped. More...
 
virtual a2dVertexArrayGetAlignmentPoints ()
 Return a list of points to align object with others. More...
 
a2dBoundingBox GetAlignmentBbox ()
 calls GetAlignmentPoints()
 
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.

a2dDrawingGetRoot () const
 get a2dCanvasDocument of the object. More...
 
void SetRoot (a2dDrawing *root, bool recurse=true)
 Sets this object to a a2dCanvasDocument. More...
 
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
 
a2dCanvasObjectListGetChildObjectList ()
 get the list where the child objects are stored in. More...
 
const a2dCanvasObjectListGetChildObjectList () const
 
a2dCanvasObjectListCreateChildObjectList ()
 create and get the list where the child objects are stored in. More...
 
unsigned int GetChildObjectsCount () const
 get number of child objects More...
 
a2dCanvasObjectCreateHierarchy (a2dCanvasObjectFlagsMask mask, bool createref=true)
 object with the same given mask are made into a group. More...
 
virtual void RemoveHierarchy ()
 move childs of childs and members which have hierarchy one level up to this object its child list. More...
 
int ReleaseChild (a2dCanvasObject *obj, bool backwards=false, bool all=false, bool now=false, bool undoCommands=false)
 remove the given object from the childobjects More...
 
bool ReleaseChildObjects (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
 removes and release only from the childobjects the objects with the given mask More...
 
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. More...
 
a2dCanvasObjectFind (a2dCanvasObject *obj) const
 return the child object if it is part of this object More...
 
bool SwitchChildNamed (const wxString &objectname, a2dCanvasObject *newobject)
 the object with the given name is released and switched in place to newobject More...
 
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. More...
 
Editing and Highlighting
void SetEditable (bool editable)
 Sets if this object may be edited. More...
 
bool GetEditable () const
 get if the object may be edited
 
void SetFixedStyle (bool fixedStyle)
 Set object to fixed style ot not.
 
bool GetFixedStyle () const
 Get object fixed style setting.
 
bool IsEditable () const
 get if the object may be edited More...
 
bool GetSelected () const
 is the object selected flag set More...
 
bool IsSelected () const
 Is the object selected flag set. More...
 
void SetSelected (bool selected)
 Set the object selected flag if allowed. More...
 
bool GetSelected2 () const
 is the object selected2 flag set More...
 
void SetSelected2 (bool selected)
 Set the object selected2 flag if allowed. More...
 
bool GetSelectable () const
 is the object selectable flag set More...
 
bool IsSelectable () const
 Is the object selectable flag set. More...
 
void SetSelectable (bool selectable)
 Allows to select this object. More...
 
void SetDraggable (bool draggable)
 Sets if this object may be dragged. More...
 
bool GetDraggable () const
 get if the object can be dragged
 
bool IsDraggable () const
 get if the object can be dragged More...
 
bool GetSnap () const
 is snap flag set?
 
void SetSnap (bool snap)
 Sets snap flag. More...
 
void SetSnapTo (bool snap)
 Sets snap_to flag. More...
 
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 More...
 
virtual int GetMode () const
 get the rendering mode of the object.
 
virtual a2dCanvasObjectStartEdit (a2dBaseTool *tool, wxUint16 editmode, wxEditStyle editstyle=wxEDITSTYLE_COPY, a2dRefMap *refs=NULL)
 create an editcopy and initialize editing of the editcopy More...
 
virtual void EndEdit ()
 cleanup an editcopy object More...
 
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
 
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 More...
 
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. More...
 
virtual void SetLayer (wxUint16 layer)
 set layer index where this object is drawn upon. More...
 
- Public Member Functions inherited from a2dObject
virtual bool ProcessEvent (wxEvent &event)
 
bool SearchDynamicEventTable (wxEvent &event)
 
void Connect (int winid, int lastId, int eventType, wxObjectEventFunction func, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
bool Disconnect (int winid, int lastId, wxEventType eventType, wxObjectEventFunction func=NULL, wxObject *userData=(wxObject *) NULL, wxEvtHandler *eventSink=(wxEvtHandler *) NULL)
 
void ProcessConnectedEvent (wxEvent &event)
 wxCHECK_VERSION(2,9,0) More...
 
void ConnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEvent (wxEventType type, wxEvtHandler *eventSink)
 
bool DisconnectEventAll (wxEvtHandler *eventSink)
 Remove all dynamic events in classA, going to classB (eventSink) More...
 
 a2dObject ()
 constructor
 
virtual ~a2dObject ()
 destructor
 
void operator= (const a2dObject &other)
 assignment operator
 
int GetOwnedBy ()
 like it to be protected, but this does not work with wxList macros More...
 
virtual a2dObjectSetNonDynamic ()
 Call to mark this object as non-dynamic (static/local/auto) More...
 
void CheckReferences ()
 Check zero reference count and delete if count is 0. More...
 
a2dObjectClone (CloneOptions options, a2dRefMap *refs=NULL) const
 create an exact copy of this property
 
 a2dObject (const a2dObject &other, CloneOptions options, a2dRefMap *refs)
 
virtual wxString GetName () const
 Returns the name of this object, if no name is given the internal id will be returned. More...
 
virtual void SetName (const wxString &name)
 Creates the a2dStringProperty PROPID_Name. More...
 
void SaveAsDocument (a2dIOHandlerXmlSerOut &out)
 Save this object and all below as an XML document. More...
 
virtual void Save (wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
 write all needed to an XML type of file called the CVG format More...
 
void LoadFromDocument (a2dIOHandlerXmlSerIn &parser)
 Load this object and all below from an XML document. More...
 
virtual void Load (wxObject *parent, a2dIOHandlerXmlSerIn &parser)
 load object from CVG file More...
 
wxInt64 GetUniqueSerializationId () const
 return a unique id for this object More...
 
virtual bool AlwaysWriteSerializationId () const
 If true, always write an id. More...
 
virtual bool LinkReference (a2dObject *other)
 link a reference in the object to the given value More...
 
virtual void ResolveInform ()
 inform an object that reference resolution was done More...
 
void Walker (wxObject *parent, a2dWalkerIOHandler &handler)
 This is used to recursively walk through an object tree.
 
void SetCheck (bool check)
 general flag use at will. More...
 
bool GetCheck () const
 general flag use at will.
 
void SetRelease (bool value)
 set release flag More...
 
bool GetRelease () const
 get release flag More...
 
a2dAutoZeroPtr< a2dObject > ** GetAutoZeroPtrList ()
 return the list head pointer for autozero pointers to this object More...
 
 DECLARE_PROPERTIES ()
 
a2dNamedPropertyGetProperty (const a2dPropertyId *propertyId, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 get property on this object More...
 
void SetProperty (a2dNamedProperty *propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object. More...
 
void SetProperty (const a2dNamedProperty &propertyHolder, a2dPropertyId::SetFlags flags=a2dPropertyId::set_none)
 Set the property to the this object and if enabled, to all childs and object members. More...
 
virtual a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none)
 Find a dynamic property with given id in the property list. More...
 
virtual const a2dNamedPropertyFindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) const
 Find a dynamic property with given id in the property list. More...
 
virtual bool HasProperty (const a2dPropertyId *id, const wxString &stringvalue=wxEmptyString) const
 Check if the object has a property with given id and string representation. More...
 
virtual void OnPropertyChanged (const a2dPropertyId *id)
 This function is called after a property changed. More...
 
void TakeOverProperties (a2dObject *from, a2dPropertyIdList *listOfIds)
 Properties in the id list are taken from the given object, en set to this. More...
 
wxURI GetURI () const
 quick way to get to PROPID_URI property More...
 
void SetURI (const wxURI &url)
 quickly set a property PROPID_URI More...
 
const a2dNamedPropertyListGetPropertyList () const
 Get the Property List. More...
 
bool HasDynamicProperties () const
 test if there are dynamic properties in the m_propertylist
 
virtual bool RemoveProperty (const a2dPropertyId *id, bool all=true)
 This function is called by a2dPropertyId to remove a property from the list. More...
 
void RemoveTemporaryProperties ()
 remove all temporary properties
 
virtual bool AddProperty (a2dNamedProperty *property)
 This function is called by a2dPropertyId to add a property to the list. More...
 

Static Public Attributes

static 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_DisableFeedback = 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 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 More...
 
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 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()
 
static a2dPropertyIdTagVecPROPID_Tags = NULL
 used in tool when grouping using tags
 
- Static Public Attributes inherited from a2dObject
static a2dPropertyIdBoolPROPID_Check = NULL
 used for linking multiple referenced objects when serializing
 
static a2dPropertyIdUriPROPID_URI = NULL
 attach an URL to the object
 
static a2dPropertyIdStringPROPID_Name = NULL
 Name property, to return name of this object.
 
static a2dPropertyIdVoidPtrPROPID_autozeroptrlist = NULL
 
static const a2dSignal sm_Edit_properties = wxNewId()
 edit properties event, see EditProperties()
 

Protected Member Functions

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. More...
 
virtual bool DoUpdate (UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
 Update derived Object specific things ( mainly boundingbox) More...
 
virtual void DoEndEdit ()
 only used for editable objects and under control of a editing tool. More...
 
- Protected Member Functions inherited from a2dObject
virtual bool DoIgnoreIfNotMember (const a2dPropertyId *id) const
 used to decide if a property shall be ignored, if it is not a member More...
 

Protected Attributes

a2dDrawingm_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. More...
 
wxUint16 m_pixelExtend
 Pixel extend. More...
 
wxUint16 m_layer
 layer of object, default wxLAYER_DEFAULT
 
a2dAffineMatrix m_lworld
 used for positioning the object (x,y,ang,scale etc.)
 
a2dCanvasObjectListm_childobjects
 holds child objects
 
- Protected Attributes inherited from a2dObject
a2dNamedPropertyList m_propertylist
 properties
 
int m_refcount
 how many references to this object do exist
 
bool m_check: 1
 used for linking multiple referenced objects when serializing
 
bool m_release: 1
 when set object is treated as being deleted, and wil be deleted in idle time.
 
bool m_recursion_active: 1
 this is used as a recursion stopper
 
bool m_pendingDisconnects: 1
 
unsigned int m_iteratorCount
 
a2dAutoZeroPtr< a2dObject > * m_autozeroptrlist
 this is a list of all a2dAutoZeroPtr object pointing to this object
 

Static Protected Attributes

static a2dCanvasOFlags m_flagsInit
 holds value for flags to initialize m_flags More...
 

Friends

class a2dCanvasObjectFilter
 
class a2dCanvasObjectFilterLayerMask
 
class a2dCanvasObjectFilterLayerMaskNoToolNoEdit
 

Construction and reference counting

 a2dCanvasObject (double x=0, double y=0)
 constructor called by derived objects
 
 a2dCanvasObject (const a2dCanvasObject &other, CloneOptions options, a2dRefMap *refs)
 constructor using reference to existing canvas object
 
a2dCanvasObjectTClone (CloneOptions options, a2dRefMap *refs=NULL)
 
virtual ~a2dCanvasObject ()
 destructor called by derived objects
 
a2dHabitatGetHabitat () const
 
virtual void Initialize ()
 
virtual bool IsRecursive ()
 returns if this object does have nested objects More...
 
virtual void MakeReferencesUnique ()
 All direct a2dCanvasObject which are part of this one are made unique. More...
 
virtual a2dObjectDoClone (CloneOptions options, a2dRefMap *refs) const
 Clone this object and return a pointer to the new object.
 

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 More...
 
double GetBboxMinY ()
 get minimum Y of the boundingbox in world coordinates relative to its parents More...
 
double GetBboxMaxX ()
 get maximum X of the boundingbox in world coordinates relative to its parents More...
 
double GetBboxMaxY ()
 get maximum Y of the boundingbox in world coordinates relative to its parents More...
 
double GetBboxWidth ()
 get width of the boundingbox in world coordinates relative to its parents More...
 
double GetBboxHeight ()
 get height of the boundingbox in world coordinates relative to its parents More...
 
a2dBoundingBoxGetBbox ()
 get boundingbox in world coordinates exclusive stroke width relative to its parent More...
 
virtual a2dBoundingBox GetUnTransformedBbox (a2dBboxFlags flags=a2dCANOBJ_BBOX_CHILDREN) const
 Get boundingbox without the affine matrix transform included. More...
 
a2dBoundingBox GetCalculatedBoundingBox (int nChildLevels)
 Like GetBbox, but it always calculcates the bounding box from scratch. More...
 
a2dBoundingBox GetMappedBbox (a2dIterC &ic, bool withExtend=true)
 first translate boundingbox with cworld and recalculate at new position More...
 
a2dBoundingBox GetMappedBbox (const a2dAffineMatrix &cworld)
 first translate boundingbox with cworld and recalculate at new position More...
 
wxRect GetAbsoluteArea (a2dIterC &ic, int inflate=2)
 Get absolute occupied area in the device coordinates. More...
 
float GetWorldExtend () const
 get world extend More...
 
int GetPixelExtend () const
 get pixel extend More...
 
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. More...
 
a2dBoundingBox GetClipBox (a2dIterC &ic)
 returns boundingbox clipping object if clipping property is set More...
 

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. More...
 
a2dCanvasObjectIsHitWorld (a2dIterC &ic, a2dHitEvent &hitEvent)
 If the position (x,y) is within the object return this. More...
 
void SetHitFlags (a2dCanvasObjectHitFlags mask)
 set hit flags More...
 
a2dCanvasObjectFlagsMask GetHitFlags () const
 return hitflags as mask
 
virtual bool ProcessCanvasObjectEvent (a2dIterC &ic, a2dHitEvent &hitEvent)
 Hit objects will receive the event. More...
 
void OnCanvasObjectMouseEvent (a2dCanvasObjectMouseEvent &event)
 default handler for mouse events, sent to the object from the a2dDrawingPart. More...
 
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
 
bool LocalHit (a2dIterC &ic, a2dHitEvent &hitEvent)
 
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) More...
 
a2dCanvasObjectHitChildObjectsOneLayer (a2dIterC &ic, RenderChild &whichchilds, a2dHitEvent &hitEvent)
 This is an internal function used by IsHitWorldChildObjects(). Don't use it directly.
 

Update and Pending

enum  UpdateMode {
  update_save = 0x0001, update_includebboxprop = 0x0002, updatemask_countObjects = 0x0004, updatemask_save_includebboxprop,
  updatemask_force, updatemask_normal, updatemask_force_and_count
}
 Various mode flags for Update. More...
 
bool RemoveReleased ()
 child objects which have relesed flag set, are removed as child, called recursive on rleased child objects.
 
virtual bool Update (UpdateMode mode)
 Update the state of the object according to its current position etc. More...
 
bool GetPending () const
 is this object pending for update? More...
 
virtual void SetPending (bool pending)
 set this object pending for update More...
 
void AddPending (a2dIterC &ic)
 search objects ( if nested recursive ) that have the pending flag Set More...
 
virtual void DependencyPending (a2dWalkerIOHandler *handler)
 called by to check if this object becomes pending as a result of other objects More...
 
virtual void DependentCommands (a2dCanvasObject *parent, a2dCommand *command)
 call this when a a2dCommands should result in extra commands, to become part of a parent a2dCommandGroup. More...
 

Rendering and style

virtual void Render (a2dIterC &ic, OVERLAP clipparent)
 Render this object to the active a2dDrawingPart. More...
 
void UpdateViewDependentObjects (a2dIterC &ic)
 update the transform matrix for objects with property 'PROPID_viewDependent' More...
 
virtual void DrawHighLighted (a2dIterC &ic)
 called by Render() if m_flags.m_HighLight is set More...
 
void SetVisible (bool visible)
 set if this object will visible (be rendered or not) More...
 
bool GetVisible () const
 get visibility (rendering depends on layer settings also)
 
bool IsVisible () const
 get visibility (rendering depends on layer settings also) More...
 
void SetFill (const a2dFill &fill)
 Set a fill for the object which will be used instead of the layer fill. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void SetStroke (const a2dStroke &stroke)
 Set stroke using pointer to a stroke. More...
 
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 More...
 
virtual double GetContourWidth () const
 get the Contour width of the shape
 
void SetDrawerStyle (a2dIterC &ic, a2dStyleProperty *style)
 sets fill and stroke of object to a2dDrawingPart More...
 
void SetChildrenOnSameLayer (bool samelayer)
 if set children are rendered on the same layer as this object. More...
 
bool GetChildrenOnSameLayer () const
 are children rendered on the same layer as this object?
 
void SetViewDependent (a2dDrawingPart *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 More...
 
void SetChildOnlyTranslate (bool onlytranslate)
 How a child is placed towards its parent object. More...
 
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. More...
 
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 More...
 
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. More...
 
const a2dShadowStylePropertyGetShadowStyle () const
 quick way to get the style property containing Shadow property More...
 
void CallDoRender (a2dIterC &ic, OVERLAP clipparent)
 
virtual a2dCanvasObjectPushInto (a2dCanvasObject *parent)
 when wanting to traverse hierarchy what level is down here.
 
virtual a2dCanvasObjectGetCommandProcessor ()
 
virtual a2dLayersGetLayerSetup ()
 
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 More...
 
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 More...
 
virtual void RenderChildObjectsOneLayer (a2dIterC &ic, RenderChild &whichchilds, OVERLAP clipparent)
 to render the child objects More...
 

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.

  • a2dPin objects know their parent, so that a communication path a2dCanvasObject (has child) a2dPin (is connected to) a2dPin (has parent) a2dCanvasObject exists.
  • 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 IsVirtConnect () const
 object is a virtual connection (connects invisible with other objects without using wires )
 
virtual bool NeedsUpdateWhenConnected () const
 used in case of flexible canvas objects (wires). More...
 
bool DoConnect ()
 if return true, connection with other object on this object its pins is allowed. More...
 
void DoConnect (bool doconnect)
 If set to true this object may be connected to other object on its pins. More...
 
bool CanConnectWith (a2dIterC &ic, a2dCanvasObject *toConnect, bool autocreate)
 check connect to other object More...
 
a2dPinCanConnectWith (a2dIterC &ic, a2dPin *pin, double margin, bool autocreate)
 is the given pin close enough to another a2dPin to allow connection? More...
 
bool IsConnected (bool needsupdate, a2dCanvasObject *toConnect=0)
 Is the object connected ( Optinal to specific object ) ? More...
 
virtual bool FindConnectedPins (a2dCanvasObjectList &result, a2dPin *pin=NULL, bool walkWires=true, a2dPinClass *searchPinClass=NULL, a2dCanvasObject *isConnectedTo=NULL)
 Find pins in other object which are connected to this object. More...
 
bool FindConnectedWires (a2dCanvasObjectList &result, a2dPin *pin, bool walkWires=true, bool selectedEnds=false, bool stopAtSelectedWire=false, bool addToResult=false)
 find wires on pins of this objects. More...
 
bool GetConnected (a2dCanvasObjectList *connected, bool needsupdate)
 get connected objects that are connected to this object via its pins. More...
 
virtual bool ConnectWith (a2dCanvasObject *parent, a2dCanvasObject *toconnect, const wxString &pinname=wxT(""), double margin=1, bool undo=false)
 Do connect with another a2dCanvasObject by pinname. More...
 
virtual bool ConnectWith (a2dCanvasObject *parent, a2dPin *pin, double margin=1, bool undo=false)
 Do connect with another a2dCanvasObject by pin pointer. More...
 
virtual void ConnectPinsCreateConnect (a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
 connect two pins More...
 
bool CleanWires (a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
 pins one wires to the same kind of wire are removed.
 
void ConnectPins (a2dCanvasObject *parent, a2dPin *pinc, a2dPin *pinother, bool undo=false)
 connect two pins which must be unconnected and at the same position More...
 
virtual bool DisConnectWith (a2dCanvasObject *toDisConnect=NULL, const wxString &pinname=wxT(""), bool undo=false)
 Do Disconnect from another a2dCanvasObject by pin name. More...
 
virtual bool DisConnectAt (a2dPin *pin, bool undo=false)
 Do Disconnect from another a2dCanvasObject by pin pointer. More...
 
void ReWireConnected (a2dCanvasObject *parent, bool undo=false)
 rewire the object to keep connection or to make connection with other objects More...
 
bool CreateWiresOnPins (a2dCanvasObject *parent, bool undo, bool onlyNonSelected=false)
 create wires on pins which do not have wires, but directly are connected to other objects. More...
 
bool SetConnectedPending (bool onoff, bool needsupdateonly)
 set connected pending or not pending More...
 
bool HasPins (bool realcheck=false)
 are there a2dPin derived children More...
 
a2dPinHasPinNamed (const wxString pinName, bool NotConnected=false)
 are there a2dPin derived children which matches the given pin name? More...
 
int GetPinCount ()
 How many a2dPin derived children are there.
 
virtual bool GeneratePinsPossibleConnections (a2dPinClass *pinClass, a2dConnectTask task, double x, double y, double margin=0)
 generates pins on all possible locations where the object can be connected. More...
 
virtual bool GeneratePins (a2dPinClass *toConnectTo, a2dConnectTask task, double x, double y, double margin=0)
 create pins in derived objects. More...
 
virtual bool AdjustPinLocation ()
 Allow change in pin location when wiring things up.
 
virtual a2dCanvasObjectGetConnectTemplate (a2dPinClass *mapThis, a2dCanvasObject *other, a2dPinClass *mapOther) const
 based on the a2dPinClass's of eventually a2dPin's wanted in both objects, a More...
 
virtual a2dCanvasObjectCreateConnectObject (a2dCanvasObject *parent, a2dPin *pinThis, a2dPin *pinOther, bool undo=false) const
 generates a connection object with pins and all. More...
 
a2dPinAddPin (const wxString name, double x, double y, wxUint32 a2dpinFlags, a2dPinClass *pinClass, bool undo=false)
 add a a2dPin as child More...
 
void RemovePins (bool NotConnected=false, bool onlyTemporary=false, bool now=false)
 Remove all a2dPin children. More...
 
void ShowPins (bool onoff)
 Set a2dPin children visible or not.
 
void SetRenderConnectedPins (bool onoff)
 Calls a2dPin::SetRenderConnected() for all pins. More...
 
virtual void ClearAllPinConnections (bool withundo=true)
 Remove all pin connections by issuing a2dCommand_DisConnectPins commands. More...
 
virtual void SetParent (a2dCanvasObject *parent)
 set parent object of the pin or some other objects that needs a parent
 
virtual a2dCanvasObjectGetParent () const
 
virtual bool DoCanConnectWith (a2dIterC &ic, a2dPin *pin, double margin, bool autocreate)
 prepare an object for being connected to a given pin More...
 

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 More...
 
void SetTipWindow (const wxString &tip)
 quickly set a property a2dTipWindowProperty More...
 
a2dObjectGetObjectTip ()
 quickly get first property with name OBJECTTIP
 
virtual bool EditProperties (const a2dPropertyId *id, bool withUndo)
 edit properties of the object More...
 
void OnPropertyChanged (a2dComEvent &event)
 

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 More...
 
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 More...
 
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. More...
 
bool GetBin () const
 general flag use at will.
 
bool GetGroupA () const
 get the groupA flag More...
 
void SetGroupA (bool value)
 set the groupA flag More...
 
bool GetGroupB () const
 get the groupA flag More...
 
void SetGroupB (bool value)
 set the groupA flag More...
 
bool GetGeneratePins () const
 get the GeneratePins flag More...
 
void SetGeneratePins (bool value)
 set the GeneratePins flag More...
 
void SetIgnoreSetpending (bool value=true)
 set IgnoreSetpending flag More...
 
bool GetIgnoreSetpending () const
 get IgnoreSetpending flag More...
 
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 SetAlgoSkip (bool value)
 
bool GetAlgoSkip () const
 
static void SetIgnoreAllSetpending (bool value=true)
 set static IgnoreAllSetpending flag More...
 
static bool GetIgnoreAllSetpending ()
 get static IgnoreSetpending flag More...
 

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 More...
 
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 More...
 
virtual void DoWalkerWithContext (a2dIterC &ic, wxObject *parent, a2dWalkerIOHandlerWithContext &handler)
 

Additional Inherited Members

- Public Types inherited from a2dObject
enum  CloneOptions {
  clone_members = 0x00000001, clone_properties = 0x00000002, clone_childs = 0x00000004, clone_unused = 0x00000008,
  clone_setoriginal = 0x00000010, clone_seteditcopy = 0x00000020, clone_noReference = 0x00000040, clone_noCameleonRef = 0x00000080,
  clone_toDrag = 0x00000100, clone_flat = 0x00000000, clone_deep = clone_members | clone_properties | clone_childs
}
 options for cloning More...
 
typedef a2dAutoZeroPtr< a2dObjectTAutoZeroPtrListClass
 this is needed inside the smart pointer template code
 
- Protected Types inherited from a2dObject
enum  { refcount_nondynamic = 0x76543210 }
 special refcount value for non-dynamic objects
 

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 a2dDrawingPart 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 a2dDrawingPart. 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 a2dDrawingPart 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 a2dDrawingPart or a2dCanvas object. The lowest object seen from the a2dDrawingPart::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 371 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 1091 of file canobj.h.

Member Function Documentation

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 a2dDrawingPart 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 a2dDrawingPart, the areas will be redrawn.

The area currently occupied by the object in the active a2dDrawingPart is added for update in case the object was pending. Next to that the a2dDrawingPart 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 a2dDrawingPart::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
iciterative context, contains cumulative matrix for transforming object to absolute position

Definition at line 4521 of file canobj.cpp.

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

add a a2dPin as child

Parameters
namename which the pin will get
xx-position of pin
yy-position of pin
a2dpinFlags
pinClasspinClass of the pin, created pin cloned from a2dPinClass->GetPin()
undoif set undo-able commands will be used
Returns
the pin that was created and added to the object.

Definition at line 6474 of file canobj.cpp.

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 6790 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
iciteration context
pinpin to check for connection to this object
marginpin as to be this close.
autocreatewhen true, pins maybe be created at the position in a derived object.

Definition at line 6836 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
iciterative context, relative to this testing is performed.
hitEventcontains x,y to test, and other hit info is assembled here
filterSelectableLayersif true layers should not only be visible but also selectable

Definition at line 3289 of file canobj.cpp.

void a2dCanvasObject::ClearAllPinConnections ( bool  withundo = true)
virtual

Remove all pin connections by issuing a2dCommand_DisConnectPins commands.

This should be done before a a2dCommand_ReleaseObject is issued, else the pins will be disconnected to late.

Parameters
withundoif true use a2dCommand_DisConnectPins commands.

Definition at line 6408 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
totallist of object found (may already contain elements found in earlier call)
classnameIf classname is empty it collects all objects else only object with this class name.
maskobject must have this mask.
idIf property id is set the object needs to have this property.
bboxonly find objects within this box.
Remarks
only searches this object and its children, not deeper.
Returns
number of objects found

Definition at line 4495 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 7037 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 7053 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 6886 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 6864 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 2561 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 3169 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 6100 of file canobj.cpp.

bool a2dCanvasObject::CreateWiresOnPins ( a2dCanvasObject parent,
bool  undo,
bool  onlyNonSelected = false 
)

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 7186 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 a2dCursorAxisMarker, a2dCanvasXYDisplayGroupAreas, a2dMarkerShow, a2dDiagram, a2dMarker, a2dCameleonInst, a2dAxisMarker, a2dCurvesArea, a2dCurveGroupLegend, and a2dCanvasDocumentReference.

Definition at line 4680 of file canobj.cpp.

void a2dCanvasObject::DependentCommands ( a2dCanvasObject parent,
a2dCommand command 
)
virtual

call this when a a2dCommands should result in extra commands, to become part of a parent a2dCommandGroup.

In some cases a command (e.g. delete an object), needs to be followed by extra commands. For example to disconnect other objects.

Parameters
parentthe parent of this object instance.
commandthe command for which the dependcies need to be found.

Definition at line 4691 of file canobj.cpp.

bool a2dCanvasObject::DisConnectAt ( a2dPin pin,
bool  undo = false 
)
virtual

Do Disconnect from another a2dCanvasObject by pin pointer.

Disconnect at pin (of this object ).

Definition at line 7134 of file canobj.cpp.

bool a2dCanvasObject::DisConnectWith ( a2dCanvasObject toDisConnect = NULL,
const wxString &  pinname = wxT( "" ),
bool  undo = false 
)
virtual

Do Disconnect from another a2dCanvasObject by pin name.

Parameters
toDisConnectobject to disconnect, if NULL all objects will be disconnected.
pinnameIf pinname is an empty string the pins connected to toConnect will be dis-connected, else only the ones with the pinname will be disconnected.
undoif true commands will be used to disconnect pins.

Definition at line 7081 of file canobj.cpp.

bool a2dCanvasObject::DoCanConnectWith ( a2dIterC ic,
a2dPin pin,
double  margin,
bool  autocreate 
)
protectedvirtual

prepare an object for being connected to a given pin

Before trying to connect in CanConnectWith() 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.

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

Reimplemented in a2dPolylineL.

Definition at line 6817 of file canobj.cpp.

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 1845 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 1849 of file canobj.h.

virtual void a2dCanvasObject::DoEndEdit ( )
inlineprotectedvirtual

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, a2dVisibleParameter, a2dVisibleProperty, a2dText, and a2dCanvasDocumentReferenceAsText.

Definition at line 2601 of file canobj.h.

a2dBoundingBox a2dCanvasObject::DoGetUnTransformedBbox ( a2dBboxFlags  flags = a2dCANOBJ_BBOX_NON) const
protectedvirtual

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.

Reimplemented in a2dEndsEllipticChord, a2dPieCurve, a2dEndsLine, a2dVertexListCurve, a2dSLine, a2dArc, a2dCameleonSymbolicRef, a2dBandCurve, a2dEllipticArc, a2dCameleon, a2dEllipse, a2dSweepCurve, a2dCanvasXYDisplayGroupAreas, a2dCircle, a2dSurface, a2dPin, a2dRect, a2dBuildIn, a2dPolylineL, a2dVertexCurve, a2dMarkerShow, a2dDiagram, a2dWH, a2dText, a2dCameleonInst, a2dPolygonL, a2dArrow, a2dFunctionCurve, a2dCurveAxis, a2dLibraryReference, a2dLayerInfo, a2dCurveGroupLegend, a2dImage, a2dVectorPath, a2dCanvasObjectArrayReference, a2dRectC, a2dRenderImage, a2dRectMM, a2dHandle, a2dWidgetButton, a2dBaseMarker, a2dPlot, a2dCanvasObjectReference, a2dPort, and a2dOrigin.

Definition at line 5031 of file canobj.cpp.

bool a2dCanvasObject::DoIsHitWorld ( a2dIterC ic,
a2dHitEvent hitEvent 
)
protectedvirtual
void a2dCanvasObject::DoLoad ( wxObject *  parent,
a2dIOHandlerXmlSerIn parser,
a2dXmlSer_flag  xmlparts 
)
virtual
void a2dCanvasObject::DoRender ( a2dIterC ic,
OVERLAP  clipparent 
)
protectedvirtual

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:

\li 1-  clip object against area to redraw.
\li 2-  iterate on layers when needed.

A a2dCanvasObject is rendered as a + (plus sign) when there or no children.

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

Definition at line 4695 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 a2dControl, a2dPieCurve, a2dVertexListCurve, a2dSLine, a2dArc, a2dBandCurve, a2dEllipticArc, a2dEllipse, a2dSweepCurve, a2dCanvasXYDisplayGroupAreas, a2dCircle, a2dSurface, a2dRect, a2dRectWindow, a2dMarkerShow, a2dVertexCurve, a2dImageMM, a2dRectWindowT2, a2dWH, a2dText, a2dVirtWire, a2dPolygonL, a2dImage, a2dWirePolylineL, a2dCanvasDocumentReferenceAsText, a2dRectMM, a2dBaseMarker, and a2dDrawingFrame.

Definition at line 1739 of file canobj.cpp.

bool a2dCanvasObject::DoUpdate ( UpdateMode  mode,
const a2dBoundingBox childbox,
const a2dBoundingBox clipbox,
const a2dBoundingBox propbox 
)
protectedvirtual

Update derived Object specific things ( mainly boundingbox)

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

Parameters
modeway to update the objects
childboxsize of children boundingbox
clipboxclip to this
propboxsize 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 a2dWires, a2dControl, a2dEndsEllipticChord, a2dScaledEndLine, a2dPieCurve, a2dEndsLine, a2dVertexListCurve, a2dArc, a2dCameleonSymbolicRef, a2dBandCurve, a2dVisibleParameter, a2dEllipticArc, a2dEllipse, a2dSweepCurve, a2dCanvasXYDisplayGroupAreas, a2dCursorAxisMarker, a2dCircle, a2dSurface, a2dPin, a2dLayers, a2dPolylineL, a2dVertexCurve, a2dMarkerShow, a2dVisibleProperty, a2dRectWindow, a2dWH, a2dNameReference, a2dCameleonInst, a2dRectWindowT2, a2dText, a2dMarker, a2dPolygonL, a2dFunctionCurve, a2dLibraryReference, a2dWindowMM, a2dAxisMarker, a2dCurvesArea, a2dCurveGroupLegend, a2dVectorPath, a2dCanvasObjectArrayReference, a2dCanvasDocumentReferenceAsText, a2dRenderImage, a2dRectMM, a2dHandle, a2dWidgetButton, a2dPlot, a2dCanvasObjectReference, a2dCurveObject, a2dCanvasObjectLua, and a2d3DShape.

Definition at line 5098 of file canobj.cpp.

void a2dCanvasObject::DoWalker ( wxObject *  parent,
a2dWalkerIOHandler handler 
)
protectedvirtual

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

Reimplemented in a2dEndsEllipticChord, a2dEndsLine, a2dBarCurve, a2dCameleonSymbolicRef, a2dCameleon, a2dCanvasXYDisplayGroupAreas, a2dBuildIn, a2dMarkerShow, a2dDiagram, a2dPolylineL, a2dRectWindowT2, a2dNameReference, a2dCameleonInst, a2dMarker, a2dExternalReference, a2dLibraryReference, a2dAxisMarker, a2dCurvesArea, a2dCurveGroupLegend, a2dWidgetButton, a2dDrawingFrame, a2dCanvasObjectReference, and a2d3DShape.

Definition at line 5504 of file canobj.cpp.

void a2dCanvasObject::DrawHighLighted ( a2dIterC ic)
virtual

called by Render() if m_flags.m_HighLight is set

Parameters
iciteration context (has a2dDrawingPart accumulative matrix to calculate absolute position of the object)

Reimplemented in a2dPin, and a2dWidgetButton.

Definition at line 5020 of file canobj.cpp.

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

edit properties of the object

This default implementation sents the a2dPropertyEditEvent with id wxEVT_PROPOBJECT_EDITPROPERTIES_EVENT.

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
idIf property id is set only matching properties are selected
withUndoIf true, the changes can be undone later.

Reimplemented from a2dObject.

Definition at line 2722 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 a2dVertexListCurve, a2dSLine, a2dBandCurve, a2dSweepCurve, a2dSurface, a2dVertexCurve, a2dPolygonL, and a2dVectorPath.

Definition at line 6191 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 1828 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
objectnameobject with this name to search for
classnameIf classname is empty it collects all objects else only object with this class name.
maskobject must have this mask.
propidif a property id is given, the object must have a property with this id
valueAsStringStringValueRepresentation of the property that is required (if not empty).
idGetUniqueSerializationId() should be this unless 0

Definition at line 4505 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::Find ( a2dCanvasObject obj) const

return the child object if it is part of this object

Parameters
objobject to search for

Definition at line 4513 of file canobj.cpp.

bool a2dCanvasObject::FindConnectedPins ( a2dCanvasObjectList result,
a2dPin pin = NULL,
bool  walkWires = true,
a2dPinClass searchPinClass = NULL,
a2dCanvasObject isConnectedTo = NULL 
)
virtual

Find pins in other object which are connected to this object.

If this object is connected on pins to other objects, those pins in the other objects will be put into the result list. The search uses the bin flag on pins to detect if this pin was already checked. Therefore you should clear that flag on pins of all object at the same level as this. Meaning the parent object of this object here. For the root object of a document, that can be done like: a2dCanvasObject* root = doc->GetRootObject(); a2dWalker_SetSpecificFlagsCanvasObjects setflags( a2dCanvasOFlags::BIN ); setflags.Start( root, false );

a2dCanvasObject* checkthis = root->GetChildObjectList()->Find( wxT("MyNameObject") ); a2dCanvasObjectList result; wxString names; if ( checkthis ) checkthis->FindConnectedPins( result, NULL, true, NULL );

If you want to skip certain Pins you can set the bin flag in advance. Pins on objects which are of connect type, like wires, will be skipped if walkWires is true. In that case the reported pins will be pins on normal objects connected to this, also via wires.

Parameters
resultall pins found
pinIf not NULL find only connections on this pin
walkWiresIf true, all wires like object are recursively iterated for pins to other non wire objects. The wire pins are skipped from the result.
searchPinClassif set search pin with this pinclass
isConnectedToif not NULL, only pins connected to this object will be searched.

Reimplemented in a2dVirtWire.

Definition at line 6586 of file canobj.cpp.

bool a2dCanvasObject::FindConnectedWires ( a2dCanvasObjectList result,
a2dPin pin,
bool  walkWires = true,
bool  selectedEnds = false,
bool  stopAtSelectedWire = false,
bool  addToResult = false 
)

find wires on pins of this objects.

A depth first serarch for correct branches. Wire passed and fitting condition, are stored to result.

Parameters
resultall wires found
pinIf not NULL find only wires on this pin
walkWiresIf true, all wires like object are recursively iterated for pins to other wire objects.
selectedEndsif true, end of wire to a non wire object must have selected flag set.
addToResultif true, this object is added to result. (default false, but recursive call set true).

Definition at line 6644 of file canobj.cpp.

virtual bool a2dCanvasObject::GeneratePins ( a2dPinClass toConnectTo,
a2dConnectTask  task,
double  x,
double  y,
double  margin = 0 
)
inlinevirtual

create pins in derived objects.

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

The idea is to generate temporary pins in objects, as feedback for the tools. This way the user sees where connections are possible.

You need to implement this function per object. The default is not doing anything.

See Also
GeneratePinsPossibleConnections()
Parameters
toConnectTothe pinClass to which the generated pin must be able to connect.
taskwhat/how to connect
xx position of mouse or pin which wants/needs connection
yy position of mouse or pin which wants/needs connection
marginif not 0 the genarted pins must be this close to x and y.

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

Definition at line 2054 of file canobj.h.

bool a2dCanvasObject::GeneratePinsPossibleConnections ( a2dPinClass pinClass,
a2dConnectTask  task,
double  x,
double  y,
double  margin = 0 
)
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
pinClassif not NULL, only generate temporary pins that may connect to this pinClass.
taskwhat/how to connect
xcan be used to create pins depending on the poition of the mouse inside the object.
ycan be used to create pins depending on the poition of the mouse inside the object.
marginif not 0 the genarted pins must be this close to x and y.

Reimplemented in a2dWirePolylineL.

Definition at line 3156 of file canobj.cpp.

a2dVertexArray * a2dCanvasObject::GetAlignmentPoints ( )
virtual

Return a list of points to align object with others.

First 4 point are the boundingbox (without pins like objects). Next are the middle points along the boundingbox ( can be made object specific if wanted). Next the baseline for e.g. text. Application specific poinst after that.

Remarks
return value must be deleted.

Definition at line 4395 of file canobj.cpp.

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

when implemented the object without its children, is converted to

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

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

Definition at line 1505 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::GetAsPolygons ( bool  transform = true) const
virtual

convert to a list of polygons.

Return non wxNullCanvasObjectList if possible and implemented.

Reimplemented in a2dSurface.

Definition at line 1510 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::GetAsPolylines ( bool  transform = true) const
virtual

convert to a list of polylines.

Return non wxNullCanvasObjectList if possible and implemented.

Reimplemented in a2dSurface.

Definition at line 1545 of file canobj.cpp.

virtual a2dVertexList* a2dCanvasObject::GetAsVertexList ( bool &  returnIsPolygon) const
inlinevirtual

convert to a polygon.

Return non NULL if possible and implemented.

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

Definition at line 2491 of file canobj.h.

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 2551 of file canobj.cpp.

unsigned int a2dCanvasObject::GetChildObjectsCount ( ) const

get number of child objects

Returns
number of child objects

Definition at line 2570 of file canobj.cpp.

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

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

Parameters
connectedlist to which connected objects will be added.
needsupdateif true only connected objects which need updating will be added.

Definition at line 6757 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 3164 of file canobj.cpp.

bool a2dCanvasObject::GetFilled ( ) const
inline

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

Definition at line 1476 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 2289 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 2267 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 2278 of file canobj.h.

static bool a2dCanvasObject::GetIgnoreAllSetpending ( )
inlinestatic

get static IgnoreSetpending flag

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

Definition at line 2311 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 2303 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 2156 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 2368 of file canobj.h.

virtual a2dCanvasObject* a2dCanvasObject::GetParent ( void  ) const
inlinevirtual

return NULL, because a a2dCanvasObject normally does not have only one parent. In a derived class, it can be a defined.

Reimplemented in a2dVisibleParameter, a2dVisibleProperty, a2dVirtWire, a2dPin, and a2dHandle.

Definition at line 2126 of file canobj.h.

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 1162 of file canobj.h.

a2dDrawing* a2dCanvasObject::GetRoot ( ) 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 952 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 1648 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 1603 of file canobj.h.

bool a2dCanvasObject::GetSelected2 ( ) const
inline

is the object selected2 flag set

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

Definition at line 1629 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 2869 of file canobj.cpp.

a2dCanvasObjectList * a2dCanvasObject::GetSnapVpath ( a2dSnapToWhatMask  snapToWhat)
virtual

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

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.

Reimplemented in a2dText, and a2dPolygonL.

Definition at line 4308 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
pinNamethe name of the pin to search for ( uses wxString::Matches() ).
NotConnectedif 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 6436 of file canobj.cpp.

bool a2dCanvasObject::HasPins ( bool  realcheck = false)

are there a2dPin derived children

Parameters
realcheckif 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 6414 of file canobj.cpp.

virtual void a2dCanvasObject::Initialize ( )
inlinevirtual

After constructing a derived instance from a string, using CreateObject(), the object may need to be filled with child objects. This is often by reading more from a file, or by calling this.

Definition at line 420 of file canobj.h.

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

Is the object connected ( Optinal to specific object ) ?

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

Definition at line 6550 of file canobj.cpp.

bool a2dCanvasObject::IsDraggable ( ) const
inline

get if the object can be dragged

Alias for GetDraggable

See Also
GetDraggable

Definition at line 1683 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 1597 of file canobj.h.

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
iccontains iteration context
hitEventstores hit information
Returns
this pointer if there is a hit on this object or its children or its properties.

Definition at line 3415 of file canobj.cpp.

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 a2dCameleonInst, a2dCurvesArea, and a2dCanvasObjectReference.

Definition at line 5435 of file canobj.cpp.

bool a2dCanvasObject::IsSelectable ( ) const
inline

Is the object selectable flag set.

Alias for GetSelectable

See Also
GetSelectable

Definition at line 1655 of file canobj.h.

bool a2dCanvasObject::IsSelected ( ) const
inline

Is the object selected flag set.

Alias for GetSelected

See Also
GetSelected

Definition at line 1610 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 1316 of file canobj.h.

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 2040 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 a2dCameleonInst, and a2dCanvasObjectReference.

Definition at line 5440 of file canobj.cpp.

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

Mirrors this object in x or y orientation.

Parameters
xmirror at X-axis (horizontally orientation)
ymirror at Y-axis (vertically orientation)

Definition at line 2639 of file canobj.cpp.

virtual bool a2dCanvasObject::NeedsUpdateWhenConnected ( ) const
inlinevirtual

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 1841 of file canobj.h.

void a2dCanvasObject::OnCanvasObjectMouseEvent ( a2dCanvasObjectMouseEvent event)

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

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 )

Definition at line 2391 of file canobj.cpp.

void a2dCanvasObject::OnPropertyChanged ( a2dComEvent event)
protected

This function is called after a property obn this object did change This is overloaded to set e.g. a pending flag

Definition at line 2762 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
iciteration context
hitEventstores hit information
Returns
true if Object (or a child ) did process the event and did not call event.Skip()

Reimplemented in a2dCanvasXYDisplayGroupAreas, a2dRectWindowT2, and a2dCurvesArea.

Definition at line 3964 of file canobj.cpp.

int a2dCanvasObject::ReleaseChild ( a2dCanvasObject obj,
bool  backwards = false,
bool  all = false,
bool  now = false,
bool  undoCommands = 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
objobject to release
backwardsstart at the end
allif true remove all references to object
nowif true remove all references to object now!, else only delete flag is set, and Update() takes care of it.
undoCommandswhen object is connected to othere, use commands do be able to undo.
Returns
number of released objects

Definition at line 6260 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 6296 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 a2dCanvasObjectArrayReference, and a2dCanvasObjectReference.

Definition at line 6160 of file canobj.cpp.

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

Remove all a2dPin children.

Parameters
NotConnectedwhen true only pins which are not connected tp another pin will be deleted
onlyTemporarywhen 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.
nowif true remove pin object now!, else only delete flag is set, and it will be deleted in idle time.

Definition at line 6504 of file canobj.cpp.

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

Render this object to the active a2dDrawingPart.

This function is called via the a2dCanvasDocument class or its nested children. The active a2dDrawingPart 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 a2dDrawingPart, 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
iciteration context (has a2dDrawingPart accumulative matrix to calculate absolute position of the object)
clipparentthis 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 a2dDrawingPart, there is no need to check child objects.

Reimplemented in a2dPolygonLClipper2, a2dPolygonLClipper, a2dRectWindowT2, and a2dWidgetButton.

Definition at line 4712 of file canobj.cpp.

void a2dCanvasObject::RenderChildObjects ( a2dIterC ic,
RenderChild whichchilds,
OVERLAP  clipparent 
)
protectedvirtual

render only the child objects

Parameters
iciteration context (has a2dDrawingPart accumulative matrix to calculate absolute position of the object)
whichchildsdefined which childs will be rendered now, and detects while rendering other types.
clipparentthis must be the clip status of parent object.

Definition at line 5951 of file canobj.cpp.

void a2dCanvasObject::RenderChildObjectsOneLayer ( a2dIterC ic,
RenderChild whichchilds,
OVERLAP  clipparent 
)
protectedvirtual

to render the child objects

Parameters
iciteration context (hasa2dDrawingPart accumulative matrix to calculate absolute position of the object)
whichchildsdefined which childs will be rendered now, and detects while rendering other types.
clipparentthis 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 6003 of file canobj.cpp.

bool a2dCanvasObject::RestrictToObject ( a2dIterC ic,
const a2dPoint2D pointToSnapTo,
a2dPoint2D bestPointSofar,
a2dSnapToWhatMask  snapToWhat,
double  thresHoldWorld 
)
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 to. 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 result of a possible snap point, is stored in a2dRestrictionEngine.

The default can snap to:

Reimplemented in a2dSLine, a2dWH, a2dVectorPath, and a2dPolygonL.

Definition at line 4209 of file canobj.cpp.

void a2dCanvasObject::ReWireConnected ( a2dCanvasObject parent,
bool  undo = false 
)

rewire the object to keep connection or to make connection with other objects

Parameters
parentparent object to get and release to connected objects.
undoif true commands will be used to disconnect pins.

Definition at line 7163 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
rotationrotate by this angle in degrees

Definition at line 2615 of file canobj.cpp.

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

Scale in x and y ( > zero)

Parameters
scalexscalling in X
scaleyscalling in Y

Definition at line 2633 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
bintemporarely status information

Definition at line 2259 of file canobj.h.

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 1453 of file canobj.h.

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
samelayerif true render children on same layer

Definition at line 1429 of file canobj.h.

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

set connected pending or not pending

Parameters
onoffset connected object pending or not pending
needsupdateonlyif true only connected object which need updating will treated.

Definition at line 7241 of file canobj.cpp.

virtual void a2dCanvasObject::SetContourWidth ( double  width)
inlinevirtual

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 a2dSLine, a2dArc, a2dEllipticArc, a2dEllipse, a2dCircle, a2dSurface, a2dRect, a2dPolygonL, a2dVectorPath, and a2dRectMM.

Definition at line 1408 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
draggabletrue to allow selection, else false

Definition at line 1673 of file canobj.h.

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

sets fill and stroke of object to a2dDrawingPart

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

See Also
a2dDrawingPart

Definition at line 3086 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
editabletrue to allow modifications, else false

Definition at line 1581 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 2874 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
fillcolorcolor to fill object with
stylestyle 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 2882 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
fillcolorcolor to fill object with
fillcolor2color to fill object with
stylestyle 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 2889 of file canobj.cpp.

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
filledif true set object filled

Definition at line 1483 of file canobj.h.

void a2dCanvasObject::SetFlags ( a2dCanvasObjectFlagsMask  newmask)

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

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

Definition at line 2650 of file canobj.cpp.

void a2dCanvasObject::SetGeneratePins ( bool  value)
inline

set the GeneratePins flag

used to define operands in operation on two groups of objects

Parameters
valuetrue to set group flag C

Definition at line 2295 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
valuetrue to set group flag A

Definition at line 2273 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
valuetrue to set group flag B

Definition at line 2284 of file canobj.h.

void a2dCanvasObject::SetHitFlags ( a2dCanvasObjectHitFlags  mask)

set hit flags

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

Parameters
maskset hit flags in object according to given mask.

Definition at line 2670 of file canobj.cpp.

static void a2dCanvasObject::SetIgnoreAllSetpending ( bool  value = true)
inlinestatic

set static IgnoreAllSetpending flag

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

Definition at line 2307 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 2299 of file canobj.h.

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

See Also
wxLayerNames
a2dLayerInfo
a2dLayers
Parameters
layerthe index of the layer

Definition at line 5920 of file canobj.cpp.

virtual void a2dCanvasObject::SetMode ( int  mode)
inlinevirtual

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 a2dPin, and a2dHandle.

Definition at line 1715 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
tipthe tip which should be shown
xx-pos of the tip
yy-pos of the tip
sizefont-size in world coordinates (font size of the font-param will be ignored, see a2dText documentation)
anglerotation in degrees
fontthe font to use
Returns
a pointer to the a2dText object used to show the tip.

Definition at line 2781 of file canobj.cpp.

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 a2dDrawingPart 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
pendingif true set object pending

Reimplemented in a2dCursor, a2dLayers, a2dPin, and a2dLayerInfo.

Definition at line 2585 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
xx position
yy position
restrictuse a2dCanvasGlobals->GetRestrictionEngine() to snap position

Definition at line 1624 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
posposition

Definition at line 547 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
xx position
yy position
Returns
true of point was restricted/changed

Definition at line 1606 of file canobj.cpp.

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
prerendertrue to prerender this object, else false

Definition at line 1469 of file canobj.h.

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 6394 of file canobj.cpp.

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 1499 of file canobj.h.

void a2dCanvasObject::SetRoot ( a2dDrawing root,
bool  recurse = true 
)

Sets this object to a a2dCanvasDocument.

Parameters
rootset the a2dCanvasDocument for this object to this (if appropriate recursive)
recursedefault true, which uses a2dWalker_SetCanvasDocument for doing the same recursive for nested object and nested object in derived classes.

Definition at line 5933 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
rotationset rotation angle in degrees

Definition at line 2609 of file canobj.cpp.

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
selectabletrue to allow selection, else false

Definition at line 1664 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
selectedif true set object selected

Definition at line 1620 of file canobj.h.

void a2dCanvasObject::SetSelected2 ( bool  selected)
inline

Set the object selected2 flag if allowed.

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

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

Definition at line 1639 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 1695 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 1704 of file canobj.h.

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
setOrClearif true sets the flag to true else to false
whichset only those flags in object to true or false

Definition at line 2645 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
strokecolorcolor to stroke object with
widthwidth of stroke in world coordinates
stylestyle 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 2924 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
strokecolorcolor to stroke object with
widthwidth of stroke in device coordinates
stylestyle 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 2931 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 2938 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
tipthe tip which should be shown

Definition at line 2798 of file canobj.cpp.

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

Returns the matrix used to position the object.

Parameters
matmatrix set for transforming the object

Definition at line 509 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
xtx translation
yty translation
scalexx scale factor
scaleyy scale factor
degreesrotation in degrees

Definition at line 2604 of file canobj.cpp.

void a2dCanvasObject::SetViewDependent ( a2dDrawingPart 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
aViewview for adding next properties on this object and maybe its children.
viewdependentif true, then add property 'PROPID_viewDependent' to objects that are depending on 'aView' view when it comes to size. Else to remove this property.
viewspecificif 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.
onlyinternalarearemoving scale for children
deepif true then set flags for all nested children objects

Definition at line 2816 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
visibleif true set object visible

Definition at line 1303 of file canobj.h.

void a2dCanvasObject::SkewX ( double  angle)

Skew in X.

Parameters
angleangle to skew in X

Definition at line 2621 of file canobj.cpp.

void a2dCanvasObject::SkewY ( double  angle)

Skew in Y.

Parameters
angleangle to skew in Y

Definition at line 2627 of file canobj.cpp.

a2dCanvasObject * a2dCanvasObject::StartEdit ( a2dBaseTool tool,
wxUint16  editmode,
wxEditStyle  editstyle = wxEDITSTYLE_COPY,
a2dRefMap refs = NULL 
)
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
tooltool from which this function is called. Currently this is the a2dObjectEditTool
editmodetobe used in derived object to switch between different way of editing ( 0 means matrix mode of a2dCanvasObject )
editstylestyle of editing e.g. filled and stroked or with a wire frame.

Reimplemented in a2dMultiSelectGroup.

Definition at line 1640 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 4487 of file canobj.cpp.

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
tworldmatrix for transform

Definition at line 577 of file canobj.h.

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
xdelta x for translation
ydelta y for translation

Definition at line 569 of file canobj.h.

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 a2dPolygonLClipper2, a2dPolygonLClipper, a2dRectWindowT2, and a2dCurvesArea.

Definition at line 5149 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
iciteration context (has a2dDrawingPart 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 4605 of file canobj.cpp.

virtual bool a2dCanvasObject::UserBaseFunctionEx ( int  function,
a2dIOHandler handler = NULL 
)
inlinevirtual

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
functionfunction id, to be able to use this function for more tasks.
handlera2dIOHandler which was use to iterate the document

Definition at line 2412 of file canobj.h.

Member Data Documentation

a2dCanvasOFlags a2dCanvasObject::m_flagsInit
staticprotected
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 2553 of file canobj.h.

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 2545 of file canobj.h.

a2dPropertyIdUint16 * a2dCanvasObject::PROPID_Datatype = NULL
static

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 2700 of file canobj.h.

a2dPropertyIdRefObject * a2dCanvasObject::PROPID_ViewSpecific = NULL
static

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 2691 of file canobj.h.


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