Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Elastic.h
1 //
2 // Elastic.h
3 //
4 // Copyright (c) 2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #pragma once
9 
12 
18 {
19 public:
21 
22  void SetTerrain(vtTerrain *pTerr);
23  void SetPostHeight(float fMeters) { m_fPostHeight = fMeters; }
24  void SetLineHeight(float fMeters) { m_fLineHeight = fMeters; }
25  void SetLineColor(const RGBAf &color);
26 
27  void SetPolyline(const DLine2 &line);
28  void AddPoint(const DPoint2 &point, bool bEnforceRightAngles = false);
29  void RemovePoint(int iPoint);
30  void SetPoint(int iPoint, const DPoint2 &point, bool bEnforceRightAngles = false);
31  void EnforceRightAngles();
32  void Clear();
33 
34  DLine2 &GetPolyline() { return m_Line; }
35  uint NumPoints() { return m_Line.GetSize(); }
36 
37 protected:
38  void Realize();
39 
40  vtMaterialArrayPtr m_Materials;
41  vtGroupPtr m_Container;
42  DLine2 m_Line;
43  vtGeodePtr m_Marker;
44  vtTerrain *m_pTerr;
45  float m_fPostHeight;
46  float m_fLineHeight;
47 };
48  // utility