8 #if !defined(AFX_B_EXTRACTORVIEW_H)
9 #define AFX_B_EXTRACTORVIEW_H
13 #endif // _MSC_VER >= 1000
15 #include "vtdata/Building.h"
19 #define NODE_CAPTURE_THRESHOLD 10.0 // Metres
46 DPoint2 GetCurLocation() {
return m_curLocation; }
52 void ZoomToImage(
CBImage *pImage);
53 void DrawBuildings(CDC *pDC);
55 void DrawRoadNodes(CDC *pDC);
56 void DrawRoadNode(CDC *pDC,
TNode *pNode);
57 void DrawRoads(CDC *pDC);
58 void DrawRoad(CDC *pDC,
TLink *pLink);
59 bool FindNearestRoadNode(CPoint &point,
TNode **pNearestNode);
62 bool SelectionOnPicture(
DPoint2 point);
68 virtual void OnDraw(CDC* pDC);
69 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
70 virtual void OnInitialUpdate();
72 virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
80 virtual void AssertValid()
const;
81 virtual void Dump(CDumpContext& dc)
const;
98 CPoint m_lastMousePoint;
102 CPoint m_SavedOffset;
103 double m_fSavedScale;
106 COLORREF m_buildingColor;
109 COLORREF m_roadColor;
112 TLink *m_pCurrentRoad;
115 char m_directory[MAX_PATH];
124 float m_fPixelRadius;
126 CPoint m_p0, m_p1, m_p2, m_p3;
142 double s_UTMx(
int sx) {
return ((sx - m_offset.x) * m_fScale); }
143 double s_UTMy(
int sy) {
return -((sy - m_offset.y) * m_fScale); }
144 void s_UTM(CPoint &p,
DPoint2 &utm)
151 int UTM_sx(
double utm_x) {
return (
int)((utm_x / m_fScale) + m_offset.x); }
152 int UTM_sy(
double utm_y) {
return (
int)((-utm_y / m_fScale) + m_offset.y); }
153 void UTM_s(
const DPoint2 &utm, CPoint &p)
155 p.x = UTM_sx((
float)utm.x);
156 p.y = UTM_sy((
float)utm.y);
160 int UTM_sdx(
double utm_x) {
return (
int)(utm_x / m_fScale); }
161 int UTM_sdy(
double utm_y) {
return (
int)(-utm_y / m_fScale); }
162 CPoint UTM_sd(
const DPoint2 &utm)
164 return CPoint((
int)(utm.x / m_fScale),
165 (
int)(-utm.y / m_fScale));
167 double s_UTMdx(
double sx) {
return (sx * m_fScale); }
168 double s_UTMdy(
double sy) {
return (-sy * m_fScale); }
169 CRect screen(
const DRECT &r)
172 r2.left = UTM_sx(r.left);
173 r2.top = UTM_sy(r.top);
174 r2.right = UTM_sx(r.right);
175 r2.bottom = UTM_sy(r.bottom);
179 void ChangeScale(
double fFactor);
181 void MopRemoveRoadNodes(
const DPoint2 &start,
const DPoint2 &end);
182 void DrawRect(CDC *pDC, CPoint one, CPoint two);
183 void ZoomToBuilding();
186 void UpdateScrollPos();
187 void OnLButtonDownEditShape(UINT nFlags, CPoint point);
188 void OnLButtonDownEditRoad(UINT nFlags, CPoint point);
189 void OnLButtonUpAddRemove(CPoint point);
190 void OnLButtonUpFootprint(CPoint point);
191 void OnLButtonUpRectangle(CPoint point);
192 void OnLButtonUpCircle(CPoint point);
193 void OnLButtonUpEditRoadNodes(CPoint point);
195 void DoPan(CPoint point);
196 void DrawPoly(CDC *pDC);
197 void UpdateRectangle(CPoint point);
198 void DrawRectangle(CDC *pDC);
199 void InvalidatePolyExtent();
200 void UpdateCircle(CPoint point);
201 void DrawCircle(CDC *pDC);
202 void DrawCircle(CDC *pDC, CPoint ¢er,
int iRadius);
205 void UpdateResizeScale();
207 void DrawCurrentBuilding(CDC *pDC);
208 void ContrainLocationForPoly();
210 void SetMode(LBMode mode);
211 void CancelFootprint();
217 afx_msg
void OnColorChange();
218 afx_msg
void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
219 afx_msg
void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
220 afx_msg
void OnFunctionsConvolve();
221 afx_msg
void OnAddRemove();
222 afx_msg
void OnUpdateAddRemove(CCmdUI* pCmdUI);
223 afx_msg
void OnLButtonUp(UINT nFlags, CPoint point);
224 afx_msg
void OnFullres();
225 afx_msg
void OnHand();
226 afx_msg
void OnUpdateHand(CCmdUI* pCmdUI);
227 afx_msg
void OnLButtonDown(UINT nFlags, CPoint point);
228 afx_msg
void OnMouseMove(UINT nFlags, CPoint point);
229 afx_msg
void OnZoomIn();
230 afx_msg
void OnZoomOut();
231 afx_msg
void OnMButtonUp(UINT nFlags, CPoint point);
232 afx_msg
void OnMButtonDown(UINT nFlags, CPoint point);
233 afx_msg
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
234 afx_msg
void OnClearscreenofBuildings();
235 afx_msg
void OnUndo();
236 afx_msg
void OnViewViewfullcolorimage();
237 afx_msg
void OnUpdateViewViewfullcolorimage(CCmdUI* pCmdUI);
238 afx_msg
void OnModesFootprintMode();
239 afx_msg
void OnUpdateModesFootprintmode(CCmdUI* pCmdUI);
240 afx_msg
void OnModesRectangle();
241 afx_msg
void OnUpdateModesRectangle(CCmdUI* pCmdUI);
242 afx_msg
void OnRButtonDown(UINT nFlags, CPoint point);
243 afx_msg
void OnModesCircle();
244 afx_msg
void OnUpdateModesCircle(CCmdUI* pCmdUI);
245 afx_msg
void OnUpdateUndo(CCmdUI* pCmdUI);
246 afx_msg
void OnUpdateFunctionsConvolve(CCmdUI* pCmdUI);
247 afx_msg
void OnUpdateFileSave(CCmdUI* pCmdUI);
248 afx_msg
void OnModesMoveresize();
249 afx_msg
void OnUpdateModesMoveresize(CCmdUI* pCmdUI);
250 afx_msg
void OnModesRoadnode();
251 afx_msg
void OnUpdateModesRoadnode(CCmdUI* pCmdUI);
252 afx_msg
void OnChangeRoadColor();
253 afx_msg
void OnModesRoadEdit();
254 afx_msg
void OnUpdateModesRoadEdit(CCmdUI* pCmdUI);
255 afx_msg
void OnConstrain();
256 afx_msg
void OnUpdateConstrain(CCmdUI* pCmdUI);
258 DECLARE_MESSAGE_MAP()
261 #ifndef _DEBUG // debug version in BExtractorView.cpp
271 #endif // !defined(AFX_B_EXTRACTORVIEW_H)