wxArt2D
|
a2dCanvasObject is the base class for Canvas Objects. More...
#include <canobj.h>
Classes | |
struct | RenderChild |
used to tell which child object to render and to detect the need for it. More... | |
Public Member Functions | |
virtual a2dCanvasObjectList * | GetAsCanvasVpaths (bool transform=true) const |
when implemented the object without its children, is converted to More... | |
virtual a2dCanvasObjectList * | GetAsPolygons (bool transform=true) const |
convert to a list of polygons. More... | |
virtual a2dCanvasObjectList * | GetAsPolylines (bool transform=true) const |
convert to a list of polylines. More... | |
virtual a2dVertexList * | GetAsVertexList (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 a2dAffineMatrix & | GetTransformMatrix () 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 | |
| |
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 a2dCanvasObjectList * | GetSnapVpath (a2dSnapToWhatMask snapToWhat) |
return a vectorpath indicating on which point/segments the object likes to be snapped. More... | |
virtual a2dVertexArray * | GetAlignmentPoints () |
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. | |
a2dDrawing * | GetRoot () 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 | |
a2dCanvasObjectList * | GetChildObjectList () |
get the list where the child objects are stored in. More... | |
const a2dCanvasObjectList * | GetChildObjectList () const |
a2dCanvasObjectList * | CreateChildObjectList () |
create and get the list where the child objects are stored in. More... | |
unsigned int | GetChildObjectsCount () const |
get number of child objects More... | |
a2dCanvasObject * | CreateHierarchy (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 | |
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. More... | |
a2dCanvasObject * | Find (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 a2dCanvasObject * | StartEdit (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 | |
a2dCanvasObject * | GetOriginal () |
if this is an editcopy, return the orginal else NULL | |
a2dHandle * | SetHandlePos (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... | |
![]() | |
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 a2dObject * | SetNonDynamic () |
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... | |
a2dObject * | Clone (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 () | |
a2dNamedProperty * | GetProperty (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 a2dNamedProperty * | FindProperty (const a2dPropertyId *id, a2dPropertyId::Flags flags=a2dPropertyId::flag_none) |
Find a dynamic property with given id in the property list. More... | |
virtual const a2dNamedProperty * | FindProperty (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 a2dNamedPropertyList & | GetPropertyList () 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 a2dPropertyIdMatrix * | PROPID_TransformMatrix = NULL |
static a2dPropertyIdPoint2D * | PROPID_Position = NULL |
static a2dPropertyIdUint16 * | PROPID_Layer = NULL |
static a2dPropertyIdBool * | PROPID_Selected = NULL |
static a2dPropertyIdBool * | PROPID_Selectable = NULL |
static a2dPropertyIdBool * | PROPID_SubEdit = NULL |
static a2dPropertyIdBool * | PROPID_SubEditAsChild = NULL |
static a2dPropertyIdBool * | PROPID_Visible = NULL |
static a2dPropertyIdBool * | PROPID_Draggable = NULL |
static a2dPropertyIdBool * | PROPID_Showshadow = NULL |
static a2dPropertyIdBool * | PROPID_Filled = NULL |
static a2dPropertyIdBool * | PROPID_GroupA = NULL |
static a2dPropertyIdBool * | PROPID_GroupB = NULL |
static a2dPropertyIdBool * | PROPID_GeneratePins = NULL |
static a2dPropertyIdBool * | PROPID_Bin = NULL |
static a2dPropertyIdBool * | PROPID_Bin2 = NULL |
static a2dPropertyIdBool * | PROPID_Pending = NULL |
static a2dPropertyIdBool * | PROPID_Snap = NULL |
static a2dPropertyIdBool * | PROPID_SnapTo = NULL |
static a2dPropertyIdBool * | PROPID_Pushin = NULL |
static a2dPropertyIdBool * | PROPID_Prerenderaschild = NULL |
static a2dPropertyIdBool * | PROPID_Visiblechilds = NULL |
static a2dPropertyIdBool * | PROPID_Editable = NULL |
static a2dPropertyIdBool * | PROPID_Editing = NULL |
static a2dPropertyIdBool * | PROPID_EditingRender = NULL |
static a2dPropertyIdBool * | PROPID_ChildrenOnSameLayer = NULL |
static a2dPropertyIdBool * | PROPID_DoConnect = NULL |
static a2dPropertyIdBool * | PROPID_IsOnCorridorPath = NULL |
static a2dPropertyIdBool * | PROPID_HasPins = NULL |
static a2dPropertyIdBool * | PROPID_IsProperty = NULL |
static a2dPropertyIdBool * | PROPID_MouseInObject = NULL |
static a2dPropertyIdBool * | PROPID_HighLight = NULL |
static a2dPropertyIdBool * | PROPID_Template = NULL |
static a2dPropertyIdBool * | PROPID_External = NULL |
static a2dPropertyIdBool * | PROPID_Used = NULL |
static a2dPropertyIdBool * | PROPID_Release = NULL |
static a2dPropertyIdCanvasObject * | PROPID_Begin = NULL |
static a2dPropertyIdCanvasObject * | PROPID_End = NULL |
static a2dPropertyIdDouble * | PROPID_EndScaleX = NULL |
static a2dPropertyIdDouble * | PROPID_EndScaleY = NULL |
static a2dPropertyIdBool * | PROPID_Spline = NULL |
static a2dPropertyIdDouble * | PROPID_ContourWidth = NULL |
static a2dPropertyIdBool * | PROPID_DisableFeedback = NULL |
static a2dPropertyIdBool * | PROPID_Allowrotation = NULL |
static a2dPropertyIdBool * | PROPID_Allowsizing = NULL |
static a2dPropertyIdBool * | PROPID_Allowskew = NULL |
static a2dPropertyIdBool * | PROPID_IncludeChildren = NULL |
static a2dPropertyIdRefObjectAutoZero * | PROPID_Controller = NULL |
static a2dPropertyIdCanvasObject * | PROPID_Original = NULL |
static a2dPropertyIdCanvasObject * | PROPID_Editcopy = NULL |
static a2dPropertyIdCanvasObject * | PROPID_Parent = NULL |
static a2dPropertyIdCanvasObject * | PROPID_Objecttip = NULL |
static a2dPropertyIdUint16 * | PROPID_Editmode = NULL |
static a2dPropertyIdUint16 * | PROPID_Editstyle = NULL |
static a2dPropertyIdUint16 * | PROPID_Index = NULL |
static a2dPropertyIdCanvasShadowStyle * | PROPID_Shadowstyle = NULL |
static a2dPropertyIdFill * | PROPID_Fill = NULL |
static a2dPropertyIdStroke * | PROPID_Stroke = NULL |
static a2dPropertyIdUint32 * | PROPID_RefDesCount = NULL |
static a2dPropertyIdUint32 * | PROPID_RefDesNr = NULL |
static a2dPropertyIdBool * | PROPID_ToolDecoration = NULL |
set for objects that act as tool decorations, when a tool is in action. | |
static a2dPropertyIdVoidPtr * | PROPID_ToolObject = NULL |
set for objects that act as tool object, when a tool is in action. | |
static a2dPropertyIdBool * | PROPID_TemporaryObject = NULL |
set for objects that do not have to be saved | |
static a2dPropertyIdBoundingBox * | PROPID_BoundingBox = NULL |
used to store state ( redraw area) of the object as it was before a change | |
static a2dPropertyIdColour * | PROPID_StrokeColour = NULL |
static a2dPropertyIdColour * | PROPID_FillColour = NULL |
static a2dPropertyIdRefObject * | PROPID_ViewSpecific = NULL |
static a2dPropertyIdBool * | PROPID_FirstEventInObject = NULL |
set in Startedit(), to be used to detect first (mouse)event sent to object. | |
static a2dPropertyIdUint16 * | PROPID_Datatype = NULL |
used in GDSII and KEY format to specify the DATATYPE of elements More... | |
static a2dPropertyIdRefObject * | PROPID_ViewDependent = NULL |
used for objects that depend on 'aView' view when it comes to size. | |
static a2dPropertyIdMatrix * | PROPID_IntViewDependTransform = NULL |
used for objects with* PROPID_viewDependent but only for internal area | |
static a2dPropertyIdDateTime * | PROPID_DateTime = NULL |
some time property which a user wants to store | |
static a2dPropertyIdDateTime * | PROPID_ModificationDateTime = NULL |
static a2dPropertyIdDateTime * | PROPID_AccessDateTime = NULL |
static a2dPropertyIdMenu * | PROPID_PopupMenu = NULL |
when set used for popup menu by default in OnPopUpEvent() | |
static a2dPropertyIdWindow * | PROPID_TipWindow = NULL |
when set used for tip window by default in OnCanvasMouseEvent() | |
static a2dPropertyIdTagVec * | PROPID_Tags = NULL |
used in tool when grouping using tags | |
![]() | |
static a2dPropertyIdBool * | PROPID_Check = NULL |
used for linking multiple referenced objects when serializing | |
static a2dPropertyIdUri * | PROPID_URI = NULL |
attach an URL to the object | |
static a2dPropertyIdString * | PROPID_Name = NULL |
Name property, to return name of this object. | |
static a2dPropertyIdVoidPtr * | PROPID_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... | |
![]() | |
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 | |
a2dDrawing * | m_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.) | |
a2dCanvasObjectList * | m_childobjects |
holds child objects | |
![]() | |
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 | |
a2dCanvasObject * | TClone (CloneOptions options, a2dRefMap *refs=NULL) |
virtual | ~a2dCanvasObject () |
destructor called by derived objects | |
a2dHabitat * | GetHabitat () 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 a2dObject * | DoClone (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... | |
a2dBoundingBox & | GetBbox () |
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 | |
a2dCanvasObject * | ChildIsHitWorld (a2dIterC &ic, a2dHitEvent &hitEvent, bool filterSelectableLayers=false) |
Do hittest on children. More... | |
a2dCanvasObject * | IsHitWorld (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) |
a2dCanvasObject * | IsHitWorldChildObjects (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... | |
a2dCanvasObject * | HitChildObjectsOneLayer (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 a2dShadowStyleProperty * | GetShadowStyle () const |
quick way to get the style property containing Shadow property More... | |
void | CallDoRender (a2dIterC &ic, OVERLAP clipparent) |
virtual a2dCanvasObject * | PushInto (a2dCanvasObject *parent) |
when wanting to traverse hierarchy what level is down here. | |
virtual a2dCanvasObject * | GetCommandProcessor () |
virtual a2dLayers * | GetLayerSetup () |
const a2dFill & | MX_GetFill () const |
void | MX_SetFill (const a2dFill &value) |
const a2dStroke & | MX_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.
| |
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... | |
a2dPin * | CanConnectWith (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... | |
a2dPin * | HasPinNamed (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 a2dCanvasObject * | GetConnectTemplate (a2dPinClass *mapThis, a2dCanvasObject *other, a2dPinClass *mapOther) const |
based on the a2dPinClass's of eventually a2dPin's wanted in both objects, a More... | |
virtual a2dCanvasObject * | CreateConnectObject (a2dCanvasObject *parent, a2dPin *pinThis, a2dPin *pinOther, bool undo=false) const |
generates a connection object with pins and all. More... | |
a2dPin * | AddPin (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 a2dCanvasObject * | GetParent () 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 |
a2dText * | 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 More... | |
void | SetTipWindow (const wxString &tip) |
quickly set a property a2dTipWindowProperty More... | |
a2dObject * | GetObjectTip () |
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 | |
![]() | |
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< a2dObject > | TAutoZeroPtrListClass |
this is needed inside the smart pointer template code | |
![]() | |
enum | { refcount_nondynamic = 0x76543210 } |
special refcount value for non-dynamic objects | |
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.
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) )
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.
ic | iterative 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
name | name which the pin will get |
x | x-position of pin |
y | y-position of pin |
a2dpinFlags |
|
pinClass | pinClass of the pin, created pin cloned from a2dPinClass->GetPin() |
undo | if set undo-able commands will be used |
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.
ic | iteration context |
pin | pin to check for connection to this object |
margin | pin as to be this close. |
autocreate | when true, pins maybe be created at the position in a derived object. |
Definition at line 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.
ic | iterative context, relative to this testing is performed. |
hitEvent | contains x,y to test, and other hit info is assembled here |
filterSelectableLayers | if true layers should not only be visible but also selectable |
Definition at line 3289 of file canobj.cpp.
|
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.
withundo | if 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.
total | list of object found (may already contain elements found in earlier call) |
classname | If classname is empty it collects all objects else only object with this class name. |
mask | object must have this mask. |
id | If property id is set the object needs to have this property. |
bbox | only find objects within this box. |
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.
|
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.
|
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.
|
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.
Definition at line 2561 of file canobj.cpp.
|
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.
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. |
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.
|
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.
|
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.
parent | the parent of this object instance. |
command | the command for which the dependcies need to be found. |
Definition at line 4691 of file canobj.cpp.
|
virtual |
Do Disconnect from another a2dCanvasObject by pin pointer.
Disconnect at pin (of this object ).
Definition at line 7134 of file canobj.cpp.
|
virtual |
Do Disconnect from another a2dCanvasObject by pin name.
toDisConnect | object to disconnect, if NULL all objects will be disconnected. |
pinname | If pinname is an empty string the pins connected to toConnect will be dis-connected, else only the ones with the pinname will be disconnected. |
undo | if true commands will be used to disconnect pins. |
Definition at line 7081 of file canobj.cpp.
|
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.
|
inline |
|
inline |
|
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.
|
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.
|
protectedvirtual |
Does hit test on the object (exclusif child objects)
DoIsHitWorld() should return the way the object is hit by filling a2dHitEvent::m_how with the correct info.
ic | iterative context ( e.g. current transform WITH the local transform applied ) |
hitEvent | stores hit information |
Reimplemented in a2dControl, a2dEndsEllipticChord, a2dPieCurve, a2dEndsLine, a2dVertexListCurve, a2dSLine, a2dArc, a2dCameleonSymbolicRef, a2dBandCurve, a2dEllipticArc, a2dCameleon, a2dSweepCurve, a2dEllipse, a2dCanvasXYDisplayGroupAreas, a2dCircle, a2dSurface, a2dBuildIn, a2dRect, a2dPin, a2dPolylineL, a2dVertexCurve, a2dMarkerShow, a2dDiagram, a2dImageMM, a2dSymbolicReference, a2dWH, a2dText, a2dCameleonInst, a2dPolygonL, a2dArrow, a2dFunctionCurve, a2dLibraryReference, a2dLayerInfo, a2dCurveGroupLegend, a2dImage, a2dVectorPath, a2dCanvasObjectArrayReference, a2dRenderImage, a2dRectC, a2dCanvasDocumentReferenceAsText, a2dRectMM, a2dHandle, a2dWidgetButton, a2dBaseMarker, a2dCanvasDocumentReference2, a2dCanvasObjectReference, a2dPort, a2dDrawingFrame, a2dOrigin, and a2d3DShape.
Definition at line 3713 of file canobj.cpp.
|
virtual |
load object specific CVG data
todo ignore until this down here is fully converted.
Reimplemented from a2dObject.
Reimplemented in a2dEndsEllipticChord, a2dPieCurve, a2dEndsLine, a2dVertexListCurve, a2dSLine, a2dBarCurve, a2dCameleonSymbolicRef, a2dArc, a2dBandCurve, a2dVisibleParameter, a2dCameleon, a2dEllipticArc, a2dSweepCurve, a2dEllipse, a2dCanvasXYDisplayGroupAreas, a2dCursorAxisMarker, a2dGui, a2dCircle, a2dParameters, a2dSurface, a2dBuildIn, a2dTextGDS, a2dPin, a2dRect, a2dLayers, a2dVertexCurve, a2dMarkerShow, a2dDiagram, a2dRectWindow, a2dVisibleProperty, a2dImageMM, a2dSymbolicReference, a2dBandMarker, a2dPolylineL, a2dNameReference, a2dCurveAxisLin, a2dVirtWire, a2dCameleonInst, a2dWH, a2dRectWindowT2, a2dMarker, a2dText, a2dRgbaImage, a2dArrow, a2dCurveAxis, a2dPolygonL, a2dFunctionCurve, a2dLibraryReference, a2dWindowMM, a2dAppear, a2dLayerInfo, a2dAxisMarker, a2dCurvesArea, a2dCurve, a2dParPin, a2dCurveGroupLegend, a2dVectorPath, a2dImage, a2dCanvasObjectArrayReference, a2dCanvasDocumentReferenceAsText, a2dWirePolylineL, a2dRectMM, a2dCanvasDocumentReference2, a2dBaseMarker, a2dHandle, a2dPlot, a2dCanvasObjectReference, a2dDrawingFrame, a2dCanvasObjectLua, and a2d3DShape.
Definition at line 5728 of file canobj.cpp.
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.
|
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.
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.
|
protectedvirtual |
Update derived Object specific things ( mainly boundingbox)
Calculates the boundingbox of the object (exclusif base class child objects but with other nested objects).
mode | way to update the objects |
childbox | size of children boundingbox |
clipbox | clip to this |
propbox | size of properties boundingbox |
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.
|
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.
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.
|
virtual |
called by Render() if m_flags.m_HighLight is set
ic | iteration 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.
|
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.
id | If property id is set only matching properties are selected |
withUndo | If true, the changes can be undone later. |
Reimplemented from a2dObject.
Definition at line 2722 of file canobj.cpp.
|
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.
|
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.
objectname | object with this name to search for |
classname | If classname is empty it collects all objects else only object with this class name. |
mask | object must have this mask. |
propid | if a property id is given, the object must have a property with this id |
valueAsString | StringValueRepresentation of the property that is required (if not empty). |
id | GetUniqueSerializationId() should be this unless 0 |
Definition at line 4505 of file canobj.cpp.
a2dCanvasObject * a2dCanvasObject::Find | ( | a2dCanvasObject * | obj | ) | const |
return the child object if it is part of this object
obj | object to search for |
Definition at line 4513 of file canobj.cpp.
|
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.
result | all pins found |
pin | If not NULL find only connections on this pin |
walkWires | If true, all wires like object are recursively iterated for pins to other non wire objects. The wire pins are skipped from the result. |
searchPinClass | if set search pin with this pinclass |
isConnectedTo | if 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.
result | all wires found |
pin | If not NULL find only wires on this pin |
walkWires | If true, all wires like object are recursively iterated for pins to other wire objects. |
selectedEnds | if true, end of wire to a non wire object must have selected flag set. |
addToResult | if true, this object is added to result. (default false, but recursive call set true). |
Definition at line 6644 of file canobj.cpp.
|
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.
toConnectTo | the pinClass to which the generated pin must be able to connect. |
task | what/how to connect |
x | x position of mouse or pin which wants/needs connection |
y | y position of mouse or pin which wants/needs connection |
margin | if not 0 the genarted pins must be this close to x and y. |
Reimplemented in a2dEllipse, a2dCircle, a2dRect, a2dPolylineL, a2dText, a2dWirePolylineL, and a2dRectMM.
|
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.
pinClass | if not NULL, only generate temporary pins that may connect to this pinClass. |
task | what/how to connect |
x | can be used to create pins depending on the poition of the mouse inside the object. |
y | can be used to create pins depending on the poition of the mouse inside the object. |
margin | if not 0 the genarted pins must be this close to x and y. |
Reimplemented in a2dWirePolylineL.
Definition at line 3156 of file canobj.cpp.
|
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.
Definition at line 4395 of file canobj.cpp.
|
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.
|
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.
|
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.
|
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.
a2dCanvasObjectList * a2dCanvasObject::GetChildObjectList | ( | ) |
get the list where the child objects are stored in.
Definition at line 2551 of file canobj.cpp.
unsigned int a2dCanvasObject::GetChildObjectsCount | ( | ) | const |
get 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.
connected | list to which connected objects will be added. |
needsupdate | if true only connected objects which need updating will be added. |
Definition at line 6757 of file canobj.cpp.
|
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
get static IgnoreSetpending flag
If this flag is set, all a2dCanvasObject will be not be set pending in SetPending()
|
inline |
get IgnoreSetpending flag
If this flag is set, the object will be not be set pending in SetPending()
|
inline |
a2dCanvasObject set as property will be rendered after all other child objects when it is rendreed from a parent a2dCanvasObject
|
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.
|
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.
|
inline |
|
inline |
get a2dCanvasDocument of the object.
Root (a2dCanvasDocument) needs to be known to each object for the following reasons:
|
inline |
|
inline |
|
inline |
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__
Definition at line 2869 of file canobj.cpp.
|
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?
pinName | the name of the pin to search for ( uses wxString::Matches() ). |
NotConnected | if true the pin must be unconnected too. |
Definition at line 6436 of file canobj.cpp.
bool a2dCanvasObject::HasPins | ( | bool | realcheck = false | ) |
are there a2dPin derived children
realcheck | if true checks all children else the flag m_flags.m_hasPins is returned |
Definition at line 6414 of file canobj.cpp.
|
inlinevirtual |
bool a2dCanvasObject::IsConnected | ( | bool | needsupdate, |
a2dCanvasObject * | toConnect = 0 |
||
) |
Is the object connected ( Optinal to specific object ) ?
needsupdate | if true, only return true when connected Object(s) need an update. |
toConnect | when not ( NULL ), the object needs to be connected with toConnect. |
Definition at line 6550 of file canobj.cpp.
|
inline |
|
inline |
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.
ic | contains iteration context |
hitEvent | stores hit information |
Definition at line 3415 of file canobj.cpp.
|
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.
|
inline |
|
inline |
|
inline |
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.
|
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.
x | mirror at X-axis (horizontally orientation) |
y | mirror at Y-axis (vertically orientation) |
Definition at line 2639 of file canobj.cpp.
|
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.
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.
|
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.
|
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.
ic | iteration context |
hitEvent | stores hit information |
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.
obj | object to release |
backwards | start at the end |
all | if true remove all references to object |
now | if true remove all references to object now!, else only delete flag is set, and Update() takes care of it. |
undoCommands | when object is connected to othere, use commands do be able to undo. |
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
Definition at line 6296 of file canobj.cpp.
|
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.
NotConnected | when true only pins which are not connected tp another pin will be deleted |
onlyTemporary | when true only pins with the temporary flag set using a2dPin::SetTemporaryPin() will be deleted. These type of pins are used in automatic connection situations, and often after an editing attempt of other objects need to be deleted in the end. |
now | if true remove pin object now!, else only delete flag is set, and it will be deleted in idle time. |
Definition at line 6504 of file canobj.cpp.
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)
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.
ic | iteration context (has a2dDrawingPart accumulative matrix to calculate absolute position of the object) |
clipparent | this must be the clip status of parent object, it is used to optimize drawing speed. e.g If parent is completely within the current clipping rectangle of the a2dDrawingPart, there is no need to check child objects. |
Reimplemented in a2dPolygonLClipper2, a2dPolygonLClipper, a2dRectWindowT2, and a2dWidgetButton.
Definition at line 4712 of file canobj.cpp.
|
protectedvirtual |
render only the child objects
ic | iteration context (has a2dDrawingPart accumulative matrix to calculate absolute position of the object) |
whichchilds | defined which childs will be rendered now, and detects while rendering other types. |
clipparent | this must be the clip status of parent object. |
Definition at line 5951 of file canobj.cpp.
|
protectedvirtual |
to render the child objects
ic | iteration context (hasa2dDrawingPart accumulative matrix to calculate absolute position of the object) |
whichchilds | defined which childs will be rendered now, and detects while rendering other types. |
clipparent | this must be the clip status of parent object. |
detect specific objects, to prevent extra rendering calls for child objects, if they do not exist.
Definition at line 6003 of file canobj.cpp.
|
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
parent | parent object to get and release to connected objects. |
undo | if 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)
rotation | rotate 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)
scalex | scalling in X |
scaley | scalling in Y |
Definition at line 2633 of file canobj.cpp.
|
inline |
general flag use at will.
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.bin | temporarely status information |
|
inline |
|
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.
samelayer | if true render children on same layer |
bool a2dCanvasObject::SetConnectedPending | ( | bool | onoff, |
bool | needsupdateonly | ||
) |
set connected pending or not pending
onoff | set connected object pending or not pending |
needsupdateonly | if true only connected object which need updating will treated. |
Definition at line 7241 of file canobj.cpp.
|
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.
|
inline |
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.
Definition at line 3086 of file canobj.cpp.
|
inline |
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.
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.
fillcolor | color to fill object with |
style | style for one colour fill |
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.
fillcolor | color to fill object with |
fillcolor2 | color to fill object with |
style | style for one colour fill |
Definition at line 2889 of file canobj.cpp.
|
inline |
void a2dCanvasObject::SetFlags | ( | a2dCanvasObjectFlagsMask | newmask | ) |
set bit flags of object (true or false) to given newmask values
newmask | mask to set flags to in object (either true or false) |
Definition at line 2650 of file canobj.cpp.
|
inline |
|
inline |
|
inline |
void a2dCanvasObject::SetHitFlags | ( | a2dCanvasObjectHitFlags | mask | ) |
set hit flags
Based on these flags the object will generate a hit true.
mask | set hit flags in object according to given mask. |
Definition at line 2670 of file canobj.cpp.
|
inlinestatic |
set static IgnoreAllSetpending flag
If this flag is set, all a2dCanvasObject will be not be set pending in SetPending()
|
inline |
set IgnoreSetpending flag
If this flag is set, the object will be not be set pending in SetPending()
|
inline |
a2dCanvasObject set as property will be rendered after all other child objects when it is rendreed from a parent a2dCanvasObject
|
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.
layer | the index of the layer |
Definition at line 5920 of file canobj.cpp.
|
inlinevirtual |
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.
tip | the tip which should be shown |
x | x-pos of the tip |
y | y-pos of the tip |
size | font-size in world coordinates (font size of the font-param will be ignored, see a2dText documentation) |
angle | rotation in degrees |
font | the font to use |
Definition at line 2781 of file canobj.cpp.
|
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.
pending | if 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.
x | x position |
y | y position |
restrict | use a2dCanvasGlobals->GetRestrictionEngine() to snap position |
Definition at line 1624 of file canobj.cpp.
|
inline |
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
x | x position |
y | y position |
Definition at line 1606 of file canobj.cpp.
|
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.
prerender | true to prerender this object, else false |
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.
|
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.
void a2dCanvasObject::SetRoot | ( | a2dDrawing * | root, |
bool | recurse = true |
||
) |
Sets this object to a a2dCanvasDocument.
root | set the a2dCanvasDocument for this object to this (if appropriate recursive) |
recurse | default true, which uses a2dWalker_SetCanvasDocument for doing the same recursive for nested object and nested object in derived classes. |
Definition at line 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.
rotation | set rotation angle in degrees |
Definition at line 2609 of file canobj.cpp.
|
inline |
|
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.
selected | if true set object 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.
selected | if true set object selected |
|
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.
|
inline |
Sets snap_to flag.
If snap is set to true
others objects may snap to this object by the restriction engine of a2dCanvasGlobal.
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
setOrClear | if true sets the flag to true else to false |
which | set only those flags in object to true or false |
Definition at line 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.
strokecolor | color to stroke object with |
width | width of stroke in world coordinates |
style | style for one colour stroke |
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.
strokecolor | color to stroke object with |
width | width of stroke in device coordinates |
style | style for one colour stroke |
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.
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.
tip | the tip which should be shown |
Definition at line 2798 of file canobj.cpp.
|
inline |
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.
xt | x translation |
yt | y translation |
scalex | x scale factor |
scaley | y scale factor |
degrees | rotation 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
aView | view for adding next properties on this object and maybe its children. |
viewdependent | if true, then add property 'PROPID_viewDependent' to objects that are depending on 'aView' view when it comes to size. Else to remove this property. |
viewspecific | if true then add property 'PROPID_viewSpecific' to objects that are only visible on 'aView' view. Else to remove this property to make visible on all views. |
onlyinternalarea | removing scale for children |
deep | if true then set flags for all nested children objects |
Definition at line 2816 of file canobj.cpp.
|
inline |
void a2dCanvasObject::SkewX | ( | double | angle | ) |
void a2dCanvasObject::SkewY | ( | double | angle | ) |
|
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
tool | tool from which this function is called. Currently this is the a2dObjectEditTool |
editmode | tobe used in derived object to switch between different way of editing ( 0 means matrix mode of a2dCanvasObject ) |
editstyle | style of editing e.g. filled and stroked or with a wire frame. |
Reimplemented in a2dMultiSelectGroup.
Definition at line 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
Definition at line 4487 of file canobj.cpp.
|
inline |
|
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.
x | delta x for translation |
y | delta y for translation |
|
virtual |
Update the state of the object according to its current position etc.
This usually does the following:
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.
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').
ic | iteration context (has a2dDrawingPart accumulative matrix to calculate absolute position of the object) |
Definition at line 4605 of file canobj.cpp.
|
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.
function | function id, to be able to use this function for more tasks. |
handler | a2dIOHandler which was use to iterate the document |
|
staticprotected |
holds value for flags to initialize m_flags
|
protected |
|
protected |
|
static |
|
static |