]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/kernel/CutModel2Manager.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / kernel / CutModel2Manager.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: CutModel2Manager.h,v $
5   Language:  C++
6   Date:      $Date: 2009/11/19 15:00:33 $
7   Version:   $Revision: 1.1 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
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.
15
16 =========================================================================*/
17
18
19
20
21 #ifndef __CutModel2ManagerH__
22 #define __CutModel2ManagerH__
23
24 #include <iostream>
25 #include <stdio.h>
26 #include <vector>
27
28 #include "vtkImageData.h"
29 #include "vtkRenderWindowInteractor.h"
30 #include "vtkRenderer.h"
31 #include <vtkPolyDataWriter.h>
32
33 #include "CutModel2Exception.h"
34 #include "CutModel2Data.h"
35 #include "CutModel2SaveBinInfo.h"
36
37
38
39 class CutModel2Manager  {
40
41 public:
42         CutModel2Manager(std::string path);
43         ~CutModel2Manager();
44
45         void setImageData(vtkImageData* img);
46
47         void setInteractor(vtkRenderWindowInteractor* interactor);
48
49         void setRenderer(vtkRenderer* renderer);
50         
51         void onAddCutModel2(int id, vtkCommand* observer) throw( CutModel2Exception);
52
53         double* getImageRange()throw( CutModel2Exception);
54
55         void changeOpacity(int id,int opacity)throw( CutModel2Exception);
56
57         void ShowViewBox(int id,bool check)throw( CutModel2Exception);
58
59         void ChangeShape(int id,int selection)throw( CutModel2Exception);
60
61         void changeColor(int id,double r,double g,double b)throw( CutModel2Exception);
62
63         void updateActorDirection(int id)throw( CutModel2Exception);
64
65         void RemoveActor(int id)throw( CutModel2Exception);
66
67         void ExecuteCut(int id, double* range, bool isinside)throw( CutModel2Exception);
68
69         vtkImageData* GetResultImage();
70
71         void RefreshActor(int id);
72
73         void SaveCutModel2Data(std::string filename)throw( CutModel2Exception);
74
75         void LoadCutModel2Data(std::string filename)throw( CutModel2Exception);
76
77         CutModel2SaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModel2Exception);
78
79         int Undo()throw( CutModel2Exception);
80
81         int Redo()throw( CutModel2Exception);
82 private:
83         
84         int _currentaction;
85
86         void checkInvariant() throw( CutModel2Exception);
87         std::string _path;
88         vtkImageData* _img;
89         vtkImageData* _copyimg;
90         vtkRenderer* _render;
91         vtkRenderWindowInteractor* _interactor;
92
93         std::vector<CutModel2Data*> _vectordata;
94         std::vector<CutModel2SaveBinInfo*> _undoredo;
95         CutModel2Data* getCutModel2Data(int id)throw( CutModel2Exception);
96         
97 };
98
99 #endif