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

Revision 1302, 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        /// 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        virtual void EvalPriority() = 0;
29        virtual int Type() const = 0;
30        virtual bool GlobalTerminationCriteriaMet() const = 0;
31
32        /** Set render cost decrease achieved through this split.
33        */
34        void SetRenderCostDecrease(const float renderCostDecr)
35        {
36                mRenderCostDecrease = renderCostDecr;
37        }
38       
39        float GetRenderCostDecrease() const
40        {
41                return mRenderCostDecrease;
42        }
43
44        /** Position in queue.
45        */
46        int GetPosition() const
47        {
48                return mPosition;
49        }
50
51protected:
52
53        /// render cost decrease achieved through this split
54        float mRenderCostDecrease;
55       
56};
57
58
59typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
60
61typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
62}
63
64// FLEXIBLEHEAP_H
65#endif
Note: See TracBrowser for help on using the repository browser.