]> Creatis software - cpMesh.git/blob - appli/examples/example_ReadVTKMeshAsQuadEdgeMesh.cxx
First commit
[cpMesh.git] / appli / examples / example_ReadVTKMeshAsQuadEdgeMesh.cxx
1 #include <cstdlib>
2 #include <iostream>
3 #include <string>
4
5 #include <cpm/DataStructures/QuadEdgeMesh.h>
6 #include <itkVTKPolyDataReader.h>
7
8 // -------------------------------------------------------------------------
9 const unsigned int Dimension = 3;
10 typedef float TScalar;
11 typedef cpm::DataStructures::QuadEdgeMesh< TScalar, Dimension > TMesh;
12
13 // -------------------------------------------------------------------------
14 int main( int argc, char* argv[] )
15 {
16   if( argc < 2 )
17   {
18     std::cerr
19       << "Usage: " << argv[ 0 ]
20       << " input_mesh_in_vtk_format"
21       << std::endl;
22     return( 1 );
23
24   } // fi
25   std::string input_mesh_fn = argv[ 1 ];
26
27   typedef itk::VTKPolyDataReader< TMesh > TReader;
28   TReader::Pointer reader = TReader::New( );
29   reader->SetFileName( input_mesh_fn );
30   reader->Update( );
31
32   return( 0 );
33 }
34
35 // eof - $RCSfile$