]> Creatis software - clitk.git/blob - vv/vvMeshActor.h
Initial revision
[clitk.git] / vv / vvMeshActor.h
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Joel Schaerer (joel.schaerer@insa-lyon.fr)
6  Program:   vv
7
8 Copyright (C) 2008
9 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
10 CREATIS-LRMN http://www.creatis.insa-lyon.fr
11
12 This program is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, version 3 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 =========================================================================*/
25 #ifndef vvMeshActor_h
26 #define vvMeshActor_h
27
28 #include "vvMesh.h"
29 #include "vvImage.h"
30
31 class vtkActor;
32 class vtkPolyDataMapper;
33 class vtkMarchingSquares;
34 class vtkImageData;
35
36 /** An actor that takes a vvMesh as input, and displays it
37  ** sliced along the given slice plane */
38 class vvMeshActor
39 {
40 public:
41     vvMeshActor();
42     ///Sets slicing orientation
43     void SetSlicingOrientation(unsigned int d);
44     ///Changes the cut plane value in real world coordinates
45     void SetCutSlice(double slice);
46     /**Initialize the actor and set the inputs. If vf is not null, will use
47      **it to propagate the contour on all time frames */ 
48     void Init(vvMesh::Pointer mesh,int time_slice, vvImage::Pointer vf=NULL);
49     ///Set the time slice (only useful when using a 4D contour)
50     void SetTimeSlice(int time);
51     ///Toggles between normal 4D mode and superposition mode
52     void ToggleSuperposition();
53     vtkActor* GetActor() {return mActor;}
54     ~vvMeshActor();
55
56 protected:
57     ///0 for x, 1 for y, 2 for z
58     unsigned int mCutDimension;
59     vvMesh::Pointer mMesh;
60     vtkMarchingSquares * mMarching;
61     vtkPolyDataMapper* mMapper;
62     vtkActor* mActor;
63     double mCutPlaneValue;
64     bool mSuperpostionMode;
65     int mTimeSlice;
66     double mCutSlice;
67 };
68
69 #endif