00001 #include <qapplication.h>
00002 #include "mainframe.h"
00003
00004 #include <wrap\io_tetramesh\import_ts.h>
00005 #include <wrap\io_tetramesh\import_ply.h>
00006 #include <vcg\complex\tetramesh\update\topology.h>
00007 #include <vcg\complex\tetramesh\update\bounding.h>
00008 #include <vcg\complex\tetramesh\update\normal.h>
00009
00010
00011
00012 #include "myglwidget.h"
00013
00014
00015 MyTetraMesh TM;
00016 MyTetraMesh *tm;
00017 TetraStats<MyTetraMesh> Stats;
00018 typedef vcg::tetra::io::ImporterTS<MyTetraMesh> ImpTS;
00019 typedef vcg::tetra::UpdateTetraTopology<MyTetraMesh::VertexContainer ,MyTetraMesh::TetraContainer > UT;
00020 typedef vcg::tetra::UpdateNormals<MyTetraMesh> UN;
00021 typedef vcg::tetra::UpdateBounding<MyTetraMesh> UB;
00022
00023
00024
00025
00026 void openTetraMesh(const char* filename)
00027 {
00028
00029 QString path=QString(filename);
00030 QString ext =path.right(3);
00031 TM=MyTetraMesh();
00032
00033 if (ext==".ts")
00034 ImpTS::Open(TM,filename);
00035 else
00036 vcg::tetra::io::ImporterPLY<MyTetraMesh> ::Open(TM,filename);
00037
00038 UT::TTTopology(TM.vert,TM.tetra);
00039 UT::ClearVTTopology(TM.vert,TM.tetra);
00040 UT::VTTopology(TM.vert,TM.tetra);
00041 UN::PerVertex(TM);
00042 UB::Box(TM);
00043 tm=&TM;
00044 Stats.SetTetraMesh(tm);
00045 Stats.Update();
00046 }
00047
00048
00049
00050 int main( int argc, char ** argv )
00051 {
00052
00053 tm=0;
00054
00055 QApplication a( argc, argv );
00056 MainFrame w;
00057
00058 w.show();
00059
00060 a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
00061
00062 return a.exec();
00063 }
00064