]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/kernel/CutModel2Data.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / kernel / CutModel2Data.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: CutModel2Data.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 __CutModel2DataH__
22 #define __CutModel2DataH__
23
24 #include <iostream>
25 #include <vector>
26
27 #include "vtkImageData.h"
28 #include "vtkRenderWindowInteractor.h"
29 #include "vtkCommand.h"
30 #include "vtkBoxWidget.h"
31 #include "vtkPolyDataMapper.h"
32 #include "vtkActor.h"
33 #include "vtkProperty.h"
34 #include "CutModel2Exception.h"
35 #include "CutModel2Figure.h"
36 #include "CutModel2FigureCube.h"
37 #include "CutModel2FigureSphere.h"
38 #include "CutModel2FigureCylinder.h"
39
40 #include <wx/utils.h>
41
42 class CutModel2Data  {
43
44 public:
45         CutModel2Data();
46         CutModel2Data(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
47         ~CutModel2Data();
48         void initializeData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
49
50
51         int getId(){
52                 return _id;
53         }
54
55         void changeOpacity(int opacity)throw( CutModel2Exception);
56
57         void ShowViewBox(bool check)throw( CutModel2Exception);
58
59         void ChangeShape(int selection)throw( CutModel2Exception);
60
61         vtkActor* getActor()throw( CutModel2Exception);
62
63         vtkPolyData* getPolyData()throw( CutModel2Exception);
64         
65         void changeColor(double r,double g,double b)throw( CutModel2Exception);
66
67         void udapteActorDirection()throw( CutModel2Exception);
68
69         void ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModel2Exception);
70
71         void ExecuteUnCut(  bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModel2Exception);
72
73         void RefreshViewBox();
74
75         vtkTransform* getCurrentMatrix(){
76                 return currentmatrix;
77         }
78
79         int getCurrentShape(){
80                 return _currentshape;
81         }
82
83         void setCurrentShape(int currentshape){
84                 _currentshape = currentshape;
85         }
86
87         void setTransform(vtkTransform* transform,vtkImageData* img)throw( CutModel2Exception);
88 private:        
89         
90         void checkInvariant()throw( CutModel2Exception);
91
92         void createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCommand* observer);
93         void createActor();
94         void setTransform(vtkImageData* img)throw( CutModel2Exception);
95         void createShapes();    
96
97         vtkBoxWidget* _boxWidgetVolume;
98         vtkPolyDataMapper* _Mapper;     
99         vtkActor* _Actor;       
100         int _id;
101
102         int _currentshape;
103
104         CutModel2FigureCube* _cubefigure;
105         CutModel2FigureCylinder* _cylinderfigure;
106         CutModel2FigureSphere* _spherefigure;
107         vtkTransform* currentmatrix;
108         vtkTransform* modeltransform;
109         vtkTransform* inversModel;
110
111
112         CutModel2Figure* getCurentCuttingModel();
113
114         vtkTransform* getModelTransform(vtkImageData* copyimage);
115         vtkTransform* getModelTransformInvers();
116 };
117
118 #endif