source: GTP/trunk/Lib/Vis/Preprocessing/src/SubdivisionCandidate.h @ 1237

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