Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
PickEngines.h
1 //
2 // PickEngines.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #pragma once
9 
14 class TerrainPicker : public vtLastMouse
15 {
16 public:
17  TerrainPicker();
18  void Eval();
19  void SetHeightField(vtHeightField3d *pHeight) { m_pHeightField = pHeight; }
20 
21  bool GetCurrentPoint(FPoint3 &p);
22  bool GetCurrentEarthPos(DPoint3 &p);
23 
24  void OnMouse(vtMouseEvent &event);
25 
26 protected:
27  void FindGroundPoint();
28 
29  FPoint3 m_GroundPoint;
30  vtHeightField3d *m_pHeightField;
31  DPoint3 m_EarthPos;
32  bool m_bOnTerrain;
33 };
34 
36 
37 class vtIcoGlobe;
38 
43 class GlobePicker : public vtLastMouse
44 {
45 public:
46  GlobePicker();
47  void Eval();
48  void SetRadius(double fRadius) { m_fRadius = fRadius; }
49  void SetGlobe(vtIcoGlobe *pGlobe) { m_pGlobe = pGlobe; }
50  void SetTargetScale(float s) { m_fTargetScale = s; }
51 
52  bool GetCurrentPoint(FPoint3 &p);
53  bool GetCurrentEarthPos(DPoint3 &p);
54 
55 protected:
56  FPoint3 m_GroundPoint;
57  DPoint3 m_EarthPos;
58  bool m_bOnTerrain;
59  double m_fRadius;
60  vtIcoGlobe *m_pGlobe;
61  float m_fTargetScale;
62 };
63