17 #ifndef __WXDRAWER2D_H__
18 #define __WXDRAWER2D_H__
25 #include "wx/prntbase.h"
26 #include <wx/module.h>
42 #define Round( x ) (int) floor( (x) + 0.5 )
44 #if wxCHECK_VERSION(2,7,1)
45 # define WX_COLOUR_HAS_ALPHA 1
47 # define WX_COLOUR_HAS_ALPHA 0
179 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
180 a2dInitCurrentSmartPointerOwner m_initCurrentSmartPointerOwner;
211 inline void SetPrimitiveThreshold( wxUint16 pixels,
bool asrect =
true ) { m_drawingthreshold = pixels; m_asrectangle = asrect; }
247 virtual wxBitmap GetBuffer()
const = 0;
254 virtual void SetBufferSize(
int w,
int h ) = 0;
256 virtual void CopyIntoBuffer(
const wxBitmap& bitm ) {};
262 void BlitBuffer(
int x,
int y,
int width,
int height,
int xbuf = 0,
int ybuf = 0 );
265 virtual void BlitBuffer( wxRect rect,
const wxPoint& bufferpos = wxPoint( 0, 0 ) ) = 0;
268 virtual void BlitBuffer( wxDC* dc, wxRect rect,
const wxPoint& bufferpos = wxPoint( 0, 0 ) ) = 0;
271 virtual void ShiftBuffer(
int WXUNUSED( dxy ),
bool WXUNUSED( yshift ) ) {};
277 virtual wxBitmap GetSubBitmap( wxRect sub_rect )
const = 0;
283 virtual void SetYaxis(
bool up );
299 void SetMappingDeviceRect(
int mapx,
int mapy,
int mapWidth,
int mapHeight,
bool remap =
false );
316 virtual void SetMappingWidthHeight(
double vx1,
double vy1,
double width,
double height );
350 void SetMappingUpp(
double vx1,
double vy1,
double xpp,
double ypp );
359 void SetMinX(
double x );
362 void SetMinY(
double y );
365 void SetUppX(
double x );
368 void SetUppY(
double y );
386 void EndRefreshDisplayDisable();
410 double GetVisibleMinX()
const;
413 double GetVisibleMinY()
const;
416 virtual double GetVisibleMaxX()
const;
419 virtual double GetVisibleMaxY()
const;
422 virtual double GetVisibleWidth()
const;
425 virtual double GetVisibleHeight()
const;
437 inline double DeviceToWorldX(
double x )
const {
return ( x - m_worldtodevice.GetValue( 2, 0 ) ) / m_worldtodevice.GetValue( 0, 0 ); }
439 inline double DeviceToWorldY(
double y )
const {
return ( y - m_worldtodevice.GetValue( 2, 1 ) ) / m_worldtodevice.GetValue( 1, 1 ); }
444 inline double DeviceToWorldXRel(
double x )
const {
return x / m_worldtodevice.GetValue( 0, 0 ); }
449 inline double DeviceToWorldYRel(
double y )
const {
return y / m_worldtodevice.GetValue( 1, 1 ); }
453 inline int WorldToDeviceX(
double x )
const {
return (
int ) floor( m_worldtodevice.GetValue( 0, 0 ) * x + m_worldtodevice.GetValue( 2, 0 ) + 0.5 ); }
455 inline int WorldToDeviceY(
double y )
const {
return (
int ) floor( m_worldtodevice.GetValue( 1, 1 ) * y + m_worldtodevice.GetValue( 2, 1 ) + 0.5 ); }
460 inline int WorldToDeviceXRel(
double x )
const {
return (
int ) floor( m_worldtodevice.GetValue( 0, 0 ) * x + 0.5 ); }
465 inline int WorldToDeviceYRel(
double y )
const {
return (
int ) floor( m_worldtodevice.GetValue( 1, 1 ) * y + 0.5 ); }
506 virtual void PushTransform();
509 virtual void PushIdentityTransform();
520 virtual void PopTransform(
void );
526 void SetSplineAberration(
double aber );
539 virtual void ResetStyle();
545 void SetDrawerStroke(
const a2dStroke& stroke );
554 void SetDrawerFill(
const a2dFill& fill );
560 void SetFont(
const a2dFont& font );
566 void SetNormalizedFont(
bool forceNormalizedFont ) { m_forceNormalizedFont = forceNormalizedFont; }
582 virtual void DrawVpath(
const a2dVpath* path );
585 virtual void DrawPolyPolygon(
a2dListOfa2dVertexList polylist, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
588 virtual void DrawPolygon(
a2dVertexArray* points,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
591 virtual void DrawPolygon(
const a2dVertexList* list,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
594 virtual void DrawLines(
a2dVertexArray* points,
bool spline =
false );
597 virtual void DrawLines(
const a2dVertexList* list,
bool spline =
false );
600 virtual void DrawLine(
double x1,
double y1,
double x2,
double y2 );
603 virtual void DrawArc(
double x1,
double y1,
double x2,
double y2,
double xc,
double yc,
bool chord );
606 virtual void DrawEllipticArc(
double xc,
double yc,
double width,
double height ,
double sa,
double ea,
bool chord );
609 virtual void DrawRoundedRectangle(
double x,
double y,
double width,
double height,
double radius,
bool pixelsize =
false );
615 virtual void DrawCenterRoundedRectangle(
double xc,
double yc,
double width,
double height,
double radius,
bool pixelsize =
false );
619 virtual void DrawCircle(
double x,
double y,
double radius );
623 virtual void DrawEllipse(
double x,
double y,
double width,
double height );
637 virtual void DrawImage(
const wxImage& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 ) = 0;
639 virtual void DrawImage(
const a2dImageRGBA& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 ) = 0;
649 void DrawImage(
const wxImage& image,
double x = 0,
double y = 0, wxUint8 Opacity = 255 )
650 { DrawImage( image, x, y, image.GetWidth(), image.GetHeight(), Opacity ); }
653 virtual void DrawPoint(
double xc,
double yc ) = 0;
669 virtual void DrawText(
const wxString& text,
double x,
double y,
int alignment = wxMINX | wxMINY,
bool Background =
true );
672 virtual void DeviceDrawAnnotation(
const wxString& WXUNUSED( text ), wxCoord WXUNUSED( x ), wxCoord WXUNUSED( y ),
const wxFont& WXUNUSED( font ) ) {}
699 void OverRuleFixedStyle();
702 void ResetFixedStyle();
708 void ReStoreFixedStyle();
726 virtual void SetClippingRegion(
a2dVertexList* points,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE ) = 0;
738 virtual void PopClippingRegion() = 0;
741 virtual void SetClippingRegionDev( wxCoord minx, wxCoord miny, wxCoord maxx, wxCoord maxy ) = 0;
744 virtual void SetClippingRegion(
double minx,
double miny,
double maxx,
double maxy ) = 0;
747 virtual void DestroyClippingRegion() = 0;
750 void GetClippingBox(
double& x,
double& y,
double& w,
double& h )
const;
756 void GetClippingMinMax(
double& xmin,
double& ymin,
double& xmax,
double& ymax )
const;
762 void GetClippingBoxDev(
int& x,
int& y,
int& w,
int& h )
const;
768 virtual void BeginDraw() = 0;
771 virtual void EndDraw() = 0;
777 void SetOpacityFactor( wxUint8 OpacityFactor );
814 virtual void SetActiveStroke(
const a2dStroke& stroke );
822 virtual void SetActiveFill(
const a2dFill& fill );
824 virtual void DoSetDrawStyle(
a2dDrawStyle drawstyle ) = 0;
827 virtual void DoSetActiveStroke() = 0;
830 virtual void DoSetActiveFill() = 0;
832 virtual void DoSetActiveFont(
const a2dFont& font ) {};
835 wxPen ConvertActiveToPen();
838 wxBrush ConvertActiveToBrush();
840 #if wxART2D_USE_GRAPHICS_CONTEXT
841 wxGraphicsBrush ConvertActiveToGraphicsBrush( wxGraphicsContext* context );
842 wxGraphicsPen ConvertActiveToGraphicsPen( wxGraphicsContext* context );
853 m_activefill.IsNoFill() ||
896 void SetMappingUpp(
double x,
double y,
double wx,
double wy,
double vx1,
double vy1,
double xpp,
double ypp );
899 unsigned int ConvertSplinedPolygon2(
unsigned int n );
902 unsigned int ConvertSplinedPolyline2(
unsigned int n );
905 bool Clipping(
double& x1,
double& y1,
double& x2,
double& y2 );
908 int GetClipCode(
double x,
double y );
911 void FillPolygon(
int n, wxRealPoint points[] );
914 bool MoveUp(
int n, wxRealPoint points[] ,
double horline,
int& index,
int direction );
917 void DetectCriticalPoints(
int n, wxRealPoint points[] );
930 void DrawTextGeneric(
const wxString& text,
double x,
double y,
void (
a2dDrawer2D::*drawchar )( wxChar ) );
933 virtual void DrawCharUnknown( wxChar c );
944 virtual void DrawTextUnknown(
const wxString& text,
double x,
double y,
bool words =
false );
952 virtual void DrawCharStroke( wxChar c );
958 virtual void DrawTextStroke(
const wxString& text,
double x,
double y );
981 virtual void DrawCharDc( wxChar c ) { DrawCharUnknown( c ); }
987 virtual void DrawTextDc(
const wxString& text,
double x,
double y )
991 wxPoint* _convertToIntPointCache(
int n, wxRealPoint* pts );
1047 wxUint16 m_smallTextThreshold;
1057 void ColourXYLinear(
int x1,
int x2,
int y );
1058 void ColourXYRadial(
int x1,
int x2,
int y );
1061 double m_dx1, m_dy1, m_dx2, m_dy2, m_radiusd, m_length, m_max_x, m_min_x, m_max_y, m_min_y;
1067 virtual void DeviceDrawPolygon(
unsigned int n,
bool spline , wxPolygonFillMode fillStyle );
1070 virtual void DeviceDrawLines(
unsigned int n,
bool spline );
1073 virtual void DeviceDrawLine(
double x1,
double y1,
double x2,
double y2 );
1084 virtual void DeviceDrawHorizontalLine(
int x1,
int y1,
int x2,
bool use_stroke_color );
1095 virtual void DeviceDrawVerticalLine(
int x1,
int y1,
int y2,
bool use_stroke_color );
1098 virtual void DeviceDrawPixel(
int x1,
int y1,
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a = 255 );
1232 const static a2dSignal sig_changedZoom;
1260 void SetBufferSize(
int w,
int h );
1265 wxBitmap GetSubBitmap( wxRect sub_rect )
const;
1275 virtual void BlitBuffer( wxRect rect,
const wxPoint& bufferpos = wxPoint( 0, 0 ) );
1277 virtual void BlitBuffer( wxDC* dc, wxRect rect,
const wxPoint& bufferpos = wxPoint( 0, 0 ) );
1282 virtual void BeginDraw();
1285 virtual void EndDraw();
1287 void SetClippingRegion(
a2dVertexList* points,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
1293 void PopClippingRegion();
1295 void SetClippingRegionDev( wxCoord minx, wxCoord miny, wxCoord width, wxCoord height );
1296 void SetClippingRegion(
double minx,
double miny,
double maxx,
double maxy );
1297 void DestroyClippingRegion();
1299 void DrawPolygon(
a2dVertexArray* points,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
1301 void DrawPolygon(
const a2dVertexList* list,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
1305 void DrawLines(
const a2dVertexList* list,
bool spline =
false );
1307 void DrawLine(
double x1,
double y1,
double x2,
double y2 );
1309 void DrawArc(
double x1,
double y1,
double x2,
double y2,
double xc,
double yc,
bool chord );
1311 void DrawEllipticArc(
double xc,
double yc,
double width,
double height ,
double sa,
double ea,
bool chord );
1313 void DrawRoundedRectangle(
double x,
double y,
double width,
double height,
double radius,
bool pixelsize =
false );
1315 void DrawCenterRoundedRectangle(
double xc,
double yc,
double width,
double height,
double radius,
bool pixelsize =
false );
1317 void DrawCircle(
double x,
double y,
double radius );
1319 void DrawEllipse(
double x,
double y,
double width,
double height );
1321 void DrawImage(
const wxImage& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 );
1323 void DrawImage(
const a2dImageRGBA& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 );
1326 void DrawVpath(
const a2dVpath* path );
1328 void DrawPoint(
double xc,
double yc );
1330 void DeviceDrawAnnotation(
const wxString& text, wxCoord x, wxCoord y,
const wxFont& font );
1336 void DoSetActiveStroke();
1338 void DoSetActiveFill();
1346 #if wxART2D_USE_GRAPHICS_CONTEXT
1354 class a2dGcBaseDrawer :
public a2dDrawer2D
1356 DECLARE_CLASS( a2dGcBaseDrawer )
1361 a2dGcBaseDrawer(
int width = 0,
int height = 0, wxGraphicsRenderer* render = NULL, wxGraphicsContext* context = NULL );
1364 a2dGcBaseDrawer( const a2dGcBaseDrawer& other );
1366 a2dGcBaseDrawer( const a2dDrawer2D& other );
1368 virtual ~a2dGcBaseDrawer();
1371 virtual
void PushTransform();
1372 virtual
void PushIdentityTransform();
1374 virtual
void PopTransform(
void );
1376 virtual
void BeginDraw();
1377 virtual
void EndDraw();
1379 virtual
void BlitBuffer( wxRect rect, const wxPoint& bufferpos );
1381 virtual
void BlitBuffer( wxDC* dc, wxRect rect, const wxPoint& bufferpos = wxPoint( 0, 0 ) ) = 0;
1385 void SetClippingRegion(
a2dVertexList* points,
bool spline = false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
1389 virtual
void ExtendAndPushClippingRegion(
a2dVertexList* points,
bool spline = false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE,
a2dBooleanClip clipoperation = a2dCLIP_AND );
1391 void PopClippingRegion();
1393 void SetClippingRegionDev( wxCoord minx, wxCoord miny, wxCoord width, wxCoord height );
1395 void SetClippingRegion(
double minx,
double miny,
double maxx,
double maxy );
1397 void DestroyClippingRegion();
1399 virtual
void DrawRoundedRectangle(
double x,
double y,
double width,
double height,
double radius,
bool pixelsize = false );
1401 virtual
void DrawCircle(
double x,
double y,
double radius );
1403 void DrawPoint(
double xc,
double yc );
1405 virtual
void DrawEllipse(
double x,
double y,
double width,
double height );
1407 virtual
void DrawLines( const
a2dVertexList* list,
bool spline );
1409 virtual
void DrawPolygon(
a2dVertexArray* points,
bool spline = false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
1411 virtual
void DrawPolygon( const
a2dVertexList* list,
bool spline = false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
1413 virtual
void DrawLines(
a2dVertexArray* points,
bool spline = false );
1415 void DrawLine(
double x1,
double y1,
double x2,
double y2 );
1417 void DrawImage( const wxImage& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 );
1419 void DrawImage( const
a2dImageRGBA& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 );
1421 void DrawText( const wxString& text,
double x,
double y,
int alignment = wxMINX | wxMINY,
bool Background = true );
1427 void DoSetActiveStroke();
1429 void DoSetActiveFill();
1431 void DoSetActiveFont( const
a2dFont& font );
1435 wxGraphicsRenderer* m_render;
1436 wxGraphicsContext* m_context;
1446 class a2dNativeGcDrawer : public a2dGcBaseDrawer
1448 DECLARE_DYNAMIC_CLASS( a2dNativeGcDrawer )
1453 a2dNativeGcDrawer(
int width = 0,
int height = 0, wxGraphicsRenderer* render = NULL, wxGraphicsContext* context = NULL );
1456 a2dNativeGcDrawer( const wxSize& size );
1460 a2dNativeGcDrawer( const wxBitmap& bitmap );
1463 wxBitmap GetBuffer() const;
1466 a2dNativeGcDrawer( const a2dNativeGcDrawer& other );
1468 a2dNativeGcDrawer( const a2dDrawer2D& other );
1471 void SetBufferSize(
int w,
int h );
1474 wxBitmap GetSubBitmap( wxRect sub_rect ) const;
1476 void CopyIntoBuffer( const wxBitmap& bitm );
1478 virtual ~a2dNativeGcDrawer();
1482 void BlitBuffer( wxDC* dc, wxRect rect, const wxPoint& bufferpos = wxPoint( 0, 0 ) );
1484 void ShiftBuffer(
int dxy,
bool yshift );
1486 void DrawPoint(
double xc,
double yc );
1496 #endif // wxART2D_USE_GRAPHICS_CONTEXT
int WorldToDeviceXRel(double x) const
convert x relative from world to device coordinates
a2dAffineMatrix m_usertodevice
pointer to current user-to-device transform matrix ( so includes mapping matrix ) ...
a2dStroke m_activestroke
used while rendering
a2dBoundingBox & GetClippingBox()
what is the current clipping region in world coordinates
a2dDrawStyle m_drawstyle
drawstyle (like invert mode)
bool GetNormalizedFont()
Get setting for a fixed device height for drawing text.
double m_xpp
user units per pixel in x
wxUint8 m_StrokeOpacityCol2
active stroke alpha
bool m_asrectangle
underneath the threshold draw rectangles if true else nothing
wxBitmap GetBuffer() const
Return the buffer as a bitmap.
wxUint8 m_StrokeOpacityCol1
active stroke alpha
Base class for all types of strokes, understood by a2dDrawer2D classes.
a2dStroke m_fixStrokeRestore
used to restore an overruled fix style
a2dVertexList m_tempPoints
used internally in some methods to avoid constructor, new, ...
a2dFill m_activefill
used while rendering
int WorldToDeviceY(double y) const
convert y from world to device coordinates
Stroke and fill base classes.
bool m_realScale
If true use real scale else different scale by x and y.
void SetPrimitiveThreshold(wxUint16 pixels, bool asrect=true)
set at what size to stop drawing
std::vector< a2dAffineMatrix > m_affineStack
Affine transform stack.
void SetRealScale(bool realScale)
If true use real scale else different scale by x and y.
unsigned char m_colour2blueFill
active fill colours
a2dStroke m_currentstroke
used while rendering
a2dDrawStyle m_fixDrawstyle
used to restore an overruled fix style
int m_refreshDisplay
see SetRefreshDisplay()
int GetMapWidth() const
get mapping to device width
bool IsStrokeOnly()
wxART2D_USE_GRAPHICS_CONTEXT
std::vector< wxRealPoint > m_cpointsDouble
cached array for containing transformed device coordinates (double)
double DeviceToWorldYRel(double y) const
convert y relative from device to world coordinates
wxUint16 m_polygonFillThreshold
polygon smaller than this value will be rendered non filled.
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
void SetPolygonFillThreshold(wxUint16 pixels)
set threshold at which polygon is drawn filled or only outline
void SetNormalizedFont(bool forceNormalizedFont)
Use a fixed device height for drawing text.
unsigned char m_colour1redFill
active fill colours
void SetDisplayAberration(double aber)
Set the display aberration of curved shapes.
bool GetYaxis() const
get y axis orientation
bool GetThresholdDrawRectangle() const
underneath the threshold draw a rectangle instead of the real object.
a2dFont m_currentfont
current font set
a2dBoundingBox m_clipboxworld
current clipping area in world coordinates
a2dAffineMatrix m_usertoworld
pointer to current user-to-world transform matrix
wxUint16 GetPrimitiveThreshold() const
get drawing threshold
void DrawCharFreetypeCb(wxChar c)
Wrapper for DrawCharFreetype.
vertex array of line and arc segments.
int m_mapHeight
height for mapping in device coordinates
bool m_fixedStyledOverRuled
keep track of this
unsigned char m_colour1blueStroke
active stroke colours
unsigned char m_colour2redFill
active fill colours
double m_virt_minY
virtual coordinates box its miminum Y
std::vector< wxPoint > m_cpointsInt
cached array for containing transformed device coordinates (integer)
vertex list of line and arc segments.
unsigned char m_colour1blueFill
active fill colours
wxUint8 GetOpacityFactor()
see SetOpacityFactor()
a2dDrawStyle GetDrawStyle() const
get drawstyle used for drawing.
double GetUppX() const
return xpp Number of user units per pixel in x
virtual wxDC * GetDeviceDC() const
get the DC that is used for rendering
general vertexlist and array and vector path functions and classes.
a2dDrawStyle
Define the manner in which a2dCanvasView draws to the device.
int GetMapY() const
Y mapping position in device coordinates.
int WorldToDeviceYRel(double y) const
convert y relative from world to device coordinates
a2dClipRegionList m_clipregionlist
pushed clipping regions
classes for initializing the artbase modules, and set paths to be used for fonts etc.
double DeviceToWorldY(double y) const
convert y from device to world coordinates
a2dAffineMatrix m_worldtodevice
world to device coordinate mapping
double m_displayaberration
accuracy of arc segment calculation etc. in device coordinates
class draws nothing, still can be used as a drawing context.
virtual void DrawCharDc(wxChar c)
Draw a dc character.
unsigned char m_colour1greenStroke
active stroke colours
wxUint16 m_drawingthreshold
object smaller than this value will not be rendered
double m_ypp
user units per pixel in y
bounding class for optimizing drawing speed.
Drawing context abstraction.
void SetDisableDrawing(bool disableDrawing)
when set, all drawing functions return immediately.
int GetHeight() const
get buffer/device height
double GetUppY() const
return ypp Number of user units per pixel in y
virtual void ShiftBuffer(int dxy, bool yshift)
quick scroll over small distance
virtual void DrawTextFreetype(const wxString &text, double x, double y)
Draw text in world coordinates, based on a freetype font .
unsigned char m_colour2greenFill
active fill colours
int WorldToDeviceX(double x) const
convert x from world to device coordinates
int m_mapX
X mapping position in device coordinates.
double GetDisplayAberration() const
Returns the display aberration of curved shapes.
the wxGraphicContext based drawing context
bool GetDisableDrawing()
see SetDisableDrawing()
a2dAETList m_AETlist
scanline list of intersections with polygon
virtual void DrawTextDc(const wxString &text, double x, double y)
Draw text in user coordinates, based on a dc font .
void SetDisplay(wxWindow *window)
the display
A 2x3 affine matrix class for 2D transformations.
virtual bool HasAlpha()
does a derived drawer have alpha support or not
a2dStroke GetDrawerStroke() const
get the current stroke
void DrawCharStrokeCb(wxChar c)
Wrapper for DrawCharStroke.
int m_height
device size height
bool m_disableDrawing
all drawing is disabled when this is true
int GetMapHeight() const
get mapping to device height
int GetWidth() const
get buffer/device width
a2dBooleanClip
Used for defining how a ClippingRegion defined as a polygon is combined with.
wxRect m_clipboxdev
current clipping area in device coordinates
virtual void DrawCharFreetype(wxChar c)
Draw a freetype character.
general modules header files all together.
a2dCriticalPointList m_CRlist
critical point list for polygon
a2dFont GetFont() const
get font used for drawing text
bool m_printingMode
can be used to modify drawing features when used as context for printing
bool m_virtualarea_set
is the virtual area set already (used during startup)
int m_beginDraw_endDraw
counter for BeginDraw EndDraw calls
double m_virt_minX
virtual coordinates box its miminum X
void DrawImage(const wxImage &image, double x=0, double y=0, wxUint8 Opacity=255)
Draw wxImage in world coordinates.
void SetPrintMode(bool onOff)
to modify drawing feature when used as context for printing
double WorldToDeviceXRelNoRnd(double x) const
convert x relative from world to device coordinates (result not rounded to integer) ...
int m_width
device size width
Contains image with RGBA per pixel.
double DeviceToWorldX(double x) const
convert x from device to world coordinates
unsigned char m_colour1greenFill
active fill colours
bool m_pendingSig_changedZoom
When display refresh is on hold, this triggers a delayed zoom signal, when released.
virtual void DeviceDrawAnnotation(const wxString &text, wxCoord x, wxCoord y, const wxFont &font)
text drawn in device coordinates
void StartRefreshDisplayDisable()
when called a mapping change will result not result in a refresh of the m_display.
unsigned char m_colour1redStroke
active stroke colours
bool m_mouseevents
enable/ disable mouse events handling by canvas
int m_mapWidth
width for mapping in device coordinates
virtual wxDC * GetRenderDC() const
get the DC that is used for rendering
wxWindow * m_display
view its window.
wxUint16 GetSmallTextThreshold() const
See SetSmallTextThreshold.
a2dFill GetDrawerFill() const
get the current fill
wxUint8 m_FillOpacityCol1
active fill alpha
bool m_forceNormalizedFont
up or down
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
const a2dAffineMatrix & GetTransform() const
get the user-to-world transform matrix.
bool GetRefreshDisplayDisable() const
see StartRefreshDisplayDisable()
wxRect & GetClippingBoxDev()
what is the current clipping region in device coordinates
double WorldToDeviceYRelNoRnd(double y) const
convert y relative from world to device coordinates (result not rounded to integer) ...
wxUint16 GetPolygonFillThreshold() const
get threshold at which polygon is drawn filled or only outline
void SetSmallTextThreshold(wxUint16 pixels)
int m_mapY
Y mapping position in device coordinates.
a2dFill m_currentfill
used while rendering
bool m_frozen
buffer updating activity possible or not
const a2dAffineMatrix & GetMappingMatrix()
get the world-to-device (aka mapping) matrix
void DrawCharDcCb(wxChar c)
Wrapper for DrawCharDc.
wxUint8 m_OpacityFactor
opacity will be the one set, derived by this
int GetMapX() const
X mapping position in device coordinates.
double DeviceToWorldXRel(double x) const
convert x relative from device to world coordinates
const a2dAffineMatrix & GetUserToDeviceTransform() const
get matrix which transforms directly from user coordinates to device
wxUint8 m_FillOpacityCol2
active fill alpha
basic 2 point line class for intersection and contouring routines.
double m_splineaberration
accuracy of spline
bool GetVirtualAreaSet() const
if the virtual area has been set already return true else false.
a2dFill m_fixFillRestore
used to restore an overruled fix style