3 #include <QApplication>
5 #include <QSplashScreen>
7 #include <QDesktopWidget>
10 #include "vvMainWindow.h"
11 #include "vvConstants.h"
13 //------------------------------------------------------------------------------
14 int main( int argc, char** argv )
17 HWND hWnd = GetConsoleWindow();
18 ShowWindow( hWnd, SW_HIDE );
23 QApplication app( argc, argv );
24 Q_INIT_RESOURCE(vvIcons);
25 //QPixmap pixmap(":/splashscreen.PNG");
26 QSplashScreen *splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/new/prefix1/splashscreen.PNG")));
27 /*splash->showMessage("VV 1.0 developped by Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr and CREATIS-LRMN http://www.creatis.insa-lyon.fr",(Qt::AlignRight | Qt::AlignBottom));*/
29 QTimer::singleShot(2000, splash, SLOT(close()));
30 while (!splash->isHidden())
35 //Try to give the window a sensible default size
36 int width=QApplication::desktop()->width()*0.8;
37 int height=QApplication::desktop()->height()*0.9;
38 if (width> 1.5*height)
40 window.resize(width,height);
44 std::vector<std::string> filenames;
45 std::vector<std::pair<int ,std::string> > overlays;
46 std::vector<std::pair<int ,std::string> > vector_fields;
49 for (int i = 1; i < argc; i++)
51 std::string temp = argv[i];
54 assert(filenames.size()>=1);
55 vector_fields.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
58 else if (temp=="--overlay")
60 assert(filenames.size()>=1);
61 overlays.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
62 i++; //skip overlay name
65 filenames.push_back(temp);
67 window.LoadImages(filenames,IMAGE);
68 for (std::vector<std::pair<int ,std::string> >::iterator i=overlays.begin();
69 i!=overlays.end();i++)
70 window.AddOverlayImage((*i).first,(*i).second.c_str());
71 for (std::vector<std::pair<int ,std::string> >::iterator i=vector_fields.begin();
72 i!=vector_fields.end();i++)
73 window.AddField((*i).second.c_str(), (*i).first);