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
77 const a2dCommandId a2dCommand_SetInternalBoundaries::COMID_SetInternalBoundaries( wxT(
"SetInternalBoundaries" ) );
83 a2dCommand_SetInternalBoundaries::a2dCommand_SetInternalBoundaries(
86 a2dCommand( true, COMID_SetInternalBoundaries ), m_irectHash( irectHash )
88 m_canvasobject = object;
95 a2dCommand_SetInternalBoundaries::~a2dCommand_SetInternalBoundaries(
void )
104 for( i = 0; i < areaList.GetCount(); i++ )
108 ( *oldIRectHash )[area->
GetName()] = aRect;
111 for( i = 0; i < areaList.GetCount(); i++ )
119 if( m_canvasobject->GetCursor() )
120 m_canvasobject->GetCursor()->
SetPending(
true );
122 m_irectHash = oldIRectHash;
137 for( i = 0; i < areaList.GetCount(); i++ )
141 ( *oldIRectHash )[area->
GetName()] = aRect;
144 for( i = 0; i < areaList.GetCount(); i++ )
152 if( m_canvasobject->GetCursor() )
153 m_canvasobject->GetCursor()->
SetPending(
true );
155 m_irectHash = oldIRectHash;
170 #if wxART2D_USE_EDITOR
172 #define CONTRDRAWER m_controller->GetDrawingPart()
173 #define CONTRDRAWER2D m_controller->GetDrawingPart()->GetDrawer2D()
193 a2dCurveZoomTool::~a2dCurveZoomTool()
223 switch( event.GetKeyCode() )
243 void a2dCurveZoomTool::OnMouseEvent( wxMouseEvent& event )
260 if ( event.LeftDClick() && !
GetBusy() )
284 else if ( event.LeftDown() && !
GetBusy() )
315 else if ( event.LeftUp() &&
GetBusy() )
329 if ( fabs( w ) < 3 && fabs( h ) < 3 )
333 a2dCursor* aCursor = m_curves->GetCursor();
341 double xcurve, ycurve;
359 for(
size_t i = 0; i < areaList.GetCount(); i++ )
363 double xcurve, ycurve;
364 double xcurve2, ycurve2;
369 ( *aHash )[area->
GetName()] = aRect;
381 else if ( ( event.Dragging() &&
GetBusy() ) )
393 #endif //wxART2D_USE_EDITOR
cursor on curve plot as a vertical line with markers
int WorldToDeviceXRel(double x) const
convert x relative from world to device coordinates
#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 SetRoot(a2dDrawing *root, bool recurse=true)
Sets this object to a a2dCanvasDocument.
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
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
a2dSmrtPtr< a2dCurvesArea > GetBaseCurvesArea() const
the a2dCurveArea which has bin set to be the m_leftAxisY
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
void World2Curve(double xw, double yw, double &xcurve, double &ycurve)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
a command processor specially designed to work with a a2dCanvasDocument
virtual void SetPending(bool pending)
set this object pending for update
The base class for all drawable objects in a a2dCanvasDocument.
double GetWidth() const
return width
a2dCanvasObject is the base class for Canvas Objects.
a2dCurveAxis * GetAxisX() const
get X axis object
bool Undo(void)
Override this to undo a command.
used to set internal boundaries of canvas plot objects
void SetWidth(double w)
set width of rectangle
a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument.
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
int WorldToDeviceYRel(double y) const
convert y relative from world to device coordinates
void SetHeight(double h)
set height of rectangle
list for a2dCurvesArea objects
double GetMinX() const
get minimum X of the boundingbox
const a2dBoundingBox & GetPlotAreaRect() const
get the boundingbox in relative world coordinates of the plot area
double GetPosX() const
get x position from affine matrix
const a2dAffineMatrix & GetCurveAreaTransform()
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the drawer.
virtual void SetPending(bool pending)
set this object pending for update
Special object group to plot a2dCurve Objects but also any other a2dCanvasObject. ...
int AppendCurvesBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
Contains a2dDrawing Class to hold a drawing.
Each a2dCommand is given a command id at construction.
virtual bool Submit(a2dCommand *command, bool storeIt=true)
next to the base class submit, it sets a2DocumentCommandProcessor for a2dCommand
A 2x3 affine matrix class for 2D transformations.
double GetMaxX() const
get maximum X of the boundingbox
double GetPosY() const
get y position from affine matrix
const a2dCurvesAreaList & GetCurvesAreaList() const
return reference to list of all a2dCurveArea objects used
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
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.
editing tool for a2dCanvasObject's
double GetMaxY() const
get maximum Y of the boundingbox
bool Do(void)
Override this to perform a command.
a2dCanvasObject * IsHitWorld(double x, double y, int layer=wxLAYER_ALL, a2dHitOption option=a2dCANOBJHITOPTION_NONE, bool filterSelectableLayers=false)
do a hittest on the view at coordinates x,y
virtual wxDC * GetRenderDC() const
get the DC that is used for rendering
const a2dBoundingBox & GetInternalBoundaries() const
get the plotting rectangle in curve coordinates
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool Invert(void)
Invert matrix.
void Modify(bool increment)
set the drawing as modified or not
double GetMinY() const
get minimum Y of the boundingbox
a2dDrawing * GetDrawing() const
get drawing via top object
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.
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
double GetHeight() const
return height
void SetInternalBoundaries(const a2dBoundingBox &extbox, const a2dBoundingBox &intbox)
set the internal curve boundaries, and update conversion to world matrix
a2dBoundingBox & GetBbox()
get boundingbox in world coordinates exclusive stroke width relative to its parent ...
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
base class for curve area in a a2dCurvesAreaList, like used in a2dCanvasXYDisplayGroups ...
a base command for the a2dCommandProcessor