Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
RoadLayer.h
1 //
2 // RoadLayer.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef ROADLAYER_H
9 #define ROADLAYER_H
10 
11 #include "Layer.h"
12 #include "RoadMapEdit.h"
13 
15 
16 class vtRoadLayer : public vtLayer, public RoadMapEdit
17 {
18 public:
19  vtRoadLayer();
20  ~vtRoadLayer();
21 
22  // implementation of vtLayer methods
23  bool GetExtent(DRECT &rect);
24  void DrawLayer(wxDC *pDC, vtScaledView *pView);
25  bool TransformCoords(vtProjection &proj);
26  bool OnSave(bool progress_callback(int) = NULL);
27  bool OnLoad();
28  bool AppendDataFrom(vtLayer *pL);
29  void GetProjection(vtProjection &proj);
30  void SetProjection(const vtProjection &proj);
31  void Offset(const DPoint2 &p);
32  void GetPropertyText(wxString &strIn);
33  void OnLeftDown(BuilderView *pView, UIContext &ui);
34  void OnLeftUp(BuilderView *pView, UIContext &ui);
35  void OnRightUp(BuilderView *pView, UIContext &ui);
36  void OnLeftDoubleClick(BuilderView *pView, UIContext &ui);
37 
38  static bool GetDrawNodes() { return m_bDrawNodes; }
39  static void SetDrawNodes(bool d) { m_bDrawNodes = d; }
40  static bool GetShowDirection() { return m_bShowDirection; }
41  static void SetShowDirection(bool d) { m_bShowDirection = d; }
42  static bool GetDrawWidth() { return m_bDrawWidth; }
43  static void SetDrawWidth(bool d) { m_bDrawWidth = d; }
44 
45  int GetSelectedNodes();
46  int GetSelectedLinks();
47  void ToggleLinkDirection(LinkEdit *pLink);
48  bool SelectArea(const DRECT &box, bool nodemode, bool crossSelect);
49  void DoClean();
50  void MoveSelectedNodes(const DPoint2 &offset);
51  void CarveRoadway(class vtElevLayer *pElev, float margin);
52 
53  //edit a single node
54  bool EditNodeProperties(BuilderView *pView, const DPoint2 &point, float error, DRECT &bound);
55  //edit a single road
56  bool EditLinkProperties(const DPoint2 &point, float error, DRECT &bound);
57  //edit all selected nodes
58  bool EditNodesProperties(BuilderView *pView);
59  //edit all selected roads
60  bool EditLinksProperties(BuilderView *pView);
61 
62 protected:
63  static bool m_bDrawNodes;
64  static bool m_bShowDirection;
65  static bool m_bDrawWidth;
66 };
67 
68 #endif