23 #include "wxgis/display/color.h"
26 #include "ogrsf_frmts.h"
27 #include "gdal_priv.h"
32 #include <cairo-win32.h>
35 WX_DEFINE_ARRAY(wxRealPoint*, wxGISPointsArray);
49 virtual size_t AddCache(
void);
51 virtual size_t GetLastCacheID(
void)
const;
52 virtual size_t GetFlashCacheID(
void)
const;
53 virtual void SetDrawCache(
size_t nCacheID,
bool bNoDerty =
false);
54 virtual size_t GetDrawCache(
void)
const;
55 virtual bool IsCacheDerty(
size_t nCacheID)
const;
56 virtual void SetCacheDerty(
size_t nCacheID,
bool bIsDerty);
57 virtual void SetAllCachesDerty(
bool bIsDerty);
58 virtual void SetUpperCachesDerty(
size_t nFromCacheNo,
bool bIsDerty =
true);
59 virtual bool IsDerty(
void)
const;
60 virtual size_t GetCacheCount(
void)
const {
return m_saLayerCaches.size();};
61 virtual void ClearCache(
size_t nCacheId);
64 virtual void SetDeviceFrame(wxRect &rc);
65 virtual wxRect GetDeviceFrame(
void)
const;
67 virtual void SetBounds(
const OGREnvelope &Env);
68 virtual OGREnvelope GetBounds(
bool bRotated =
true)
const;
69 virtual wxRealPoint GetBoundsCenter(
void)
const {
return wxRealPoint(m_dRotatedBoundsCenterX, m_dRotatedBoundsCenterY);};
71 virtual void SetRotate(
double dAngleRad);
72 virtual double GetRotate(
void)
const {
return m_dAngleRad;};
73 virtual void DC2World(
double* pdX,
double* pdY);
74 virtual void World2DC(
double* pdX,
double* pdY);
75 virtual void DC2WorldDist(
double* pdX,
double* pdY,
bool bRotated =
true);
76 virtual void World2DCDist(
double* pdX,
double* pdY,
bool bRotated =
true);
78 virtual void OnEraseBackground(
void);
79 virtual void Output(wxDC* pDC);
80 virtual bool Output(GDALDataset *pGDALDataset);
82 virtual void SetColor(
const wxGISColor &Color);
83 virtual void SetLineCap(cairo_line_cap_t line_cap = CAIRO_LINE_CAP_BUTT);
84 virtual void SetLineJoin(cairo_line_join_t line_join = CAIRO_LINE_JOIN_MITER);
85 virtual void SetLineWidth(
double dWidth);
86 virtual void SetMiterLimit(
double dMiterLimit);
87 virtual void SetFillRule(cairo_fill_rule_t fill_rule = CAIRO_FILL_RULE_WINDING);
89 virtual bool CanDraw(OGREnvelope &Env);
90 virtual void Stroke();
91 virtual void FillPreserve();
92 virtual void SetColor(
double dRed,
double dGreen,
double dBlue,
double dAlpha = 0);
93 virtual bool CheckDrawAsPoint(
const OGREnvelope &Envelope,
double dfLineWidth,
bool bIsRing =
true,
double dOffsetX = 0,
double dOffsetY = 0,
bool bCheckEnvelope =
false);
94 virtual bool DrawCircle(
double dX,
double dY,
double dOffsetX = 0,
double dOffsetY = 0,
double dfRadius = 1.0,
double angle1 = 0,
double angle2 = 2 * M_PI);
95 virtual bool DrawEllipse(
double dX,
double dY,
double dOffsetX = 0,
double dOffsetY = 0,
double dfWidth = 1.0,
double dfHeight = 1.0);
96 virtual bool DrawPointFast(
double dX,
double dY,
double dOffsetX = 0,
double dOffsetY = 0);
97 virtual bool DrawLine(OGRRawPoint* pOGRRawPoints,
int nPointCount,
bool bOwn =
true,
double dOffsetX = 0,
double dOffsetY = 0,
bool bIsRing =
false);
98 virtual void DrawRaster(cairo_surface_t *surface,
const OGREnvelope& Envelope,
bool bDrawEnvelope =
false);
99 virtual void ZoomingDraw(
const wxRect& rc, wxDC* pDC);
100 virtual void WheelingDraw(
double dZoom, wxDC* pDC);
101 virtual void PanningDraw(wxCoord x, wxCoord y, wxDC* pDC);
102 virtual void RotatingDraw(
double dAngle, wxDC* pDC);
103 virtual OGREnvelope TransformRect(wxRect &rect);
105 virtual void TestDraw(
void);
110 cairo_surface_t *pCairoSurface;
111 cairo_t *pCairoContext;
113 virtual wxCriticalSection &GetLock();
115 virtual void Output(cairo_surface_t *pSurface, wxDC* pDC);
116 virtual cairo_t* CreateContext(wxDC* dc);
117 virtual void InitTransformMatrix(
void);
118 virtual inline double GetScaledWidth(
double nWidth)
121 x_new = y_new = nWidth;
122 DC2WorldDist(&x_new, &y_new);
123 return (fabs(x_new) + fabs(y_new)) / 2;
126 wxVector<LAYERCACHEDATA> m_saLayerCaches;
128 size_t m_nLastCacheID, m_nCurrentLayer;
129 int m_nMax_X, m_nMax_Y;
130 wxRect m_oDeviceFrameRect;
131 OGREnvelope m_RealBounds, m_CurrentBounds, m_CurrentBoundsRotated, m_CurrentBoundsX8;
132 double m_dRotatedBoundsCenterX, m_dRotatedBoundsCenterY;
135 cairo_matrix_t *m_pMatrix, *m_pDisplayMatrix, *m_pDisplayMatrixNoRotate;
136 double m_dOrigin_X, m_dOrigin_Y;
137 double m_dFrameCenterX, m_dFrameCenterY;
138 double m_dCacheCenterX, m_dCacheCenterY;
139 double m_dFrameXShift, m_dFrameYShift;
140 wxCriticalSection m_CritSect;
141 bool m_bZeroCacheSet;
142 double m_dFrameRatio;
144 int m_nSysCacheCount;
145 double m_dfLineWidth;
148 cairo_surface_t *m_surface_tmp;
Definition: gisdisplay.h:43
Definition: gisdisplay.h:107