18 #ifndef __WXCANOBJ_H__
19 #define __WXCANOBJ_H__
29 #include "wx/geometry.h"
53 #if defined(WXART2D_USINGDLL)
57 #if defined(WXART2D_USINGDLL)
67 typedef wxUint8 a2dTag;
68 typedef vector<a2dTag> a2dTagVec;
181 bool m_fill_non_transparent: 1;
183 bool m_stroke_non_transparent: 1;
257 a2dHitEvent(
double absx = 0,
double absy = 0,
bool continues =
true,
261 m_maxlevel = INT_MAX;
267 m_continue = continues;
271 m_extendedWanted = wantExtended;
272 m_xyRelToChildren =
false;
276 void SetProcessed(
bool val )
384 bool m_postrender: 1;
389 DECLARE_EVENT_TABLE()
428 virtual bool IsRecursive();
437 virtual void MakeReferencesUnique();
461 void Rotate(
double rotation );
471 void SetRotation(
double rotation );
478 void Scale(
double scalex,
double scaley );
485 void Mirror(
bool x =
true,
bool y =
false );
491 void SkewX(
double angle );
497 void SkewY(
double angle );
524 void SetTransformMatrix(
double xt,
double yt,
double scalex = 1,
double scaley = 1,
double degrees = 0 );
527 double GetPosX()
const {
return m_lworld.GetValue( 2, 0 ); }
530 double GetPosY()
const {
return m_lworld.GetValue( 2, 1 ); }
541 void SetPosXY(
double x,
double y,
bool restrict =
false );
549 SetPosXY( pos.m_x, pos.m_y,
false );
561 bool SetPosXYRestrict(
double& x,
double& y );
569 void Translate(
double x,
double y ) { m_lworld.Translate( x, y ); SetPending(
true ); }
584 virtual bool EliminateMatrix();
665 a2dCANOBJ_BBOX_NON = 0x0000,
666 a2dCANOBJ_BBOX_EDIT = 0x0001,
667 a2dCANOBJ_BBOX_CHILDREN = 0x0002
670 typedef unsigned int a2dBboxFlags;
725 virtual a2dBoundingBox GetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_CHILDREN )
const;
763 wxRect GetAbsoluteArea(
a2dIterC& ic,
int inflate = 2 );
891 void OnChar( wxKeyEvent& event );
960 void SetRoot(
a2dDrawing* root,
bool recurse =
true );
969 void Insert(
size_t before,
a2dCanvasObject* obj,
bool ignoreReleased =
true );
994 unsigned int GetChildObjectsCount()
const;
1009 virtual void RemoveHierarchy();
1024 int ReleaseChild(
a2dCanvasObject* obj,
bool backwards =
false,
bool all =
false,
bool now =
false,
bool undoCommands =
false );
1045 a2dCanvasObject* Find(
const wxString& objectname,
const wxString& classname = wxT(
"" ),
1047 wxUint32
id = 0 )
const;
1059 bool SwitchChildNamed(
const wxString& objectname,
a2dCanvasObject* newobject );
1074 const wxString& classname = wxT(
"" ),
1094 update_save = 0x0001,
1097 update_includebboxprop = 0x0002,
1099 updatemask_countObjects = 0x0004,
1102 updatemask_save_includebboxprop =
1103 update_includebboxprop |
1108 update_includebboxprop |
1114 update_includebboxprop,
1116 updatemask_force_and_count =
1117 update_includebboxprop |
1118 updatemask_countObjects |
1124 bool RemoveReleased();
1156 virtual bool Update( UpdateMode mode );
1185 virtual void SetPending(
bool pending );
1290 void UpdateViewDependentObjects(
a2dIterC& ic );
1296 virtual void DrawHighLighted(
a2dIterC& ic );
1305 if( m_flags.m_visible != visible ) { m_flags.m_visible = visible; SetPending(
true ); }
1329 void SetFill(
const a2dFill& fill );
1358 void SetFillColour(
const wxColour& colour );
1361 wxColour GetFillColour()
const;
1394 void SetStroke(
const a2dStroke& stroke );
1399 void SetStrokeColour(
const wxColour& colour );
1402 wxColour GetStrokeColour()
const;
1446 void SetViewDependent(
a2dDrawingPart* aView,
bool viewdependent,
bool viewspecific =
false,
bool onlyinternalarea =
false,
bool deep =
false );
1453 inline void SetChildOnlyTranslate(
bool onlytranslate ) { SetPending(
true ); m_flags.m_ChildOnlyTranslate = onlytranslate; }
1469 inline void SetPreRenderAsChild(
bool prerender ) { SetPending(
true ); m_flags.m_prerenderaschild = prerender; }
1483 void SetFilled(
bool filled ) {
if ( m_flags.m_filled != filled ) SetPending(
true ); m_flags.m_filled = filled; }
1510 DoRender( ic, clipparent );
1517 virtual a2dLayers* GetLayerSetup() {
return NULL; }
1521 const a2dFill& MX_GetFill()
const;
1522 void MX_SetFill(
const a2dFill& value );
1524 void MX_SetStroke(
const a2dStroke& value );
1541 virtual void DoRender(
a2dIterC& WXUNUSED( ic ),
OVERLAP WXUNUSED( clipparent ) );
1544 virtual void DoUpdateViewDependentTransform(
a2dIterC& ic );
1547 virtual void DoUpdateViewDependentObjects(
a2dIterC& WXUNUSED( ic ) );
1555 virtual void RenderChildObjects(
a2dIterC& ic, RenderChild& whichchilds,
OVERLAP clipparent );
1563 virtual void RenderChildObjectsOneLayer(
a2dIterC& ic, RenderChild& whichchilds,
OVERLAP clipparent );
1581 inline void SetEditable(
bool editable ) { m_flags.m_editable = editable; }
1587 inline void SetFixedStyle(
bool fixedStyle ) { m_flags.m_fixedStyle = fixedStyle; }
1622 if ( m_flags.m_selectable ) {
if( m_flags.m_selected != selected ) SetPending(
true ); m_flags.m_selected = selected;}
1641 if ( m_flags.m_selectable ) {
if( m_flags.m_selected2 != selected ) SetPending(
true ); m_flags.m_selected2 = selected;}
1673 inline void SetDraggable(
bool draggable ) { m_flags.m_draggable = draggable; }
1695 void SetSnap(
bool snap ) { m_flags.m_snap = snap; }
1740 virtual void EndEdit();
1743 void ReStartEdit( wxUint16 editmode );
1749 a2dHandle* SetHandlePos( wxString name,
double x,
double y );
1758 bool IsCapturedMouse(
a2dIterC& ic )
const ;
1794 #if wxART2D_USE_CVGIO
1800 virtual void DoLoad( wxObject* parent,
a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts );
1802 #endif //wxART2D_USE_CVGIO
1849 void DoConnect(
bool doconnect ) { m_flags.m_doConnect = doconnect; }
1922 bool FindConnectedWires(
a2dCanvasObjectList& result,
a2dPin* pin,
bool walkWires =
true,
bool selectedEnds =
false,
bool stopAtSelectedWire =
false,
bool addToResult =
false );
1937 virtual bool ConnectWith(
a2dCanvasObject* parent,
a2dCanvasObject* toconnect,
const wxString& pinname = wxT(
"" ),
double margin = 1,
bool undo =
false );
1944 virtual bool ConnectWith(
a2dCanvasObject* parent,
a2dPin* pin,
double margin = 1,
bool undo =
false );
1972 virtual bool DisConnectWith(
a2dCanvasObject* toDisConnect = NULL,
const wxString& pinname = wxT(
"" ),
bool undo =
false );
1978 virtual bool DisConnectAt(
a2dPin* pin,
bool undo =
false );
1992 bool CreateWiresOnPins(
a2dCanvasObject* parent,
bool undo,
bool onlyNonSelected =
false );
1999 bool SetConnectedPending(
bool onoff,
bool needsupdateonly );
2006 bool HasPins(
bool realcheck =
false );
2017 a2dPin* HasPinNamed(
const wxString pinName,
bool NotConnected =
false );
2034 virtual bool GeneratePinsPossibleConnections(
a2dPinClass* pinClass,
a2dConnectTask task,
double x,
double y,
double margin = 0 );
2092 a2dPin* AddPin(
const wxString name,
double x,
double y, wxUint32 a2dpinFlags,
a2dPinClass* pinClass,
bool undo =
false );
2104 void RemovePins(
bool NotConnected =
false,
bool onlyTemporary =
false,
bool now =
false );
2107 void ShowPins(
bool onoff );
2113 void SetRenderConnectedPins(
bool onoff );
2119 virtual void ClearAllPinConnections(
bool withundo =
true );
2138 virtual bool DoCanConnectWith(
a2dIterC& ic,
a2dPin* pin,
double margin,
bool autocreate );
2152 inline void SetIsProperty(
bool IsProperty ) { SetPending(
true ); m_flags.m_IsProperty = IsProperty; }
2171 a2dText* SetObjectTip(
const wxString& tip,
double x,
double y,
double size = 30,
double angle = 0,
2181 void SetTipWindow(
const wxString& tip );
2259 inline void SetBin(
bool bin ) { m_flags.m_bin = bin; }
2262 inline bool GetBin()
const {
return m_flags.m_bin;}
2273 void SetGroupA(
bool value ) { SetPending(
true ); m_flags.m_a = value; }
2284 void SetGroupB(
bool value ) { SetPending(
true ); m_flags.m_b = value; }
2295 void SetGeneratePins(
bool value ) { SetPending(
true ); m_flags.m_generatePins = value; }
2313 void SetIgnoreLayer(
bool value =
true ) { m_flags.m_ignoreLayer = value; }
2315 bool GetIgnoreLayer( )
const {
return m_flags.m_ignoreLayer; }
2317 void SetSubEdit(
bool value ) { m_flags.m_subEdit = value; }
2318 bool GetSubEdit( )
const {
return m_flags.m_subEdit; }
2319 void SetSubEditAsChild(
bool value ) { m_flags.m_subEditAsChild = value; }
2320 bool GetSubEditAsChild( )
const {
return m_flags.m_subEditAsChild; }
2321 void SetShowshadow(
bool value ) { m_flags.m_showshadow = value; }
2322 bool GetShowshadow( )
const {
return m_flags.m_showshadow; }
2323 void SetPushin(
bool value ) { m_flags.m_pushin = value; }
2324 bool GetPushin( )
const {
return m_flags.m_pushin; }
2325 void SetBin2(
bool value ) { m_flags.m_bin2 = value; }
2326 bool GetBin2( )
const {
return m_flags.m_bin2; }
2327 void SetPrerenderaschild(
bool value ) { m_flags.m_prerenderaschild = value; }
2328 bool GetPrerenderaschild( )
const {
return m_flags.m_prerenderaschild; }
2329 void SetVisiblechilds(
bool value ) { m_flags.m_visiblechilds = value; }
2330 bool GetVisiblechilds( )
const {
return m_flags.m_visiblechilds; }
2331 void SetEditing(
bool value ) { m_flags.m_editing = value; }
2332 bool GetEditing( )
const {
return m_flags.m_editing; }
2333 void SetEditingRender(
bool value ) { m_flags.m_editingCopy = value; }
2334 bool GetEditingRender( )
const {
return m_flags.m_editingCopy; }
2335 void SetDoConnect(
bool value ) { m_flags.m_doConnect = value; }
2336 bool GetDoConnect( )
const {
return m_flags.m_doConnect; }
2337 void SetIsOnCorridorPath(
bool value ) { m_flags.m_isOnCorridorPath = value; }
2338 bool GetIsOnCorridorPath( )
const {
return m_flags.m_isOnCorridorPath; }
2339 void SetHasPins(
bool value ) { m_flags.m_hasPins = value; }
2340 bool GetHasPins( )
const {
return m_flags.m_hasPins; }
2341 void SetMouseInObject(
bool value ) { m_flags.m_MouseInObject = value; }
2342 bool GetMouseInObject( )
const {
return m_flags.m_MouseInObject; }
2343 void SetHighLight(
bool value ) { m_flags.m_HighLight = value; }
2344 bool GetHighLight( )
const {
return m_flags.m_HighLight; }
2345 void SetAlgoSkip(
bool value ) { m_flags.m_AlgoSkip = value; }
2346 bool GetAlgoSkip( )
const {
return m_flags.m_AlgoSkip; }
2382 virtual void SetLayer( wxUint16 layer );
2460 void Dump(
int indent = 0 );
2463 virtual void DoDump(
int indent, wxString* line );
2493 void SetTemplate(
bool b =
true );
2494 void SetExternal(
bool b =
true );
2495 void SetUsed(
bool b =
true );
2497 bool GetTemplate()
const ;
2498 bool GetExternal()
const ;
2499 bool GetUsed()
const ;
2503 bool ProcessCanvasEventChild(
a2dIterC& ic, RenderChild& whichchilds,
a2dHitEvent& hitEvent );
2505 bool ProcessCanvasEventChildOneLayer(
a2dIterC& ic, RenderChild& whichchilds,
a2dHitEvent& hitEvent );
2518 virtual bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
2568 virtual void DoAddPending(
a2dIterC& ic );
2577 virtual a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON )
const;
2601 virtual void DoEndEdit() {};
2606 static bool m_ignoreAllSetpending;
2730 #include "wx/canvas/canpin.h"
2735 A2DCANVASDLLEXP
extern a2dCanvasObjectSorter s_a2dCanvasObjectSorter;
2774 #if defined(WXART2D_USINGDLL)
2791 m_antimask = antimask;
2841 m_maskedCanvasObject = 0;
3024 const a2dAffineMatrix& GetLocalTransform() {
return m_localtransform; }
3063 a2dIterPP* SmrtPtrOwn() { m_refcount++;
return this; }
3068 bool SmrtPtrRelease()
3071 wxASSERT_MSG( m_refcount >= 0, wxT(
"a2dIterCU Own/Release not matched (extra Release calls)" ) );
3072 if ( m_refcount <= 0 )
3199 typedef unsigned int a2dCanViewUpdateFlagsMask;
3251 a2dIterPP* Last() {
return m_contextList.back(); }
3261 void SetHitMarginDevice(
int pixels );
3269 void SetHitMarginWorld(
double world );
3272 double GetHitMarginWorld();
3276 double ExtendDeviceToWorld(
int extend );
3279 double GetTransformedHitMargin();
3379 void SetCorridorPath(
bool OnOff,
a2dCanvasObject* captureObject = NULL );
3382 void SetCorridorPathToParent();
3406 OVERLAP GetClipStatus()
const;
3409 OVERLAP GetParentClipStatus()
const;
3412 void SetClipStatus(
OVERLAP status );
3444 void SetUpdateHint( a2dCanViewUpdateFlagsMask updateHint ) { m_updateHint = updateHint; }
3446 a2dCanViewUpdateFlagsMask GetUpdateHint() {
return m_updateHint; }
3454 bool m_disableInvert;
3470 double m_hitmargin_world;
3476 bool m_foundCorridorEnd;
3479 double m_worldStrokeExtend;
3485 a2dSmrtPtr<a2dCanvasObjectFilter> m_objectFilter;
3491 bool m_generateCommands;
3496 bool m_perLayerMode;
3499 bool m_renderChildDerived;
3501 a2dCanViewUpdateFlagsMask m_updateHint;
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
bool m_processed
set if event was processed sofar
virtual bool GeneratePins(a2dPinClass *toConnectTo, a2dConnectTask task, double x, double y, double margin=0)
create pins in derived objects.
virtual void EndFilter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to reset filtering feature when filtered object goes out of context...
void SetFixedStyle(bool fixedStyle)
Set object to fixed style ot not.
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
double m_relx
(world coordinates) hit point x relative to the canvas object its parent object(s) ...
bool GetSnap() const
is snap flag set?
bool GetDisableInvert()
see SetDisableInvert()
bool m_objectLevel
indicates type of constructor used.
Base class for all types of strokes, understood by a2dDrawer2D classes.
bool GetGeneratePins() const
get the GeneratePins flag
a2dCanViewUpdateFlags
mask flags for a2dDrawingPart::OnUpdate
bool GetGenerateCommands()
get setting for command generation or not.
void SetGeneratePins(bool value)
set the GeneratePins flag
bool m_continue
set if the event processing or hittest needs to continue after first hit
virtual bool IsVirtConnect() const
object is a virtual connection (connects invisible with other objects without using wires ) ...
virtual void SetParent(a2dCanvasObject *parent)
set parent object of the pin or some other objects that needs a parent
a2dHandle is used inside editing versions of a certain objects.
bool GetEditable() const
get if the object may be edited
mouse event sent from a2dCanvasObject to itself
a2dConnectTask
flags for searching a connecting a2dpinClass, for the connecting task at hand.
float GetWorldExtend() const
get world extend
a2dAffineMatrix m_relativetransform
the accumulated transforms up to and including m_object->m_lworld
void SetFoundCorridorEnd(bool foundCorridorEnd)
when there is a corridorPath set, this is used internal to set this flag to indicate that the end of ...
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
virtual bool IsTemporary_DontSave() const
Check if this is a temporary object, which should not be saved.
a2dCanvasObjectHitFlags
event mask flags for a2dCanvasObject hit
class to map references to objects stored in XML, in order to make the connection later on...
Creates a shadow behind a a2dCanvasObject when added as property.
a2dDrawing * m_root
root group for rendering and accessing the canvas's also contains layer settings
a2dDocumentRenderStyle operator|(a2dDocumentRenderStyle a, a2dDocumentRenderStyle b)
OR-ing a2dDocumentRenderStyle is allowed.
filter for selected a2dCanvasObject's
a2dCanvasObject * GetDeepestHit() const
get deepest object that was hit during event processing down the hierarchy.
a2dCanvasOFlags m_flags
holds flags for objects
virtual bool AdjustPinLocation()
Allow change in pin location when wiring things up.
int m_level
level of the hit object below the start (root) object
void SetSelected2(bool selected)
Set the object selected2 flag if allowed.
a2dPin is used in a2dCanvasObject to add pins to it.
This is a class/type description for a2dPin's.
static a2dCanvasOFlags m_flagsInit
holds value for flags to initialize m_flags
static a2dPropertyIdVoidPtr * PROPID_ToolObject
set for objects that act as tool object, when a tool is in action.
static a2dHit stock_nohit
Stock object for no hit.
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
bool GetPending() const
is this object pending for update?
void SetTransformMatrix(const a2dAffineMatrix &mat=a2dIDENTITY_MATRIX)
Returns the matrix used to position the object.
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
a2dIOHandlerCVGIn and a2dIOHandlerCVGOut - XML I/O classes for the CVG format.
virtual void SetContourWidth(double width)
set the Contour width of the shape
a2dIOHandler takes care of loading and/or saving data.
double GetBboxMinY()
get minimum Y of the boundingbox in world coordinates relative to its parents
a2dObject * Clone(CloneOptions options, a2dRefMap *refs=NULL) const
create an exact copy of this property
wxUint16 GetLayer()
get the layer that is to be rendered
a2dCanvasOHitFlags m_hitflags
allow hits on basis of those flags
This template class is for property ids meant for properties that do not encapsulate another type...
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
virtual int GetMode() const
get the rendering mode of the object.
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
void SetStrokeWorldExtend(double worldStrokeExtend)
Set strokeworld extend of last added object, used in a2dCanvasObject::DoIsHitWorld() ...
void SetSelectable(bool selectable)
Allows to select this object.
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
bool ParseCvgTransForm(a2dAffineMatrix &matrix, const wxString &str, wxString &error)
function to parse a string in SVG/CVG format and return the resulting matrix
a2dCanvasObjectPtr m_object
the canvas object at the current level of iteration
a2dCanvasObjectFilter * GetObjectFilter()
get the filter set for the iteration context.
object hit should not have select flag set
A trivial base class for a2dSmrtPtr. Non-template class, so that it can.
void SetShowShadow(bool showshadow)
If True shadow object is visible (if property is there)
snapping engine, for snapping while editing a drawing
This is one hit result from a2dExtendedResult.
#define DECLARE_PROPERTIES()
check if class has the given id as a valid id for this object
virtual bool UserBaseFunction()
can be used by the user to implement a function that affects all a2dCanvas derived objects ...
double GetBboxMinX()
get minimum X of the boundingbox in world coordinates relative to its parents
wxUint16 m_layer
layer of object, default wxLAYER_DEFAULT
int GetLevel() const
level of the hit object below the start (root) object
vertex array of line and arc segments.
a2dCanvasObject is the base class for Canvas Objects.
a2dAffineMatrix a2dIDENTITY_MATRIX
global a2dAffineMatrix to set/pass the identity matrix.
a2dHit m_type
type of the hit
a2dBoundingBox wxNonValidBbox
global non valid boundingbox to use as default argument etc.
double GetBboxMaxY()
get maximum Y of the boundingbox in world coordinates relative to its parents
bool SetPointIfCloser(const a2dPoint2D &pointToSnapTo, const a2dPoint2D &pointToSnap, a2dPoint2D &bestPointSofar, double thresHoldWorld)
a2dCanvasObject * GetObject()
Get the current object.
void SetEditable(bool editable)
Sets if this object may be edited.
vertex list of line and arc segments.
void SetObjectFilter(a2dCanvasObjectFilter *filter)
set object filter class.
OVERLAP m_clip
how far this object in the view being rendered
bool GetSelected() const
is the object selected flag set
void SetSelected(bool selected)
Set the object selected flag if allowed.
a2dAffineMatrix m_inverseRelativetransform
inverse of m_relativetransform
filter for selected a2dCanvasObject's
virtual a2dCanvasObject * GetParent() const
double GetBboxWidth()
get width of the boundingbox in world coordinates relative to its parents
void SetBin(bool bin)
general flag use at will.
bool IsVisible() const
get visibility (rendering depends on layer settings also)
double GetBboxMaxX()
get maximum X of the boundingbox in world coordinates relative to its parents
static a2dPropertyIdBool * PROPID_FirstEventInObject
set in Startedit(), to be used to detect first (mouse)event sent to object.
float m_worldExtend
world extend in world coordinates.
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
static a2dPropertyIdRefObject * PROPID_ViewSpecific
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
virtual void OnPropertyChanged(const a2dPropertyId *id)
This function is called after a property changed.
Io handler to iterate through a a2dDocument.
bool GetGroupA() const
get the groupA flag
a2dFillStyle
Filling styles for a2dFill.
void SetGroupA(bool value)
set the groupA flag
class a2dCanvasObject * GetObject() const
the hit object
a2dCanvasObject * m_parent
the parent object of the hit object
bool m_xyRelToChildren
is set, m_x and m_y are supplied relative to the child objects ( object matrix m_world already applie...
wxUint32 m_option
the way to hit/traverse the document.
void SetIgnoreSetpending(bool value=true)
set IgnoreSetpending flag
bool GetPreRenderAsChild() const
Returns if this object should be rendered before other children objects.
void SetHasToolObjectsBelow(bool value)
selected object itself or one of its recursive children
a2dText is an abstract base class.
virtual bool UserBaseFunctionVar(...)
can be used by the user to implement a function using a variable argument list that affects all a2dCa...
virtual bool EditProperties(const a2dPropertyId *id, bool withUndo=true)
edit properties of the object
a2dCanvasObjectList * m_childobjects
holds child objects
void SetDrawStyle(a2dDocumentRenderStyle drawstyle)
set drawstyle used for rendering the document
void Transform(const a2dAffineMatrix &tworld)
transform the object using the given matrix
a2dExtendedResult m_extended
extended result information with e.g path to lead to the nested object hit
bool GetIgnoreSetpending() const
get IgnoreSetpending flag
a2dHitOption
Enum for hit test options.
bool GetSnapTo() const
is snap_to flag set?
double GetPosX() const
get x position from affine matrix
bounding class for optimizing drawing speed.
Drawing context abstraction.
static a2dPropertyIdBool * PROPID_TemporaryObject
set for objects that do not have to be saved
void SetDisableInvert(bool disableInvert)
when true, disable inversion of matrixes
const a2dAffineMatrix & GetTransform()
Get the accumulated transforms up to and including m_object->m_lworld.
class a2dCanvasObject * GetParent() const
the parent object of the hit object
bool GetShowShadow() const
If True shadow object is visible (if property is there)
const a2dAffineMatrix & GetInverseTransform()
Get the accumulated transforms up to and including m_object->m_lworld.
void SetPerLayerMode(bool value)
if set the rendering is done layers by layer from the top
virtual bool UserBaseFunctionEx(int function, a2dIOHandler *handler=NULL)
can be used by the user to implement a function that affects all a2dCanvas derived objects ...
void SetResizeOnChildBox(bool resizeToChilds)
If True resize to child boundingbox.
void SetDeepestHit(a2dCanvasObject *canvasObject)
set during event processing down the hierarchy, to the deepest object that was hit ...
void Translate(double x, double y)
relative translate the object to position x,y in world coordinates
a2dCanvasObject hit flags as a structure
general event sent from a2dHandle to its parent a2dCanvasObject
virtual void Initialize()
bool m_extendedWanted
fill m_extended or not
bool m_isHit
in the end if there was a hit (even if not processed event)
wxUint16 GetLayer() const
Returns the layer index where this object is drawn upon.
general hittest functions
Input and output handler for the XmlSer format.
if set, respect layer order, hit testing is done per layer from the top.
bool GetResizeOnChildBox() const
see SetResizeOnChildBox()
bool IsSelected() const
Is the object selected flag set.
bool GetBin() const
general flag use at will.
Invisible Style property that can be added to Canvas Objects.
bool GetChildOnlyTranslate() const
are children rendered using just the translation of the parent or also rotation and scale...
a2dCanvasObject * GetObject()
Get the current object.
void SetFilled(bool filled)
set the filled flag to render only outlines
a2dCanvasObject flags as a structure
a2dCanvasObject * m_object
the hit object
int GetLevel() const
number of levels deep we are inside a document as seen from the m_top
wxUint32 a2dSnapToWhatMask
mask for a2dSnapToWhat flags
a2dBboxFlag
flags for calculating boundingbox of derived object
editing is completely controlled by tools. No handles are added
int m_refcount
how many references to this object do exist
corridor as a direct event path to a a2dCanvasObject
defines common settinsg for a habitat for a set of a2dCameleons.
void SetVisible(bool visible)
set if this object will visible (be rendered or not)
void SetSnapTo(bool snap)
Sets snap_to flag.
A 2x3 affine matrix class for 2D transformations.
static a2dPropertyIdMatrix * PROPID_IntViewDependTransform
used for objects with* PROPID_viewDependent but only for internal area
a2dPoint2D GetPosXY() const
get position of object
static a2dPropertyIdWindow * PROPID_TipWindow
when set used for tip window by default in OnCanvasMouseEvent()
wxUint16 m_pixelExtend
Pixel extend.
if set, don't hit test the root object or object for which IsHitWorld is called
bool DoConnect()
if return true, connection with other object on this object its pins is allowed.
a2dExtendedResultItem(a2dCanvasObject *object, a2dCanvasObject *parent, a2dHit type, int level, int typeex)
Standard Constructor.
bool GetFixedStyle() const
Get object fixed style setting.
double GetPosY() const
get y position from affine matrix
double GetWorldStrokeExtend()
virtual double GetContourWidth() const
get the Contour width of the shape
while iterating a a2dCanvasDocument, this holds the context.
void SetChildOnlyTranslate(bool onlytranslate)
How a child is placed towards its parent object.
struct for how a single object on one layer was hit
double m_x
(world coordinates) hit point x as in a2dDrawingPart or any other top level
bool GetPerLayerMode()
if set the rendering is done layers by layer from the top
static const a2dCanvasObjectFlagsMask NON
Flags for a2dCanvasObject.
void SetHasSelectedObjectsBelow(bool value)
selected object itself or one of its recursive children
void SetSnap(bool snap)
Sets snap flag.
static a2dPropertyIdMenu * PROPID_PopupMenu
when set used for popup menu by default in OnPopUpEvent()
const a2dFont * a2dDEFAULT_CANVASFONT
global a2dFont stock object for default font
general modules header files all together.
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
a2dHit m_type
type of the hit
void SetChildrenOnSameLayer(bool samelayer)
if set children are rendered on the same layer as this object.
int m_id
application specific use
void SetGenerateCommands(bool generateCommands)
set to generate command or not in certain situations.
const a2dAffineMatrix & GetInverseTransform()
Get the accumulated transforms up to and including m_object->m_lworld.
const a2dAffineMatrix & GetTransform()
Get the accumulated transforms up to and including m_object->m_lworld.
bool GetFoundCorridorEnd()
when there is a corridor path set, this return if end has bin found while iterating.
bool GetGroupB() const
get the groupA flag
const a2dHit & GetHitType() const
type of the hit
void SetGroupB(bool value)
set the groupA flag
bool GetRenderChildDerived()
when set child object in derived a2dCanvasObject are rendered, else only the object itself...
bool IsEditable() const
get if the object may be edited
a2dExtendedResultItem()
Default Constructor.
virtual bool DoIgnoreIfNotMember(const a2dPropertyId *id) const
used to decide if a property shall be ignored, if it is not a member
void DoConnect(bool doconnect)
If set to true this object may be connected to other object on its pins.
virtual bool Filter(a2dIterC &ic, a2dCanvasObject *canvasObject)
called from a2dCanvasObject to filter objects for rendering
bool IsDraggable() const
get if the object can be dragged
filter for selected a2dCanvasObject's
This is the base class for all kinds of property id's for a2dObject.
bool IsSelectable() const
Is the object selectable flag set.
An object of this class will update a a2dIterC with the required information.
style properties that are specific to the canvas modules.
void SetIsProperty(bool IsProperty)
if set, don't stop at the first hit, but test child/sibling objects anyway
int m_maxlevel
maximum level of hit object below this (this = level 0)
void SetLayer(wxUint16 layer)
set the layer that is to be rendered
void SetDraggable(bool draggable)
Sets if this object may be dragged.
bool GetHasSelectedObjectsBelow() const
selected object itself or one of its recursive children
objects not fitting the property are not drawn, inclusif its children.
double GetBboxHeight()
get height of the boundingbox in world coordinates relative to its parents
hit if stroke is not transparent
bool GetVisible() const
get visibility (rendering depends on layer settings also)
int m_typeex
Extended hit type.
bool GetSelectable() const
is the object selectable flag set
used to tell which child object to render and to detect the need for it.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool GetChildrenOnSameLayer() const
are children rendered on the same layer as this object?
virtual void SetMode(int mode)
you may use it to modify rendering of the object depending on setting
static a2dPropertyIdDateTime * PROPID_DateTime
some time property which a user wants to store
bool GetHasToolObjectsBelow() const
tool object itself or one of its recursive children
int GetPixelExtend() const
get pixel extend
static a2dPropertyIdBoundingBox * PROPID_BoundingBox
used to store state ( redraw area) of the object as it was before a change
Classes for generating connection between pins in canvas objects.
An object of this class represents the context of a query like a hit test.
object not fitting the mask are drawn blind.
void SetPosXyPoint(const a2dPoint2D &pos)
set position to x,y
bool GetSelected2() const
is the object selected2 flag set
virtual bool NeedsUpdateWhenConnected() const
used in case of flexible canvas objects (wires).
static a2dPropertyIdBool * PROPID_ToolDecoration
set for objects that act as tool decorations, when a tool is in action.
filter on this layer and mask.
This template class is for property ids with a known data type.
a2dBoundingBox m_bbox
boundingbox in world coordinates
Walker taking iterative context into account.
static bool GetIgnoreAllSetpending()
get static IgnoreSetpending flag
static a2dPropertyIdTagVec * PROPID_Tags
used in tool when grouping using tags
hit if filling is not transparent
static const a2dCanvasObjectFlagsMask ALL
class use by a2dIterC to filter objects for rendering.
bool GetIsProperty() const
a2dStrokeStyle
stroke styles for a2dStroke
a2dDocumentRenderStyle
Define the manner in which a2dCanvasView draws the document to the device.
static a2dPropertyIdUint16 * PROPID_Datatype
used in GDSII and KEY format to specify the DATATYPE of elements
virtual bool IsConnect() const
return true, if this object is used to connect other object's using rubberband like structures...
wxEvent * m_event
event to process in case of event processing call
void SetRenderChildDerived(bool value)
when set child object in derived a2dCanvasObject are rendered, else only the object itself...
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
a2dDocumentRenderStyle GetDrawStyle()
get drawstyles used for drawing the document
double m_y
(world coordinates) hit point y as in a2dDrawingPart or any other top level
edit a copy of the original object
CloneOptions
options for cloning
bool GetDraggable() const
get if the object can be dragged
static a2dPropertyIdRefObject * PROPID_ViewDependent
used for objects that depend on 'aView' view when it comes to size.
void SetPreRenderAsChild(bool prerender)
If set, this object has a higher priority in rendering than other children objects.
structure to give as parameter to member functions of a2dCanvasObject
Contain one drawing as hierarchical tree of a2dCanvasObject's.
const a2dHit & GetHitType() const
type of the hit
static void SetIgnoreAllSetpending(bool value=true)
set static IgnoreAllSetpending flag
virtual bool UserBaseFunctionFormat(wxString format,...)
can be used by the user to implement a function using a variable argument list and format string that...
a base command for the a2dCommandProcessor