All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BuildingFootprintSelectionController.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "BuildingFootprints.h"
6 
7 #include "Types.h"
8 #include "Collision.h"
9 #include "CollisionVisualization.h"
10 #include "VectorMath.h"
11 #include "ICallback.h"
12 #include "Camera.h"
13 #include "BuildingFootprintSelectionModel.h"
14 
15 #include <map>
16 #include <vector>
17 #include <string>
18 
19 
20 namespace Eegeo
21 {
22  namespace BuildingFootprints
23  {
25  {
26  public:
27  enum Operation
28  {
29  Select,
30  Deselect,
31  Toggle,
32  SetFlashing,
33  CycleFlashing
34  };
35 
36 
38 
39  typedef std::vector<BuildingFootprint> FootprintVector;
40  typedef BuildingFootprintSelectionModel::ModelId ModelId;
41 
44  CollisionVisualization::CollisionVisualizationRenderer& collisionVisualizationRenderer,
46 
48 
49  void OperateOnClosestGroup(const dv3& pointEcef, Operation operation);
50 
51  void DeselectAll();
52 
53  void Update(float dt);
54  void Draw(const Eegeo::Camera::RenderCamera& renderCamera);
55 
56  private:
57  typedef std::map<ModelId, BuildingFootprintSelectionModel*> IdToModel;
58  typedef std::map<const BuildingFootprintSelectionModel*, BuildingFootprintSelectionView*> ModelToView;
59 
60  void HandleOperationCallback(const Eegeo::BuildingFootprints::BuildingFootprintServiceQueryResult& result, const Operation& operation);
61 
62  bool IsSelected(const ModelId& modelId) const;
63  BuildingFootprintSelectionModel* GetModelOrNull(const ModelId& modelId) const;
64  void SelectModel(const ModelId& modelId, const FootprintVector& footprints);
65  void DeselectModel(const ModelId& modelId);
66 
67  void RemoveAllModels();
68  void RemoveAllViews();
69  void PerformOperation(const ModelId& modelId, const FootprintVector& footprints, Operation operation);
70 
71 
72  IdToModel m_idToModel;
73  ModelToView m_modelToView;
74 
75  BuildingFootprintService& m_buildingFootprintService;
77  CollisionVisualization::CollisionVisualizationRenderer& m_collisionVisualizationRenderer;
78 
79  OperationCallback m_operationCallback;
80 
81  float m_flashingPhase;
82 
83  const v4 m_color;
84  const float m_flashFrequency;
85  const float m_flashSaturateScale;
86  const float m_flashAlphaMin;
87  const float m_flashAlphaMax;
88  };
89  }
90 }