Last change
on this file since 48 was
35,
checked in by rosiere, 17 years ago
|
Viewer : Changement de la nomenclature des fichiers de positions, ajout d'exemple
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | /*******************************************/ |
---|
2 | /* */ |
---|
3 | /* viewer application */ |
---|
4 | /* beta test v 1.0 */ |
---|
5 | /* */ |
---|
6 | /*******************************************/ |
---|
7 | |
---|
8 | #include "window.h" |
---|
9 | |
---|
10 | using namespace morpheo::tools::viewer::parser; |
---|
11 | using namespace morpheo::tools::viewer::bdd; |
---|
12 | using namespace morpheo::tools::viewer::graphics; |
---|
13 | |
---|
14 | using namespace std; |
---|
15 | |
---|
16 | int main (int argc, char* argv[]) |
---|
17 | { |
---|
18 | /*if to many arguments*/ |
---|
19 | if(argc>2){ |
---|
20 | cout << "error : argument must be a file name or nothing" << endl; |
---|
21 | cout << "usage : Viewer [file]" << endl; |
---|
22 | return 0; |
---|
23 | } |
---|
24 | |
---|
25 | /*construct the base*/ |
---|
26 | Parse *par = new Parse(); |
---|
27 | |
---|
28 | /*create the window application*/ |
---|
29 | QApplication *a=new QApplication (argc,argv); |
---|
30 | |
---|
31 | if(argc == 2){ |
---|
32 | if(par->open_file(argv[1],0)==-1){ |
---|
33 | cout << "file doesn't exist or is not a valid format" << endl; |
---|
34 | exit(1); |
---|
35 | } |
---|
36 | Window *win = new Window(QString(argv[1])); |
---|
37 | win->_setParse(par); |
---|
38 | win->_init_file(); |
---|
39 | win->show(); |
---|
40 | } |
---|
41 | |
---|
42 | else{ |
---|
43 | |
---|
44 | Window *win = new Window(NULL); |
---|
45 | win->_setParse(par); |
---|
46 | win->show(); |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | a->setStyle(new QPlastiqueStyle); |
---|
51 | |
---|
52 | return a->exec(); |
---|
53 | |
---|
54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.