source: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBSP.h @ 190

Revision 190, 1.6 KB checked in by mattausch, 19 years ago (diff)

started bspviecells

Line 
1#ifndef _ViewCellBsp_H__
2#define _ViewCellBsp_H__
3
4class ViewCell;
5class Plane3;
6
7//namespace GtpVisibilityPreprocessor {
8 
9  class BSPInterior;
10
11  /**
12     BSPNode abstract class serving for interior and leaf node implementation
13  */
14  class BSPNode
15  {
16  public:
17    /** Determines whether this node is a leaf or not
18        @return true if leaf
19    */
20    virtual bool IsLeaf() const = 0;
21   
22    /** Determines whether this node is a root
23        @return true if root
24    */
25    virtual bool IsRoot() const;
26
27  protected:
28    /// parent of this node
29    BSPInterior *mParent;
30  };
31
32  /** BSP interior node implementation */
33  class BSPInterior : public BSPNode
34  {   
35    /** @return false since it is an interior node */
36    bool IsLeaf() const;
37
38  protected:
39    /// Splitting plane corresponding to this node
40    Plane3 mPlane;
41    /// back node
42    BSPNode *mBack;
43    /// front node
44    BSPNode *mFront;
45  };
46 
47 
48  /** BSP leaf node implementation */
49  class BSPLeaf : public BSPNode
50  {
51  public:
52        BSPLeaf(ViewCell *viewCell = NULL);
53   
54        /** @return true since it is an interior node */
55    bool IsLeaf() const;
56
57  protected:
58    /// polygonal representation of this viewcell
59    /// if NULL this note does not correspond to feasible viewcell
60    ViewCell *mViewCell;
61  };
62 
63  /** Implementation of the ViewCell BSP tree */
64  class BSPTree
65  {
66  public:
67    /** Constructor takes a pointer to the cell corresponding to the whole
68        viewspace */
69    BSPTree(ViewCell *cell);
70       
71  protected:
72    /// Pointer to the root of the tree
73    BSPNode *mRoot;
74    /// Pointer to the root cell of the viewspace */
75        ViewCell *mRootCell;
76  };
77 
78//}; // GtpVisibilityPreprocessor
79
80#endif
Note: See TracBrowser for help on using the repository browser.