#ifndef __creaImageIOWxViewer_h_INCLUDED__ #define __creaImageIOWxViewer_h_INCLUDED__ #ifdef USE_WXWIDGETS // wx #include #include #include #include #include #include // For image preview // vtk and wxvtk classes #include "creawxVTKRenderWindowInteractor.h" #include "vtkImageViewer2.h" namespace creaImageIO { class WxViewerPlayer; class WxViewer : public wxPanel { public: /// Ctors WxViewer(); WxViewer(wxWindow *parent, const wxWindowID id, wxString title, const wxPoint& pos, const wxSize& size); /// Dtor virtual ~WxViewer(); /// Shows the next image in the image vector void ShowNextImage(); ///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: /// 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; /// 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; }; } #endif // USE_WIDGETS // EOF #endif