]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxViewer.h
memory leak tracking
[creaImageIO.git] / src2 / creaImageIOWxViewer.h
index f416cfc6b59fabc244d48bf491da70ba82ba385a..a13632f16ed8669380875ee7e28ccd68a9723aed 100644 (file)
@@ -10,6 +10,7 @@
 #include <wx/splitter.h>
 
 #include <creaImageIOSystem.h>
+#include <creaImageIOImagePointerHolder.h>
 
 // For image preview 
 // vtk and wxvtk classes
@@ -23,10 +24,9 @@ namespace creaImageIO
 
   class WxViewer : public wxPanel
   {
-
   public:
-    //   friend class ThreadedMovie;
-    /// Ctor 
+    /// Ctors 
     WxViewer();
     WxViewer(wxWindow *parent, 
                   const wxWindowID id,
@@ -35,46 +35,43 @@ namespace creaImageIO
                   const wxSize& size);
     /// Dtor
     virtual ~WxViewer();
-    ///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();
-    /// 
+    /// Shows the next image in the image vector
     void ShowNextImage();
-    
-    void OnInternalIdle();
+       ///Starts the image player
+       void StartPlayer();
+       ///Stops the image player
+    void StopPlayer();
+       ///Refreshes the interface if the current image shown has changed
+    bool RefreshIfNecessary();
+       ///Sets a new image vector to be read
 
-       void StopPlayer();
+       void SetImageVector(std::vector<boost::shared_ptr<ImagePointerHolder> > &pointers);
+  
 
   private:
-   ///Shows the image passed as parameter
+    ///Shows the image passed as parameter
     void ShowImage(vtkImageData* im);
-
     /// Previewer
     vtkImageViewer2* mViewer;
     /// Associated wxvtk interactor
     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;
-    /// 
+    /// Current image shown
     int mCurrent;
     ///The threaded movie player
     WxViewerPlayer* mPlayer;
-
     /// The mutex
     wxMutex mMutex;
+    /// Boolean that declares if the player needs to be refreshed
+    bool mNeedRefresh;
+       ///Last image shown
+    vtkImageData* mLastImageShown;
+       ///The vectors of images to be shown
+       std::vector< boost::shared_ptr<ImagePointerHolder> > imagePointers;
 
   };