/*========================================================================= Program: wxMaracas Module: $RCSfile: CutModel2Manager.h,v $ Language: C++ Date: $Date: 2009/11/19 15:00:33 $ Version: $Revision: 1.1 $ 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 __CutModel2ManagerH__ #define __CutModel2ManagerH__ #include #include #include #include "vtkImageData.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderer.h" #include #include "CutModel2Exception.h" #include "CutModel2Data.h" #include "CutModel2SaveBinInfo.h" class CutModel2Manager { public: CutModel2Manager(std::string path); ~CutModel2Manager(); void setImageData(vtkImageData* img); void setInteractor(vtkRenderWindowInteractor* interactor); void setRenderer(vtkRenderer* renderer); void onAddCutModel2(int id, vtkCommand* observer) throw( CutModel2Exception); double* getImageRange()throw( CutModel2Exception); void changeOpacity(int id,int opacity)throw( CutModel2Exception); void ShowViewBox(int id,bool check)throw( CutModel2Exception); void ChangeShape(int id,int selection)throw( CutModel2Exception); void changeColor(int id,double r,double g,double b)throw( CutModel2Exception); void updateActorDirection(int id)throw( CutModel2Exception); void RemoveActor(int id)throw( CutModel2Exception); void ExecuteCut(int id, double* range, bool isinside)throw( CutModel2Exception); vtkImageData* GetResultImage(); void RefreshActor(int id); void SaveCutModel2Data(std::string filename)throw( CutModel2Exception); void LoadCutModel2Data(std::string filename)throw( CutModel2Exception); CutModel2SaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModel2Exception); int Undo()throw( CutModel2Exception); int Redo()throw( CutModel2Exception); private: int _currentaction; void checkInvariant() throw( CutModel2Exception); std::string _path; vtkImageData* _img; vtkImageData* _copyimg; vtkRenderer* _render; vtkRenderWindowInteractor* _interactor; std::vector _vectordata; std::vector _undoredo; CutModel2Data* getCutModel2Data(int id)throw( CutModel2Exception); }; #endif