]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / kernel / CutModelManager.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: CutModelManager.h,v $
5   Language:  C++
6   Date:      $Date: 2009/12/08 13:42:39 $
7   Version:   $Revision: 1.4 $
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 __CutModelManagerH__
22 #define __CutModelManagerH__
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 "CutModelException.h"
34 #include "CutModelData.h"
35 #include "CutModelSaveBinInfo.h"
36
37
38
39 class CutModelManager  {
40
41 public:
42         CutModelManager(std::string path);
43         ~CutModelManager();
44
45         void setImageData(vtkImageData* img);
46
47         void setInteractor(vtkRenderWindowInteractor* interactor);
48
49         void setRenderer(vtkRenderer* renderer);
50         
51         void onAddCutModel(int id, vtkCommand* observer) throw( CutModelException);
52
53         double* getImageRange()throw( CutModelException);
54
55         void changeOpacity(int id,int opacity)throw( CutModelException);
56
57         void ShowViewBox(int id,bool check)throw( CutModelException);
58
59         void ChangeShape(int id,int selection)throw( CutModelException);
60
61         void changeColor(int id,double r,double g,double b)throw( CutModelException);
62
63         void updateActorDirection(int id)throw( CutModelException);
64
65         void RemoveActor(int id)throw( CutModelException);
66
67         void ExecuteCut(int id, double* range, bool isinside)throw( CutModelException);
68
69         vtkImageData* GetResultImage();
70
71         void RefreshActor(int id);
72
73         void SaveCutModelData(std::string filename)throw( CutModelException);
74
75         void LoadCutModelData(std::string filename)throw( CutModelException);
76
77         CutModelSaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModelException);
78
79         int Undo()throw( CutModelException);
80
81         int Redo()throw( CutModelException);
82
83 private:
84         
85         int _currentaction;
86
87         void checkInvariant() throw( CutModelException);
88         std::string _path;
89         vtkImageData* _img;
90         vtkImageData* _img2;
91         vtkRenderer* _render;
92         vtkRenderWindowInteractor* _interactor;
93
94         std::vector<CutModelData*> _vectordata;
95         std::vector<CutModelSaveBinInfo*> _undoredo;
96         CutModelData* getCutModelData(int id)throw( CutModelException);
97         
98 };
99
100 #endif