Changeset 1122 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 07/12/06 01:30:05 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1108 r1122 91 91 mBox.Include((*mi)->GetBox()); 92 92 } 93 94 ProcessLeafObjects(NULL, leaf, NULL);95 93 96 94 cout <<"KdTree Root Box:"<<mBox<<endl; … … 307 305 mStat.objectRefs += objectsBack + objectsFront; 308 306 } 309 310 ProcessLeafObjects(leaf, front, back);311 312 307 313 308 delete leaf; … … 1094 1089 1095 1090 1096 void KdTree::ProcessLeafObjects(KdLeaf *parent, KdLeaf *front, KdLeaf *back) const 1097 { 1098 if (parent) 1099 { 1100 // remove the parents from the set 1101 ObjectContainer::const_iterator oit, oit_end = parent->mObjects.end(); 1102 1103 for (oit = parent->mObjects.begin(); oit != oit_end; ++ oit) 1104 { 1105 Intersectable *object = *oit; 1106 1107 set<KdLeaf *>::iterator kdit = object->mKdLeaves.find(parent); 1108 1109 // remove parent leaf 1110 if (kdit != object->mKdLeaves.end()) 1111 object->mKdLeaves.erase(kdit); 1112 } 1113 } 1114 1115 //Intersectable::NewMail(); 1116 1117 if (front) 1118 { 1119 // Add front to leaf kd cells 1120 ObjectContainer::const_iterator oit, oit_end = front->mObjects.end(); 1121 1122 for (oit = front->mObjects.begin(); oit != oit_end; ++ oit) 1123 { 1124 Intersectable *object = *oit; 1125 object->mKdLeaves.insert(front); 1126 } 1127 } 1128 1129 if (back) 1130 { 1131 // Add back to leaf kd cells 1132 ObjectContainer::const_iterator oit, oit_end = back->mObjects.end(); 1133 1134 for (oit = back->mObjects.begin(); oit != oit_end; ++ oit) 1135 { 1136 Intersectable *object = *oit; 1137 object->mKdLeaves.insert(back); 1138 } 1139 } 1140 1141 // note: can find out about multiple objects only now after adding and deleting 1142 // finished 1143 if (front) 1144 { 1145 // find objects from multiple kd-leaves 1146 ObjectContainer::const_iterator oit, oit_end = front->mObjects.end(); 1147 1148 for (oit = front->mObjects.begin(); oit != oit_end; ++ oit) 1149 { 1150 Intersectable *object = *oit; 1151 1152 if (object->mKdLeaves.size() > 1) 1153 front->mMultipleObjects.push_back(object); 1154 } 1155 } 1156 1157 if (back) 1158 { 1159 // find objects from multiple kd-leaves 1160 ObjectContainer::const_iterator oit, oit_end = back->mObjects.end(); 1161 1162 for (oit = back->mObjects.begin(); oit != oit_end; ++ oit) 1163 { 1164 Intersectable *object = *oit; 1165 1166 if (object->mKdLeaves.size() > 1) 1167 back->mMultipleObjects.push_back(object); 1168 } 1169 } 1170 1171 } 1172 1173 1174 } 1091 } -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h
r1121 r1122 541 541 542 542 543 /** does some post processing on the objects in the new child leaves.544 */545 void ProcessLeafObjects(KdLeaf *parent, KdLeaf *front, KdLeaf *back) const;546 547 543 int mTermMaxNodes; 548 544 float mSplitBorder; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1121 r1122 2695 2695 } 2696 2696 2697 // only for debugging : test valitidy2698 TestSubdivision();2697 // only for debugging purpose: test if the subdivision is valid 2698 if (0) TestSubdivision(); 2699 2699 2700 2700 mColorCode = savedColorCode; … … 3946 3946 3947 3947 // only for debugging purpose: test if the subdivision is valid 3948 TestSubdivision();3948 if (0) TestSubdivision(); 3949 3949 3950 3950 //-- refines the merged view cells … … 4901 4901 long startTime; 4902 4902 4903 mHierarchyManager->Construct2(constructionRays, objects, &mViewSpaceBox);4904 4903 //mHierarchyManager->Construct2(constructionRays, objects, &mViewSpaceBox); 4904 mHierarchyManager->Construct(constructionRays, objects, &mViewSpaceBox); 4905 4905 4906 4906 //-- stats -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1121 r1122 2826 2826 SplitObjects(splitPlane, leaf->mObjects, front->mObjects, back->mObjects); 2827 2827 2828 ProcessLeafObjects(back, leaf); 2829 ProcessLeafObjects(front, leaf); 2830 2828 ProcessLeafObjects(leaf, front, back); 2829 2831 2830 backData.mNode = back; 2832 2831 frontData.mNode = front; … … 3408 3407 3409 3408 3410 void OspTree::ProcessLeafObjects(KdLeaf *leaf, KdLeaf *parent) const 3411 { 3412 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 3413 3414 for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 3415 { 3416 Intersectable *object = *oit; 3417 3418 if (parent) 3419 { 3409 void OspTree::ProcessLeafObjects(KdLeaf *parent, KdLeaf *front, KdLeaf *back) const 3410 { 3411 if (parent) 3412 { 3413 // remove the parents from the set 3414 ObjectContainer::const_iterator oit, oit_end = parent->mObjects.end(); 3415 3416 for (oit = parent->mObjects.begin(); oit != oit_end; ++ oit) 3417 { 3418 Intersectable *object = *oit; 3419 3420 3420 set<KdLeaf *>::iterator kdit = object->mKdLeaves.find(parent); 3421 3421 … … 3424 3424 object->mKdLeaves.erase(kdit); 3425 3425 } 3426 3427 object->mKdLeaves.insert(leaf); 3428 3429 if (object->mKdLeaves.size() > 1) 3430 leaf->mMultipleObjects.push_back(object); 3431 } 3426 } 3427 3428 //Intersectable::NewMail(); 3429 3430 if (front) 3431 { 3432 // Add front to leaf kd cells 3433 ObjectContainer::const_iterator oit, oit_end = front->mObjects.end(); 3434 3435 for (oit = front->mObjects.begin(); oit != oit_end; ++ oit) 3436 { 3437 Intersectable *object = *oit; 3438 object->mKdLeaves.insert(front); 3439 } 3440 } 3441 3442 if (back) 3443 { 3444 // Add back to leaf kd cells 3445 ObjectContainer::const_iterator oit, oit_end = back->mObjects.end(); 3446 3447 for (oit = back->mObjects.begin(); oit != oit_end; ++ oit) 3448 { 3449 Intersectable *object = *oit; 3450 object->mKdLeaves.insert(back); 3451 } 3452 } 3453 3454 // note: can find out about multiple objects only now after adding and deleting 3455 // finished 3456 if (front) 3457 { 3458 // find objects from multiple kd-leaves 3459 ObjectContainer::const_iterator oit, oit_end = front->mObjects.end(); 3460 3461 for (oit = front->mObjects.begin(); oit != oit_end; ++ oit) 3462 { 3463 Intersectable *object = *oit; 3464 3465 if (object->mKdLeaves.size() > 1) 3466 front->mMultipleObjects.push_back(object); 3467 } 3468 } 3469 3470 if (back) 3471 { 3472 // find objects from multiple kd-leaves 3473 ObjectContainer::const_iterator oit, oit_end = back->mObjects.end(); 3474 3475 for (oit = back->mObjects.begin(); oit != oit_end; ++ oit) 3476 { 3477 Intersectable *object = *oit; 3478 3479 if (object->mKdLeaves.size() > 1) 3480 back->mMultipleObjects.push_back(object); 3481 } 3482 } 3483 3432 3484 } 3433 3485 … … 3702 3754 3703 3755 3704 mOspTree.ProcessLeafObjects( kdleaf, NULL);3756 mOspTree.ProcessLeafObjects(NULL, kdleaf, NULL); 3705 3757 3706 3758 // compute first split candidate -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
r1121 r1122 1439 1439 ObjectContainer &back); 1440 1440 1441 void ProcessLeafObjects(KdLeaf *leaf, KdLeaf *parent) const; 1441 /** does some post processing on the objects in the new child leaves. 1442 */ 1443 void ProcessLeafObjects(KdLeaf *parent, KdLeaf *front, KdLeaf *back) const; 1442 1444 1443 1445 /** Selects an axis aligned for the next split.
Note: See TracChangeset
for help on using the changeset viewer.