16 #ifndef __WXCANPRIM_H__
17 #define __WXCANPRIM_H__
72 #endif //wxART2D_USE_CVGIO
80 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
115 a2dRectC(
double xc,
double yc,
double w,
double h,
double angle = 0 ,
double radius = 0 );
132 void Set(
double xc,
double yc,
double w,
double h,
double angle = 0 ,
double radius = 0 );
153 #if wxART2D_USE_CVGIO
155 #endif //wxART2D_USE_CVGIO
169 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
198 class A2DCANVASDLLEXP
a2dArrow: public a2dCanvasObject
211 a2dArrow(
double xt,
double yt,
double l1,
double l2,
double b,
bool spline =
false );
229 void Set(
double xt,
double yt,
double l1,
double l2,
double b,
bool spline =
false );
237 void Set(
double l1,
double l2,
double b,
bool spline =
false );
264 #if wxART2D_USE_CVGIO
268 #endif //wxART2D_USE_CVGIO
301 class A2DCANVASDLLEXP
a2dWH:
public a2dCanvasObject
303 DECLARE_EVENT_TABLE()
316 a2dWH(
double x,
double y,
double w,
double h );
328 void SetWidth(
double w ) { m_width = w; SetPending(
true ); }
334 void SetHeight(
double h ) { m_height = h; SetPending(
true ); }
341 #if wxART2D_USE_CVGIO
345 #endif //wxART2D_USE_CVGIO
351 DECLARE_CLASS(
a2dWH )
358 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
360 bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
394 DECLARE_EVENT_TABLE()
407 a2dWHCenter(
double xc,
double yc,
double w,
double h );
443 DECLARE_EVENT_TABLE()
458 a2dRect(
double x,
double y,
double w,
double h ,
double radius = 0,
double contourwidth = 0 );
491 void SetRadius(
double radius ) { m_radius = radius; SetPending(
true ); }
504 #if wxART2D_USE_CVGIO
508 #endif //wxART2D_USE_CVGIO
510 virtual a2dVertexList* GetAsVertexList(
bool& returnIsPolygon )
const;
519 DECLARE_DYNAMIC_CLASS(
a2dRect )
524 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
528 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
537 double m_contourwidth;
568 a2dCircle(
double x,
double y,
double radius,
double width = 0 );
578 void SetRadius(
double radius ) { m_radius = radius; SetPending(
true ); }
589 #if wxART2D_USE_CVGIO
593 #endif //wxART2D_USE_CVGIO
595 virtual a2dVertexList* GetAsVertexList(
bool& returnIsPolygon )
const;
607 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
611 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
618 double m_contourwidth;
649 a2dEllipse(
double xc,
double yc,
double width,
double height,
double contourwidth = 0 );
653 #if wxART2D_USE_CVGIO
657 #endif //wxART2D_USE_CVGIO
659 virtual a2dVertexList* GetAsVertexList(
bool& returnIsPolygon )
const;
677 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
681 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
689 double m_contourwidth;
699 DECLARE_EVENT_TABLE()
717 a2dEllipticArc(
double xc,
double yc,
double width,
double height,
double start,
double end,
bool chord =
false,
double contourwidth = 0 );
730 void SetStart(
double start ) { m_start = start; SetPending(
true ); }
740 void SetEnd(
double end ) { m_end = end; SetPending(
true ); }
746 void SetChord(
bool chord );
751 #if wxART2D_USE_CVGIO
755 #endif //wxART2D_USE_CVGIO
757 virtual a2dVertexList* GetAsVertexList(
bool& returnIsPolygon )
const;
773 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
775 void OnChar( wxKeyEvent& event );
781 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
794 double m_contourwidth;
809 #if (defined(__WXMSW__) && defined(WXUSINGDLL) )
823 class A2DCANVASDLLEXP
a2dArc:
public a2dCanvasObject
825 DECLARE_EVENT_TABLE()
844 a2dArc(
double xc,
double yc,
double radius,
double start,
double end,
bool chord =
false,
double contourwidth = 0 );
857 a2dArc(
double x1,
double y1,
double x2,
double y2,
double xc,
double yc,
bool chord =
false,
double contourwidth = 0 );
866 double GetX1()
const {
return m_x1; }
868 double GetY1()
const {
return m_y1; }
870 double GetX2()
const {
return m_x2; }
872 double GetY2()
const {
return m_y2; }
874 double GetStartAngle()
const;
876 double GetEndAngle()
const;
882 void SetX1(
double x1 ) { m_x1 = x1; SetPending(
true ); }
884 void SetY1(
double y1 ) { m_y1 = y1; SetPending(
true ); }
886 void SetX2(
double x2 ) { m_x2 = x2; SetPending(
true ); }
888 void SetY2(
double y2 ) { m_y2 = y2; SetPending(
true ); }
890 void SetStartAngle(
double a );
892 void SetEndAngle(
double a );
895 void Set(
double xs,
double ys,
double xm,
double ym,
double xe,
double ye );
898 void SetRadius(
double radius );
901 double GetRadius()
const;
904 void SetChord(
bool chord );
909 #if wxART2D_USE_CVGIO
913 #endif //wxART2D_USE_CVGIO
916 virtual a2dVertexList* GetAsVertexList(
bool& returnIsPolygon )
const;
926 DECLARE_DYNAMIC_CLASS(
a2dArc )
931 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
933 void OnChar( wxKeyEvent& event );
939 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
957 double m_contourwidth;
987 class A2DCANVASDLLEXP
a2dSLine: public a2dCanvasObject
989 DECLARE_EVENT_TABLE()
1003 a2dSLine(
double x1,
double y1,
double x2,
double y2,
double contourwidth = 0 );
1016 double GetPosX1(
bool transform =
true )
const;
1022 double GetPosY1(
bool transform =
true )
const;
1028 double GetPosX2(
bool transform =
true )
const;
1034 double GetPosY2(
bool transform =
true )
const;
1040 double GetLength()
const;
1043 bool EliminateMatrix();
1055 void SetPosXY1(
double x,
double y,
bool afterinversion =
true );
1067 void SetPosXY2(
double x,
double y,
bool afterinversion =
true );
1081 void SetPosXY12(
double x1,
double y1,
double x2,
double y2,
bool afterinversion =
true );
1084 virtual void SetBegin( a2dCanvasObject* WXUNUSED( begin ) ) {}
1086 virtual void SetEnd( a2dCanvasObject* WXUNUSED( end ) ) {}
1092 virtual a2dCanvasObject*
GetEnd() {
return NULL; }
1120 #if wxART2D_USE_CVGIO
1124 #endif //wxART2D_USE_CVGIO
1132 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
1134 void OnChar( wxKeyEvent& event );
1140 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
1152 double m_contourwidth;
1187 a2dEndsLine(
double x1,
double y1,
double x2,
double y2,
double contourwidth = 0 );
1199 void SetBegin( a2dCanvasObject* begin );
1204 void SetEnd( a2dCanvasObject* end );
1214 double GetEndScaleX() {
return m_xscale; }
1222 double GetEndScaleY() {
return m_yscale; }
1229 #if wxART2D_USE_CVGIO
1233 #endif //wxART2D_USE_CVGIO
1244 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
1260 bool m_takeStyleToArrow;
1279 DECLARE_EVENT_TABLE()
1293 a2dScaledEndLine(
double x1,
double y1,
double x2,
double y2,
double contourwidth = 0 );
1305 void SetBegin(
double l1,
double l2,
double b,
bool spline =
false );
1307 void SetEnd(
double l1,
double l2,
double b,
bool spline =
false );
1343 a2dEndsEllipticChord(
double xc,
double yc,
double width,
double height,
double start,
double end );
1353 void SetBeginObj( a2dCanvasObject* begin );
1359 void SetEndObj( a2dCanvasObject* endob );
1384 #if wxART2D_USE_CVGIO
1388 #endif //wxART2D_USE_CVGIO
1397 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON ) const;
1439 a2dControl(
double x,
double y,
double width,
double height, wxWindow* control );
1453 virtual
bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
1455 virtual
void DoEndEdit();
1462 wxWindow* m_control;
1490 a2dWires( a2dCanvasObject* toconnect,
const wxString& pinname );
1499 virtual bool IsConnect()
const;
1503 bool ConnectWith( a2dCanvasObject* parent, a2dCanvasObject* graph,
const wxString& pinname,
double margin = 1,
bool undo =
false );
1505 bool ConnectWith( a2dCanvasObject* parent,
a2dPin* pin,
double margin = 1,
bool undo =
false );
1507 bool GetFrozen() {
return m_frozen; }
1508 void SetFrozen(
bool freeze ) { m_frozen = freeze; }
1515 virtual
void CreateWires();
a2dCircle at x,y, and with radius
void SetContourWidth(double width)
set the Contour width of the shape
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
a2dPATH_END_TYPE
defines the way a polyline with a contour width is ended.
void SetBoxType(int type)
GDSII compatible to sub identify types of rectangles.
virtual bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
double GetContourWidth() const
get the Contour width of the shape
void SetWidth(double width)
set width
void SetEndScaleY(double ys)
Scale begin and end object with this factor in Y.
a2dConnectTask
flags for searching a connecting a2dpinClass, for the connecting task at hand.
void SetEndScaleX(double xs)
Scale begin and end object with this factor in X.
double GetWidth() const
return width
virtual void SetEndScaleY(double ys)
dummies to be compatible with a2dEndsLine
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void SetRadius(double radius)
set corner radius of rectangle
class to map references to objects stored in XML, in order to make the connection later on...
void SetEndScaleX(double xs)
Scale begin and end object with this factor in X.
virtual void SetBegin(a2dCanvasObject *begin)
dummies to be compatible with a2dEndsLine
void SetContourWidth(double width)
set the Contour width of the shape
void SetRadius(double radius)
set radius
double GetRadius() const
return radius
void SetContourWidth(double width)
set a contour width
void SetWidth(double w)
set width of rectangle
a2dPin is used in a2dCanvasObject to add pins to it.
This is a class/type description for a2dPin's.
double GetRadius() const
return radius
double GetContourWidth() const
get the Contour width of the shape
double GetY2() const
Get Y2 of arc being end point of arc.
double GetBase()
return how broad the basis of the arrow is.
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
virtual void SetPending(bool pending)
set this object pending for update
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
a2dRectC is a centered rectangle
double m_l1
length from top of arrow to outside points in X
The base class for all drawable objects in a a2dCanvasDocument.
double GetEndScaleY()
dummies to be compatible with a2dEndsLine
#define DECLARE_PROPERTIES()
check if class has the given id as a valid id for this object
double GetWidth() const
return width
a2dCanvasObject * GetEnd()
dummies to be compatible with a2dEndsLine
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
bool m_spline
draw splined?
a2dCanvasObject is the base class for Canvas Objects.
void SetX1(double x1)
Set X1 of arc being begin point of arc.
double GetContourWidth() const
get the Contour width of the shape
void SetWidth(double w)
set width of rectangle
vertex list of line and arc segments.
virtual void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
double GetStart()
return start angle
Io handler to iterate through a a2dDocument.
void SetHeight(double h)
set height of rectangle
a2dCanvasObject * GetBeginObj()
return begin object
double GetWidth()
return width
see a2dCanvasObjectMouseEvent
bool NeedsUpdateWhenConnected() const
used in case of flexible canvas objects (wires).
a2dOrigin stays at World Coordinate Zero (0,0) not matter what.
a2dCanvasObject * GetEndObj()
return end object
a2dControl captures a wxWindow inside
a2dEllipse centered at x,y.
virtual a2dCanvasObjectList * GetAsCanvasVpaths(bool transform=true) const
when implemented the object without its children, is converted to
bool GetChord() const
get chord setting
double GetL2()
return Distance from top to the inside of the arrow.
double GetL1()
Returns the arrow length.
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
double m_l2
length from top of arrow to inside point in X
Input and output handler for the XmlSer format.
void SetEndScaleY(double ys)
Scale begin and end object with this factor in Y.
void SetHeight(double height)
set height
a2dArrow is used for having line begin and ends on specific objects.
wxUint32 a2dSnapToWhatMask
mask for a2dSnapToWhat flags
virtual a2dCanvasObject * GetEnd()
dummies to be compatible with a2dEndsLine
int GetBoxType() const
GDSII compatible to sub identify types of rectangles.
double GetX1() const
Get X1 of arc being begin point of arc.
bool GetSpline()
is the arrwo drawn as a splined polygon?
A 2x3 affine matrix class for 2D transformations.
virtual a2dCanvasObject * GetBegin()
dummies to be compatible with a2dEndsLine
bool GetChord()
get chord setting
virtual void SetEnd(a2dCanvasObject *end)
dummies to be compatible with a2dEndsLine
while iterating a a2dCanvasDocument, this holds the context.
double GetContourWidth() const
get the Contour width of the shape
virtual a2dVertexList * GetAsVertexList(bool &returnIsPolygon) const
convert to a polygon.
double GetEndScaleX()
see SetEndScaleX()
a2dWires is used to generate wires to Connect other a2dCanvasObject's
a2dEndsLine with begin and/or end object.
a2dCanvasObject * GetBegin()
dummies to be compatible with a2dEndsLine
void SetY2(double y2)
Set Y2 of arc being end point of arc.
virtual void SetEndScaleX(double xs)
dummies to be compatible with a2dEndsLine
void SetPathType(a2dPATH_END_TYPE pathtype)
Set when m_contourwidth != 0 what is the end of the line should be.
a2dEndsEllipticChord with begin and/or end object.
void SetHeight(double h)
set height of rectangle
double GetRadius() const
return radius
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
double GetX2() const
Get X2 of arc being end point of arc.
void SetX2(double x2)
Set X2 of arc being end point of arc.
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 chi...
double GetEnd()
return end angle
void SetContourWidth(double width)
set the Contour width of the shape
double GetEndScaleY()
see SetEndScaleY()
void SetStart(double start)
set start angle
wxWindow * GetControl()
Get control pointer.
double GetY1() const
Get Y1 of arc being begin point of arc.
bool GetStyleToArrow()
if true take style changes on line to the arrow objects
This template class is for property ids with a known data type.
void SetStyleToArrow(bool takeStyleToArrow)
if set take style changes on line to the arrow objects
double GetContourWidth() const
get the Contour width of the shape
double GetHeight() const
return height
void SetContourWidth(double width)
set the Contour width of the shape
void SetContourWidth(double width)
set the Contour width of the shape
double GetEndScaleX()
dummies to be compatible with a2dEndsLine
void SetY1(double y1)
Set Y1 of arc being begin point of arc.
double GetHeight() const
return height
CloneOptions
options for cloning
double GetContourWidth() const
get the Contour width of the shape
structure to give as parameter to member functions of a2dCanvasObject
a2dEllipticArc centered at x,y
double GetHeight()
return height
void SetEnd(double end)
set end angle
a2dPATH_END_TYPE GetPathType()
get when m_contourwidth != 0 what is the end of the line looks like.