Changeset 221 for trunk/VUT


Ignore:
Timestamp:
08/08/05 14:39:15 (19 years ago)
Author:
mattausch
Message:

changed notation for bsp trees

Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/include/Preprocessor.h

    r74 r221  
    6868    SceneGraph *mSceneGraph; 
    6969    /// BSP tree representing the viewcells 
    70     BSPTree *mViewCellBSPTree; 
     70    BspTree *mViewCellBspTree; 
    7171    /// kD-tree organizing the scene graph (occluders + occludees) + viewcells 
    7272    KdTree *mKdTree; 
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj

    r219 r221  
    256256                        </File> 
    257257                        <File 
    258                                 RelativePath="..\src\ViewCellBSP.h"> 
     258                                RelativePath="..\src\ViewCellBsp.h"> 
    259259                        </File> 
    260260                        <File 
     
    315315                        </File> 
    316316                        <File 
    317                                 RelativePath="..\include\ViewCellBSP.h"> 
     317                                RelativePath="..\include\ViewCellBsp.h"> 
    318318                        </File> 
    319319                </Filter> 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h

    r176 r221  
    7979  SceneGraph *mSceneGraph; 
    8080  /// BSP tree representing the viewcells 
    81   BSPTree *mViewCellBSPTree; 
     81  BspTree *mViewCellBspTree; 
    8282  /// kD-tree organizing the scene graph (occluders + occludees) + viewcells 
    8383  KdTree *mKdTree; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Rectangle3.h

    r209 r221  
    3838        Rectangle3 &r1, 
    3939        Rectangle3 &r2 
    40         ) const; 
     40        ) const 
    4141 
    42          
     42  {//TODO 
     43  } 
    4344   
    4445}; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h

    r220 r221  
    66//namespace GtpVisibilityPreprocessor { 
    77   
    8 class BSPInterior; 
     8class BspInterior; 
    99class BspPvs; 
    1010/** 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r202 r221  
    88//namespace GtpVisibilityPreprocessor { 
    99/****************************************************************/ 
    10 /*                  class BSPNode implementation                */ 
     10/*                  class BspNode implementation                */ 
    1111/****************************************************************/ 
    12 bool BSPNode::IsRoot() const  
     12bool BspNode::IsRoot() const  
    1313{ 
    1414        return mParent == NULL; 
     
    1616 
    1717/****************************************************************/ 
    18 /*              class BSPInterior implementation                */ 
     18/*              class BspInterior implementation                */ 
    1919/****************************************************************/ 
    2020 
    21 bool BSPInterior::IsLeaf() const 
     21bool BspInterior::IsLeaf() const 
    2222{  
    2323        return false;  
    2424} 
    2525 
    26 void BSPInterior::ReplaceChildLink(BSPNode *oldChild, BSPNode *newChild)  
     26void BspInterior::ReplaceChildLink(BspNode *oldChild, BspNode *newChild)  
    2727{ 
    2828        if (mBack == oldChild) 
     
    3636} 
    3737 
    38 void BSPInterior::SetupChildLinks(BSPNode *b, BSPNode *f)  
     38void BspInterior::SetupChildLinks(BspNode *b, BspNode *f)  
    3939{ 
    4040    mBack = b; 
     
    4343 
    4444/****************************************************************/ 
    45 /*                  class BSPLeaf implementation                */ 
     45/*                  class BspLeaf implementation                */ 
    4646/****************************************************************/ 
    4747 
    48 BSPLeaf::BSPLeaf(ViewCell *viewCell): mViewCell(viewCell)  
     48BspLeaf::BspLeaf(ViewCell *viewCell): mViewCell(viewCell)  
    4949{ 
    5050} 
    5151 
    52 bool BSPLeaf::IsLeaf() const  
     52bool BspLeaf::IsLeaf() const  
    5353{  
    5454        return true;  
     
    5656 
    5757/****************************************************************/ 
    58 /*                  class BSPTree implementation                */ 
     58/*                  class BspTree implementation                */ 
    5959/****************************************************************/ 
    6060 
    61 BSPTree::BSPTree(ViewCell *cell)  
     61BspTree::BspTree(ViewCell *cell)  
    6262{ 
    6363        mRootCell = cell; 
    64         mRoot = new BSPLeaf(mRootCell); 
     64        mRoot = new BspLeaf(mRootCell); 
    6565} 
    6666 
    6767   
    68 void BSPTree::Subdivide() 
     68void BspTree::Subdivide() 
    6969{ 
    70         BSPNode *currentNode = mRoot; 
     70        BspNode *currentNode = mRoot; 
    7171   
    72         std::stack<BSPTraversalData> tStack; 
     72        std::stack<BspTraversalData> tStack; 
    7373        //  stack<STraversalData> tStack; 
    7474 
     
    7777        while (!tStack.empty())  
    7878        { 
    79             BSPTraversalData data = tStack.top(); 
     79            BspTraversalData data = tStack.top(); 
    8080            tStack.pop(); 
    8181     
     
    8383                Mesh frontPolys; 
    8484 
    85                 BSPNode *node = SubdivideNode(dynamic_cast<BSPLeaf *>(data.mNode), 
     85                BspNode *node = SubdivideNode(dynamic_cast<BspLeaf *>(data.mNode), 
    8686                                                                          data.mParent, 
    8787                                                                          &data.mViewCell, 
     
    9292                if (!node->IsLeaf()) 
    9393                { 
    94                         BSPInterior *interior = dynamic_cast<BSPInterior *>(node); 
     94                        BspInterior *interior = dynamic_cast<BspInterior *>(node); 
    9595 
    9696                        // push the children on the stack 
    9797                        if (interior->GetBack()) 
    98                                 tStack.push(BSPTraversalData(interior->GetBack(), interior, backPolys, data.mDepth+1)); 
     98                                tStack.push(BspTraversalData(interior->GetBack(), interior, backPolys, data.mDepth+1)); 
    9999                        if (interior->GetFront()) 
    100                                 tStack.push(BSPTraversalData(interior->GetFront(), interior, frontPolys, data.mDepth+1)); 
     100                                tStack.push(BspTraversalData(interior->GetFront(), interior, frontPolys, data.mDepth+1)); 
    101101                } 
    102102        } 
    103103} 
    104104 
    105 Plane3 *BSPTree::SelectPlane(Mesh *viewcell) 
     105Plane3 *BspTree::SelectPlane(Mesh *viewcell) 
    106106{ 
    107107        return &viewcell->GetFacePlane(0); 
    108108} 
    109109 
    110 BSPNode *BSPTree::SubdivideNode(BSPLeaf *leaf, BSPInterior *parent,  
     110BspNode *BspTree::SubdivideNode(BspLeaf *leaf, BspInterior *parent,  
    111111                                                                Mesh *viewCell, const int depth,  
    112112                                                                Mesh &frontPolys, Mesh &backPolys) 
     
    119119        // add the new nodes to the tree + select subdivision plane 
    120120        Plane3 *plane = SelectPlane(viewCell); 
    121         BSPInterior *node = new BSPInterior(*plane); // ERROR!! 
     121        BspInterior *node = new BspInterior(*plane); // ERROR!! 
    122122   
    123123 
     
    128128        } 
    129129   
    130         BSPLeaf *back = new BSPLeaf(mRootCell); 
    131         BSPLeaf *front = new BSPLeaf(mRootCell); 
     130        BspLeaf *back = new BspLeaf(mRootCell); 
     131        BspLeaf *front = new BspLeaf(mRootCell); 
    132132 
    133133        // replace a link from node's parent 
Note: See TracChangeset for help on using the changeset viewer.