/*========================================================================= Program: wxMaracas Module: $RCSfile: CutModelManager.h,v $ Language: C++ Date: $Date: 2009/12/08 13:42:39 $ Version: $Revision: 1.4 $ Copyright: (c) 2002, 2003 License: This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef __CutModelManagerH__ #define __CutModelManagerH__ #include #include #include #include "vtkImageData.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderer.h" #include #include "CutModelException.h" #include "CutModelData.h" #include "CutModelSaveBinInfo.h" class CutModelManager { public: CutModelManager(std::string path); ~CutModelManager(); void setImageData(vtkImageData* img); void setInteractor(vtkRenderWindowInteractor* interactor); void setRenderer(vtkRenderer* renderer); void onAddCutModel(int id, vtkCommand* observer) throw( CutModelException); double* getImageRange()throw( CutModelException); void changeOpacity(int id,int opacity)throw( CutModelException); void ShowViewBox(int id,bool check)throw( CutModelException); void ChangeShape(int id,int selection)throw( CutModelException); void changeColor(int id,double r,double g,double b)throw( CutModelException); void updateActorDirection(int id)throw( CutModelException); void RemoveActor(int id)throw( CutModelException); void ExecuteCut(int id, double* range, bool isinside)throw( CutModelException); vtkImageData* GetResultImage(); void RefreshActor(int id); void SaveCutModelData(std::string filename)throw( CutModelException); void LoadCutModelData(std::string filename)throw( CutModelException); CutModelSaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModelException); int Undo()throw( CutModelException); int Redo()throw( CutModelException); private: int _currentaction; void checkInvariant() throw( CutModelException); std::string _path; vtkImageData* _img; vtkImageData* _img2; vtkRenderer* _render; vtkRenderWindowInteractor* _interactor; std::vector _vectordata; std::vector _undoredo; CutModelData* getCutModelData(int id)throw( CutModelException); }; #endif