21 #include <wx/wfstream.h>
22 #include <wx/module.h>
23 #include <wx/clipbrd.h>
35 #if defined(__WXMSW__) && defined(__MEMDEBUG__)
36 #include <wx/msw/msvcrt.h>
66 const
long a2dHandle::sm_HandleHit = wxGenNewId();
75 a2dHandle::a2dHandle()
79 m_flags.m_prerenderaschild =
false;
80 m_width = GetHabitat()->GetHandleSize();
81 m_height = GetHabitat()->GetHandleSize();
82 m_radius = GetHabitat()->GetHandle()->GetRadius();
83 m_mode = sm_HandleNoHit;
87 double w,
double h,
double angle ,
double radius )
99 else if ( parent && parent->
GetRoot() )
100 m_width = parent->GetHabitat()->GetHandleSize();
105 else if ( parent && parent->
GetRoot() )
106 m_height = parent->GetHabitat()->GetHandleSize();
116 void a2dHandle::Set(
double xc,
double yc,
double w,
double h,
double angle,
double radius )
138 if ( !name.IsEmpty() )
144 a2dHandle::~a2dHandle()
167 return new a2dHandle( *
this, options, refs );
232 if (
m_mode == sm_HandleHit )
238 else if (
m_mode == sm_HandleNoHit )
280 hitEvent.
m_how = HitTestRectangle( hitEvent.
m_x, hitEvent.
m_y, xh - w / 2.0, yh - h / 2.0, xh + w / 2.0, yh + h / 2.0, 0 );
287 #if wxART2D_USE_CVGIO
291 if ( xmlparts == a2dXmlSer_attrib )
293 out.WriteAttribute( wxT(
"width" ),
m_width );
294 out.WriteAttribute( wxT(
"height" ),
m_height );
297 out.WriteAttribute( wxT(
"radius" ),
m_radius );
307 if ( xmlparts == a2dXmlSer_attrib )
318 #endif //wxART2D_USE_CVGIO
344 static bool pushed =
false;
371 m_parent->ProcessEvent( handleEvent );
376 x = xw - ( xprev -
GetPosX() );
377 y = yw - ( yprev -
GetPosY() );
383 m_parent->ProcessEvent( handleEvent );
389 m_parent->ProcessEvent( handleEvent );
394 ic->SetCorridorPathToParent();
400 m_parent->ProcessEvent( handleEvent );
412 #ifdef _DEBUG_REPORTHIT
413 wxLogDebug( wxT(
"hit = %s %p" ), wxT(
"enter handle" ),
this );
421 m_parent->ProcessEvent( handleEvent );
431 #ifdef _DEBUG_REPORTHIT
432 wxLogDebug( wxT(
"hit = %s %p" ), wxT(
"leave handle" ),
this );
440 m_parent->ProcessEvent( handleEvent );
468 std::list< a2dPinClass* >::iterator iter =
m_canConnectTo.begin();
471 if ( ( *iter ) == pinClass )
492 std::list< a2dPinClass* >::iterator iter;
501 std::list< a2dPinClass* >::const_iterator iter;
505 if ( ( other == NULL || ( *iter ) == other ) )
513 std::list< a2dPinClass* >::iterator iter;
517 if ( ( *iter )->m_name == name )
534 m_defPin->
SetStroke( wxColour( 66, 159, 235 ), 0 );
541 m_defCannotConnectPin = newpin;
546 if ( !m_defCannotConnectPin )
549 m_defCannotConnectPin->
SetFill( wxColour( 255, 128, 128 ) );
550 m_defCannotConnectPin->
SetStroke( *wxRED, 0 );
552 return m_defCannotConnectPin;
557 m_defCanConnectPin = newpin;
562 if ( !m_defCanConnectPin )
565 m_defCanConnectPin->
SetFill( wxColour( 128, 255, 128 ) );
566 m_defCanConnectPin->
SetStroke( *wxGREEN, 0 );
568 return m_defCanConnectPin;
573 m_defParPin = newpin;
590 bool
a2dPin::m_worldBased = false;
591 bool a2dPin::m_doRender = true;
599 const
long a2dPin::sm_PinUnConnected =
wxGenNewId();
600 const
long a2dPin::sm_PinConnected = wxGenNewId();
601 const
long a2dPin::sm_PinCanConnect = wxGenNewId();
602 const
long a2dPin::sm_PinCannotConnect = wxGenNewId();
603 const
long a2dPin::sm_PinCanConnectToPinClass = wxGenNewId();
609 m_flags.m_prerenderaschild =
false;
614 m_radius = GetHabitat()->GetPin()->GetRadius();
616 m_mode = sm_PinUnConnected;
618 m_RenderConnected =
false;
619 m_dynamicPin =
false;
620 m_temporaryPin =
false;
626 double angle ,
double w,
double h,
double radius )
663 void a2dPin::Set(
double xc,
double yc,
double angle,
const wxString& name,
bool dynamic )
672 if ( !name.IsEmpty() )
679 a2dPinList::iterator iter;
683 (*iter)->Disconnect(
this );
688 a2dPin::a2dPinFlagsMask a2dPin::GetPinFlags()
const
700 void a2dPin::SetPinFlags( a2dPinFlagsMask which,
bool value )
718 void a2dPin::SetPinFlags( a2dPinFlagsMask which )
740 wxUint32 connected = 0;
755 a2dPinList::const_iterator iter;
763 a2dPinList::const_iterator iter2;
766 if ( *iter2 ==
this )
769 wxASSERT_MSG( found2, _T(
"connection not found in other pin" ) );
795 a2dPin* connectedPin = *iter;
796 if ( connectedPin && (connectedPin == pin || !pin) )
803 if ( *iter2 ==
this )
819 wxASSERT_MSG( found2, _T(
"connection not found in other pin" ) );
841 a2dPin* connectedPin = *iter;
842 if ( connectedPin && !connectedPin->
GetRelease() )
848 a2dPin* connectedPinconnect = *iter2;
850 if ( connectedPin != connectedPinconnect && !connectedPin->
IsConnectedTo( connectedPinconnect ) )
855 connectedPin->
ConnectTo( connectedPinconnect );
869 a2dPin* connectedPin = *iter;
870 if ( connectedPin && !connectedPin->
GetRelease() )
872 if ( connectedPin !=
this )
878 if ( *iter2 == connectedPin )
900 a2dPin* connectedPin = *iter;
901 if ( connectedPin && !connectedPin->
GetRelease() && connectedPin != this )
907 if ( *iter2 == connectedPin )
920 wxASSERT_MSG( connectto, _T(
"connect pin should not be NULL" ) );
921 wxASSERT_MSG( connectto !=
this , _T(
"connect pin should not be itself" ) );
922 if ( connectto !=
this )
981 assert( fabs( x -
GetAbsX() ) < 1e-3 );
982 assert( fabs( y -
GetAbsY() ) < 1e-3 );
1003 , wxT(
"pinclass incompatible on both sides" ) );
1096 a2dPinList::const_iterator iter;
1099 a2dPin* connectedPin = *iter;
1100 if ( !connectedPin || connectedPin->
GetRelease() )
1103 double dx = fabs( thispos.m_x - otherpos.m_x );
1104 double dy = fabs( thispos.m_y - otherpos.m_y );
1105 if ( dx > maxdx || dy > maxdy )
1107 found = connectedPin;
1123 fabs( thispos.m_x - otherpos.m_x ) < margin &&
1124 fabs( thispos.m_y - otherpos.m_y ) < margin
1151 wxASSERT_MSG( refs, wxT(
"for reconnect a2dRefMap needed" ) );
1153 a2dPinList::const_iterator iter;
1156 a2dPin* connectedPin = *iter;
1160 wxASSERT(
id != 0 );
1161 wxString resolveKey;
1171 return new a2dPin( *
this, options, refs );
1475 #if wxART2D_USE_CVGIO
1479 if ( xmlparts == a2dXmlSer_attrib )
1481 out.WriteAttribute( wxT(
"width" ),
m_width );
1482 out.WriteAttribute( wxT(
"height" ),
m_height );
1485 out.WriteAttribute( wxT(
"radius" ),
m_radius );
1487 out.WriteAttribute( wxT(
"pinclass" ),
m_pinclass->GetName() );
1490 a2dPinList::const_iterator iter;
1493 a2dPin* connectedPin = *iter;
1497 wxASSERT_MSG( !
m_temporaryPin, wxT(
"temporary pins should have bin deleted" ) );
1503 out.WriteAttribute( wxT(
"dynamicPin" ),
m_dynamicPin,
true );
1504 out.WriteAttribute( wxT(
"internal" ),
m_internal,
true );
1508 a2dPinList::const_iterator iter;
1513 a2dPin* connectedPin = *iter;
1518 wxASSERT_MSG( !
m_temporaryPin, wxT(
"temporary pins should have bin deleted" ) );
1533 if ( xmlparts == a2dXmlSer_attrib )
1545 wxString reference_name =
GetName();
1546 a2dGeneralGlobals->ReportErrorF(
a2dError_NoPinClass, _(
"a2dPin with name %s \n Pin class %s not found (replaced with Standard)" ), reference_name.c_str(), pinclass.c_str() );
1560 while( parser.
GetTagName() == wxT(
"connect" ) )
1574 #endif //wxART2D_USE_CVGIO
1600 hitEvent.
m_how = HitTestRectangle( hitEvent.
m_x, hitEvent.
m_y, xh - w / 2.0, yh - h / 2.0, xh + w / 2.0, yh + h / 2.0, 0 );
1627 wxString reference_name =
GetName();
1641 void a2dPin::DoDump(
int indent, wxString* line )
1643 a2dCanvasObject::DoDump( indent, line );
1644 *line += wxString::Format( _T(
" name=%s" ),
GetName() );
1645 a2dPinList::const_iterator iter;
1648 a2dPin* connectedPin = *iter;
1651 *line += wxString::Format( _T(
" cp=%p" ), connectedPin );
a2dPin * FindNonWirePin(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
bool IsSameLocation(a2dPin *other, double margin=0) const
Check if this pin is at same location.
bool GetAttributeValueBool(const wxString &attrib, bool defaultv=false)
Returns the boolean value of an attribute.
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
a2dPin * IsDislocated() const
double GetAbsY() const
get absolute Y position of the pin ( after applying the parent's matrix and its own matrix ) ...
A2DGENERALDLLEXP long wxGenNewId()
This function is like wxNewId, but it has its own ID set.
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
Base class for all types of strokes, understood by a2dDrawer2D classes.
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
wxString m_name
name of the handle
a2dHandle is used inside editing versions of a certain objects.
virtual bool IsTemporary_DontSave() const
Check if this is a temporary object, which should not be saved.
virtual bool HasProperty(const a2dPropertyId *id, const wxString &stringvalue=wxEmptyString) const
Check if the object has a property with given id and string representation.
bool CanConnectWith(a2dIterC &ic, a2dCanvasObject *toConnect, bool autocreate)
check connect to other object
mouse event sent from a2dCanvasObject to itself
void SetDrawStyle(a2dDrawStyle drawstyle)
set drawstyle to use for drawing,
static const a2dCanvasObjectFlagsMask HasPins
int WorldToDeviceY(double y) const
convert y from world to device coordinates
virtual bool AlwaysWriteSerializationId() const
If true, always write an id.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
virtual void PopTransform(void)
Recall the previously saved user-to-world transform off the matrix stack.
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
XMLeventType Next()
Walks to next element and returns event type.
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
void OnCanvasObjectMouseEvent(a2dCanvasObjectMouseEvent &event)
default handler for mouse events, sent to the object from the a2dDrawingPart.
class to map references to objects stored in XML, in order to make the connection later on...
a2dDrawing * m_root
root group for rendering and accessing the canvas's also contains layer settings
a2dCanvasOFlags m_flags
holds flags for objects
static const long sm_PinCanConnectToPinClass
Pin can connect to supplied a2dPinClass.
#define EVT_CANVASOBJECT_ENTER_EVENT(func)
static event table macro for a2dCanvasObject mouse enter event
a2dPin is used in a2dCanvasObject to add pins to it.
void WriteStartElementAttributes(const wxString &name, bool newLine=true)
Writes start tag which has attributes.
This is a class/type description for a2dPin's.
static a2dPropertyIdVoidPtr * PROPID_ToolObject
set for objects that act as tool object, when a tool is in action.
static void InitializeStockPinClasses()
called to initialize static stockobjects
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
void Enlarge(const double Marge)
enlarge with the given amount
void AddConnect(a2dPinClass *pinClass)
add a connection pinclass, to which this pin can connect
a2dCanvasObject * GetCaptured() const
are events redirected to a captured corridor? if so return the captured object in it...
double wxDegToRad(double deg)
conversion from degrees to radians
double GetRadius() const
return radius
bool IsHit() const
true if this is a hit
double DeviceToWorldYRel(double y) const
convert y relative from device to world coordinates
static bool m_worldBased
pins are world based or not.
double m_radius
radius of rectangle that will be rendered
int GetAttributeValueInt(const wxString &attrib, int defaultv=0)
Returns the integer value of an attribute.
a2dPinClass * m_pinclass
The class defines to which other pins this pin can connect.
void SetDrawerStroke(const a2dStroke &stroke)
Used to set the current stroke.
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
bool GetPixelStroke() const
if the width is pixels or not.
double GetValue(int col, int row) const
get the value in the matrix at col,row
virtual void SetPending(bool pending)
set this object pending for update
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
a2dParPin points to a2dPort
static const long sm_PinConnected
Pin is connected rendering mode.
a2dPin * IsConnectedTo(a2dPin *pin=a2dAnyPin) const
Return the pin to which this pin is connected.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
clone it
The base class for all drawable objects in a a2dCanvasDocument.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double m_height
height in pixels
void ReStoreFixedStyle()
when fixed drawing style is set, it can be overruled.
a2dPoint2D GetAbsXY() const
get absolute position of the pin ( after applying the parent's matrix and its own matrix ) ...
a2dCanvasObject is the base class for Canvas Objects.
int m_mode
modifies rendering
wxUint32 GetConnectedPinsNr() const
Get the number of connected pins.
a2dPin * FindWirePin(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
a2dParPin * GetParPin()
Pin to use in a2dCameleonInst when creating a2dParPin from an a2dPort.
a2dCanvasObject * m_parent
what is the a2dCanvasObject that i am part of
virtual void SetParent(a2dCanvasObject *parent)
set parent object of the pin
void SetParent(a2dCanvasObject *parent)
set parent object of the pin
a2dPinClass * CanConnectTo(a2dPinClass *other=NULL) const
searches in the connection list for a given pin class
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
virtual void DrawCenterRoundedRectangle(double xc, double yc, double width, double height, double radius, bool pixelsize=false)
Draw CenterRoundedRectangle in world coordinates.
double m_height
height in pixels
double GetRotation() const
return rotation
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
bool HasAngleLine() const
is there an angle line on the pin
virtual a2dCanvasObject * GetParent() const
bool m_selected
object is selected
void Set2(double xc, double yc, const wxString &name=wxT(""))
set basic parameters
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
float m_worldExtend
world extend in world coordinates.
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
void SetDrawerFill(const a2dFill &fill)
Used to set the current fill.
void RemoveDuplicateConnectedPins(a2dPin *other)
pins connected to given other pin, will be removed on this pin.
bool Disconnect(a2dPin *pin=a2dAnyPin, bool forceErase=false)
a2dPin * GetPin()
get default pin for graph like structure
void ConnectTo(a2dPin *connectto)
connect this pin to the given pin
wxString m_name
name of pin class
bool GetValid() const
returns true if boundingbox is calculated properly and therefore its valid flag is set...
void Expand(const a2dPoint2D &, const a2dPoint2D &)
expand boundingbox width two points
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
a2dlist< a2dDumbPtr< a2dPin > > m_connectedPins
to which a2dPin is this pin connected with other canvas objects its pins.
double GetHeight() const
return height
void Set(double xc, double yc, double angle=0, const wxString &name=wxT(""), bool dynamic=false)
set postion angle and name of the pin
virtual bool IsTemporary_DontSave() const
Check if this is a temporary object, which should not be saved.
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
double GetPosX() const
get x position from affine matrix
double GetCoordinateEpsilon() const
coordinates below this distance will be trated as equal
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void SetAbsXY(double x, double y)
set the absolute X,Y position of the pin ( after applying the parent's matrix and its own matrix ) ...
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
a2dCanvasObject * m_parent
what is the a2dCanvasObject that i am part of
void SetSpecificFlags(bool setOrClear, a2dCanvasObjectFlagsMask which)
set all bit flags in object that or true in mask to true or false
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
virtual void SetPending(bool pending)
set this object pending for update
const a2dError a2dError_LinkPin
static a2dPinClass * GetClassByName(const wxString &name)
return the name of this pinclass.
A2DGENERALDLLEXP a2dSmrtPtr< a2dGeneralGlobal > a2dGeneralGlobals
a global pointer to get to global instance of important classes.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
general event sent from a2dHandle to its parent a2dCanvasObject
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Restriction engine for editing restrictions like snapping.
static std::list< a2dPinClass * > m_allPinClasses
a linked lists of all a2dPinClass'es, so that one can get a class by name
virtual void DrawHighLighted(a2dIterC &ic)
called by Render() if m_flags.m_HighLight is set
int WorldToDeviceX(double x) const
convert x from world to device coordinates
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
Input and output handler for the XmlSer format.
bool CheckMask(a2dCanvasObjectFlagsMask mask) const
Compares all flags in object to the given mask and return true is the same.
double m_radius
radius of rectangle that will be rendered
void CleanUpNonConnected()
double m_width
width in pixels
wxString RequireAttributeValue(const wxString &attrib)
Forces an attribute and returns its string value.
a2dPin * GetPinCanConnect()
represents the pin styles for pins that can connect right now
Contains a2dDrawing Class to hold a drawing.
bool Identity(void)
Make into identity matrix.
void SetMode(int mode)
you may use it to modify rendering of the object depending on setting
void WriteEndAttributes(bool close=false)
"Closes" the start tag after writing all attributes (writes the ">" or "/>" bracket).
virtual bool Submit(a2dCommand *command, bool storeIt=true)
next to the base class submit, it sets a2DocumentCommandProcessor for a2dCommand
bool m_internal
true when pin is internal to object border.
A 2x3 affine matrix class for 2D transformations.
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dCanvasObject
a2dStroke GetDrawerStroke() const
get the current stroke
wxUint16 m_pixelExtend
Pixel extend.
a2dPinClass * GetPinClass() const
return the pin class of this pin
void AutoConnect(a2dCanvasObject *root, double margin)
Try to connect this pin to another pin at the same location.
double GetPosY() const
get y position from affine matrix
double GetWorldStrokeExtend()
static void DeleteStockPinClasses()
called to delete all pin class objects
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
bool m_objectPin
is true when pin is on an object instead of a wire/connect
while iterating a a2dCanvasDocument, this holds the context.
const a2dError a2dError_NoPinClass
void SetParPin(a2dParPin *newpin)
double m_x
(world coordinates) hit point x as in a2dDrawingPart or any other top level
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void MapBbox(const a2dAffineMatrix &matrix)
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
void Set(double xc, double yc, double w, double h, double angle=0, double radius=0)
set all parameters
special a2dCanvasObject to make a multi view hierachy.
#define EVT_CANVASOBJECT_LEAVE_EVENT(func)
static event table macro for a2dCanvasObject mouse leave event
virtual bool Submit(a2dCommand *command, bool storeIt=true)
void SetStroke(const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
Set a stroke for the object which will be used instead of the layer stroke.
void DuplicateConnectedPins(a2dPin *other, bool undo=false)
pins connected to given other pin, will become part of this pin.
wxString GetName() const
get the name given to the pin.
wxString GetAttributeValue(const wxString &attrib, const wxString &defaultv=wxT(""))
Returns the value of an attribute.
a2dRestrictionEngine * GetRestrictionEngine()
Get restriction engine (grid snapping)
int RequireAttributeValueInt(const wxString &attrib)
Forces an attribute and returns its integer value.
double GetAbsAngle() const
get absolute angle of the pin ( after applying the parent its matrix and it own matrix ) ...
bool GetRelease() const
get release flag
double WorldToDeviceXRelNoRnd(double x) const
convert x relative from world to device coordinates (result not rounded to integer) ...
a2dCanvasCommandProcessor * GetCanvasCommandProcessor()
get a pointer to the command processor
wire classes for connecting objects.
a2dPinClass(const wxString &name)
constructor
An object of this class will update a a2dIterC with the required information.
void Require(const XMLeventType &type, wxString name)
Forces a special tag.
wxString GetTagName()
Returns name of the current XML tag.
static a2dPinClass * Standard
Pins of this class can only connect to pins of the same class.
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
static bool m_doRender
when set disables rending of pin objects
bool Translate(double x, double y)
Translate by dx, dy:
virtual bool LinkReference(a2dObject *other)
link a reference in the object to the given value
virtual bool IsTemporary_DontSave() const
Check if this is a temporary object, which should not be saved.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool Invert(void)
Invert matrix.
void Rotate(double rotation)
Rotates this object clockwise.
virtual bool MayConnectTo(a2dPin *connectto)
Is given pin allowed to connect to this pin.
bool m_RenderConnected
flag to render or not when connected
static const long sm_PinUnConnected
Pin is not connected rendering mode.
int m_mode
modifies rendering
void RemoveConnect(a2dPinClass *pinClass)
remove a connection pinclass
void DuplicateConnectedToOtherPins(bool undo=false)
all connections to this pins, will become available in those connected pins too.
the a2dDrawingPart is a a2dView specially designed for displaying parts of a a2dDrawing. It uses a a2dDrawer2D to actually redraw things from the document, by giving that a2dDrawer2D as drawing context to the document, and telling the document to redraw a certain rectangular area. At that last is what this class is for. It optimizes the areas to be redrawn after object in the document were changed. To do that it combines redraw areas to a minimal set of redrawing areas. All the administration for this and the way things will be redrawn is from this view.
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
static const long sm_PinCannotConnect
Pin can NOT be connected rendering mode.
static a2dPinClass * Any
used to ask for a new default pin on an object.
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
#define Round(x)
round to integer such that e.g 2.5 < x < 3.5 becomes 3
virtual void DrawCircle(double x, double y, double radius)
Draw Circle in world coordinates.
double WorldToDeviceYRelNoRnd(double y) const
convert y relative from world to device coordinates (result not rounded to integer) ...
bool m_prerenderaschild
as child this object will be rendered before the parent object itself when true (default) ...
a2dDrawingPart * GetDrawingPart() const
get current a2dDrawingPart
This template class is for property ids with a known data type.
a2dBoundingBox m_bbox
boundingbox in world coordinates
a2dConnectionGeneratorPtr m_connectionGenerator
Use this connection generator for wires and pins.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
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.
bool m_dynamicPin
set when this pin is a temporary pin for editing feedback
double GetAbsX() const
get absolute X position of the pin ( after applying the parent's matrix and its own matrix ) ...
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
a2dPin * GetPinCannotConnect()
represents the pin styles for pins that cannot connect right now
void PopCursor()
pop a cursor from the cursor stack, and set display cursor to back
std::list< a2dPinClass * > m_canConnectTo
double m_width
width in pixels
void SetPinCannotConnect(a2dPin *newpin)
void SetAngleLine(bool value)
is there an angle line on the pin
virtual bool IsConnect() const
return true, if this object is used to connect other object's using rubberband like structures...
double GetWidth() const
return width
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
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void SetPin(a2dPin *newpin)
set default pin for graph like structure
double DeviceToWorldXRel(double x) const
convert x relative from device to world coordinates
CloneOptions
options for cloning
bool ResolveOrAddLink(a2dObject *obj, const wxString &id=wxT(""))
try to resolve an object referenced by obj using the LinkReference function
void SetCorridorPath(bool OnOff, a2dCanvasObject *captureObject=NULL)
to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on...
void SetPinCanConnect(a2dPin *newpin)
structure to give as parameter to member functions of a2dCanvasObject
a2dPin * FindConnectablePin(a2dCanvasObject *root, double margin, bool autocreate)
Find a connectable pin.
wxInt64 GetUniqueSerializationId() const
return a unique id for this object
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
virtual void PushIdentityTransform()
push no transform, to draw directly in device coordinates
static const long sm_PinCanConnect
Pin can be connected rendering mode.
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
general canvas module declarations and classes
wxString m_name
name of the handle
void OverRuleFixedStyle()
id style is FIXED, saves current style and sets style to a2dFILLED