1 /*=========================================================================
4 Module: $RCSfile: CutModel2Manager.h,v $
6 Date: $Date: 2009/11/19 15:24:57 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
21 #ifndef __CutModel2ManagerH__
22 #define __CutModel2ManagerH__
28 #include "vtkImageData.h"
29 #include "vtkRenderWindowInteractor.h"
30 #include "vtkRenderer.h"
31 #include <vtkPolyDataWriter.h>
33 #include "CutModel2Exception.h"
34 #include "CutModel2Data.h"
35 #include "CutModel2SaveBinInfo.h"
39 class CutModel2Manager {
42 CutModel2Manager(std::string path);
45 void setImageData(vtkImageData* img);
47 void setInteractor(vtkRenderWindowInteractor* interactor);
49 void setRenderer(vtkRenderer* renderer);
51 void onAddCutModel2(int id, vtkCommand* observer) throw( CutModel2Exception);
53 double* getImageRange()throw( CutModel2Exception);
55 void changeOpacity(int id,int opacity)throw( CutModel2Exception);
57 void ShowViewBox(int id,bool check)throw( CutModel2Exception);
59 void ChangeShape(int id,int selection)throw( CutModel2Exception);
61 void changeColor(int id,double r,double g,double b)throw( CutModel2Exception);
63 void updateActorDirection(int id)throw( CutModel2Exception);
65 void RemoveActor(int id)throw( CutModel2Exception);
67 void ExecuteCut(int id, double* range, bool isinside)throw( CutModel2Exception);
69 vtkImageData* GetResultImage();
71 void RefreshActor(int id);
73 void SaveCutModel2Data(std::string filename)throw( CutModel2Exception);
75 void LoadCutModel2Data(std::string filename)throw( CutModel2Exception);
77 CutModel2SaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModel2Exception);
79 int Undo()throw( CutModel2Exception);
81 int Redo()throw( CutModel2Exception);
86 void checkInvariant() throw( CutModel2Exception);
89 vtkImageData* _copyimg;
91 vtkRenderWindowInteractor* _interactor;
93 std::vector<CutModel2Data*> _vectordata;
94 std::vector<CutModel2SaveBinInfo*> _undoredo;
95 CutModel2Data* getCutModel2Data(int id)throw( CutModel2Exception);