Changeset 1845 for GTP/trunk/Lib/Vis
- Timestamp:
- 12/04/06 23:32:28 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1844 r1845 2354 2354 2355 2355 2356 voidHierarchyManager::CompressObjectSpace()2356 int HierarchyManager::CompressObjectSpace() 2357 2357 { 2358 2358 //mBvHierarchy->Compress(); 2359 mVspTree->CompressObjects(); 2359 return mVspTree->CompressObjects(); 2360 } 2361 2360 2362 2361 2363 void HierarchyManager::CreateUniqueObjectIds() -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1844 r1845 292 292 void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects); 293 293 294 voidCompressObjectSpace();294 int CompressObjectSpace(); 295 295 void CreateUniqueObjectIds(); 296 296 -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1844 r1845 889 889 Intersectable *obj = entry.mObject; 890 890 891 cout << (int)obj << " ";891 cout << obj << " "; 892 892 } 893 893 -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r1842 r1845 206 206 Name="VCLinkerTool" 207 207 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtGlRenderer.lib" 208 OutputFile="../bin/release/Preprocessor 2.exe"208 OutputFile="../bin/release/Preprocessor.exe" 209 209 LinkIncremental="1" 210 210 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtGlRenderer\Release" -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1843 r1845 4605 4605 cout << ss << endl; 4606 4606 4607 4608 4607 if (0) CompressViewCells(); 4609 4608 … … 6162 6161 6163 6162 6163 void VspOspViewCellsManager::CompressViewCells() 6164 { 6165 ViewCellsManager::CompressViewCells(); 6166 return; 6167 //////////// 6168 //-- compression 6169 6170 if (ViewCellsTreeConstructed() && mCompressViewCells) 6171 { 6172 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 6173 6174 cout << "compressing in the objects" << endl; 6175 cout << "number of entries before compress: " << pvsEntries << endl; 6176 Debug << "number of entries before compress: " << pvsEntries << endl; 6177 6178 pvsEntries = mHierarchyManager->CompressObjectSpace(); 6179 6180 Debug << "number of entries after compress: " << pvsEntries << endl; 6181 cout << "number of entries after compress: " << pvsEntries << endl; 6182 } 6183 } 6184 6185 6164 6186 ViewCellsManager *VspOspViewCellsManager::LoadViewCells(const string &filename, 6165 6187 ObjectContainer *objects, -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1843 r1845 467 467 const ViewCellContainer &viewCells) const; 468 468 469 void CompressViewCells(); 469 virtual void CompressViewCells(); 470 470 471 ///////////////////////////// 471 472 // static members … … 1163 1164 void CollectViewCells(); 1164 1165 1166 virtual void CompressViewCells(); 1167 1165 1168 /** Prepare view cells for use after loading them from disc. 1166 1169 */ … … 1183 1186 ///////////////////////////////////////// 1184 1187 1185 /** collect objects intersecting a given spatial box */ 1186 virtual void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects); 1188 /** collect objects intersecting a given spatial box 1189 */ 1190 virtual void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects); 1187 1191 1188 1192 HierarchyManager *mHierarchyManager; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1844 r1845 3389 3389 3390 3390 3391 voidVspTree::CompressObjects(VspLeaf *leaf)3391 int VspTree::CompressObjects(VspLeaf *leaf) 3392 3392 { 3393 3393 bool compressed = true; 3394 3394 3395 Intersectable::NewMail(2);3396 3397 3395 while (compressed) 3398 3396 { 3397 BvhNode::NewMail(2); 3398 3399 3399 ObjectPvsIterator oit = leaf->GetViewCell()->GetPvs().GetIterator(); 3400 3400 vector<BvhNode *> parents; … … 3414 3414 if (!parent->Mailed()) 3415 3415 { 3416 if (parent->Mailed(1)) 3417 cout << "error!!" << endl; 3416 3418 parent->Mail(); 3417 3419 } … … 3422 3424 parents.push_back(parent); 3423 3425 parent->Mail(1); 3426 3424 3427 compressed = true; 3425 3428 } … … 3439 3442 3440 3443 // add only entries that cannot be exchaned with the parent 3441 if ( parent->Mailed(1))3444 if (!parent->Mailed(1)) 3442 3445 { 3443 3446 newPvs.AddSampleDirty(obj, entry.mData.mSumPdf); … … 3448 3451 // add parents 3449 3452 vector<BvhNode *>::const_iterator bit, bit_end = parents.end(); 3453 3450 3454 for (bit = parents.begin(); bit != bit_end; ++ bit) 3451 3455 { … … 3453 3457 } 3454 3458 3459 //cout << "size " << newPvs.GetSize() << endl; 3455 3460 leaf->GetViewCell()->SetPvs(newPvs); 3456 3461 } 3457 } 3458 3459 3460 void VspTree::CompressObjects() 3462 3463 return leaf->GetViewCell()->GetPvs().GetSize(); 3464 } 3465 3466 3467 int VspTree::CompressObjects() 3461 3468 { 3462 3469 vector<VspLeaf *> leaves; 3463 3470 CollectLeaves(leaves); 3464 3471 3472 int numEntries = 0; 3473 3465 3474 vector<VspLeaf *>::const_iterator lit, lit_end = leaves.end(); 3466 3475 3467 3476 for (lit = leaves.begin(); lit != lit_end; ++ lit) 3468 3477 { 3469 CompressObjects(*lit); 3470 } 3471 } 3472 3473 } 3478 numEntries += CompressObjects(*lit); 3479 } 3480 3481 return numEntries; 3482 } 3483 3484 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1844 r1845 1028 1028 AxisAlignedBox3 *forcedBoundingBox); 1029 1029 1030 voidCompressObjects();1031 1032 voidCompressObjects(VspLeaf *leaf);1030 int CompressObjects(); 1031 1032 int CompressObjects(VspLeaf *leaf); 1033 1033 1034 1034 protected:
Note: See TracChangeset
for help on using the changeset viewer.