Last change
on this file since 27 was
26,
checked in by chou, 17 years ago
|
Release 3 du viewer:
Etape 1 et 2 du projet complet et à jour.
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Rev | Line | |
---|
[20] | 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(argc>2){ |
---|
| 19 | cout << "error : argument must be a file name or nothing" << endl; |
---|
[26] | 20 | cout << "usage : Viewer [file]" << endl; |
---|
[20] | 21 | return 0; |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | Parse *par = new Parse(); |
---|
| 25 | |
---|
[26] | 26 | |
---|
[20] | 27 | QApplication *a=new QApplication (argc,argv); |
---|
| 28 | |
---|
[26] | 29 | if(argc == 2){ |
---|
| 30 | if(par->open_file(argv[1],0)==-1){ |
---|
[20] | 31 | cout << "file doesn't exist or is not a valid format" << endl; |
---|
| 32 | exit(1); |
---|
| 33 | } |
---|
| 34 | Window *win = new Window(QString(argv[1])); |
---|
| 35 | win->_setParse(par); |
---|
| 36 | win->_init_file(); |
---|
| 37 | win->show(); |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | else{ |
---|
| 41 | |
---|
| 42 | Window *win = new Window(NULL); |
---|
| 43 | win->_setParse(par); |
---|
| 44 | win->show(); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | a->setStyle(new QPlastiqueStyle); |
---|
| 49 | |
---|
| 50 | return a->exec(); |
---|
| 51 | |
---|
| 52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.