Ignore:
Timestamp:
03/06/07 17:37:28 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r2187 r2198  
    775775                                                                           bool computeSplitPlane) 
    776776{ 
    777         mEvalTimer.Entry(); 
     777        mPlaneTimer.Entry(); 
    778778 
    779779        if (computeSplitPlane) 
     
    796796        } 
    797797         
     798        mPlaneTimer.Exit(); 
     799 
     800        mEvalTimer.Entry(); 
     801 
    798802        VspLeaf *leaf = static_cast<VspLeaf *>(splitCandidate.mParentData.mNode); 
    799803 
     
    11121116        } 
    11131117 
    1114         stable_sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end()); 
    1115         //sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end()); 
     1118        if (1) 
     1119                stable_sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end()); 
     1120        else 
     1121                sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end()); 
    11161122 
    11171123        mSortTimer.Exit(); 
     
    25522558ViewCell *VspTree::GetViewCell(const Vector3 &point, const bool active) 
    25532559{ 
    2554         if (mRoot == NULL) 
     2560        if (!mRoot) 
    25552561                return NULL; 
    25562562 
     
    25902596        } 
    25912597   
     2598        // return active or leaf view cell 
    25922599        if (active) 
    25932600        { 
     
    27852792                const AxisAlignedBox3 bbox = GetBoundingBox(node); 
    27862793 
    2787                 if (Overlap(bbox, box)) { 
    2788                   if (node->IsLeaf()) 
    2789                         { 
    2790                           VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    2791                            
    2792                           if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 
     2794                if (Overlap(bbox, box))  
     2795                { 
     2796                        if (node->IsLeaf()) 
     2797                        { 
     2798                                VspLeaf *leaf = static_cast<VspLeaf *>(node); 
     2799 
     2800                                if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 
    27932801                                { 
    2794                                   leaf->GetViewCell()->Mail(); 
    2795                                   viewCells.push_back(leaf->GetViewCell()); 
     2802                                        leaf->GetViewCell()->Mail(); 
     2803                                        viewCells.push_back(leaf->GetViewCell()); 
    27962804                                } 
    27972805                        } 
    2798                   else  
    2799                         { 
    2800                           VspInterior *interior = static_cast<VspInterior *>(node); 
    2801                            
    2802                           VspNode *first = interior->GetFront(); 
    2803                           VspNode *second = interior->GetBack(); 
    2804                            
    2805                           nodeStack.push(first); 
    2806                           nodeStack.push(second); 
     2806                        else  
     2807                        { 
     2808                                VspInterior *interior = static_cast<VspInterior *>(node); 
     2809 
     2810                                VspNode *first = interior->GetFront(); 
     2811                                VspNode *second = interior->GetBack(); 
     2812 
     2813                                nodeStack.push(first); 
     2814                                nodeStack.push(second); 
    28072815                        } 
    28082816                } 
     
    28522860void VspTree::GetViewCells(const VssRay &ray, ViewCellContainer &viewCells) 
    28532861{ 
     2862        mViewCellsTimer.Entry(); 
     2863         
    28542864        static Ray hray; 
    28552865        hray.Init(ray); 
     
    28632873        const Vector3 termination = hray.Extrap(tmax); 
    28642874 
    2865         // view cells were not precomputed 
    2866         // don't mail because we need mailboxing for something else 
     2875        // view cells were not precomputed and are extracted on the fly 
     2876        // don't mail because the same view cells can be found for different rays 
    28672877        CastLineSegment(origin, termination, viewCells, false); 
     2878 
     2879        mViewCellsTimer.Exit(); 
    28682880} 
    28692881 
Note: See TracChangeset for help on using the changeset viewer.