[1239] | 1 | #ifndef SUBDIVISIONCANDIDATE_H
|
---|
| 2 | #define SUBDIVISIONCANDIDATE_H
|
---|
[1237] | 3 |
|
---|
[1239] | 4 |
|
---|
[1237] | 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 |
|
---|
[1305] | 21 | virtual ~SubdivisionCandidate() {};
|
---|
[1237] | 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 | */
|
---|
[1473] | 28 | inline void SetRenderCostDecrease(const float renderCostDecr)
|
---|
[1237] | 29 | {
|
---|
| 30 | mRenderCostDecrease = renderCostDecr;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
[1473] | 33 | inline float GetRenderCostDecrease() const
|
---|
[1237] | 34 | {
|
---|
| 35 | return mRenderCostDecrease;
|
---|
| 36 | }
|
---|
| 37 |
|
---|
[1297] | 38 | /** Position in queue.
|
---|
| 39 | */
|
---|
| 40 | int GetPosition() const
|
---|
| 41 | {
|
---|
| 42 | return mPosition;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
[1473] | 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 |
|
---|
[1237] | 50 | protected:
|
---|
| 51 |
|
---|
| 52 | /// render cost decrease achieved through this split
|
---|
| 53 | float mRenderCostDecrease;
|
---|
| 54 |
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 | typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
|
---|
[1259] | 58 | typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
|
---|
[1313] | 59 |
|
---|
[1237] | 60 | }
|
---|
| 61 |
|
---|
| 62 | // FLEXIBLEHEAP_H
|
---|
| 63 | #endif
|
---|