vcglib/apps/test/segmentation3d/main.cpp

59 lines
1.4 KiB
C++
Raw Normal View History

2004-12-17 12:17:36 +01:00
#include <qapplication.h>
#include <qimage.h>
#include <segmentform.h>
2005-02-01 19:07:14 +01:00
//#include <segmentator.h>
2004-12-17 12:17:36 +01:00
#include <qdir.h>
#include <qcolor.h>
#include <SimpleGLWidget.h>
#include <qtimer.h>
2005-02-01 19:07:14 +01:00
2004-12-17 12:17:36 +01:00
Segmentator *s;
QTimer *timer;
2005-02-01 19:07:14 +01:00
2004-12-17 12:17:36 +01:00
int main( int argc, char ** argv )
{
2004-12-20 18:56:01 +01:00
s=new Segmentator();
2004-12-17 12:17:36 +01:00
//s->LoadFromDir("./venacava/","prova.txt");//to chANGE
2004-12-21 18:38:42 +01:00
2004-12-20 18:56:01 +01:00
//s->InitSegmentation(0.5,0.2,20,10.f);
2004-12-21 18:38:42 +01:00
2004-12-17 12:17:36 +01:00
QApplication a( argc, argv );
SegmentForm w;
w.show();
//assign pointer to pricipal form
w.simpleGLWidget1->w=&w;
2005-02-01 19:07:14 +01:00
2004-12-17 12:17:36 +01:00
2004-12-21 18:38:42 +01:00
#ifdef _TORUS
2005-04-20 17:20:13 +02:00
//w.simpleGLWidget1->SetExtractionParameters();
2005-07-18 17:46:23 +02:00
//s->SetSegmentParameters(10,0.5f,0.2f,0.8f,0.4f,3.f,vcg::Point3f(1.f,1.f,1.f),1000,30);
s->SetSegmentParameters(10,0.5f,0.6f,0.25f,0.2f,3.f,vcg::Point3f(1.f,1.f,1.f),1000,15);
2005-04-20 17:20:13 +02:00
s->BBox().min=Point3f(-40.f,-40.f,-40.f);
s->BBox().max=Point3f(40.f,40.f,40.f);
2005-04-22 11:23:09 +02:00
s->InitSegmentation(Point3f(-25.f,0.f,0.f));
2005-04-20 17:20:13 +02:00
w.simpleGLWidget1->CenterExtraction=vcg::Point3f(0.f,-25.f,0.f);
s->gray_init=100;
2004-12-21 18:38:42 +01:00
#endif
2005-02-01 19:07:14 +01:00
2004-12-20 18:56:01 +01:00
/*s=new Segmentator();*/
2004-12-17 12:17:36 +01:00
//s->LoadFromDir("./venacava/","prova.txt");//to chANGE
2004-12-21 18:38:42 +01:00
////s->InitSegmentation(0.5,0.2,20,10.f);
//w.simpleGLWidget1->path="./venacava/";
2004-12-17 12:17:36 +01:00
timer = new QTimer(w.simpleGLWidget1 );
QTimer::connect( timer, SIGNAL(timeout()), w.simpleGLWidget1, SLOT(Update()) );
2005-07-18 17:46:23 +02:00
timer->start(0); //
2004-12-17 12:17:36 +01:00
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}