Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Contours.h
1 //
2 // Contours.h
3 //
4 // Copyright (c) 2004-2009 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef CONTOURSH
9 #define CONTOURSH
10 
11 #if SUPPORT_QUIKGRID
12 
13 #include "Terrain.h"
14 class SurfaceGrid;
15 
19 
55 class vtContourConverter
56 {
57 public:
58  vtContourConverter();
59  ~vtContourConverter();
60 
61  // There are two ways to use the converter:
63  vtGeode *Setup(vtTerrain *pTerr, const RGBf &color, float fHeight);
65  bool Setup(vtTerrain *pTerr, vtFeatureSetLineString *fset);
66 
67  void GenerateContour(float fAlt);
68  void GenerateContours(float fAInterval);
69  void Finish();
70  void Coord(float x, float y, bool bStart);
71 
72 protected:
73  bool SetupTerrain(vtTerrain *pTerr);
74  void Flush();
75 
76  SurfaceGrid *m_pGrid;
77 
78  vtTerrain *m_pTerrain;
79  vtHeightFieldGrid3d *m_pHF;
80  DRECT m_ext;
81  DPoint2 m_spacing;
82  float m_fAltitude;
83  float m_fHeight;
84  DLine2 m_line;
85 
86  // These are used if building geometry directly
87  vtGeode *m_pGeode;
88  vtGeomFactory *m_pMF;
89 
90  // This is used if building line features
92 };
93  // utility
95 
96 #endif // SUPPORT_QUIKGRID
97 #endif // CONTOURSH