X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOWxViewer.h;h=b807f7cc68aba7b9d74809cf7c717e4263eb7325;hb=8392c8e1b57464fe92e6280b88f69cabfbac58cf;hp=aa0079c320e7ebe202f0cf22a61928c5c99ac982;hpb=b2aa225767df8c22bd10d4fa893c2327a1e19aa4;p=creaImageIO.git diff --git a/src2/creaImageIOWxViewer.h b/src2/creaImageIOWxViewer.h index aa0079c..b807f7c 100644 --- a/src2/creaImageIOWxViewer.h +++ b/src2/creaImageIOWxViewer.h @@ -10,6 +10,7 @@ #include #include +#include // 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,52 +35,63 @@ 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 SetImageVector(std::vector > &pointers); + + /// Set value of slider control + void SetValue(); private: - ///Shows the image passed as parameter - void ShowImage(vtkImageData* im); + /// Event to resume or start cine loop + void OnCineLoop(wxCommandEvent &Event); + + /// Event to change displayed frames with slide control + void OnSlide(wxCommandEvent &Event); + + + ///Shows the image passed as parameter + void ShowImage(vtkImageData* im); /// Previewer vtkImageViewer2* mViewer; + + ///Slider + wxSlider *mslide ; + + ///CheckBox to cine loop + wxCheckBox *mcheck; + /// 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 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 > imagePointers; + + /// Sizers to preview images + wxFlexGridSizer *mflexSizer; + wxBoxSizer *mtopSizer; };