[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 |
|
---|
| 28 | /*SubdivisionCandidate(const AxisAlignedPlane &plane):
|
---|
| 29 | mSplitPlane(plane), mRenderCostDecrease(0)
|
---|
| 30 | {}*/
|
---|
| 31 |
|
---|
| 32 | virtual void EvalPriority() = 0;
|
---|
| 33 | virtual int Type() const = 0;
|
---|
| 34 | virtual bool GlobalTerminationCriteriaMet() const = 0;
|
---|
| 35 |
|
---|
| 36 | /** Set render cost decrease achieved through this split.
|
---|
| 37 | */
|
---|
| 38 | void SetRenderCostDecrease(const float renderCostDecr)
|
---|
| 39 | {
|
---|
| 40 | mRenderCostDecrease = renderCostDecr;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | float GetRenderCostDecrease() const
|
---|
| 44 | {
|
---|
| 45 | return mRenderCostDecrease;
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | protected:
|
---|
| 49 |
|
---|
| 50 | /// render cost decrease achieved through this split
|
---|
| 51 | float mRenderCostDecrease;
|
---|
| 52 |
|
---|
| 53 | };
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
|
---|
| 57 |
|
---|
[1259] | 58 | typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
|
---|
[1237] | 59 | }
|
---|
| 60 |
|
---|
| 61 | // FLEXIBLEHEAP_H
|
---|
| 62 | #endif
|
---|