Ignore:
Timestamp:
02/19/07 02:51:22 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.h

    r2116 r2124  
    88#include "AxisAlignedBox3.h" 
    99#include "Ray.h" 
    10 //#include "ObjectPvs.h" 
    11 //#include "Viewcell.h" 
    12 //#include "VssRay.h" 
    13 //#include "IntersectableWrapper.h" 
    1410 
    1511 
     
    2521class TraversalTree; 
    2622   
    27 //  TraversalTree *SceneTraversalTree; 
    2823 
    2924// -------------------------------------------------------------- 
     
    5550  // max number of rays per node 
    5651  int maxObjectRefs; 
     52  // max number of rays per node 
     53  int totalObjectRefs; 
    5754  // number of dynamically added ray refs 
    5855  int addedRayRefs; 
     
    8380          minCostNodes = 0; 
    8481          maxObjectRefs = 0; 
     82          totalObjectRefs = 0; 
    8583          addedRayRefs = removedRayRefs = 0; 
    8684  } 
     
    121119        } 
    122120 
    123         /** Parent of the node - the parent is a little overhead for maintanance of the tree, 
    124                 but allows various optimizations of tree traversal algorithms  
     121        /** Parent of the node - the parent is a little overhead for  
     122                maintanance of the tree, but allows various optimizations  
     123                of tree traversal algorithms  
    125124        */ 
    126125        TraversalInterior *mParent; 
     
    217216 
    218217        // pointers to view cells contained in this node 
    219         ObjectContainer mObjects; 
     218        ViewCellContainer mViewCells; 
    220219 
    221220        short mDepth; 
     
    237236                float mPriority; 
    238237 
    239                 TraversalData() {} 
     238                TraversalData(): mNode(NULL), mPriority(0), mDepth(0) {} 
    240239 
    241240                TraversalData(TraversalNode *n, const float p): 
    242                 mNode(n), mPriority(p) 
     241                mNode(n), mPriority(p), mDepth(0) 
    243242                {} 
    244243 
    245244                TraversalData(TraversalNode *n, 
    246                         const AxisAlignedBox3 &b, 
    247                         const int d): 
    248                 mNode(n), mBox(b), mDepth(d) {} 
     245                                          const AxisAlignedBox3 &b, 
     246                                          const int d): 
     247                mNode(n), mBox(b), mDepth(d)  
     248                {} 
    249249 
    250250 
     
    255255                         
    256256                        return  
    257                                 leafa->mObjects.size() * mBox.SurfaceArea() 
     257                                leafa->mViewCells.size() * mBox.SurfaceArea() 
    258258                                < 
    259                                 leafb->mObjects.size() * b.mBox.SurfaceArea(); 
     259                                leafb->mViewCells.size() * b.mBox.SurfaceArea(); 
    260260                } 
    261261 
    262262 
    263                         // comparator for the  
    264                         struct less_priority: public  
     263                // comparator for the  
     264                struct less_priority: public  
    265265                                binary_function<const TraversalData, const TraversalData, bool>  
     266                { 
     267                        bool operator()(const TraversalData a, const TraversalData b)  
    266268                        { 
    267                 bool operator()(const TraversalData a, const TraversalData b)  
    268                                 { 
    269                                         return a.mPriority < b.mPriority; 
    270                                 } 
    271             }; 
     269                                return a.mPriority < b.mPriority; 
     270                        } 
     271                }; 
    272272        }; 
    273273 
     
    292292                                                const bool useMailboxing); 
    293293 
    294         virtual bool Construct(); 
     294        virtual bool Construct(const ViewCellContainer &viewCells); 
    295295 
    296296        /** Check whether subdivision criteria are met for the given subtree. 
    297297                If not subdivide the leafs of the subtree. The criteria are specified in 
    298                         the environment as well as the subdivision method. By default surface area 
     298                the environment as well as the subdivision method. By default surface area 
    299299                heuristics is used. 
    300300 
     
    372372                {} 
    373373 
    374                 bool operator<(const SortableEntry &b) const  
     374                /*bool operator<(const SortableEntry &b) const  
    375375                { 
     376                        // view cells usually adjacent  
     377                        if (EpsilonEqual(value, b.value, 0.001)) 
     378                                return (type == BOX_MAX); 
     379                         
    376380                        return value < b.value; 
    377                 } 
     381                }*/ 
    378382        }; 
    379383 
    380384        inline static bool iltS(SortableEntry *a, SortableEntry *b) 
    381385        { 
     386                // view cells usually adjacent  
     387                //if (EpsilonEqual(a->value, b->value)) 
     388                //      return false; 
     389                //      return (a->type == SortableEntry::BOX_MAX); 
     390                         
    382391                return a->value < b->value; 
    383392        } 
     
    409418                                        float &position); 
    410419 
     420        int FindViewCellIntersections(const Vector3 &lStart,  
     421                                                                  const Vector3 &lEnd, 
     422                                                                  const ViewCellContainer &viewCells, 
     423                                                                  ViewCellContainer &hitViewCells, 
     424                                                                  const bool useMailboxing); 
    411425 
    412426        //////////////////////// 
Note: See TracChangeset for help on using the changeset viewer.