1 | #ifndef SUBDIVISIONCANDIDATE_H
|
---|
2 | #define SUBDIVISIONCANDIDATE_H
|
---|
3 |
|
---|
4 |
|
---|
5 | #include "FlexibleHeap.h"
|
---|
6 |
|
---|
7 | using namespace std;
|
---|
8 |
|
---|
9 | namespace GtpVisibilityPreprocessor {
|
---|
10 |
|
---|
11 | /** Candidate for a view space / object space split.
|
---|
12 | */
|
---|
13 | class SubdivisionCandidate: public Heapable
|
---|
14 | {
|
---|
15 | public:
|
---|
16 |
|
---|
17 | enum {OBJECT_SPACE, VIEW_SPACE};
|
---|
18 |
|
---|
19 | SubdivisionCandidate(): mRenderCostDecrease(0) {};
|
---|
20 |
|
---|
21 | virtual ~SubdivisionCandidate() {};
|
---|
22 | virtual void EvalPriority() = 0;
|
---|
23 | virtual int Type() const = 0;
|
---|
24 | virtual bool GlobalTerminationCriteriaMet() const = 0;
|
---|
25 |
|
---|
26 | /** Set render cost decrease achieved through this split.
|
---|
27 | */
|
---|
28 | inline void SetRenderCostDecrease(const float renderCostDecr)
|
---|
29 | {
|
---|
30 | mRenderCostDecrease = renderCostDecr;
|
---|
31 | }
|
---|
32 |
|
---|
33 | inline float GetRenderCostDecrease() const
|
---|
34 | {
|
---|
35 | return mRenderCostDecrease;
|
---|
36 | }
|
---|
37 |
|
---|
38 | /** Position in queue.
|
---|
39 | */
|
---|
40 | int GetPosition() const
|
---|
41 | {
|
---|
42 | return mPosition;
|
---|
43 | }
|
---|
44 |
|
---|
45 | /// split axis of this plane (0, 1, 2, or 3 if non-axis-aligned)
|
---|
46 | int mSplitAxis;
|
---|
47 | /// the number of misses of max cost ratio until this split
|
---|
48 | int mMaxCostMisses;
|
---|
49 |
|
---|
50 | protected:
|
---|
51 |
|
---|
52 | /// render cost decrease achieved through this split
|
---|
53 | float mRenderCostDecrease;
|
---|
54 |
|
---|
55 | };
|
---|
56 |
|
---|
57 | typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
|
---|
58 | typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
|
---|
59 |
|
---|
60 | }
|
---|
61 |
|
---|
62 | // FLEXIBLEHEAP_H
|
---|
63 | #endif
|
---|