Changeset 2198 for GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
- Timestamp:
- 03/06/07 17:37:28 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r2187 r2198 775 775 bool computeSplitPlane) 776 776 { 777 m EvalTimer.Entry();777 mPlaneTimer.Entry(); 778 778 779 779 if (computeSplitPlane) … … 796 796 } 797 797 798 mPlaneTimer.Exit(); 799 800 mEvalTimer.Entry(); 801 798 802 VspLeaf *leaf = static_cast<VspLeaf *>(splitCandidate.mParentData.mNode); 799 803 … … 1112 1116 } 1113 1117 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()); 1116 1122 1117 1123 mSortTimer.Exit(); … … 2552 2558 ViewCell *VspTree::GetViewCell(const Vector3 &point, const bool active) 2553 2559 { 2554 if ( mRoot == NULL)2560 if (!mRoot) 2555 2561 return NULL; 2556 2562 … … 2590 2596 } 2591 2597 2598 // return active or leaf view cell 2592 2599 if (active) 2593 2600 { … … 2785 2792 const AxisAlignedBox3 bbox = GetBoundingBox(node); 2786 2793 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()) 2793 2801 { 2794 2795 2802 leaf->GetViewCell()->Mail(); 2803 viewCells.push_back(leaf->GetViewCell()); 2796 2804 } 2797 2805 } 2798 2799 { 2800 2801 2802 2803 2804 2805 2806 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); 2807 2815 } 2808 2816 } … … 2852 2860 void VspTree::GetViewCells(const VssRay &ray, ViewCellContainer &viewCells) 2853 2861 { 2862 mViewCellsTimer.Entry(); 2863 2854 2864 static Ray hray; 2855 2865 hray.Init(ray); … … 2863 2873 const Vector3 termination = hray.Extrap(tmax); 2864 2874 2865 // view cells were not precomputed 2866 // don't mail because we need mailboxing for something else2875 // 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 2867 2877 CastLineSegment(origin, termination, viewCells, false); 2878 2879 mViewCellsTimer.Exit(); 2868 2880 } 2869 2881
Note: See TracChangeset
for help on using the changeset viewer.