Last change
on this file since 107 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
File size:
1.2 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 | { |
---|
[32] | 18 | /*if to many arguments*/ |
---|
[20] | 19 | if(argc>2){ |
---|
| 20 | cout << "error : argument must be a file name or nothing" << endl; |
---|
[26] | 21 | cout << "usage : Viewer [file]" << endl; |
---|
[20] | 22 | return 0; |
---|
| 23 | } |
---|
| 24 | |
---|
[32] | 25 | /*construct the base*/ |
---|
[20] | 26 | Parse *par = new Parse(); |
---|
| 27 | |
---|
[32] | 28 | /*create the window application*/ |
---|
[35] | 29 | QApplication *a=new QApplication (argc,argv); |
---|
[20] | 30 | |
---|
[32] | 31 | if(argc == 2){ |
---|
[26] | 32 | if(par->open_file(argv[1],0)==-1){ |
---|
[20] | 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); |
---|
[35] | 51 | |
---|
[20] | 52 | return a->exec(); |
---|
| 53 | |
---|
| 54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.