]> Creatis software - creaImageIO.git/blob - appli/TestWxSimpleView/main.cxx
58ffcdbd877d2542551d321b2e5c0633340e3c34
[creaImageIO.git] / appli / TestWxSimpleView / main.cxx
1 #include <creaImageIOSystem.h>
2 #include <creaWx.h>
3 #include <creaImageIOWxSimpleDlg.h>
4 #include <creaVtkBasicSlicer.h>
5
6 // Just to test the selection of file(s), directory or from creaImageIO database.
7 class myApp : public wxApp
8 {
9 public:
10   bool OnInit( );
11   int  OnExit() { return true; }
12 };
13
14 IMPLEMENT_APP(myApp);
15
16 CREA_WXMAIN_WITH_CONSOLE
17
18 bool myApp::OnInit( )
19 {
20   wxApp::OnInit();
21 #ifdef __WXGTK__
22   //See http://www.wxwindows.org/faqgtk.htm#locale
23   setlocale(LC_NUMERIC, "C");
24 #endif
25    wxInitAllImageHandlers();
26
27    creaImageIO::SetGimmickMessageLevel(5);
28    creaImageIO::SetGimmickDebugMessageLevel(0);
29
30    creaImageIO::WxSimpleDlg x(0);
31    x.ShowModal();
32    std::vector <vtkImageData*> test = x.getImagesSelected();
33    if(test.size() >0)
34    {
35         crea::VtkBasicSlicer(test.front());
36    }
37    
38    return false;
39 }
40
41