]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h
5f6f53e0a5b341df09d8dba0c3d2ebda865a9bb9
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / kernel / CutModelData.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: CutModelData.h,v $
5   Language:  C++
6   Date:      $Date: 2009/08/31 08:46:11 $
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 __CutModelDataH__
22 #define __CutModelDataH__
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 "CutModelException.h"
35 #include "CutModelFigure.h"
36 #include "CutModelFigureCube.h"
37 #include "CutModelFigureSphere.h"
38 #include "CutModelFigureCylinder.h"
39
40 #include <wx/utils.h>
41
42 class CutModelData  {
43
44 public:
45         CutModelData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
46         ~CutModelData();
47
48         int getId(){
49                 return _id;
50         }
51
52         void changeOpacity(int opacity)throw( CutModelException);
53
54         void ShowViewBox(bool check)throw( CutModelException);
55
56         void ChangeShape(int selection)throw( CutModelException);
57
58         vtkActor* getActor()throw( CutModelException);
59         
60         void changeColor(double r,double g,double b)throw( CutModelException);
61
62         void udapteActorDirection()throw( CutModelException);
63
64         void ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModelException);
65 private:        
66         
67         void checkInvariant()throw( CutModelException);
68
69         void createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCommand* observer);
70         void createActor();
71         void setTransform(vtkImageData* img)throw( CutModelException);
72         void createShapes();
73
74         vtkBoxWidget* _boxWidgetVolume;
75         vtkPolyDataMapper* _Mapper;     
76         vtkActor* _Actor;       
77         int _id;
78
79         int _currentshape;
80
81         CutModelFigureCube* _cubefigure;
82         CutModelFigureCylinder* _cylinderfigure;
83         CutModelFigureSphere* _spherefigure;
84         vtkTransform* currentmatrix;
85         vtkTransform* modeltransform;
86         vtkTransform* inversModel;
87
88         CutModelFigure* getCurentCuttingModel();
89
90         vtkTransform* getModelTransform(vtkImageData* copyimage);
91         vtkTransform* getModelTransformInvers();
92 };
93
94 #endif