Changeset 1344 for GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
- Timestamp:
- 09/12/06 17:39:08 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r1315 r1344 15 15 #include "Beam.h" 16 16 #include "IntersectableWrapper.h" 17 #include "Triangle3.h" 17 18 18 19 … … 20 21 21 22 22 VrmlExporter::VrmlExporter(const string filename): Exporter(filename)23 VrmlExporter::VrmlExporter(const string filename): Exporter(filename) 23 24 { 24 25 stream.open(mFilename.c_str()); … … 159 160 160 161 stream<<"</Group>"<<endl; 161 }162 163 164 void VrmlExporter::ExportIntersectable(Intersectable *object)165 {166 switch (object->Type())167 {168 case Intersectable::MESH_INSTANCE:169 ExportMeshInstance((MeshInstance *)object);170 break;171 case Intersectable::TRANSFORMED_MESH_INSTANCE:172 ExportTransformedMeshInstance(dynamic_cast<TransformedMeshInstance *>(object));173 break;174 case Intersectable::VIEW_CELL:175 ExportViewCell(dynamic_cast<ViewCell *>(object));176 break;177 case Intersectable::KD_INTERSECTABLE:178 ExportKdIntersectable(*(dynamic_cast<KdIntersectable *>(object)));179 break;180 default:181 cerr << "Sorry the export for object type " << Intersectable::GetTypeName(object) << " is not available yet" << endl;182 break;183 }184 }185 186 187 void VrmlExporter::ExportMeshInstance(MeshInstance *object)188 {189 // $$JB$$190 // in the future check whether the mesh was not already exported191 // and use a reference to the that mesh instead192 ExportMesh(object->GetMesh());193 }194 195 196 void VrmlExporter::ExportTransformedMeshInstance(TransformedMeshInstance *mi)197 {198 Mesh mesh(*mi->GetMesh());199 200 Matrix4x4 m;201 mi->GetWorldTransform(m);202 mesh.ApplyTransformation(m);203 204 ExportMesh(&mesh);205 }206 207 208 void VrmlExporter::ExportViewCells(const ViewCellContainer &viewCells)209 {210 ViewCellContainer::const_iterator it, it_end = viewCells.end();211 212 for (it = viewCells.begin(); it != it_end; ++ it)213 {214 ExportViewCell(*it);215 }216 162 } 217 163
Note: See TracChangeset
for help on using the changeset viewer.