1 /*=========================================================================
4 Module: $RCSfile: CutModelManager.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 __CutModelManagerH__
22 #define __CutModelManagerH__
28 #include "vtkImageData.h"
29 #include "vtkRenderWindowInteractor.h"
30 #include "vtkRenderer.h"
31 #include <vtkPolyDataWriter.h>
33 #include "CutModelException.h"
34 #include "CutModelData.h"
35 #include "CutModelSaveBinInfo.h"
39 class CutModelManager {
42 CutModelManager(std::string path);
45 void setImageData(vtkImageData* img);
47 void setInteractor(vtkRenderWindowInteractor* interactor);
49 void setRenderer(vtkRenderer* renderer);
51 void onAddCutModel(int id, vtkCommand* observer) throw( CutModelException);
53 double* getImageRange()throw( CutModelException);
55 void changeOpacity(int id,int opacity)throw( CutModelException);
57 void ShowViewBox(int id,bool check)throw( CutModelException);
59 void ChangeShape(int id,int selection)throw( CutModelException);
61 void changeColor(int id,double r,double g,double b)throw( CutModelException);
63 void updateActorDirection(int id)throw( CutModelException);
65 void RemoveActor(int id)throw( CutModelException);
67 void ExecuteCut(int id, double* range, bool isinside)throw( CutModelException);
69 vtkImageData* GetResultImage();
71 void RefreshActor(int id);
73 void SaveCutModelData(std::string filename)throw( CutModelException);
75 void LoadCutModelData(std::string filename)throw( CutModelException);
77 CutModelSaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModelException);
79 int Undo()throw( CutModelException);
81 int Redo()throw( CutModelException);
86 void checkInvariant() throw( CutModelException);
89 vtkImageData* _copyimg;
91 vtkRenderWindowInteractor* _interactor;
93 std::vector<CutModelData*> _vectordata;
94 std::vector<CutModelSaveBinInfo*> _undoredo;
95 CutModelData* getCutModelData(int id)throw( CutModelException);