All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IOcclusionResolver.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Labels.h"
6 #include "Types.h"
7 #include "VectorMathDecl.h"
8 
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Labels
14  {
16  {
17  int priority;
18  int subPriority;
19  int tiebreakPriority;
20  int lodCount;
21  int currentLod;
22 
23  OcclusionInput(int priority_,
24  int subPriority_,
25  int tiebreakPriority_,
26  int lodCount_,
27  int currentLod_)
28  : priority(priority_)
29  , subPriority(subPriority_)
30  , tiebreakPriority(tiebreakPriority_)
31  , lodCount(lodCount_)
32  , currentLod(currentLod_)
33  {
34 
35  }
36  };
37 
39  {
40  int inputIndex;
41  int lod;
42  float minX;
43  float minY;
44  float maxX;
45  float maxY;
46 
47  OcclusionInputLod(int inputIndex_,
48  int lod_,
49  float minX_,
50  float minY_,
51  float maxX_,
52  float maxY_)
53  : inputIndex(inputIndex_)
54  , lod(lod_)
55  , minX(minX_)
56  , minY(minY_)
57  , maxX(maxX_)
58  , maxY(maxY_)
59  {}
60  };
61 
63  {
64  int inputIndex;
65  int desiredLod;
66 
67  bool IsCompletelyOccluded() const { return desiredLod < 0; }
68 
69  OcclusionResult(int inputIndex_, int desiredLod_)
70  : inputIndex(inputIndex_)
71  , desiredLod(desiredLod_)
72  {
73  }
74  };
75 
77  {
78  public:
80  virtual bool operator()(const OcclusionInputLod& a, const OcclusionInputLod& b) const = 0;
81  };
82 
83  namespace OcclusionResolverMode
84  {
85  enum Type
86  {
87  Never,
88  Always
89  };
90  };
91 
92 
94  {
95  public:
96  typedef std::vector<OcclusionInput> InputListType;
97  typedef std::vector<OcclusionInputLod> InputLodListType;
98  typedef std::vector<OcclusionResult> ResultsListType;
99 
100  virtual ~IOcclusionResolver() {}
101 
102  virtual void Clear() = 0;
103 
104  virtual void Shrink() = 0;
105 
106  virtual void SetMode(OcclusionResolverMode::Type occlusionMode) = 0;
107 
108  virtual void SetScreenDimensions(const v2& screenDimensions) = 0;
109 
110  virtual InputListType& InputList() = 0;
111 
112  virtual InputLodListType& InputLodList() = 0;
113 
114  virtual void Resolve(const IOcclusionIntersectionPredicate& intersectionPredicate) = 0;
115 
116  // only objects that have changed occlusion state are present on results list
117  virtual const ResultsListType& GetResults() const = 0;
118  };
119  }
120 }