Changeset 1161 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 07/27/06 02:07:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1160 r1161 3985 3985 if (ViewCellsTreeConstructed() && mCompressViewCells) 3986 3986 { 3987 int pvsEntries = mViewCellsTree->Get NumPvsEntries(mViewCellsTree->GetRoot());3987 int pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 3988 3988 Debug << "number of entries before compress: " << pvsEntries << endl; 3989 3989 3990 3990 mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 3991 3991 3992 pvsEntries = mViewCellsTree->Get NumPvsEntries(mViewCellsTree->GetRoot());3992 pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 3993 3993 Debug << "number of entries after compress: " << pvsEntries << endl; 3994 3994 } … … 4589 4589 { 4590 4590 int numSamples; 4591 4591 4592 4592 Environment::GetSingleton()->GetIntValue("RenderSampler.samples", numSamples); 4593 4593 cout << "samples" << numSamples << endl; … … 4607 4607 4608 4608 4609 // counting the pvss 4609 // for each sample: 4610 // find view cells associated with the samples 4611 // store the sample pvs with the pvs associated with the view cell 4612 // for each view cell: 4613 // compute difference point sampled pvs - view cell pvs 4614 // export geometry with color coded pvs difference 4615 4616 std::map<ViewCell *, ObjectPvs> sampleMap; 4617 4610 4618 vector<RenderCostSample>::const_iterator rit, rit_end = samples.end(); 4611 4619 4612 //std::map<ViewCell *, ObjectPvs> sampleMap; 4613 4620 for (rit = samples.begin(); rit != rit_end; ++ rit) 4621 { 4622 RenderCostSample sample = *rit; 4623 4624 ViewCell *vc = GetViewCell(sample.mPosition); 4625 4626 std::map<ViewCell *, ObjectPvs>::iterator it = sampleMap.find(vc); 4627 4628 if (it == sampleMap.end()) 4629 { 4630 sampleMap[vc] = sample.mPvs; 4631 } 4632 else 4633 { 4634 (*it).second.Merge(sample.mPvs); 4635 } 4636 } 4637 4638 // visualize the view cells 4639 std::map<ViewCell *, ObjectPvs>::const_iterator vit, vit_end = sampleMap.end(); 4640 4641 Material m;//= RandomMaterial(); 4642 4643 for (vit = sampleMap.begin(); vit != vit_end; ++ vit) 4644 { 4645 ViewCell *vc = (*vit).first; 4646 4647 const int pvsVc = mViewCellsTree->GetPvsEntries(vc); 4648 const int pvs2 = (*vit).second.GetSize(); 4649 4650 m.mDiffuseColor.r = (float) (pvsVc - pvs2); 4651 m.mDiffuseColor.b = 1.0f; 4652 //exporter->SetForcedMaterial(m); 4653 4654 // ExportViewCellGeometry(exporter, vc, mClipPlane); 4655 4656 /* // counting the pvss 4614 4657 for (rit = samples.begin(); rit != rit_end; ++ rit) 4615 4658 { … … 4622 4665 4623 4666 DEL_PTR(hMesh); 4624 #if 0 4625 if (!sampleMap.find(vc)) 4626 sampleMap.insert(vc, sample.mVisibleObjects); 4627 else 4628 sampleMap[vc].Merge(Merge(sample.mVisibleObjects); 4629 #endif 4667 4668 */ 4630 4669 } 4631 4670 } … … 5044 5083 if (ViewCellsTreeConstructed() && mCompressViewCells) 5045 5084 { 5046 int pvsEntries = mViewCellsTree->Get NumPvsEntries(mViewCellsTree->GetRoot());5085 int pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 5047 5086 Debug << "number of entries before compress: " << pvsEntries << endl; 5048 5087 5049 5088 mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 5050 5089 5051 pvsEntries = mViewCellsTree->Get NumPvsEntries(mViewCellsTree->GetRoot());5090 pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 5052 5091 Debug << "number of entries after compress: " << pvsEntries << endl; 5053 5092 }
Note: See TracChangeset
for help on using the changeset viewer.