source: branches/VUT/DummyModules/GtpVisibilityPreprocessor/include/ViewCellBSP.h @ 68

Revision 68, 1.8 KB checked in by bittner, 20 years ago (diff)

Added include files

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