Changeset 189 for trunk/VUT/GtpVisibilityPreprocessor/include
- Timestamp:
- 08/01/05 17:37:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/include/ViewCellBSP.h
r68 r189 2 2 #define _ViewCellBsp_H__ 3 3 4 class ViewCell; 5 class Plane3; 6 4 7 namespace GtpVisibilityPreprocessor { 5 6 8 7 9 class BSPInterior; … … 10 12 BSPNode abstract class serving for interior and leaf node implementation 11 13 */ 12 class BSPNode { 14 class BSPNode 15 { 13 16 public: 14 17 /** Determines whether this node is a leaf or not … … 20 23 @return true if root 21 24 */ 22 virtual bool IsRoot() const { 23 return parent == NULL; 24 } 25 virtual bool IsRoot(); 26 25 27 protected: 26 28 /// parent of this node 27 BSPInterior * parent;29 BSPInterior *mParent; 28 30 }; 29 31 30 32 /** BSP interior node implementation */ 31 class BSPInterior : public BSPNode {32 33 class BSPInterior : public BSPNode 34 { 33 35 /** @return false since it is an interior node */ 34 virtual bool IsLeaf() const { return false; }36 bool IsLeaf() const; 35 37 36 38 protected: … … 45 47 46 48 /** BSP leaf node implementation */ 47 class BSPLeaf : public BSPNode { 49 class BSPLeaf : public BSPNode 50 { 48 51 public: 49 BSPLeaf(ViewCell *viewCell = NULL):mViewCell(viewCell) {}50 52 /** @return true since it is an interior node */ 51 virtual bool IsLeaf() const { return true; }53 virtual bool IsLeaf(); 52 54 53 55 protected: … … 58 60 59 61 /** Implementation of the ViewCell BSP tree */ 60 class BSPTree { 62 class BSPTree 63 { 61 64 public: 62 65 /** Constructor takes a pointer to the cell corresponding to the whole 63 66 viewspace */ 64 BSPTree(ViewCell *cell) { 65 mRootCell = cell; 66 mRoot = new BSPLeaf(mRootCell); 67 } 68 69 67 BSPTree(ViewCell *cell); 68 70 69 protected: 71 70 /// Pointer to the root of the tree … … 75 74 }; 76 75 77 }; 78 79 76 }; // GtpVisibilityPreprocessor 80 77 81 78 #endif
Note: See TracChangeset
for help on using the changeset viewer.