]> Creatis software - creaImageIO.git/blob - src2/creaImageIOWxViewer.h
Viewer with movie done.
[creaImageIO.git] / src2 / creaImageIOWxViewer.h
1 #ifndef __creaImageIOWxViewer_h_INCLUDED__
2 #define __creaImageIOWxViewer_h_INCLUDED__
3
4 #ifdef USE_WXWIDGETS
5
6 // wx
7 #include <creaWx.h>
8 #include <wx/image.h>
9 #include <wx/imaglist.h>
10 #include <wx/splitter.h>
11
12 #include <creaImageIOSystem.h>
13
14 // For image preview 
15 // vtk and wxvtk classes
16 #include "creawxVTKRenderWindowInteractor.h"
17 #include "vtkImageViewer2.h"
18
19 namespace creaImageIO
20 {
21
22   class WxViewer : public wxFrame
23   {
24
25           public:
26                   friend class ThreadedMovie;
27     /// Ctor 
28     WxViewer();
29     WxViewer(wxWindow *parent, 
30                    const wxWindowID id,
31                    wxString title,
32                    const wxPoint& pos, 
33                    const wxSize& size);
34     /// Dtor
35     virtual ~WxViewer();
36         ///Shows the image in the vector as a movie
37         void ShowImages();
38         ///Shows the image passed as parameter
39         void ShowImage(vtkImageData* im);
40         ///Adds an image to the selection
41         void AddImage(vtkImageData* im);
42         ///Clears the selection of images
43         void ClearImages();
44         ///Returns true if the image vector is empty
45         bool ImagesEmpty();
46
47   private:
48         /// Previewer
49     vtkImageViewer2* mViewer;
50     /// Associated wxvtk interactor
51         crea::creawxVTKRenderWindowInteractor  *mInteractor;
52   
53     int mx1,mx2,my1,my2,mz1,mz2;
54     double mspx,mspy,mspz;
55
56         /// The vector of images to show
57         std::vector<vtkImageData*> images;
58         ///The threaded movie
59         ThreadedMovie* mMovie;
60
61   };
62
63 }
64
65 #endif // USE_WIDGETS
66 // EOF
67 #endif