- Timestamp:
- 08/23/06 00:45:59 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1259 r1262 723 723 724 724 //-- the view space bounding box 725 stream << "<ViewSpaceBox" 726 << " min=\"" << mViewSpaceBox.Min().x << " " << mViewSpaceBox.Min().y << " " << mViewSpaceBox.Min().z << "\"" 727 << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 728 729 if (exportPvs) { 730 //-- export bounding boxes 731 stream << "<BoundingBoxes>" << endl; 732 733 ObjectContainer::const_iterator oit, oit_end = objects.end(); 734 735 for (oit = objects.begin(); oit != oit_end; ++ oit) 736 { 725 //stream << "<ViewSpaceBox" 726 // << " min=\"" << mViewSpaceBox.Min().x << " " << mViewSpaceBox.Min().y << " " << mViewSpaceBox.Min().z << "\"" 727 // << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 728 729 if (exportPvs) 730 { 731 //-- export bounding boxes 732 stream << "<BoundingBoxes>" << endl; 733 734 ObjectContainer::const_iterator oit, oit_end = objects.end(); 735 736 for (oit = objects.begin(); oit != oit_end; ++ oit) 737 { 737 738 MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit); 738 739 const AxisAlignedBox3 box = mi->GetBox(); … … 742 743 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 743 744 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 744 } 745 746 stream << "</BoundingBoxes>" << endl; 747 } 745 } 746 747 stream << "</BoundingBoxes>" << endl; 748 } 749 750 751 // the type of hierarchy: this must be known before to build 752 // the view cells manager 753 stream << "<ViewSpaceHierarchyType name=\"vspBspTree\" />" << endl; 748 754 749 755 //-- export the view cells and the pvs 750 stream << "<HierarchyType name=\"vspBspTree\" />" << endl;751 756 752 757 const int numViewCells = mCurrentViewCellsStats.viewCells; … … 759 764 760 765 761 //-- export the spatial hierarchy 762 763 // the type of the view cells hierarchy 764 stream << "<Hierarchy>" << endl; 766 //-- export the view space hierarchy 767 768 stream << "<ViewSpaceHierarchy type=\"bsp\"" 769 << " min=\"" << mViewSpaceBox.Min().x << " " << mViewSpaceBox.Min().y << " " << mViewSpaceBox.Min().z << "\"" 770 << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 771 765 772 mVspBspTree->Export(stream); 766 stream << endl << "</ Hierarchy>" << endl;773 stream << endl << "</ViewSpaceHierarchy>" << endl; 767 774 768 775 stream << "</VisibilitySolution>" << endl; … … 5007 5014 5008 5015 //-- compression 5016 5009 5017 if (ViewCellsTreeConstructed() && mCompressViewCells) 5010 5018 { … … 5469 5477 //-- export view space bounding box 5470 5478 5471 stream << "<ViewSpaceBox"5472 << " min=\"" << mViewSpaceBox.Min().x << " " << mViewSpaceBox.Min().y << " " << mViewSpaceBox.Min().z << "\""5473 << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl;5479 //stream << "<ViewSpaceBox" 5480 // << " min=\"" << mViewSpaceBox.Min().x << " " << mViewSpaceBox.Min().y << " " << mViewSpaceBox.Min().z << "\"" 5481 // << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 5474 5482 5475 5483 … … 5493 5501 stream << "</BoundingBoxes>" << endl; 5494 5502 5503 // the type of the view space hierarchy: 5504 // must be known beforehand because necessary for building view cels 5505 //stream << "<ViewSpaceHierarchyType name=\"vspTree\" />" << endl; 5506 5495 5507 5496 5508 //-- export the view cells and the pvs 5497 5509 5498 stream << "<Hierarchy name=\"vspTree\" />" << endl;5499 5510 const int numViewCells = mCurrentViewCellsStats.viewCells; 5500 5511 … … 5506 5517 //-- export the view space hierarchy 5507 5518 5508 // the type of the view space partition 5509 stream << "<ViewSpaceHierarchy>" << endl; 5519 stream << "<ViewSpaceHierarchy type=\"vsp\"" 5520 << " min=\"" << mViewSpaceBox.Min().x << " " << mViewSpaceBox.Min().y << " " << mViewSpaceBox.Min().z << "\"" 5521 << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 5522 5510 5523 mVspTree->Export(stream); 5511 stream << endl << "</ViewSpace Partitioin>" << endl;5524 stream << endl << "</ViewSpaceHierarchy>" << endl; 5512 5525 5513 5526 … … 5515 5528 5516 5529 // the type of the view cells hierarchy 5517 stream << "<ObjectSpaceHierarchy>" << endl; 5518 mOspTree->Export(stream); 5519 stream << endl << "</ObjectSpaceHierarchy>" << endl; 5520 5530 if (mHierarchyManager->GetObjectSpaceSubdivisonType() == 5531 HierarchyManager::KD_BASED_OBJ_SUBDIV) 5532 { 5533 stream << "<ObjectSpaceHierarchy type=\"osp\">" << endl; 5534 mOspTree->Export(stream); 5535 stream << endl << "</ObjectSpaceHierarchy>" << endl; 5536 } 5537 else if (mHierarchyManager->GetObjectSpaceSubdivisonType() == 5538 HierarchyManager::BV_BASED_OBJ_SUBDIV) 5539 { 5540 stream << "<ObjectSpaceHierarchy type=\"bvh\">" << endl; 5541 mBvHierarchy->Export(stream); 5542 stream << endl << "</ObjectSpaceHierarchy>" << endl; 5543 } 5521 5544 5522 5545 stream << "</VisibilitySolution>" << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r1233 r1262 108 108 void ViewCellsParseHandlers::endElement(const XMLCh* const name) 109 109 { 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 110 StrX lname(name); 111 string element(lname.LocalForm()); 112 113 if (element == "ViewCells") 114 EndViewCells(); 115 116 if (element == "BoundingBoxes") 117 EndBoundingBoxes(); 118 119 // inside the view cell description 120 if (mCurrentTask == PARSE_VIEWCELLS) 121 { 122 if (element == "Interior") 123 EndViewCellInterior(); 124 } 125 else 126 { 127 if (element == "Interior") 128 EndBspInterior(); 129 } 130 130 } 131 131 … … 150 150 } 151 151 152 152 153 void ViewCellsParseHandlers::EndViewCellInterior() 153 154 { … … 204 205 const char *ptr = attrValue.LocalForm(); 205 206 206 // --the view cells manager is created here207 // the view cells manager is created here 207 208 CreateViewCellsManager(ptr); 208 209 } … … 720 721 mBspTree = new BspTree(); 721 722 mBspTree->mBox = mViewSpaceBox; 722 //mCurrentBspNode = mBspTree->GetRoot();723 723 724 724 mViewCellsManager = new BspViewCellsManager(mBspTree); … … 729 729 730 730 mVspBspTree = new VspBspTree(); 731 //mCurrentBspNode = mVspBspTree->GetRoot();732 731 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 733 732 … … 746 745 mVspTree->mBoundingBox = mViewSpaceBox; 747 746 } 748 749 747 750 748 mViewCellsTree = mViewCellsManager->GetViewCellsTree(); -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1259 r1262 1081 1081 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 1082 1082 { 1083 BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj , NULL);1083 BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 1084 1084 1085 1085 if (!leaf->Mailed()) … … 1088 1088 leaf->mCounter = 1; 1089 1089 1090 ++ pvsSize;1090 pvsSize += (int)leaf->mObjects.size(); 1091 1091 } 1092 1092 else … … 1266 1266 { 1267 1267 leaf->Mail(); 1268 ++ pvs;1268 pvs += (int)leaf->mObjects.size(); 1269 1269 } 1270 1270 break; … … 1311 1311 1312 1312 if (-- leaf->mCounter == 0) 1313 ++ pvs;1313 pvs += (int)leaf->mObjects.size(); 1314 1314 break; 1315 1315 }
Note: See TracChangeset
for help on using the changeset viewer.