12 #include "ogr_geometry.h"
17 vtScaledView(wxWindow *parent, wxWindowID
id = -1,
const wxPoint& pos = wxDefaultPosition,
18 const wxSize& size = wxDefaultSize,
long style = wxHSCROLL | wxVSCROLL,
const wxString& name = _T(
""));
20 void SetScale(
double scale);
23 void ZoomToPoint(
const DPoint2 &p);
24 void ZoomToRect(
const DRECT &geo_rect,
float margin);
25 void ZoomOutToRect(
const DRECT &geo_rect);
27 wxRect WorldToCanvas(
const DRECT &r);
28 wxRect WorldToWindow(
const DRECT &r);
29 DRECT CanvasToWorld(
const wxRect &r);
31 void GetCanvasPosition(
const wxMouseEvent &
event, wxPoint &pos);
33 wxRect PointsToRect(
const wxPoint &p1,
const wxPoint &p2);
36 int sx(
double x) {
return (
int)(x*m_fScale - m_limits.x); }
37 int sy(
double y) {
return (
int)(-y*m_fScale - m_limits.y); }
38 void screen(
const DPoint2 &p, wxPoint &sp)
const
40 sp.x = (int)(p.x*m_fScale - m_limits.x);
41 sp.y = (int)(-p.y*m_fScale - m_limits.y);
43 void screen(
const OGRPoint *p, wxPoint &sp)
const
45 sp.x = (int)(p->getX()*m_fScale - m_limits.x);
46 sp.y = (int)(-(p->getY())*m_fScale - m_limits.y);
49 int sdx(
double x) {
return (
int)(x*m_fScale); }
50 int sdy(
double y) {
return (
int)(-y*m_fScale); }
52 wxPoint screen_delta(
const DPoint2 &p)
const
55 sp.x = (int)(p.x*m_fScale);
56 sp.y = (int)(-p.y*m_fScale);
61 double ox(
int x) {
return (x + m_limits.x) / m_fScale; }
62 double oy(
int y) {
return -(y + m_limits.y) / m_fScale; }
63 void object(
const wxPoint &sp,
DPoint2 &p)
const
65 p.x = (sp.x + m_limits.x) / m_fScale;
66 p.y = -(sp.y + m_limits.y) / m_fScale;
70 double odx(
int x) {
return x/m_fScale; }
71 double ody(
int y) {
return -y/m_fScale; }
74 void DrawPolyLine(wxDC *pDC,
const DLine2 &line,
bool bClose);
75 void DrawDoubleLine(wxDC *pDC,
const DLine2 &line,
const DLine2 &width);
76 void DrawPolygon(wxDC *pDC,
const DPolygon2 &poly,
bool bFill);
78 void DrawOGRLinearRing(wxDC *pDC,
const OGRLinearRing *line,
bool bCircles);
79 void DrawOGRPolygon(wxDC *pDC,
const OGRPolygon &poly,
bool bFill,
bool bCircles);
80 void DrawDPolygon2(wxDC *pDC,
const DPolygon2 &poly,
bool bFill,
bool bCircles);
89 #define SCREENBUF_SIZE 32000
90 extern wxPoint g_screenbuf[SCREENBUF_SIZE];