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

Revision 1473, 1.3 KB checked in by mattausch, 18 years ago (diff)
Line 
1#ifndef SUBDIVISIONCANDIDATE_H
2#define SUBDIVISIONCANDIDATE_H
3
4
5#include "FlexibleHeap.h"
6
7using namespace std;
8
9namespace GtpVisibilityPreprocessor {
10
11/** Candidate for a view space / object space split.
12*/
13class SubdivisionCandidate: public Heapable
14
15public:
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
50protected:
51
52        /// render cost decrease achieved through this split
53        float mRenderCostDecrease;
54       
55};
56
57typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
58typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
59
60}
61
62// FLEXIBLEHEAP_H
63#endif
Note: See TracBrowser for help on using the repository browser.