Changeset 1419 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 09/20/06 10:43:22 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r1418 r1419 293 293 } 294 294 295 //cout << "describe:\n" << dummyMesh << endl; 296 //dummyMesh.CheckMesh(); 297 295 298 ExportMesh(&dummyMesh); 296 299 CLEAR_CONTAINER(polys); -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1418 r1419 214 214 const bool isTermination) const; 215 215 216 friend ostream &operator<<(ostream &s, const HierarchyManager &hm) 217 { 218 hm.mHierarchyStats.Print(s); 219 return s; 220 } 221 216 222 protected: 217 223 -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r1418 r1419 499 499 } 500 500 501 502 bool Mesh::CheckMesh() const 503 { 504 VertexContainer::const_iterator vit, vit_end = mVertices.end(); 505 506 for (vit = mVertices.begin(); vit != vit_end; ++ vit) 507 { 508 for (int i = 0; i < 3; ++ i) 509 { 510 const float x = (*vit)[i]; 511 if (x != x) // nan 512 //if (isnan((*vit)[i])) 513 { 514 cout << "warning: vertex is ill defined" << endl; 515 return false; 516 } 517 } 518 } 519 return true; 520 } 521 522 523 void Mesh::Print(ostream &app) const 524 { 525 VertexContainer::const_iterator vit, vit_end = mVertices.end(); 526 527 for (vit = mVertices.begin(); vit != vit_end; ++ vit) 528 { 529 app << (*vit) << " "; 530 } 531 app << endl; 532 533 /*FaceContainer::const_iterator fit, fit_end = mVertices.end(); 534 535 for (vit = mVertices.begin(); vit != vit_end; ++ vit) 536 { 537 app << (*vit); 538 } 539 app << endl;*/ 540 } 541 542 501 543 void 502 544 Mesh::Cleanup() -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
r1418 r1419 210 210 Vector3 GetNormal(const int idx) const; 211 211 212 virtual ostream &Describe(ostream &s) { 212 // $$ matt temp 213 bool CheckMesh() const; 214 215 void Print(ostream &app) const; 216 217 virtual ostream &Describe(ostream &s) const { 213 218 return s<<"Mesh #vertices="<<(int)mVertices.size()<<" #faces="<<(int)mFaces.size(); 214 219 } … … 219 224 friend Mesh *CreateMeshFromBox(const AxisAlignedBox3 &box); 220 225 221 226 friend ostream& operator<< (ostream &s, const Vector3 &A); 227 222 228 protected: 223 229 … … 225 231 int mId; 226 232 }; 233 234 235 // Overload << operator for C++-style output 236 inline ostream& 237 operator<< (ostream &s, const Mesh &A) 238 { 239 A.Print(s); 240 return s; 241 } 227 242 228 243 -
GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
r1379 r1419 182 182 meshProxy.IndexVertices(); 183 183 184 Mesh *mesh = new Mesh( meshProxy.mVertices.size(),185 meshProxy.mFaces.size());184 Mesh *mesh = new Mesh((int)meshProxy.mVertices.size(), 185 (int)meshProxy.mFaces.size()); 186 186 187 187 … … 210 210 for (int k = 0; k < flist[i]->nverts; k++) { 211 211 Vertex *v = vlist[flist[i]->verts[k]]; 212 vc.push_back( meshProxy.mVertices.size());212 vc.push_back((int)meshProxy.mVertices.size()); 213 213 meshProxy.mVertices.push_back(Vector3(v->x, v->y, v->z)); 214 214 } … … 222 222 meshProxy.IndexVertices(); 223 223 224 Mesh *mesh = new Mesh( meshProxy.mVertices.size(),225 meshProxy.mFaces.size());224 Mesh *mesh = new Mesh((int)meshProxy.mVertices.size(), 225 (int)meshProxy.mFaces.size()); 226 226 227 227 mesh->mVertices = meshProxy.mVertices; -
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
r1418 r1419 67 67 mVertices.push_back(tri.mVertices[2]); 68 68 69 VertexContainer::iterator it, it_end = mVertices.end(); 70 71 for (it = mVertices.begin(); it != it_end; ++ it) 72 { 73 cout << (*it) << " "; 74 }cout<<endl<<endl; 69 75 //cout << "poly n: " << GetNormal() << " t normal: " << tri.GetNormal() << endl; 70 76 } … … 584 590 const int n = (int)mesh.mVertices.size(); 585 591 586 //-- add the vertices 592 ///////////// 593 //-- add the vertices to the mesh 594 587 595 VertexContainer::const_iterator vit, vit_end = poly.mVertices.end(); 588 596 for (vit = poly.mVertices.begin(); vit != vit_end; ++ vit) … … 602 610 603 611 // add indices of triangle strip 604 for (int i = 0; i < (int)indices.size(); i += 3)605 { 606 Face *face = new Face( n +indices[i],607 n +indices[i + 1],608 n +indices[i + 2]);612 for (int i = n; i < (int)indices.size() + n; i += 3) 613 { 614 Face *face = new Face(indices[i], 615 indices[i + 1], 616 indices[i + 2]); 609 617 mesh.AddFace(face); 610 618 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1418 r1419 380 380 381 381 382 //////////////////////////////////////////////// 383 // 382 ////////////////////// 384 383 //-- Cast some more sampling after initial construction. 385 384 //-- The additional rays can be used to gain … … 444 443 445 444 //////////////////// 446 //447 445 //-- post processing of the initial construction 448 446 //-- We can bottom-up merge the view cells in this step … … 4796 4794 4797 4795 // print subdivision statistics 4798 Debug << endl << endl ;4799 mHierarchyManager->PrintHierarchyStatistics(Debug);4796 Debug << endl << endl << mHierarchyManager << endl; 4797 //mHierarchyManager->PrintHierarchyStatistics(Debug); 4800 4798 4801 4799 if (0) … … 5157 5155 cout << "visualization using " << (int)rays.size() << " samples" << endl; 5158 5156 Debug << "visualization using " << (int)rays.size() << " samples" << endl; 5159 Debug << "\nOutput view cells: " << endl; 5160 5157 5161 5158 const bool sortedViewCells = false; 5162 5159 … … 5169 5166 int limit = min(leafOut, (int)mViewCells.size()); 5170 5167 int raysOut = 0; 5168 5169 cout << "\nOutput of " << limit << " view cells: " << endl; 5171 5170 5172 5171 /////////////// … … 5234 5233 //-- export objects seen from the rays 5235 5234 Intersectable::NewMail(); 5236 VssRayContainer::const_iterator vcit, vcit_end = vcRays.end(); 5235 5236 VssRayContainer::const_iterator vcit, vcit_end = vcRays.end(); 5237 5237 for (vcit = vcRays.begin(); vcit != vcit_end; ++ vcit) 5238 5238 { … … 5244 5244 { 5245 5245 obj->Mail(); 5246 //exporter->ExportIntersectable(obj);5246 exporter->ExportIntersectable(obj); 5247 5247 } 5248 5248 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r1404 r1419 125 125 const Vector3 a = (*ri)->GetOrigin(); 126 126 const Vector3 b = (*ri)->mTerminationObject ? (*ri)->GetTermination() : a + 1000 * Normalize((*ri)->GetDir()); 127 //const Vector3 b = (*ri)->GetTermination(); // matt: change back!! 128 129 stream << a.x << " " << a.y << " " << a.z << " ,"; 130 stream << b.x << " " << b.y << " " << b.z << " ,\n"; 127 128 bool isnan = false; 129 130 if ((a[0] != a[0]) || (a[1] != a[1]) || (a[2] != a[2])) 131 { 132 cout << "error a"<<endl; 133 isnan = true; 134 } 135 136 if ((b[0] != b[0]) || (b[1] != b[1]) || (b[2] != b[2])) 137 { 138 cout << "error b"<<endl; 139 isnan = true; 140 } 141 142 if (!isnan) 143 { 144 stream << a.x << " " << a.y << " " << a.z << " ,"; 145 stream << b.x << " " << b.y << " " << b.z << " ,\n"; 146 } 131 147 } 132 148 -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r1418 r1419 255 255 { 256 256 TriangleIntersectable *ti = new TriangleIntersectable(*tit); 257 cout << "t: " << (*tit) << endl; 257 258 mCurrentNode->mGeometry.push_back(ti); 258 259 }
Note: See TracChangeset
for help on using the changeset viewer.