Ignore:
Timestamp:
09/12/06 17:39:08 (18 years ago)
Author:
mattausch
Message:

worked on triangle processing. logical units will be created by grouping objects
using their visibility definitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp

    r1315 r1344  
    1515#include "Beam.h" 
    1616#include "IntersectableWrapper.h" 
     17#include "Triangle3.h" 
    1718 
    1819 
     
    2021 
    2122 
    22 VrmlExporter::VrmlExporter(const string filename):Exporter(filename) 
     23VrmlExporter::VrmlExporter(const string filename): Exporter(filename) 
    2324{ 
    2425        stream.open(mFilename.c_str()); 
     
    159160   
    160161        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 exported 
    191         // and use a reference to the that mesh instead 
    192         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         } 
    216162} 
    217163 
Note: See TracChangeset for help on using the changeset viewer.