00001 #ifndef _ViewCellBsp_H__ 00002 #define _ViewCellBsp_H__ 00003 00004 namespace GtpVisibilityPreprocessor { 00005 00006 00007 class BSPInterior; 00008 00012 class BSPNode { 00013 public: 00017 virtual bool IsLeaf() const = 0; 00018 00022 virtual bool IsRoot() const { 00023 return parent == NULL; 00024 } 00025 protected: 00027 BSPInterior *parent; 00028 }; 00029 00031 class BSPInterior : public BSPNode { 00032 00034 virtual bool IsLeaf() const { return false; } 00035 00036 protected: 00038 Plane3 mPlane; 00040 BSPNode *mBack; 00042 BSPNode *mFront; 00043 }; 00044 00045 00047 class BSPLeaf : public BSPNode { 00048 public: 00049 BSPLeaf(ViewCell *viewCell = NULL):mViewCell(viewCell) {} 00051 virtual bool IsLeaf() const { return true; } 00052 00053 protected: 00056 ViewCell *mViewCell; 00057 }; 00058 00060 class BSPTree { 00061 public: 00064 BSPTree(ViewCell *cell) { 00065 mRootCell = cell; 00066 mRoot = new BSPLeaf(mRootCell); 00067 } 00068 00069 00070 protected: 00072 BSPNode *mRoot; 00074 ViewCell *mRootCell; 00075 }; 00076 00077 }; 00078 00079 00080 00081 #endif