]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.h
fa275aa1df3edd3291d6c00f279a23557d779ade
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / kernel / CutModelSaveBinInfo.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: CutModelSaveBinInfo.h,v $
5   Language:  C++
6   Date:      $Date: 2009/09/08 08:14:27 $
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 __CutModelSaveBinInfoH__
22 #define __CutModelSaveBinInfoH__
23
24 #include <iostream>
25 #include <vector>
26 #include "CutModelException.h"
27
28 #include <vtkPolyData.h>
29 #include <vtkPolyDataWriter.h>
30 #include <vtkPolyDataReader.h>
31 #include <vtkPolyDataMapper.h>
32 #include <vtkTransform.h>
33 #include <vtkMatrix4x4.h>
34 #include <vtkActor.h>
35
36 enum UNDOTYPE
37 {
38     CUTMODEL_ADD = 0,   
39         CUTMODEL_REMOVE = 10,
40         CUTMODEL_CUT= 20,
41         
42 };
43
44 class CutModelSaveBinInfo  {
45
46 public:
47         
48         CutModelSaveBinInfo(int id, int currentaction,UNDOTYPE actiontype, std::string path);
49         ~CutModelSaveBinInfo();
50
51         int getId(){
52                 return _id;
53         }       
54
55         UNDOTYPE getActionType(){
56                 return _actiontype;
57         }
58         std::string getSTDFileName()throw( CutModelException){
59                 if(_stdFilename==""){
60                         throw new CutModelException("Filename undoredo does not exists");
61                 }
62                 return _stdFilename;
63         }
64
65         /*void setSTDFileName(std::string filename){
66                 _stdFilename = filename;
67         }*/
68
69         int getCurrentShape(){
70                 return _currentshape;
71         }
72
73         void setCurrentShape(int currentshape){
74                 _currentshape=currentshape;
75         }
76
77         void savePolyData(vtkPolyData* polydata);
78
79         vtkTransform* getPolyDataTransform()throw( CutModelException);  
80
81         void saveMatrix4x4(vtkMatrix4x4* matrix);
82         vtkTransform* getTransformFromMatrixFile()throw( CutModelException);
83
84         void setRange(double* range){
85                 _range = range;
86         }
87         void setIsInside(bool isinside){
88                 _isinside = isinside;
89         }
90
91         double* getRange(){
92                 return _range;
93         }
94         bool getIsInside(){
95                 return _isinside;
96         }
97         
98 private:                
99         
100         int _id;
101         UNDOTYPE _actiontype;
102         int _currentshape;
103         double* _range;
104         bool _isinside;
105         std::string _stdFilename;               
106         std::string _matrixFilename;    
107 };
108
109
110
111 #endif