16 #ifndef __WXCURVEGROUP_H__
17 #define __WXCURVEGROUP_H__
25 WX_DECLARE_STRING_HASH_MAP_WITH_DECL(
a2dBoundingBox, _a2dBoundingBoxHash,
class A2DCURVESDLLEXP );
76 wxString GetAxisText()
const;
79 bool SetAxisText(
const wxString& name );
97 UpdateInternalBoundaries( extbox );
103 SetInternalBoundaries( extbox,
a2dBoundingBox( ximin, yimin, ximax, yimax ) );
118 void AddCurve(
a2dCurve* curve,
const wxString curvename = _T(
"" ) );
138 void InsertCurve(
size_t before,
a2dCurve* curve,
const wxString curvename = _T(
"" ) );
141 a2dCurve* GetCurve(
const wxString curvename );
161 void World2Curve(
double xw,
double yw,
double& xcurve,
double& ycurve );
164 void Curve2World(
double xcurve,
double ycurve,
double& xw,
double& yw );
176 void SetShowYaxis(
bool showyaxis );
181 void SetAxes(
const a2dBoundingBox& extbox,
double x,
double y,
double& zerox,
double& zeroy,
double& ixmin,
double& ixmax );
184 bool IsCurvesHighlighted()
const;
188 a2dMarkerShow* GetMarkerShow(
void )
const {
return m_markerShow; }
189 a2dMarkerShow* GetMarkerShow2(
void )
const {
return m_markerShow2; }
192 void SetColor(
const wxColour& color ) { m_colour = color; }
194 const wxColour&
GetColor()
const {
return m_colour;}
213 bool Update( UpdateMode mode );
220 #if wxART2D_USE_CVGIO
224 virtual void DoLoad( wxObject* WXUNUSED( parent ),
a2dIOHandlerXmlSerIn& WXUNUSED( parser ), a2dXmlSer_flag WXUNUSED( xmlparts ) ) ;
257 #include <wx/dynarray.h>
258 WX_DECLARE_OBJARRAY_WITH_DECL( a2dSmrtPtr<a2dCurvesArea>, a2dCurvesAreaListBase,
class A2DCURVESDLLEXP );
303 void SetAxes(
const a2dBoundingBox& extbox,
double x,
double y,
double& zerox,
double& zeroy,
double& ixmin,
double& ixmax );
334 void SetTicY(
int numLines );
341 bool GetPending(
void );
342 void UpdateViewDependentObjects(
a2dIterC& ic );
346 bool GetHasToolObjectsBelow();
352 void SetAutoShowYAxes(
bool autoshowyaxes ) { m_autoshowyaxes = autoshowyaxes; }
354 bool GetAutoShowYAxes(
void ) {
return m_autoshowyaxes; }
368 #if wxART2D_USE_CVGIO
372 virtual void DoLoad( wxObject* parent,
a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts ) ;
375 bool m_autoshowyaxes;
414 m_axesarealist = areaList;
415 m_axesarealist->SetGroup(
this );
445 void SetInternalBoundaries(
double ximin,
double yimin,
double ximax,
double yimax,
const wxString& curveAreaName = wxEmptyString );
451 void SetInternalXBoundaries(
double ximin,
double ximax );
454 a2dBoundingBox GetInternalBoundaries(
const wxString& curveAreaName = wxEmptyString )
const;
464 a2dAffineMatrix GetCurvesAreaTransform(
const wxString& curveAreaName );
467 {
return m_axesarealist->GetCurvesArea( curveAreaName ); }
470 a2dCurvesArea* AddCurvesArea(
const wxString& curveAreaName );
478 void AddCurveToArea(
const wxString& curveAreaName,
a2dCurve* curve,
const wxString curvename = _T(
"" ) );
485 void AddMarkerToArea(
const wxString& curveAreaName,
a2dMarker* marker );
492 void RemoveMarkerFromArea(
const wxString& curveAreaName,
a2dMarker* marker );
501 void ChangeCursorPos(
double step );
511 void InsertCurveToArea(
const wxString& curveAreaName,
size_t before,
a2dCurve* curve,
const wxString curvename = _T(
"" ) );
518 a2dCurve* GetCurveFromArea(
const wxString& curveAreaName,
const wxString curvename );
539 a2dBoundingBox GetCurvesBoundariesFromArea(
const wxString& curveAreaName );
551 a2dCurveAxis* GetAreaAxisY(
const wxString& curveAreaName )
const;
554 void SetShowXaxis(
bool showxaxis ) { m_showxaxis = showxaxis; SetPending(
true ); }
563 void SetAreaAxisY(
const wxString& curveAreaName,
a2dCurveAxis* axisY );
577 void SetShowGrid(
bool showgrid ) { m_showgrid = showgrid; SetPending(
true ); }
580 void SetGridStroke(
const a2dStroke& stroke );
583 void SetAxisAreaFill(
const a2dFill& fill );
586 void SetAxisAreaStroke(
const a2dStroke& fill );
593 wxString GetLeftAxisText()
const ;
596 wxString GetRightAxisText()
const ;
604 void SetAxisText(
const wxString& curveAreaName,
const wxString& text,
const wxColour& color );
606 void ClearCurvesAreas();
608 void SetAreaMarkerShow(
const wxString& curveAreaName,
a2dMarkerShow* showm );
609 void SetAreaMarkerShow2(
const wxString& curveAreaName,
a2dMarkerShow* showm );
611 a2dMarkerShow* GetAreaMarkerShow(
const wxString& curveAreaName )
const;
612 a2dMarkerShow* GetAreaMarkerShow2(
const wxString& curveAreaName )
const;
614 void SetTicY(
int numLines );
616 virtual int SetAxisTicPrecision(
a2dCurveAxis* axisY,
double newMinY,
double newMaxY );
617 virtual void SetCommonTicPrecision(
int precision );
619 void SetAutoShowYAxes(
bool autoshowyaxes ) { m_axesarealist->SetAutoShowYAxes( autoshowyaxes ); SetPending(
true );}
621 void SetCursorOnlyByCurves(
bool cursorOnlyByCurves ) { m_cursorOnlyByCurves = cursorOnlyByCurves; SetPending(
true );}
622 bool GetCursorOnlyByCurves(
void ) {
return m_cursorOnlyByCurves; }
624 void OnChar( wxKeyEvent& event );
628 DECLARE_EVENT_TABLE()
634 virtual
void DrawGrid(
a2dIterC& ic );
638 void DoUpdateViewDependentObjects(
a2dIterC& ic );
640 bool DoStartEdit( wxUint16 editmode,
wxEditStyle editstyle );
646 #if wxART2D_USE_CVGIO
650 #endif //wxART2D_USE_CVGIO
652 a2dBoundingBox DoGetUnTransformedBbox( a2dBboxFlags flags = a2dCANOBJ_BBOX_NON )
const;
662 bool m_autoTicYPrecision;
685 bool m_cursorOnlyByCurves;
692 #if defined(WXART2D_USINGDLL)
717 AddCurveToArea( (
const wxString& )wxEmptyString, curve, curvename );
726 AddMarkerToArea( (
const wxString& )wxEmptyString, marker );
735 RemoveMarkerFromArea( (
const wxString& )wxEmptyString, marker );
746 InsertCurveToArea( (
const wxString& )wxEmptyString, before, curve, curvename );
752 return GetCurveFromArea( (
const wxString& )wxEmptyString, curvename );
761 return GetCurvesFromArea( (
const wxString& )wxEmptyString );
768 return GetCurvesBoundariesFromArea( (
const wxString& )wxEmptyString );
776 return GetAreaAxisY( (
const wxString& )wxEmptyString );
781 SetAreaAxisY( (
const wxString& )wxEmptyString, axisY );
795 #if wxART2D_USE_CVGIO
799 #endif //wxART2D_USE_CVGIO
806 #if defined(WXART2D_USINGDLL)
810 extern A2DCURVESDLLEXP
double a2dBoundsRound(
double val );
811 extern A2DCURVESDLLEXP
double a2dTicsRound(
double val );
cursor on curve plot as a vertical line with markers
virtual bool ProcessCanvasObjectEvent(a2dIterC &ic, a2dHitEvent &hitEvent)
Hit objects will receive the event.
Base class for all types of strokes, understood by a2dDrawer2D classes.
void SetShowRightYaxis(const wxString &curveAreaName, bool showyaxis)
the a2dCurveArea with the given name is set as holding the rigth Yaxis
bool IsAutoTicYPrecision() const
get
mouse event sent from a2dCanvasObject to itself
class to map references to objects stored in XML, in order to make the connection later on...
void AddCurve(a2dCurve *curve, const wxString curvename=_T(""))
add a curve to the end of the exisiting curves.
a2dSmrtPtr< a2dCurvesArea > m_rightAxisY
the curve area to display the right Y axis
bool IsRecursive()
returns if this object does have nested objects
void SetInternalBoundaries(const a2dBoundingBox &extbox, double ximin, double yimin, double ximax, double yimax)
set the internal curve boundaries, and update conversion to world matrix
a2dSmrtPtr< a2dCurvesArea > m_leftAxisY
the curve area to display the left Y axis
bool GetHasSelectedObjectsBelow()
selected object itself or one of its recursive children
void SetAxisY(a2dCurveAxis *axisY)
set Y axis of this curve area
a2dSmrtPtr< a2dCurvesArea > GetBaseCurvesArea() const
the a2dCurveArea which has bin set to be the m_leftAxisY
void SetAxisX(a2dCurveAxis *axisX)
set X axis object
a2dSmrtPtr< a2dCurveAxis > m_axisY
y axis object
virtual void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
double GetTic() const
get distance of tic lines in X/Y (curve coords)
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
For Showing Marker position of Markers on a Curve.
#define DECLARE_PROPERTIES()
check if class has the given id as a valid id for this object
const a2dCanvasObjectList * GetCurves() const
returns the list where the curves are stored in.
base class for axis in a2dCanvasXYDisplayGroup
a2dCanvasObject is the base class for Canvas Objects.
a2dCurveAxis * GetAxisX() const
get X axis object
a2dBoundingBox wxNonValidBbox
global non valid boundingbox to use as default argument etc.
bool GetShowYaxis(void)
get show yaxis
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
a2dSmrtPtr< a2dCurvesAreaList > m_axesarealist
internal object used to display the curves in internal coordinates
void SetShowYaxis(const wxString &curveAreaName, bool showyaxis)
show yaxis
simple curve group with just one a2dCurvesArea in use
void RemoveMarker(a2dMarker *marker)
remove a marker
void RenderAxesY(a2dIterC &ic, OVERLAP clipparent)
render all Yaxis objects ( of Left and Right a2dCurveArea )
void SetBoundaries(const a2dBoundingBox &extbox)
sets for all curve areas in the list the same boundaries
void SetBoundaries(double xmin, double ymin, double xmax, double ymax)
see SetBoundaries(const a2dBoundingBox& extbox)
Io handler to iterate through a a2dDocument.
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load settings.
void AddMarker(a2dMarker *marker)
add a marker
list for a2dCurvesArea objects
void SetCurvesAreaList(a2dCurvesAreaList *areaList)
set list of all a2dCurveArea objects
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
clone it
bool IsRecursive()
this object is recursive (has children ).
int AppendInternalBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
clips all children to a polygon
const a2dBoundingBox & GetPlotAreaRect() const
get the boundingbox in relative world coordinates of the plot area
virtual void DoUpdateViewDependentObjects(a2dIterC &ic)
update derived objects
const a2dAffineMatrix & GetCurveAreaTransform()
a2dCurveAxis * GetAxisY()
get Y axis of this curve area
a2dCanvasXYDisplayGroupAreas * GetGroup(void)
the group of which the area is a part
void InsertCurve(size_t before, a2dCurve *curve, const wxString curvename=_T(""))
add a curve to the end of the exisiting curves.
const wxColour & GetColor() const
get color of axis text
a2dCurve * GetCurve(const wxString curvename)
return curve named curvename, if not available returns NULL
Special object group to plot a2dCurve Objects but also any other a2dCanvasObject. ...
Input and output handler for the XmlSer format.
WX_DECLARE_STRING_HASH_MAP(a2dPropertyId *, a2dPropertyIdHashMap)
Declaration of the hash map type to convert prop names to prop id objects.
void SetShowXaxis(bool showxaxis)
show xaxis
a2dBoundingBox m_plotrect
placement in world coordinates
A 2x3 affine matrix class for 2D transformations.
void SetShowLeftYaxis(const wxString &curveAreaName, bool showyaxis)
the a2dCurveArea with the given name is set as holding the left Yaxis
a2dCanvasXYDisplayGroupAreas * m_group
the group of which the area is a part
void SetAutoTicYPrecision(bool autoPrecision)
set
while iterating a a2dCanvasDocument, this holds the context.
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double GetTicY() const
tic distance in Y for the m_leftAxisY area
const a2dCurvesAreaList & GetCurvesAreaList() const
return reference to list of all a2dCurveArea objects used
a2dCurvesArea * GetCurvesArea(const wxString &curvesAreaName)
get a2dCurvesArea with the given name
void SetShowYaxis(bool showyaxis)
show yaxis
void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
void SetColor(const wxColour &color)
set color of axis text
a2dBoundingBox GetCurvesBbox(void)
get the boundingbox in internal curve coordinates of all the curves
void SetShowGrid(bool showgrid)
show grid
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Save settings.
virtual void DoAddPending(a2dIterC &ic)
called by addPending
const a2dBoundingBox & GetInternalBoundaries() const
get the plotting rectangle in curve coordinates
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
a2dAffineMatrix m_iworld
internal coordinates used for curve plotting expressed as matrix
bool m_showyaxis
if true show the Y axis object
wxColour m_colour
color of axis text
a2dCanvasObjectList * GetCurves(void)
returns the list where the curves are stored in.
This template class is for property ids with a known data type.
void SetAxes(const a2dBoundingBox &extbox, double x, double y, double &zerox, double &zeroy, double &ixmin, double &ixmax)
sets m_axisY values
a2dCanvasObjectList * GetCurves()
returns the list where the curves are stored in.
a2dSmrtPtr< a2dCursor > m_cursor
cursor object
void SetInternalBoundaries(const a2dBoundingBox &extbox, const a2dBoundingBox &intbox)
set the internal curve boundaries, and update conversion to world matrix
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
CloneOptions
options for cloning
a2dSmrtPtr< a2dCurveAxis > m_axisX
x axis object
structure to give as parameter to member functions of a2dCanvasObject
int AppendCurvesBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
base class for curve area in a a2dCurvesAreaList, like used in a2dCanvasXYDisplayGroups ...