source: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp @ 32

Last change on this file since 32 was 32, checked in by chou, 17 years ago

Morpheo Viewer Release 5.0
Réalisation des étapes 3 (fin) et 4.

  • 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
10using namespace morpheo::tools::viewer::parser;
11using namespace morpheo::tools::viewer::bdd;
12using namespace morpheo::tools::viewer::graphics;
13
14using namespace std;
15
16int 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.