#ifndef _ViewCellBsp_H__ #define _ViewCellBsp_H__ #include "Containers.h" class ViewCell; class Plane3; namespace GtpVisibilityPreprocessor { class BspInterior; /** BspNode abstract class serving for interior and leaf node implementation */ class BspNode { public: /** Determines whether this node is a leaf or not @return true if leaf */ virtual bool IsLeaf() const = 0; /** Determines whether this node is a root @return true if root */ virtual bool IsRoot() const; protected: /// parent of this node BspInterior *mParent; }; /** BSP interior node implementation */ class BspInterior : public BspNode { /** @return false since it is an interior node */ bool IsLeaf() const; protected: /// Splitting plane corresponding to this node Plane3 mPlane; /// back node BspNode *mBack; /// front node BspNode *mFront; }; /** BSP leaf node implementation. */ class BspLeaf : public BspNode { public: BspLeaf(ViewCell *viewCell = NULL); /** @return true since it is an interior node */ virtual bool IsLeaf(); protected: /// polygonal representation of this viewcell /// if NULL this note does not correspond to feasible viewcell ViewCell *mViewCell; }; /** Implementation of the ViewCell BSP tree. */ class BspTree { public: /** Default constructor. */ BspTree(); protected: /// Pointer to the root of the tree BspNode *mRoot; /// Pointer to the root cell of the viewspace */ ViewCell *mRootCell; }; }; // GtpVisibilityPreprocessor #endif