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

Revision 1313, 1.3 KB checked in by mattausch, 18 years ago (diff)
RevLine 
[1239]1#ifndef SUBDIVISIONCANDIDATE_H
2#define SUBDIVISIONCANDIDATE_H
[1237]3
[1239]4
[1237]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
[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]52protected:
53
54        /// render cost decrease achieved through this split
55        float mRenderCostDecrease;
56       
57};
58
59typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue;
[1259]60typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;
[1313]61
[1237]62}
63
64// FLEXIBLEHEAP_H
65#endif
Note: See TracBrowser for help on using the repository browser.