Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
WaterLayer.h
1 //
2 // WaterLayer.h
3 //
4 // Copyright (c) 2001-2008 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef WATERLAYER_H
9 #define WATERLAYER_H
10 
11 #include "vtdata/shapelib/shapefil.h"
12 #include "vtdata/RoadMap.h"
13 #include "Layer.h"
14 
15 class vtDIB;
16 
18 
19 class vtWaterFeature : public DLine2
20 {
21 public:
22  vtWaterFeature() : DLine2() { m_bIsBody = false; }
23  bool m_bIsBody;
24 };
25 
26 class vtWaterLayer : public vtLayer
27 {
28 public:
29  vtWaterLayer();
30  ~vtWaterLayer();
31 
32  bool GetExtent(DRECT &rect);
33  void DrawLayer(wxDC *pDC, vtScaledView *pView);
34  bool TransformCoords(vtProjection &proj);
35  bool OnSave(bool progress_callback(int) = NULL);
36  bool OnLoad();
37  bool AppendDataFrom(vtLayer *pL);
38  void GetProjection(vtProjection &proj);
39  void SetProjection(const vtProjection &proj);
40  void Offset(const DPoint2 &p);
41  void GetPropertyText(wxString &str);
42 
43  void AddFeature(const DLine2 &dline, bool bIsBody = false);
44  vtWaterFeature &GetFeature(int i) { return (vtWaterFeature &) m_Lines[i]; }
45 
46  void PaintDibWithWater(vtDIB *dib);
47 
48  void AddElementsFromDLG(vtDLGFile *pDlg);
49  void AddElementsFromSHP(const wxString &filename, const vtProjection &proj);
50 
51  // Import from SDTS via OGR
52  void AddElementsFromOGR(class OGRDataSource *datasource,
53  bool progress_callback(int) = NULL);
54 
55 protected:
56  // data for rivers and water bodies
57  // eventually, should have vector+width data for rivers, area data for bodies
58  // for now, just use plain vectors for everything
59  DLine2Array m_Lines;
60  std::vector<bool> m_IsBody;
61  vtProjection m_proj;
62 };
63 
64 #endif
65