- Timestamp:
- 09/09/05 15:03:48 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/data/atlanta/atlanta_viewcells_large.x3d
r261 r262 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <X3D> 3 <Scene> 4 <Shape> 5 <Appearance> 6 <Material diffuseColor="0.500626 0.781793 0.596652" specularColor="0.0 0.0 0.0"/> 7 </Appearance> 8 <IndexedFaceSet ccw="TRUE" coordIndex=" 9 0 1 2 -1 10 5 4 3 -1 11 0 3 4 1 -1 12 1 4 5 2 -1 13 0 2 5 3 -1 14 " > 15 <Coordinate point=" 16 3588 0 -2541, 17 3568 0 -2541, 18 3588 0 -2561, 19 3568 -10 -2541, 20 3568 -10 -2541, 21 3568 -10 -2541, 22 " > 23 </Coordinate> 24 </IndexedFaceSet> 25 </Shape> 26 <Shape> 27 <Appearance> 28 <Material diffuseColor="0.90437 0.792505 0.739937" specularColor="0.0 0.0 0.0"/> 29 </Appearance> 30 <IndexedFaceSet ccw="TRUE" coordIndex=" 31 0 1 2 -1 32 5 4 3 -1 33 0 3 4 1 -1 34 1 4 5 2 -1 35 0 2 5 3 -1 36 " > 37 <Coordinate point=" 38 3558 0 -2540, 39 3578 0 -2540, 40 3558 0 -2560, 41 3578 10 -2540, 42 3578 10 -2540, 43 3578 10 -2540, 44 " > 45 </Coordinate> 46 </IndexedFaceSet> 47 </Shape> 48 <Shape> 49 <Appearance> 50 <Material diffuseColor="0.675146 0.947981 0.91142" specularColor="0.0 0.0 0.0"/> 51 </Appearance> 52 <IndexedFaceSet ccw="TRUE" coordIndex=" 53 0 1 2 -1 54 5 4 3 -1 55 0 3 4 1 -1 56 1 4 5 2 -1 57 0 2 5 3 -1 58 " > 59 <Coordinate point=" 60 3552 0 -2921, 61 3572 0 -2921, 62 3552 0 -2941, 63 3572 10 -2921, 64 3572 10 -2921, 65 3572 10 -2921, 66 " > 67 </Coordinate> 68 </IndexedFaceSet> 69 </Shape> 70 <Shape> 71 <Appearance> 72 <Material diffuseColor="0.873302 0.587054 0.929472" specularColor="0.0 0.0 0.0"/> 73 </Appearance> 74 <IndexedFaceSet ccw="TRUE" coordIndex=" 75 0 1 2 -1 76 5 4 3 -1 77 0 3 4 1 -1 78 1 4 5 2 -1 79 0 2 5 3 -1 80 " > 81 <Coordinate point=" 82 3484 0 -3315, 83 3504 0 -3315, 84 3484 0 -3335, 85 3504 10 -3315, 86 3504 10 -3315, 87 3504 10 -3315, 88 " > 89 </Coordinate> 90 </IndexedFaceSet> 91 </Shape> 92 <Shape> 93 <Appearance> 94 <Material diffuseColor="0.855251 0.756767 0.651997" specularColor="0.0 0.0 0.0"/> 95 </Appearance> 96 <IndexedFaceSet ccw="TRUE" coordIndex=" 97 0 1 2 -1 98 5 4 3 -1 99 0 3 4 1 -1 100 1 4 5 2 -1 101 0 2 5 3 -1 102 " > 103 <Coordinate point=" 104 3175 0 -3323, 105 3195 0 -3323, 106 3175 0 -3343, 107 3195 10 -3323, 108 3195 10 -3323, 109 3195 10 -3323, 110 " > 111 </Coordinate> 112 </IndexedFaceSet> 113 </Shape> 114 <Shape> 115 <Appearance> 116 <Material diffuseColor="0.507492 0.545701 0.682226" specularColor="0.0 0.0 0.0"/> 117 </Appearance> 118 <IndexedFaceSet ccw="TRUE" coordIndex=" 119 0 1 2 -1 120 5 4 3 -1 121 0 3 4 1 -1 122 1 4 5 2 -1 123 0 2 5 3 -1 124 " > 125 <Coordinate point=" 126 4034 0 -3655, 127 4054 0 -3655, 128 4034 0 -3675, 129 4054 10 -3655, 130 4054 10 -3655, 131 4054 10 -3655, 132 " > 133 </Coordinate> 134 </IndexedFaceSet> 135 </Shape> 136 <Shape> 137 <Appearance> 138 <Material diffuseColor="0.573656 0.582949 0.994263" specularColor="0.0 0.0 0.0"/> 139 </Appearance> 140 <IndexedFaceSet ccw="TRUE" coordIndex=" 141 0 1 2 -1 142 5 4 3 -1 143 0 3 4 1 -1 144 1 4 5 2 -1 145 0 2 5 3 -1 146 " > 147 <Coordinate point=" 148 3407 0 -4380, 149 3427 0 -4380, 150 3407 0 -4400, 151 3427 10 -4380, 152 3427 10 -4380, 153 3427 10 -4380, 154 " > 155 </Coordinate> 156 </IndexedFaceSet> 157 </Shape> 158 <Shape> 159 <Appearance> 160 <Material diffuseColor="0.722846 0.559542 0.502335" specularColor="0.0 0.0 0.0"/> 161 </Appearance> 162 <IndexedFaceSet ccw="TRUE" coordIndex=" 163 0 1 2 -1 164 5 4 3 -1 165 0 3 4 1 -1 166 1 4 5 2 -1 167 0 2 5 3 -1 168 " > 169 <Coordinate point=" 170 3005 0 -4968, 171 3025 0 -4968, 172 3005 0 -4988, 173 3025 10 -4968, 174 3025 10 -4968, 175 3025 10 -4968, 176 " > 177 </Coordinate> 178 </IndexedFaceSet> 179 </Shape> 180 <Shape> 181 <Appearance> 182 <Material diffuseColor="0.504456 0.68894 0.765831" specularColor="0.0 0.0 0.0"/> 183 </Appearance> 184 <IndexedFaceSet ccw="TRUE" coordIndex=" 185 0 1 2 -1 186 5 4 3 -1 187 0 3 4 1 -1 188 1 4 5 2 -1 189 0 2 5 3 -1 190 " > 191 <Coordinate point=" 192 5143 0 -4990, 193 5163 0 -4990, 194 5143 0 -5010, 195 5163 10 -4990, 196 5163 10 -4990, 197 5163 10 -4990, 198 " > 199 </Coordinate> 200 </IndexedFaceSet> 201 </Shape> 202 <Shape> 203 <Appearance> 204 <Material diffuseColor="0.785592 0.800882 0.803583" specularColor="0.0 0.0 0.0"/> 205 </Appearance> 206 <IndexedFaceSet ccw="TRUE" coordIndex=" 207 0 1 2 -1 208 5 4 3 -1 209 0 3 4 1 -1 210 1 4 5 2 -1 211 0 2 5 3 -1 212 " > 213 <Coordinate point=" 214 5355 0 -4195, 215 5375 0 -4195, 216 5355 0 -4205, 217 5375 10 -4195, 218 5375 10 -4195, 219 5375 10 -4195, 220 " > 221 </Coordinate> 222 </IndexedFaceSet> 223 </Shape> 2 <X3D profile="Full"> 3 <Scene> 4 <Shape > 5 <IndexedFaceSet coordIndex=" 0 1 2 -1 3 4 5 -1 6 7 8 -1 9 10 11 -1 12 13 14 -1 15 16 17 -1 18 19 20 -1 21 22 23 -1 24 25 26 -1 27 28 29 -1"> 6 <Coordinate point="3588.0 0.0 -2541.0, 3568.0 0.0 -2541.0, 3588.0 0.0 -2561.0, 3558.0 0.0 -2540.0, 3578.0 0.0 -2540.0, 3558.0 0.0 -2560.0, 3552.0 0.0 -2921.0, 3572.0 0.0 -2921.0, 3552.0 0.0 -2941.0, 3484.0 0.0 -3315.0, 3504.0 0.0 -3315.0, 3484.0 0.0 -3335.0, 3175.0 0.0 -3323.0, 3195.0 0.0 -3323.0, 3175.0 0.0 -3343.0, 4034.0 0.0 -3655.0, 4054.0 0.0 -3655.0, 4034.0 0.0 -3675.0, 3407.0 0.0 -4380.0, 3427.0 0.0 -4380.0, 3407.0 0.0 -4400.0, 3005.0 0.0 -4968.0, 3025.0 0.0 -4968.0, 3005.0 0.0 -4988.0, 5143.0 0.0 -4990.0, 5163.0 0.0 -4990.0, 5143.0 0.0 -5010.0, 5355.0 0.0 -4195.0, 5375.0 0.0 -4195.0, 5355.0 0.0 -4205.0, "/> 7 </IndexedFaceSet> 8 </Shape> 9 </Scene> 10 11 </X3D> -
trunk/VUT/GtpVisibilityPreprocessor/include/Polygon3.h
r238 r262 46 46 int Side(Plane3 *plane); 47 47 48 /** Deletes all polygons om the queue.49 */50 static void DeletePolygons(PolygonContainer *polys);51 52 48 /// vertices are connected in counterclockwise order. 53 49 VertexContainer mVertices; -
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp
r261 r262 12 12 Polygon3::Polygon3(Face *face, Mesh *parent) 13 13 { 14 VertexIndexContainer:: const_iterator it;14 VertexIndexContainer::reverse_iterator it = face->mVertexIndices.rbegin(); 15 15 16 for ( it = face->mVertexIndices.begin(); it != face->mVertexIndices.end(); ++it)16 for (; it != face->mVertexIndices.rend(); ++it) 17 17 { 18 18 mVertices.push_back(parent->mVertices[*it]); 19 19 mMaterial = parent->mMaterial; 20 20 21 Debug << parent->mVertices[*it] << endl;21 //Debug << parent->mVertices[*it] << endl; 22 22 } 23 23 } … … 31 31 #endif 32 32 return Plane3(mVertices[0], mVertices[1], mVertices[2]); 33 }34 35 void Polygon3::DeletePolygons(PolygonContainer *polys)36 {37 while(!polys->empty())38 {39 DEL_PTR(polys->back());40 polys->pop_back();41 }42 33 } 43 34 -
trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.h
r256 r262 62 62 63 63 64 /** Deletes all polygons om the queue.65 */66 static void DeletePolygons(PolygonContainer *polys);67 68 64 /// vertices are connected in counterclockwise order. 69 65 VertexContainer mVertices; -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r261 r262 7 7 #include "Environment.h" 8 8 9 Preprocessor::Preprocessor(): 10 mKdTree(NULL), 11 mBspTree(NULL) 12 { 13 } 9 14 10 15 Preprocessor::~Preprocessor() 11 16 { 12 // delete view cells 13 while (!mViewCells.empty()) 14 { 15 DEL_PTR(mViewCells.back()); 16 mViewCells.pop_back(); 17 } 18 19 // delete psp tree 17 CLEAR_CONTAINER(mViewCells); 20 18 DEL_PTR(mBspTree); 19 DEL_PTR(mKdTree); 21 20 } 22 21 … … 25 24 { 26 25 X3dParser *parser = new X3dParser; 27 28 delete parser;29 26 30 27 bool result = parser->ParseFile(filename, mViewCells); … … 32 29 if (result) 33 30 { 34 Exporter *exporter = Exporter::GetExporter( filename);31 Exporter *exporter = Exporter::GetExporter("viewcells.x3d"); 35 32 36 33 if (exporter) 34 { 37 35 exporter->ExportViewCells(&mViewCells); 38 36 delete exporter; 37 } 38 39 Debug << "Generating view cells" << endl; 39 40 GenerateViewCells(); 41 Debug << "Generated view cells" << endl; 40 42 } 43 44 DEL_PTR(parser); 45 46 41 47 return result; 42 48 } … … 91 97 Preprocessor::BuildBspTree() 92 98 { 93 ObjectContainer objects; 94 mSceneGraph->CollectObjects(&objects); 95 99 DEL_PTR(mBspTree); 96 100 mBspTree = new BspTree(); 97 101 … … 116 120 } 117 121 122 ObjectContainer objects; 123 RayContainer rays; 124 118 125 switch (constructionMethod) 119 126 { 120 127 case BspTree::VIEWCELLS: 128 Debug << "Construction method: view cells\n"; 129 121 130 // derive view cells from the scene objects 122 //ViewCell::DeriveViewCells(objects, mViewCells, maxViewCells); 131 if (mViewCells.empty()) 132 { 133 Debug << "View cells empty => generating new ones\n"; Debug.flush(); 134 mSceneGraph->CollectObjects(&objects); 135 ViewCell::DeriveViewCells(objects, mViewCells, maxViewCells); 136 } 137 138 mBspTree->Construct(mViewCells); 139 break; 140 case BspTree::SCENE_GEOMETRY: 141 Debug << "Construction method: geometry\n"; 142 143 CLEAR_CONTAINER(mViewCells); // we generate new view cells 144 mSceneGraph->CollectObjects(&objects); 145 146 mBspTree->Construct(objects, &mViewCells); 147 break; 148 case BspTree::RAYS: 149 Debug << "Construction method: rays\n"; 150 151 CLEAR_CONTAINER(mViewCells); // we generate new view cells 123 152 124 mBspTree->Construct(mViewCells); 125 break; 126 case BspTree::SCENE_GEOMETRY: 127 CLEAR_CONTAINER(mViewCells); 128 mBspTree->Construct(objects, &mViewCells); 129 break; 130 case BspTree::RAYS: 131 CLEAR_CONTAINER(mViewCells); 132 mBspTree->Construct(objects, &mViewCells); 153 mBspTree->Construct(rays, &mViewCells); 133 154 break; 134 155 default: 156 Debug << "Error: Method not available\n"; 135 157 break; 136 158 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h
r261 r262 25 25 class Preprocessor { 26 26 public: 27 /** Default constructor initialising e.g., KD tree and BSP tree. 28 */ 29 Preprocessor(); 30 27 31 ~Preprocessor(); 28 32 … … 88 92 /// scene graph loaded from file 89 93 SceneGraph *mSceneGraph; 90 /// BSP tree representing the viewcells 91 BspTree *mViewCellBspTree; 94 92 95 /// kD-tree organizing the scene graph (occluders + occludees) + viewcells 93 96 KdTree *mKdTree; … … 100 103 ViewCellContainer mViewCells; 101 104 102 BspTree * mBspTree; 105 /// BSP tree representing the viewcells 106 BspTree *mBspTree; 103 107 }; 104 108 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
r261 r262 11 11 ViewCell::~ViewCell() 12 12 { 13 // NOTE: should I really do this here? 13 // NOTE: should I really do this here? (I know that there is only one mesh per view cell) 14 14 DEL_PTR(mMesh); 15 15 } … … 114 114 // add top vertices 115 115 for (int i = 0; i < 3; ++i) 116 mesh->mVertices.push_back(topTri.mVertices[ 1]);116 mesh->mVertices.push_back(topTri.mVertices[i]); 117 117 118 118 return new ViewCell(mesh); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r261 r262 67 67 68 68 }; 69 69 70 70 //}; // GtpVisibilityPreprocessor 71 71 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r261 r262 11 11 #include <time.h> 12 12 #include <iomanip> 13 #include "Exporter.h" 13 14 14 15 #define INITIAL_COST 999999// unreachable high initial cost for heuristic evaluation … … 200 201 mRoot(NULL), 201 202 mIsIncremential(false), 202 mStorePolys( false)203 mStorePolys(true) 203 204 { 204 205 Randomize(); // initialise random generator for heuristics … … 279 280 tStack.pop(); 280 281 281 /// if we store 282 if (mStorePolys) 283 Polygon3::DeletePolygons(&node->mPolygons); 282 /// if we stored the polygons 283 CLEAR_CONTAINER(node->mPolygons); 284 284 285 285 if (!node->IsLeaf()) … … 365 365 mTermMaxDepth = maxDepth; 366 366 mStat.nodes = 1; 367 367 368 mBox.Initialize(); // initialise bsp tree bounding box 368 369 } … … 438 439 const int maxPolygons = 0; 439 440 const int maxDepth = 99999; 441 440 442 InitTree(maxPolygons, maxDepth); 441 443 442 443 // tree is completely constructed before444 // view cells are not inserted one after another => better tree behaviour444 // tree is completely constructed once before 445 // view cells are inserted one after another => 446 // global tree optimization possible 445 447 if (!mIsIncremential) 446 448 { 449 Debug << "Not incremential => constructing tree in advance\n"; 447 450 // copy view cell meshes into one big polygon soup 448 451 PolygonContainer *polys = new PolygonContainer(); … … 451 454 // construct tree from viewcell polygons 452 455 Construct(polys); 453 } 454 455 // insert all viewcells 456 457 Export("bsp.x3d"); 458 } 459 460 //-- insert all viewcells 456 461 ViewCellContainer::const_iterator it; 457 462 463 int counter = 0; 464 465 Debug << "View cells insertion...\n"; Debug.flush(); 458 466 for (it = viewCells.begin(); it != viewCells.end(); ++ it) 459 467 { 468 Debug << "Inserting view cell " << ++counter; 460 469 InsertViewCell(*it); 461 470 } 471 Debug << "finished view cells insertion"; 462 472 } 463 473 … … 465 475 void BspTree::Construct(const ObjectContainer &objects, ViewCellContainer *viewCells) 466 476 { 467 #ifdef _DEBUG468 Debug << "Constructing tree using object container\n";469 #endif470 477 // take termination criteria from globals 471 478 InitTree(mTermMaxPolygons, mTermMaxDepth); 472 479 Debug << "HAHAHAHHA";Debug.flush(); 473 480 PolygonContainer *polys = new PolygonContainer(); 474 481 … … 490 497 { 491 498 std::stack<BspTraversalData> tStack; 492 // new root corresponding to unbounded space 493 BspTraversalData tData(new BspLeaf(), mRoot->GetParent(), polys, 0); 499 Debug << "HDDHDH"; Debug.flush(); 500 501 BspTraversalData tData(new BspLeaf(), NULL, polys, 0); 494 502 495 503 tStack.push(tData); 496 504 505 Debug << "Contructing tree using objects..."; Debug.flush(); 497 506 while (!tStack.empty()) 498 507 { … … 500 509 tStack.pop(); 501 510 511 502 512 // subdivide leaf node 503 513 BspNode *root = Subdivide(tStack, tData); 504 514 505 if (!mRoot) // empty tree => new root 515 // empty tree => // new root corresponding to unbounded space 516 if (!mRoot) 506 517 mRoot = root; 507 518 } 519 520 Debug << "finished\n"; 508 521 } 509 522 … … 543 556 } 544 557 558 bool BspTree::ProcessPolygons(PolygonContainer *polys, BspLeaf *leaf) 559 { 560 bool result = false; 561 562 if (mStorePolys) 563 { 564 leaf->AddPolygons(polys); 565 result = true; 566 } 567 else 568 CLEAR_CONTAINER(*polys); 569 570 delete polys; 571 return result; 572 } 573 545 574 BspNode *BspTree::SubdivideNode(BspLeaf *leaf, 546 575 BspInterior *parent, … … 554 583 { 555 584 // add or delete remaining polygons 556 if (mStorePolys) 557 leaf->AddPolygons(polys); 558 else 559 Polygon3::DeletePolygons(polys); 560 561 delete polys; 585 ProcessPolygons(polys, leaf); 562 586 563 587 return leaf; … … 572 596 Debug << node << endl; 573 597 #endif 598 574 599 // split polygon according to current plane 575 600 int splits = 0; … … 795 820 return mStorePolys; 796 821 } 822 797 823 void BspTree::EvaluateLeafStats(const BspTraversalData &data) 798 824 { … … 929 955 } 930 956 957 bool BspTree::Export(const string filename) 958 { 959 Exporter *exporter = Exporter::GetExporter(filename); 960 961 if (exporter) 962 { 963 exporter->ExportBspTree(*this); 964 delete exporter; 965 966 return true; 967 } 968 969 return false; 970 } 931 971 //} // GtpVisibilityPreprocessor -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r261 r262 286 286 bool StorePolys() const; 287 287 288 /** Exports Bsp tree to file. 289 */ 290 bool Export(const string filename); 291 292 288 293 protected: 289 294 … … 386 391 int CastRay(Ray &ray); 387 392 393 /** Discards or stores polygons in leaf and deletes the container. 394 @param polys the polygons 395 @param leaf the leaf where polygons are stored 396 */ 397 bool ProcessPolygons(PolygonContainer *polys, BspLeaf *node); 398 388 399 /// Pointer to the root of the tree 389 400 BspNode *mRoot; -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp
r261 r262 237 237 238 238 239 //-- create and write indices 239 240 if (mWireframe) 240 241 stream << "<IndexedLineSet ccw=\"TRUE\" coordIndex=\"" << endl; … … 242 243 stream << "<IndexedFaceSet ccw=\"TRUE\" coordIndex=\"" << endl; 243 244 244 VertexContainer::const_iterator vi = poly->mVertices.begin(); 245 245 int index = 0; 246 247 VertexContainer::const_iterator vi; 248 249 for (vi = poly->mVertices.begin(); vi != poly->mVertices.end(); ++vi) 250 { 251 stream << index ++ << " "; 252 } 253 stream << "-1" << endl; 254 255 stream << "\" >" << endl; 256 246 257 stream << "<Coordinate point=\"" << endl; 247 258 248 for ( ; vi != poly->mVertices.end(); ++vi)259 for (vi = poly->mVertices.begin(); vi != poly->mVertices.end(); ++vi) 249 260 { 250 261 stream << (*vi).x << " " << (*vi).y << " " << (*vi).z; … … 252 263 } 253 264 254 stream <<"\" >"<<endl;255 stream <<"</Coordinate>"<<endl;265 stream << "\" >" << endl; 266 stream << "</Coordinate>" << endl; 256 267 257 268 if (mWireframe) … … 303 314 Mesh *mesh = new Mesh; 304 315 305 //AxisAlignedBox3 box = tree.GetBoundingBox();306 //ExportBox(box);316 AxisAlignedBox3 box = tree.GetBoundingBox(); 317 ExportBox(box); 307 318 308 319 while (!tStack.empty()) … … 332 343 { 333 344 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 345 334 346 // export view cell geometry 347 335 348 if (!tree.StorePolys() && leaf->GetViewCell()) 349 { 336 350 ExportViewCell(leaf->GetViewCell()); 351 } 352 337 353 } 338 354 } -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dParser.cpp
r261 r262 378 378 379 379 /*********************************************************** 380 * class X3dViewCellsParseHandlers implemenation 380 * class X3dViewCellsParseHandlers implemenation * 381 381 ***********************************************************/ 382 382 … … 421 421 int len = attributes.getLength(); 422 422 int i; 423 423 // clear previous vertex indices 424 mCurrentVertexIndices.clear(); 424 425 for (i=0; i < len; i++) 425 426 { … … 460 461 461 462 VertexContainer vertices; 462 463 463 464 for (int i=0; i < len; i++) 464 465 { … … 498 499 499 500 Vector3 v(x, y, z); 500 vertices.push_back(v); 501 vertices.push_back(v); 501 502 } 502 503 } 503 504 } 504 505 505 506 506 … … 511 511 vertices[mCurrentVertexIndices[i+2]]); 512 512 513 513 // create view cell from base triangle 514 514 const float height = 10; 515 515 mViewCells->push_back(ViewCell::ExtrudeViewCell(baseTri, height)); 516 517 Mesh *mesh = mViewCells->back()->GetMesh(); 518 #ifdef _DEBUG 519 Debug << "Viewcell :" 520 << mesh->mVertices[0] << " " << mesh->mVertices[1] << " " << mesh->mVertices[2] << " " 521 << mesh->mVertices[3] << " " << mesh->mVertices[4] << " " << mesh->mVertices[5] << "\n"; 522 #endif 516 523 } 517 524 } -
trunk/VUT/GtpVisibilityPreprocessor/src/common.h
r261 r262 128 128 129 129 #ifndef DEL_PTR 130 #define DEL_PTR(ptr) while (0) {if (ptr) {delete (ptr); (ptr) = NULL;}} 131 #endif 132 130 #define DEL_PTR(ptr) do {if (ptr) { \ 131 delete (ptr); \ 132 (ptr) = 0;}} \ 133 while (0) 134 #endif 135 // Clears a container (i.e., a vector of pointers) and deletes the pointers 133 136 #ifndef CLEAR_CONTAINER 134 #define CLEAR_CONTAINER(co) while (!co.empty()) {delete co.back(); co.pop_back();} 137 #define CLEAR_CONTAINER(co) do { while (!(co).empty()) { \ 138 DEL_PTR((co).back()); \ 139 (co).pop_back();}} \ 140 while (0) 135 141 #endif 136 142
Note: See TracChangeset
for help on using the changeset viewer.