Changeset 268
- Timestamp:
- 09/14/05 18:32:40 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r267 r268 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 71 71 # constructionMethod sceneGeometry 72 72 maxCandidates 25 73 maxViewCells 9999 73 maxViewCells 999999 74 74 Termination { 75 75 maxPolygons 0 -
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r260 r268 1184 1184 optInt, 1185 1185 "-bsp_max_viewcells=", 1186 "9999 ");1186 "999999"); 1187 1187 } 1188 1188 -
trunk/VUT/GtpVisibilityPreprocessor/src/Plane3.h
r265 r268 50 50 if (coplanar) 51 51 (*coplanar) = true; 52 52 Debug << "signum is zero" << endl; 53 53 return a; 54 54 } … … 62 62 (*t) = u; 63 63 64 return a + u * b - u * a; // NOTE: gives better precision than calclulating a + u * v64 return a - Distance(a) * b / dv + Distance(a) * a / dv; // NOTE: gives better precision than calclulating a + u * v 65 65 //return a + (u * v); 66 66 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp
r265 r268 1 1 #include "Polygon3.h" 2 2 #include "Mesh.h" 3 3 #include "ViewCellBsp.h" // TODO: erase this 4 // tolerance value for side relation 4 5 #define SIDE_TOLERANCE 0.002f // TODO: Test different values 5 6 … … 114 115 { 115 116 int side = plane.Side(*it, SIDE_TOLERANCE); 116 //Debug << "side: " << side << " " << plane.Distance(*it) << endl;117 if (BspTree::displayDebug) Debug << "side: " << side << " " << plane.Distance(*it) << endl; 117 118 118 119 if (side > 0) -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r265 r268 48 48 @param objects the intersectables the viewcells are derived from 49 49 @param viewCells the viewcells are returned in this container 50 @param maxViewCells if > 0, indicates the maximim number of viewcells that will be created50 @param maxViewCells the maximum number of viewcells created. if 0 => unbounded 51 51 */ 52 52 static void DeriveViewCells(const ObjectContainer &objects, -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r267 r268 33 33 const int FACTOR_LEAST_SPLITS = 1; 34 34 35 int counter = 0; 36 bool BspTree::displayDebug = false; 35 37 /****************************************************************/ 36 38 /* class BspNode implementation */ 37 39 /****************************************************************/ 38 40 39 BspNode::BspNode(): mParent(NULL), mPolygons(NULL) 41 BspNode::BspNode(): mParent(NULL), mPolygons(NULL),mViewCellIdx(0) 40 42 {} 41 43 42 BspNode::BspNode(BspInterior *parent): mParent(parent), mPolygons(NULL) 44 BspNode::BspNode(BspInterior *parent): mParent(parent), mPolygons(NULL),mViewCellIdx(0) 43 45 {} 44 46 … … 147 149 int &splits, bool storePolys) 148 150 { 149 #ifdef _Debug 151 //#ifdef _Debug 152 if (BspTree::displayDebug) 150 153 Debug << "Splitting polygons of node " << this << " with plane " << mPlane << endl; 151 #endif154 //#endif 152 155 bool inside = false; 153 156 … … 157 160 polys->pop_back(); 158 161 162 if (BspTree::displayDebug) Debug << "New polygon with plane: " << poly->GetSupportingPlane() << "\n"; 163 159 164 // test if split is neccessary 160 165 int classification = poly->ClassifyPlane(mPlane); … … 162 167 Polygon3 *front_piece = NULL; 163 168 Polygon3 *back_piece = NULL; 164 169 165 170 switch (classification) 166 171 { … … 170 175 // same surface normal 171 176 inside = (DotProd(mPlane.mNormal, poly->GetSupportingPlane().mNormal) > 0); 172 173 //Debug << "coincident" << endl;177 if (BspTree::displayDebug) 178 Debug << "coincident" << endl; 174 179 // discard polygons or saves them in node 175 180 ProcessPolygon(poly, storePolys); 176 181 break; 177 case Polygon3::FRONT_SIDE: 178 //Debug << "front" << endl;182 case Polygon3::FRONT_SIDE: if (BspTree::displayDebug) 183 Debug << "front" << endl; 179 184 frontPolys->push_back(poly); 180 185 break; 181 186 case Polygon3::BACK_SIDE: 182 inside = true; 183 //Debug << "back" << endl;187 inside = true; if (BspTree::displayDebug) 188 Debug << "back" << endl; 184 189 backPolys->push_back(poly); 185 190 break; 186 191 case Polygon3::SPLIT: 187 inside = true; 188 //Debug << "split " << poly << endl; 192 inside = true; 189 193 190 194 front_piece = new Polygon3(); … … 197 201 backPolys->push_back(back_piece); 198 202 199 #ifdef _DEBUG200 Debug << "split " << *poly << endl << *front_piece << endl << *back_piece << endl;201 #endif203 //#ifdef _DEBUG 204 if (BspTree::displayDebug)Debug << "split " << *poly << endl << *front_piece << endl << *back_piece << endl; 205 //#endif 202 206 // save or discard polygons 203 207 ProcessPolygon(poly, storePolys); … … 258 262 mRoot(NULL), 259 263 mIsIncremential(false), 260 mStorePolys( false)264 mStorePolys(true) 261 265 { 262 266 Randomize(); // initialise random generator for heuristics … … 440 444 Polygon3 *poly = new Polygon3((*fi), mesh); 441 445 polys.push_back(poly); 446 if (displayDebug) 447 Debug << *poly << endl; 442 448 polysNum ++; 443 449 } … … 531 537 532 538 long startTime = GetTime(); 533 534 intcounter = 0;539 displayDebug = true; 540 counter = 0; 535 541 Debug << "**** Starting view cell insertion ****" << endl; 536 542 for (it = viewCells.begin(); it != viewCells.end(); ++ it) 537 543 { 538 Debug << "** inserting view cell " << counter ++ << " **" << endl; 539 InsertViewCell(*it); 544 if ((counter == 12) || (counter == 14)) 545 {Debug << "** inserting view cell " << counter << " **" << endl; 546 InsertViewCell(*it);} 547 counter ++; 540 548 } 541 549 … … 609 617 { 610 618 //#ifdef _DEBUG 611 Debug << "subdivision terminated at depth " << tData.mDepth << ", #polys: " << (int)tData.mPolygons->size() << endl; 619 if (displayDebug) 620 Debug << "subdivision terminated at depth " << tData.mDepth << ", #polys: " << (int)tData.mPolygons->size() << endl; 612 621 //#endif 613 622 … … 620 629 621 630 if (leaf->GetViewCell()) 622 Debug << "ERROR: leaf already has view cell" << endl; 623 631 Debug << "ERROR: leaf already has view cell " << leaf->mViewCellIdx << endl; 632 633 leaf->mViewCellIdx = counter; 624 634 Debug << "insert view cell" << endl; 625 635 leaf->SetViewCell(viewCell); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r267 r268 144 144 */ 145 145 PolygonContainer *GetPolygons(); 146 146 int mViewCellIdx; 147 147 protected: 148 148 … … 193 193 return s << A.mPlane; 194 194 } 195 196 195 197 196 protected: … … 318 317 bool Export(const string filename); 319 318 320 319 static bool displayDebug; 321 320 protected: 322 321
Note: See TracChangeset
for help on using the changeset viewer.