Changeset 275 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 09/15/05 18:49:05 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r268 r275 65 65 # splitPlaneStrategy leastSplits 66 66 # splitPlaneStrategy balancedTree 67 splitPlaneStrategy nextPolygon68 #splitPlaneStrategy combined67 # splitPlaneStrategy nextPolygon 68 splitPlaneStrategy combined 69 69 # constructionMethod rays 70 70 constructionMethod viewCells -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r271 r275 149 149 int &splits, bool storePolys) 150 150 { 151 //#ifdef _Debug 152 if (BspTree::displayDebug) 153 Debug << "Splitting polygons of node " << this << " with plane " << mPlane << endl; 154 //#endif 151 #ifdef _Debug 152 //if (BspTree::displayDebug)Debug << "Splitting polygons of node " << this << " with plane " << mPlane << endl; 153 #endif 155 154 bool inside = false; 156 155 … … 160 159 polys->pop_back(); 161 160 162 if (BspTree::displayDebug) Debug << "New polygon with plane: " << poly->GetSupportingPlane() << "\n";161 //if (BspTree::displayDebug) Debug << "New polygon with plane: " << poly->GetSupportingPlane() << "\n"; 163 162 164 163 // test if split is neccessary … … 175 174 // same surface normal 176 175 inside = (DotProd(mPlane.mNormal, poly->GetSupportingPlane().mNormal) > 0); 177 if (BspTree::displayDebug) 178 Debug << "coincident" << endl; 176 //if (BspTree::displayDebug) Debug << "coincident" << endl; 179 177 // discard polygons or saves them in node 180 178 ProcessPolygon(poly, storePolys); 181 179 break; 182 case Polygon3::FRONT_SIDE: if (BspTree::displayDebug)183 Debug << "front" << endl;180 case Polygon3::FRONT_SIDE: 181 //if (BspTree::displayDebug)Debug << "front" << endl; 184 182 frontPolys->push_back(poly); 185 183 break; 186 184 case Polygon3::BACK_SIDE: 187 inside = true; if (BspTree::displayDebug) 188 Debug << "back" << endl; 185 inside = true; //if (BspTree::displayDebug)Debug << "back" << endl; 189 186 backPolys->push_back(poly); 190 187 break; … … 201 198 backPolys->push_back(back_piece); 202 199 203 //#ifdef _DEBUG200 #ifdef _DEBUG 204 201 if (BspTree::displayDebug)Debug << "split " << *poly << endl << *front_piece << endl << *back_piece << endl; 205 //#endif202 #endif 206 203 // save or discard polygons 207 204 ProcessPolygon(poly, storePolys); … … 213 210 } 214 211 } 215 if (BspTree::displayDebug) Debug << "inside: " << inside << endl;212 //if (BspTree::displayDebug) Debug << "inside: " << inside << endl; 216 213 // contains nothing 217 214 delete polys; … … 262 259 mRoot(NULL), 263 260 mIsIncremential(false), 264 mStorePolys(true) 261 //mStorePolys(true) 262 mStorePolys(false) 265 263 { 266 264 Randomize(); // initialise random generator for heuristics … … 449 447 Polygon3 *poly = new Polygon3((*fi), mesh); 450 448 polys.push_back(poly); 451 if (displayDebug) 452 Debug << *poly << endl; 449 //if (displayDebug)Debug << *poly << endl; 453 450 polysNum ++; 454 451 } … … 461 458 462 459 for (int i = 0; i < limit; ++i) 463 { if((i == 12) || (i ==14))460 {//if ((i == 12) ||(i==14)) 464 461 if (viewCells[i]->GetMesh()) // copy the mesh data to polygons 465 462 { … … 519 516 // view cells are inserted one after another => 520 517 // global tree optimization possible 521 if (!mIsIncremential) 518 if (!mIsIncremential) // todo: not incremential does not work 522 519 { 523 520 // copy view cell meshes into one big polygon soup … … 542 539 543 540 long startTime = GetTime(); 544 displayDebug = true;541 //displayDebug = true; 545 542 counter = 0; 546 543 Debug << "**** Starting view cell insertion ****" << endl; 547 544 for (it = viewCells.begin(); it != viewCells.end(); ++ it) 548 545 { 549 if ((counter == 12) || (counter == 14))550 {Debug << "** inserting view cell " << counter << " **" << endl;551 InsertViewCell(*it); }552 counter ++;546 //if ((counter == 12) || (counter == 14)){ 547 //Debug << "** inserting view cell " << counter << " **" << endl; 548 InsertViewCell(*it); 549 //} counter ++; 553 550 } 554 551 … … 621 618 //&& !(viewCell && tData.mIsInside && dynamic_cast<BspLeaf *>(tData.mNode)->GetViewCell())) 622 619 { 623 //#ifdef _DEBUG 624 if (displayDebug) 625 Debug << "subdivision terminated at depth " << tData.mDepth << ", #polys: " << (int)tData.mPolygons->size() << endl; 626 //#endif 620 #ifdef _DEBUG 621 if (displayDebug)Debug << "subdivision terminated at depth " << tData.mDepth << ", #polys: " << (int)tData.mPolygons->size() << endl; 622 #endif 627 623 628 624 EvaluateLeafStats(tData); … … 634 630 635 631 if (leaf->GetViewCell()) 636 Debug << "ERROR: leaf already has view cell " << leaf->mViewCellIdx << endl;637 638 leaf->mViewCellIdx = counter;639 Debug << "insert view cell" << endl;632 Debug << "ERROR: leaf already has view cell " << endl;//leaf->mViewCellIdx << endl; 633 634 //leaf->mViewCellIdx = counter; 635 //Debug << "insert view cell" << endl; 640 636 leaf->SetViewCell(viewCell); 641 637 } -
trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
r265 r275 45 45 p->LoadViewCells(vcFilename); 46 46 47 /*Exporter *exporter = Exporter::GetExporter("viewcells.x3d");47 Exporter *exporter = Exporter::GetExporter("viewcells.x3d"); 48 48 if (exporter) 49 49 { exporter->ExportViewCells(&p->mViewCells); 50 50 delete exporter; 51 } */51 } 52 52 } 53 53 else
Note: See TracChangeset
for help on using the changeset viewer.