11 #pragma warning(disable:4786)
23 #include <wx/wfstream.h>
26 #include "wx/canvas/eval.h"
34 #if wxART2D_USE_EDITOR
36 #endif //wxART2D_USE_EDITOR
50 #define wxMAX_COORDINATE INT_MAX
51 #define wxMIN_COORDINATE INT_MIN
53 #define wxMAX_COORDINATE 100e99
54 #define wxMIN_COORDINATE 100e-99
88 m_textheight = m_l1 / 5 ;
89 m_font =
a2dFont( m_textheight, wxSWISS, wxITALIC );
93 a2dBaseMarker::a2dBaseMarker(
const wxString& format,
double atx,
double height ):
a2dCurveObject()
108 m_textheight = height;
110 m_textheight = m_l1 / 5 ;
112 m_font =
a2dFont( m_textheight, wxSWISS, wxITALIC );
115 a2dBaseMarker::a2dBaseMarker(
const wxString& format,
double atx,
const a2dFont& font ):
a2dCurveObject()
128 m_textheight = m_font.
GetSize();
134 a2dBaseMarker::~a2dBaseMarker()
141 m_format = other.m_format;
142 m_textheight = other.m_textheight;
185 if ( !m_format.IsEmpty() && m_textheight )
190 form.Printf( m_format, xc, yc );
199 #if wxART2D_USE_CVGIO
204 if ( xmlparts == a2dXmlSer_attrib )
206 out.WriteAttribute( wxT(
"l1" ) ,
m_l1 );
207 out.WriteAttribute( wxT(
"l2" ) ,
m_l2 );
208 out.WriteAttribute( wxT(
"b" ) ,
m_b );
218 if ( xmlparts == a2dXmlSer_attrib )
230 #endif //wxART2D_USE_CVGIO
265 #define BBOX2XYWH(bbox) (bbox).GetMinX(), (bbox).GetMinY(), (bbox).GetWidth(), (bbox).GetHeight()
290 if( !m_format.IsEmpty() )
295 form.Printf( m_format, xc, yc );
306 const wxString& a2dBaseMarker::GetMarkerString()
308 if( !m_promptFormat.IsEmpty() )
313 m_promptString.Printf( m_promptFormat, xc, yc );
316 m_promptString = wxT(
"BaseMarker" );
317 return m_promptString;
330 m_promptText->
SetText( GetMarkerString() );
348 void a2dBaseMarker::SetPrompt(
a2dText* prompttext )
352 m_promptText = prompttext;
391 if ( m_flags.m_editingCopy )
393 a2dAxisMarker* original =
wxStaticCast( PROPID_Original->GetPropertyValue(
this ).Get(), a2dAxisMarker );
408 if ( event.GetMouseEvent().LeftDown() )
414 else if ( event.GetMouseEvent().LeftUp() )
423 else if ( event.GetMouseEvent().Dragging() )
425 if( m_axis->IsYAxis() )
427 double xy = m_axis->ConvertWorld2Axis( yh );
428 if ( m_axis->GetAxisMin() < xy && m_axis->GetAxisMax() > xy )
431 x = xh - ( xprev - GetPosX() );
432 y = yh - ( yprev - GetPosY() );
438 else if ( m_axis->GetAxisMin() > xy )
441 if ( m_axis->GetAxisMin() != m_axis->GetBoundaryMin() )
442 y = m_axis->GetLength();
452 else if ( m_axis->GetAxisMax() < xy )
455 if ( m_axis->GetAxisMin() == m_axis->GetBoundaryMin() )
456 y = m_axis->GetLength();
469 double xy = m_axis->ConvertWorld2Axis( xh );
470 if ( m_axis->GetAxisMin() < xy && m_axis->GetAxisMax() > xy )
473 x = xh - ( xprev - GetPosX() );
474 y = yh - ( yprev - GetPosY() );
480 else if ( m_axis->GetAxisMin() > xy )
483 if ( m_axis->GetAxisMin() != m_axis->GetBoundaryMin() )
484 x = m_axis->GetLength();
494 else if ( m_axis->GetAxisMax() < xy )
497 if ( m_axis->GetAxisMin() == m_axis->GetBoundaryMin() )
498 x = m_axis->GetLength();
523 a2dAxisMarker::a2dAxisMarker(
const wxString& format,
a2dCurveAxis* axis )
529 a2dAxisMarker::a2dAxisMarker(
const wxString& format,
a2dCurveAxis* axis ,
double atx,
double height )
535 a2dAxisMarker::a2dAxisMarker(
const wxString& format,
a2dCurveAxis* axis ,
double atx,
const a2dFont& font )
542 a2dAxisMarker::~a2dAxisMarker()
546 a2dAxisMarker::a2dAxisMarker(
const a2dAxisMarker& other, CloneOptions options,
a2dRefMap* refs )
549 m_axis = other.m_axis;
554 return new a2dAxisMarker( *
this, options, refs );
576 double worldPos = m_axis->ConvertAxis2World(
m_position );
589 #if wxART2D_USE_CVGIO
594 if ( xmlparts == a2dXmlSer_attrib )
598 out.WriteAttribute( wxT(
"axisname" ) , m_axis->
GetName() );
610 if ( xmlparts == a2dXmlSer_attrib )
623 #endif //wxART2D_USE_CVGIO
625 const wxString& a2dAxisMarker::GetMarkerString()
628 if( !m_promptFormat.IsEmpty() && m_axis->GetLevelValue(
GetName(), val ) )
630 m_promptString.Printf( m_promptFormat, val );
632 else if( !
GetName().IsEmpty() )
635 m_promptString = wxT(
"AxisMarker" );
636 return m_promptString;
645 INITIALIZE_PROPERTIES( a2dCursorAxisMarker, a2dAxisMarker )
651 a2dCursorAxisMarker::a2dCursorAxisMarker(
const wxString& format,
a2dCurveAxis* axis,
a2dCursor* cursor )
652 : a2dAxisMarker( format, axis )
658 a2dCursorAxisMarker::a2dCursorAxisMarker(
const wxString& format,
a2dCurveAxis* axis ,
a2dCursor* cursor,
double atx,
double aty,
double height )
659 : a2dAxisMarker( format, axis, atx, height )
665 a2dCursorAxisMarker::a2dCursorAxisMarker(
const wxString& format,
a2dCurveAxis* axis ,
a2dCursor* cursor,
double atx,
double aty,
const a2dFont& font )
666 : a2dAxisMarker( format, axis, atx, font )
673 a2dCursorAxisMarker::~a2dCursorAxisMarker()
677 a2dCursorAxisMarker::a2dCursorAxisMarker(
const a2dCursorAxisMarker& other, CloneOptions options,
a2dRefMap* refs )
678 : a2dAxisMarker( other, options, refs )
680 m_cursor = other.m_cursor;
681 m_positionY = other.m_positionY;
686 return new a2dCursorAxisMarker( *
this, options, refs );
702 double worldPosY = 0.;
704 worldPosY = m_cursor->ConvertAxis2World( m_positionY );
705 double worldPos = m_axis->ConvertAxis2World(
m_position );
718 #if wxART2D_USE_CVGIO
723 if ( xmlparts == a2dXmlSer_attrib )
739 if ( xmlparts == a2dXmlSer_attrib )
752 #endif //wxART2D_USE_CVGIO
774 m_curve->
Walker(
this, handler );
782 EVT_CHAR( a2dMarker::OnChar )
789 if ( m_flags.m_editingCopy )
791 a2dMarker* original =
wxStaticCast( PROPID_Original->GetPropertyValue(
this ).Get(), a2dMarker );
806 double xcurve, ycurve;
807 m_curvesArea->World2Curve( xh, yh, xcurve, ycurve );
809 if ( event.GetMouseEvent().LeftDown() )
815 else if ( event.GetMouseEvent().LeftUp() )
824 else if ( event.GetMouseEvent().Dragging() )
832 x = xh - ( xprev - GetPosX() );
833 y = yh - ( yprev - GetPosY() );
836 CalculatePositionMarker( x, y );
842 original->SetPosition( m_position );
844 else if ( curvebox.
GetMinX() > xcurve )
847 m_position = curvebox.
GetMinX();
848 CalculatePositionMarker( x, y );
854 original->SetPosition( m_position );
856 else if ( curvebox.
GetMaxX() < xcurve )
859 m_position = curvebox.
GetMaxX();
860 CalculatePositionMarker( x, y );
866 original->SetPosition( m_position );
883 void a2dMarker::OnChar( wxKeyEvent& event )
902 switch( event.GetKeyCode() )
940 CalculatePositionMarker( yw, xw );
947 original->SetPosition( m_position );
949 else if ( curvebox.
GetMinX() > x )
952 m_position = curvebox.
GetMinX();
953 CalculatePositionMarker( yw, xw );
959 original->SetPosition( m_position );
961 else if ( curvebox.
GetMaxX() < x )
964 m_position = curvebox.
GetMaxX();
965 CalculatePositionMarker( yw, xw );
971 original->SetPosition( m_position );
998 a2dMarker::~a2dMarker()
1005 m_curve = other.m_curve;
1010 return new a2dMarker( *
this, options, refs );
1013 void a2dMarker::CalculatePositionMarker(
double& xw,
double& yw )
1019 m_position = point.m_x;
1064 CalculatePositionMarker( x, y );
1076 #if wxART2D_USE_CVGIO
1081 if ( xmlparts == a2dXmlSer_attrib )
1085 out.WriteAttribute( wxT(
"curvename" ) , m_curve->
GetName() );
1097 if ( xmlparts == a2dXmlSer_attrib )
1110 #endif //wxART2D_USE_CVGIO
1114 if( !m_promptFormat.IsEmpty() )
1119 m_promptString.Printf( m_promptFormat, xc, yc );
1121 else if( !
GetName().IsEmpty() )
1124 m_promptString = wxT(
"CurveMarker" );
1125 return m_promptString;
1132 a2dBandMarker::a2dBandMarker(
const wxString& format,
a2dBandCurve* curve )
1133 : a2dMarker( format, curve )
1135 m_markerUpLow =
true;
1136 m_curveBand = curve;
1140 a2dBandMarker::a2dBandMarker(
const wxString& format,
a2dBandCurve* curve ,
double atx,
double height )
1141 : a2dMarker( format, curve, atx, height )
1143 m_markerUpLow =
true;
1144 m_curveBand = curve;
1148 a2dBandMarker::a2dBandMarker(
const wxString& format,
a2dBandCurve* curve ,
double atx,
const a2dFont& font )
1149 : a2dMarker( format, curve, atx, font )
1151 m_markerUpLow =
true;
1152 m_curveBand = curve;
1156 a2dBandMarker::~a2dBandMarker()
1160 a2dBandMarker::a2dBandMarker(
const a2dBandMarker& other, CloneOptions options,
a2dRefMap* refs )
1161 : a2dMarker( other, options, refs )
1163 m_markerUpLow = other.m_markerUpLow;
1164 m_curveBand = other.m_curveBand;
1169 return new a2dBandMarker( *
this, options, refs );
1172 void a2dBandMarker::CalculatePositionMarker(
double& xw,
double& yw )
1177 a2dMarker::CalculatePositionMarker( xw, yw );
1203 #if wxART2D_USE_CVGIO
1208 if ( xmlparts == a2dXmlSer_attrib )
1210 out.WriteAttribute( wxT(
"uplow" ) , m_markerUpLow );
1220 if ( xmlparts == a2dXmlSer_attrib )
1228 #endif //wxART2D_USE_CVGIO
1230 void a2dBandMarker::DoRender(
a2dIterC& ic,
OVERLAP WXUNUSED( clipparent ) )
1246 CalculatePositionMarker( xw, yw2 );
1247 m_markerUpLow = !m_markerUpLow;
1248 CalculatePositionMarker( xw, yw );
1249 m_markerUpLow = !m_markerUpLow;
1258 if( !m_format.IsEmpty() )
1263 form.Printf( m_format, xc, yc );
1301 m_marker->
Walker(
this, handler );
1303 m_xText->
Walker(
this, handler );
1305 m_yText->
Walker(
this, handler );
1307 m_Xlabel->
Walker(
this, handler );
1309 m_Ylabel->
Walker(
this, handler );
1319 a2dMarkerShow::a2dMarkerShow(
double x,
double y,
1320 const wxString& XLabel, const wxString& YLabel,
1321 const wxString& XValueformat, const wxString& YValueformat,
1322 a2dMarker* marker,
double height )
1327 m_XValueformat = XValueformat;
1328 m_YValueformat = YValueformat;
1330 m_textheight = height;
1334 m_Xlabel =
new a2dText( XLabel, 0, 0,
a2dFont( m_textheight, wxSWISS ) );
1336 m_Xlabel->SetName( wxT(
"__XLABEL__" ) );
1339 m_Ylabel =
new a2dText( YLabel, 0, -1.2 * m_textheight,
a2dFont( m_textheight, wxSWISS ) );
1341 m_Ylabel->SetName( wxT(
"__YLABEL__" ) );
1344 m_xText =
new a2dText( wxT(
"" ), 0, 0,
a2dFont( m_textheight, wxSWISS ) );
1346 m_xText->SetName( wxT(
"__XTEXT__" ) );
1349 m_yText =
new a2dText( wxT(
"" ), 0, -1.2 * m_textheight,
a2dFont( m_textheight, wxSWISS ) );
1351 m_yText->SetName( wxT(
"__YTEXT__" ) );
1355 a2dMarkerShow::~a2dMarkerShow()
1359 a2dMarkerShow::a2dMarkerShow(
const a2dMarkerShow& other, CloneOptions options,
a2dRefMap* refs )
1362 m_marker = other.m_marker;
1363 m_XValueformat = other.m_XValueformat;
1364 m_YValueformat = other.m_YValueformat;
1365 m_textheight = other.m_textheight;
1367 m_xText = (
a2dText* )
Find( wxT(
"__XTEXT__" ) );
1369 m_yText = (
a2dText* )
Find( wxT(
"__YTEXT__" ) );
1371 m_Xlabel = (
a2dText* )
Find( wxT(
"__XLABEL__" ) );
1373 m_Ylabel = (
a2dText* )
Find( wxT(
"__YLABEL__" ) );
1379 return new a2dMarkerShow( *
this, options, refs );
1389 bbox.
Expand( Xlabelbox );
1395 bbox.
Expand( Ylabelbox );
1398 double labelw = bbox.
GetMaxX();
1430 m_xText->
GetText().ToDouble( &x );
1432 m_marker->SetPosition( x );
1437 void a2dMarkerShow::OnPropertyChanged(
a2dComEvent& event )
1440 if( event.GetPropertyId() == PROPID_Stroke )
1448 else if( event.GetPropertyId() == PROPID_Fill )
1468 formX.Printf( m_XValueformat, point.m_x );
1469 formY.Printf( m_YValueformat, point.m_y );
1473 formX.Printf( m_XValueformat, 0.0 );
1474 formY.Printf( m_YValueformat, 0.0 );
1479 m_xText->
SetFill( GetFill() );
1481 m_Xlabel->
SetFill( GetFill() );
1483 m_yText->
SetFill( GetFill() );
1485 m_Ylabel->
SetFill( GetFill() );
1508 formX.Printf( m_XValueformat, point.m_x );
1509 formY.Printf( m_YValueformat, point.m_y );
1513 formX.Printf( m_XValueformat, 0.0 );
1514 formY.Printf( m_YValueformat, 0.0 );
1527 bbox.
Expand( Xlabelbox );
1532 bbox.
Expand( Ylabelbox );
1534 double labelw = bbox.
GetMaxX();
1550 #if wxART2D_USE_CVGIO
1554 if ( xmlparts == a2dXmlSer_attrib )
1565 if ( xmlparts == a2dXmlSer_attrib )
1567 m_xText = (
a2dText* )
Find( wxT(
"__XTEXT__" ) );
1568 m_yText = (
a2dText* )
Find( wxT(
"__YTEXT__" ) );
1569 m_Xlabel = (
a2dText* )
Find( wxT(
"__XLABEL__" ) );
1570 m_Ylabel = (
a2dText* )
Find( wxT(
"__YLABEL__" ) );
1576 #endif //wxART2D_USE_CVGIO
1619 hitinfo.m_xyRelToChildren =
true;
1623 #if wxART2D_USE_EDITOR
1629 #else //wxART2D_USE_EDITOR
1630 wxMessageBox( wxT(
"Need editor module enabled for this" ) );
1631 #endif //wxART2D_USE_EDITOR
1661 a2dCursorMarkerList::a2dCursorMarkerList()
1665 a2dCursorMarkerList::~a2dCursorMarkerList()
1684 a2dCursor::a2dCursor(
double csize )
1692 m_onlyIntPosX =
false;
1693 m_onlyIntPosY =
false;
1696 a2dCursor::~a2dCursor()
1700 a2dCursor::a2dCursor(
const a2dCursor& other, CloneOptions options,
a2dRefMap* refs )
1703 m_hsize = other.m_hsize;
1704 m_wsize = other.m_wsize;
1705 m_csize = other.m_csize;
1706 m_posx = other.m_posx;
1707 m_posy = other.m_posy;
1714 return new a2dCursor( *
this, options, refs );
1733 a2dBoundingBox a2dCursor::DoGetUnTransformedBbox( a2dBboxFlags flags )
1742 scalex = propMatrix->GetValue().
Get_scaleX();
1746 bbox.
Expand( m_csize * scalex, m_hsize );
1770 #define BBOX2XYWH(bbox) (bbox).GetMinX(), (bbox).GetMinY(), (bbox).GetWidth(), (bbox).GetHeight()
1783 scalex = propMatrix->GetValue().
Get_scaleX();
1798 void a2dCursor::RemoveMarkers()
1803 void a2dCursor::SetPosition(
double posx,
double posy,
const a2dAffineMatrix& mat )
1810 marker->SetPosition( m_posx );
1819 bool a2dCursor::GetPosition(
double& posx,
double& posy )
1826 bool a2dCursor::CheckPosition(
double posx )
1828 bool retCode =
false;
1843 void a2dCursor::UpdatePosition(
double WXUNUSED( minx ),
double miny,
const a2dAffineMatrix& mat )
1863 double a2dCursor::ConvertAxis2World(
double percentValue )
1865 return percentValue / 100.*m_hsize;
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
cursor on curve plot as a vertical line with markers
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
double m_relx
(world coordinates) hit point x relative to the canvas object its parent object(s) ...
double GetHeight() const
returns height of the boundingbox
double GetSize() const
Get the font size.
#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.
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
property to hold a a2dAffineMatrix
bool GetEditable() const
get if the object may be edited
mouse event sent from a2dCanvasObject to itself
a2dBoundingBox m_untransbbox
Untransformed bounding box.
virtual wxString GetName() const
Returns the name of this object, if no name is given the internal id will be returned.
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
double m_step
step to move when dragging/moving marker
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
bool ResolveOrAdd(a2dSmrtPtr< a2dObject > *storedHere, const wxString &id=wxT(""))
try to resolve the object that is in storedHere when it is a reference.
class to map references to objects stored in XML, in order to make the connection later on...
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
virtual const wxString & GetMarkerString()
string for maker, as is rendered when entering marker with cursor.
a2dCanvasOFlags m_flags
holds flags for objects
const a2dAffineMatrix & GetInverseTransform() const
Inverse of GetTransform()
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
#define EVT_CANVASOBJECT_ENTER_EVENT(func)
static event table macro for a2dCanvasObject mouse enter event
const a2dFill * a2dBLACK_FILL
global a2dFill stock object for BLACK filling
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
bool GetPending() const
is this object pending for update?
void Enlarge(const double Marge)
enlarge with the given amount
proptype * GetPropertyListOnly(const a2dObject *obj) const
Get the property from the list in obj ( no members, not cloned )
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
bool m_pending
set when a2dCanvasObject needs an update (redraw).
a2dBoundingBox GetClippedCurveBoundaries()
get clipped boundary box of plot boundary in curve coordinates
bool IsHit() const
true if this is a hit
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
double m_l2
length from top of arrow to inside point in X
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
Input and output handler for the XmlSer format.
virtual void DrawPolygon(a2dVertexArray *points, bool spline=false, wxPolygonFillMode fillStyle=wxODDEVEN_RULE)
Draw polygon in world coordinates using pointarray.
UpdateMode
Various mode flags for Update.
a2dCurve * GetCurve() const
return curve of the marker
void World2Curve(double xw, double yw, double &xcurve, double &ycurve)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
virtual void SetPending(bool pending)
set this object pending for update
bool GetPositionCurvePoint(a2dPoint2D &point)
get point at position of marker.
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
bool m_prompting
prompting when OnEnterObject
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
The base class for all drawable objects in a a2dCanvasDocument.
double GetTransformedHitMargin()
transformed to object its coordinate system
For Showing Marker position of Markers on a Curve.
void SetFont(const a2dFont &font)
set font to use for drawing text
base class for axis in a2dCanvasXYDisplayGroup
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
vertex array of line and arc segments.
a2dCanvasObject is the base class for Canvas Objects.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void DoAddPending(a2dIterC &ic)
called by addPending
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectStart
id for a2dWalkEvent issued from within a2dWalkerIOHandler
a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument.
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
virtual void EndEdit()
cleanup an editcopy object
a2dBoundingBox GetTextExtent(const wxString &string, int alignment=wxMINX|wxMINY, double *w=NULL, double *h=NULL, double *descent=NULL, double *externalLeading=NULL) const
Get the dimensions in world coordinates of the string.
void Curve2World(double xcurve, double ycurve, double &xw, double &yw)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
a2dFont GetFont() const
get font for text
a2dCurveObject for objects needing to know its parent a2dCurvesArea.
int ReleaseChild(a2dCanvasObject *obj, bool backwards=false, bool all=false, bool now=false, bool undoCommands=false)
remove the given object from the childobjects
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
marker for two value in one curve, called a a2dBandCurve.
void SetDrawerFill(const a2dFill &fill)
Used to set the current fill.
void Set(double xt, double yt, double l1, double l2, double b)
Io handler to iterate through a a2dDocument.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void OnPropertyChanged(a2dComEvent &event)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
bool IsYAxis() const
return true is this axis is Yaxis
a2dText is an abstract base class.
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
used to change a property on objects
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
void SetMarkerUpLow(bool markerUpLow)
return of GetXyAtSweep() is upper side of curve if true, else low
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
const a2dBoundingBox & Translate(a2dPoint2D &)
translate with given vector
double GetMinX() const
get minimum X of the boundingbox
virtual void DrawRoundedRectangle(double x, double y, double width, double height, double radius, bool pixelsize=false)
Draw RoundedRectangle in world coordinates.
#define forEachIn(listtype, list)
easy iteration for a2dlist
bool m_spline
draw splined?
const a2dFont * a2dNullFONT
global a2dFont stock object for NO font
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
double GetPosX() const
get x position from affine matrix
#define EVT_COM_EVENT(func)
static wxEvtHandler for communication event
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dMarker(const wxString &format=_T("%f %f"), a2dCurve *curve=0)
marker formatted
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
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...
bool m_editable
object can be edited
Normal straight line segment in a2dVertexList and a2dVertexArray.
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
void DoUpdateViewDependentTransform(a2dIterC &ic)
update transform matrix klion: I'm not sure that this function necessary as virtual ...
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void Translate(double x, double y)
relative translate the object to position x,y in world coordinates
bool m_onlyIntPosY
position is rounded to whole number
double GetLineHeight() const
Height in world coordinates of one line.
a2dBoundingBox m_untransbbox
Untransformed bounding box.
virtual void SetPending(bool pending)
set this object pending for update
bool m_onlyIntPosX
position is rounded to whole number
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
Input and output handler for the XmlSer format.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void DoAddPending(a2dIterC &ic)
called by addPending
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
virtual void DrawText(const wxString &text, double x, double y, int alignment=wxMINX|wxMINY, bool Background=true)
Draw text in user coordinates.
void SetVisible(bool visible)
set if this object will visible (be rendered or not)
A 2x3 affine matrix class for 2D transformations.
static a2dPropertyIdMatrix * PROPID_IntViewDependTransform
used for objects with* PROPID_viewDependent but only for internal area
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dCanvasObject
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
double GetMaxX() const
get maximum X of the boundingbox
virtual bool GetXyAtSweep(double sweepValue, a2dPoint2D &point) const =0
return Points in plot at the value of sweep parameter.
static const a2dCanvasObjectFlagsMask DRAGGABLE
double GetPosY() const
get y position from affine matrix
double GetWorldStrokeExtend()
bool GetPositionCurvePoint(a2dPoint2D &point)
get point at position of marker.
while iterating a a2dCanvasDocument, this holds the context.
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
void MapBbox(const a2dAffineMatrix &matrix)
double Get_scaleX() const
return scaling in X
#define EVT_CANVASOBJECT_LEAVE_EVENT(func)
static event table macro for a2dCanvasObject mouse leave event
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.
#define A2D_PROPID_GS(type, classname, propname, defaultval, fget, fset)
to define a get set property more easily
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
a2dHit HitTestPolygon(const a2dPoint2D &ptest, double margin)
extensive hittesting on vertex list seen as polygon.
wxString GetAttributeValue(const wxString &attrib, const wxString &defaultv=wxT(""))
Returns the value of an attribute.
void SetText(const wxString &text)
set the text for the object ' ' in string means new line
editing tool for a2dCanvasObject's
a2dCurvesArea * m_curvesArea
parent of curve
double GetWidth() const
returns width of the boundingbox
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
An object of this class will update a a2dIterC with the required information.
bool ReleaseObject(T *object)
release a certain object from the list
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
bool m_editingCopy
true if the object needs to be rendered in edit mode.
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
Curve represented by a number of vertexes.
a2dCanvasObject * IsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
If the position (x,y) is within the object return this.
virtual void DoUpdateViewDependentTransform(a2dIterC &ic)
update transform matrix klion: I'm not sure that this function necessary as virtual ...
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
double m_position
the current X where the marker is located
virtual bool WalkTask(wxObject *parent, wxObject *object, a2dWalkEvent event)
called from within a2dObject's and derived classes
double GetMinY() const
get minimum Y of the boundingbox
a2dCursorMarkerList m_markers
list of markers on cursor line
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.
void SetCaptured(a2dCanvasObject *captured)
set the object that is captured for events in the a2dDrawing.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectEnd
id for a2dWalkEvent issued from within a2dWalkerIOHandler
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
a2dFont m_font
marker font
a2dDrawingPart * GetDrawingPart() const
get current a2dDrawingPart
int GetAlignment() const
Get the position of the anchor point w.r.t the text.
This template class is for property ids with a known data type.
a2dBoundingBox m_bbox
boundingbox in world coordinates
double RequireAttributeValueDouble(const wxString &attrib)
Forces an attribute and returns its double value.
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...
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
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.
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
wxString GetText() const
get the text of the object ' ' in string means new line
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
A pointer class, that automatically calls SmrtPtrOwn/SmrtPtrRelease.
CloneOptions
options for cloning
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
This is here so that this class cannot be used directly.
void SetCorridorPath(bool OnOff, a2dCanvasObject *captureObject=NULL)
to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on...
double m_l1
length from top of arrow to outside points in X
structure to give as parameter to member functions of a2dCanvasObject
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
wxInt64 GetUniqueSerializationId() const
return a unique id for this object
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
general canvas module declarations and classes