]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxViewer.h
*** empty log message ***
[creaImageIO.git] / src2 / creaImageIOWxViewer.h
index 9323e3de3e32d329e58065acdad0c0425548c8d6..aa0079c320e7ebe202f0cf22a61928c5c99ac982 100644 (file)
 namespace creaImageIO
 {
 
-  class WxViewer : public wxFrame
+  class WxViewerPlayer;
+
+  class WxViewer : public wxPanel
   {
 
-         public:
-                 friend class ThreadedMovie;
+  public:
+    //   friend class ThreadedMovie;
     /// Ctor 
     WxViewer();
     WxViewer(wxWindow *parent, 
@@ -33,30 +35,52 @@ namespace creaImageIO
                   const wxSize& size);
     /// Dtor
     virtual ~WxViewer();
-       ///Shows the image in the vector as a movie
-       void ShowImages();
-       ///Shows the image passed as parameter
-       void ShowImage(vtkImageData* im);
-       ///Adds an image to the selection
-       void AddImage(vtkImageData* im);
-       ///Clears the selection of images
-       void ClearImages();
-       ///Returns true if the image vector is empty
-       bool ImagesEmpty();
+    ///Shows the image in the vector as a movie
+    //void ShowImages();
+    /// Sets the movie size
+    void SetMovieSize(unsigned int);
+    ///Sets the ith image of the movie
+    void SetImage(int i, vtkImageData* im);
+    ///Clears the selection of images
+    //  void ClearImages();
+    ///Returns true if the image vector is empty
+    bool ImagesEmpty();
+    /// 
+    void ShowNextImage();
+    
+    void OnInternalIdle();
+
+    void StopPlayer();
+
+    bool RefreshIfNecessary();
 
   private:
-       /// Previewer
+   ///Shows the image passed as parameter
+    void ShowImage(vtkImageData* im);
+
+    /// Previewer
     vtkImageViewer2* mViewer;
     /// Associated wxvtk interactor
-       crea::creawxVTKRenderWindowInteractor  *mInteractor;
-  
+    crea::creawxVTKRenderWindowInteractor  *mInteractor;
+    
+    /// Current extent 
     int mx1,mx2,my1,my2,mz1,mz2;
+    /// Current spacing
     double mspx,mspy,mspz;
 
-       /// The vector of images to show
-       std::vector<vtkImageData*> images;
-       ///The threaded movie
-       ThreadedMovie* mMovie;
+    /// The vector of images to show
+    std::vector<vtkImageData*> images;
+    /// 
+    int mCurrent;
+    ///The threaded movie player
+    WxViewerPlayer* mPlayer;
+
+    /// The mutex
+    wxMutex mMutex;
+
+    /// 
+    bool mNeedRefresh;
+    vtkImageData* mLastImageShown;
 
   };
 
@@ -64,4 +88,4 @@ namespace creaImageIO
 
 #endif // USE_WIDGETS
 // EOF
-#endif  
\ No newline at end of file
+#endif