[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 | /// the current split plane
|
---|
| 20 | //AxisAlignedPlane mSplitPlane;
|
---|
| 21 | /// split axis of this plane (0, 1, 2, or 3 if non-axis-aligned)
|
---|
| 22 | int mSplitAxis;
|
---|
| 23 | /// the number of misses of max cost ratio until this split
|
---|
| 24 | int mMaxCostMisses;
|
---|
| 25 |
|
---|
| 26 | SubdivisionCandidate(): mRenderCostDecrease(0) {};
|
---|
| 27 |
|
---|
[1305] | 28 | virtual ~SubdivisionCandidate() {};
|
---|
[1237] | 29 | virtual void EvalPriority() = 0;
|
---|
| 30 | virtual int Type() const = 0;
|
---|
| 31 | virtual bool GlobalTerminationCriteriaMet() const = 0;
|
---|
| 32 |
|
---|
| 33 | /** Set render cost decrease achieved through this split.
|
---|
| 34 | */
|
---|
| 35 | void SetRenderCostDecrease(const float renderCostDecr)
|
---|
| 36 | {
|
---|
| 37 | mRenderCostDecrease = renderCostDecr;
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | float GetRenderCostDecrease() const
|
---|
| 41 | {
|
---|
| 42 | return mRenderCostDecrease;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
[1297] | 45 | /** Position in queue.
|
---|
| 46 | */
|
---|
| 47 | int GetPosition() const
|
---|
| 48 | {
|
---|
| 49 | return mPosition;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
[1237] | 52 | protected:
|
---|
| 53 |
|
---|
| 54 | /// render cost decrease achieved through this split
|
---|
| 55 | float mRenderCostDecrease;
|
---|
| 56 |
|
---|
| 57 | };
|
---|
| 58 |
|
---|
| 59 | typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
|
---|
[1259] | 60 | typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
|
---|
[1313] | 61 |
|
---|
[1237] | 62 | }
|
---|
| 63 |
|
---|
| 64 | // FLEXIBLEHEAP_H
|
---|
| 65 | #endif
|
---|