source: GTP/trunk/App/Demos/Illum/pathmap/MergeTree.h @ 2197

Revision 2197, 984 bytes checked in by szirmay, 18 years ago (diff)
RevLine 
[2197]1#pragma once
2#include "Occluder.hpp"
3#include "Heap.hpp"
4
5#define MERGETREELEAFNODE 55
6
7class MergeTree
8{
9        Occluder* occluders;
10        unsigned short nOccluders;
11        unsigned short* locations;
12
13        Heap<unsigned short> freeNodes;
14        class Node{
15                public:
16                char type; //0 - x, 1 - y, 2 - z, 55 - leaf
17                unsigned short parent;
18                union{
19                        struct{
20                                float cut;
21                                unsigned short left;
22                                unsigned short right;
23                        };
24                        unsigned short occluderIndex;
25                };
26        }       *pool;
27        unsigned short nAllocated;
28        unsigned short poolSize;
29
30        float maxR;
31
32public:
33        bool verify(unsigned short p, float minx, float maxx, float miny, float maxy, float minz, float maxz);
34
35        MergeTree(unsigned short nOccluders, Occluder* accArray);
36        ~MergeTree(void);
37        void insert(unsigned short index);
38        void remove(unsigned short index);
39
40        unsigned short indexOfCandidate;
41        float minCost;
42        unsigned short minMerger;
43        void searchOptimalMerger(unsigned short p);
44
45        bool foundMyselfAllRight;
46};
Note: See TracBrowser for help on using the repository browser.