15 #ifndef __A2DCANVASSIM_H__
16 #define __A2DCANVASSIM_H__
23 #include "wx/geometry.h"
79 const wxPoint& pos = wxDefaultPosition,
80 const wxSize& size = wxDefaultSize,
81 long style = wxScrolledWindowStyle );
92 void SetMappingShowAll(
bool centre =
true );
111 void ClearBackground();
114 void SetBackgroundFill(
const a2dFill& backgroundfill );
120 virtual void Refresh(
bool eraseBackground =
true,
const wxRect* rect = NULL );
123 void SetGridAtFront(
bool gridatfront ) { m_drawingPart->SetGridAtFront( gridatfront ); }
132 void SetGridSize( wxUint16 gridsize ) { m_drawingPart->SetGridSize( gridsize ); }
138 double GetGridX() {
return m_drawingPart->GetGridX(); }
141 void SetGridX(
double gridx ) { m_drawingPart->SetGridX( gridx ); }
144 double GetGridY() {
return m_drawingPart->GetGridY(); }
147 void SetGridY(
double gridy ) { m_drawingPart->SetGridY( gridy ); }
150 void SetGrid(
bool grid ) { m_drawingPart->SetGrid( grid ); }
153 bool GetGrid() {
return m_drawingPart->GetGrid(); }
156 void SetGridLines(
bool gridlines ) { m_drawingPart->SetGridLines( gridlines ); }
165 void SetYaxis(
bool up );
168 bool GetYaxis()
const;
209 void SetMappingWidthHeight(
double vx1,
double vy1,
double width,
double height );
237 void SetMappingUpp(
double vx1,
double vy1,
double xpp,
double ypp );
240 inline double DeviceToWorldX(
int x )
const {
return m_drawingPart->GetDrawer2D()->DeviceToWorldX( x ); }
242 inline double DeviceToWorldY(
int y )
const {
return m_drawingPart->GetDrawer2D()->DeviceToWorldY( y ); }
245 inline double DeviceToWorldXRel(
int x )
const {
return m_drawingPart->GetDrawer2D()->DeviceToWorldXRel( x ); }
248 inline double DeviceToWorldYRel(
int y )
const {
return m_drawingPart->GetDrawer2D()->DeviceToWorldYRel( y ); }
251 inline int WorldToDeviceX(
double x )
const {
return m_drawingPart->GetDrawer2D()->WorldToDeviceX( x ); }
253 inline int WorldToDeviceY(
double y )
const {
return m_drawingPart->GetDrawer2D()->WorldToDeviceY( y ); }
256 inline int WorldToDeviceXRel(
double x )
const {
return m_drawingPart->GetDrawer2D()->WorldToDeviceXRel( x ); }
259 inline int WorldToDeviceYRel(
double y )
const {
return m_drawingPart->GetDrawer2D()->WorldToDeviceYRel( y ); }
286 int layer = wxLAYER_ALL,
293 void SetMouseEvents(
bool onoff );
295 bool GetMouseEvents();
298 bool WriteSVG(
const wxString& filename,
double Width,
double Height, wxString unit );
303 void OnSize( wxSizeEvent& event );
306 void OnPaint( wxPaintEvent& event );
309 void OnEraseBackground( wxEraseEvent& event );
312 void DeleteAllPendingAreas();
331 DECLARE_EVENT_TABLE()
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
Base class for all types of strokes, understood by a2dDrawer2D classes.
void SetGridX(double gridx)
Set grid distance in X.
void SetGridSize(wxUint16 gridsize)
set size of grid circle
double DeviceToWorldX(int x) const
convert x from window to virtual coordinates
Simple canvas using a whole view for all of the scrolled window.
The base class for all drawable objects in a a2dCanvasDocument.
a2dCanvasObject is the base class for Canvas Objects.
void SetGridAtFront(bool gridatfront)
Set grid setting for drawing grid in front or back.
double DeviceToWorldXRel(int x) const
bool GetGrid()
Get grid setting on/off.
int WorldToDeviceXRel(double x) const
a2dCanvasObject * GetShowObject() const
void SetGridLines(bool gridlines)
Get grid setting for line drawing.
void SetGridY(double gridy)
Set grid distance in Y.
bool GetGridAtFront()
Get grid setting for drawing grid in front or back.
a2dHitOption
Enum for hit test options.
bounding class for optimizing drawing speed.
Drawing context abstraction.
if set, respect layer order, hit testing is done per layer from the top.
double DeviceToWorldYRel(int y) const
double DeviceToWorldY(int y) const
convert y from window to virtual coordinates
if set, don't hit test the root object or object for which IsHitWorld is called
int WorldToDeviceX(double x) const
convert x from virtual to window coordinates
bool IsFrozen()
Returns if canvas is frozen.
double GetGridX()
Get grid distance in X.
void SetShowOrigin(bool show)
Set showorigin on/off.
void SetZoomOutBorder(wxUint16 border)
zoomout leafs a border of this amount of pixels around the drawing
bool GetGridLines()
set grid to draw lines instead of points
void SetGridFill(const a2dFill &gridfill)
set brush used for grid drawing
void SetGridStroke(const a2dStroke &gridstroke)
set stroke used for grid drawing
int WorldToDeviceYRel(double y) const
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.
double GetGridY()
Get grid distance in Y.
int WorldToDeviceY(double y) const
convert y from virtual to window coordinates
a2dDrawer2D * GetDrawer2D() const
Get the drawer of the view.
Contain one drawing as hierarchical tree of a2dCanvasObject's.
void SetGrid(bool grid)
Set grid on/off.