]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkPlane2DView.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #ifndef VTKPLANE2DVIEW_H_
27 #define VTKPLANE2DVIEW_H_
28
29 #include "vtkInteractorStylePlane2D.h"
30 #include "vtkInfoTextImageInteractorPlane2D.h"
31 #include "vtkInfoTextImage.h"
32
33 #include "wxVtk2DBaseView.h"
34
35 #include "vtkTransform.h"
36 #include "vtkImageChangeInformation.h"
37 #include "vtkStructuredPoints.h"
38 #include "vtkPlaneSource.h"
39 #include "vtkProbeFilter.h"
40 #include "vtkPolyDataMapper.h"
41
42 class vtkPlane2DView : public wxVtk2DBaseView
43 {
44 public:
45         vtkPlane2DView(wxWindow *parent);
46         ~vtkPlane2DView();
47         void                    Configure();
48         void                    ExtractPlane();
49         int                             GetImgSize();
50         void                    SetImgSize( int imgSize );
51
52         void                    RotationStart();
53         void                    RotationDrag(double vx, double vy,  bool ok_v, bool ok_ang);
54
55         virtual int             GetActualSlice(); 
56         virtual void    SetActualSlice(int slice);
57
58         virtual void    Refresh( );
59
60         vtkMPRBaseData                          *GetVtkmprbasedata();
61         vtkInteractorStylePlane2D       *GetInteractorstyleplane2D();
62
63         void                    SetActive(bool active);
64         void                    SetVisibleLine(bool ok);
65
66         void                    TransfromCoordViewWorld2(double &X, double &Y, double &Z);
67
68         int                             GetMipWidth();
69         void                    SetMipWidth(int value);
70         bool                    GetMipVisualization();
71         void                    SetMipVisualization(bool ok);
72
73         void                    ResetBack();
74
75 private:
76         bool                    _active;
77         int                             _mip_width;
78         bool                    _mip_visualization;
79
80         double                  _backX;
81         double                  _backY;
82         double                  _backZ;
83         double                  _backOrient[4];
84
85         double                  _ang;
86         double                  _vxb;
87         double                  _vyb;
88         double                  _n[3];   // Normal
89
90         double                  _cx;
91         double                  _cy;
92         double                  _cz;
93
94         int                             _sizeIma;
95
96         vtkImageData *  _imageResult;
97
98         // Horizontal line
99         vtkPoints                                                       *_pts;
100         vtkActor                                                        *_lineActor;
101         vtkPolyDataMapper                                       *_lineMapper;
102     vtkPolyData                                                 *_pd;
103
104     vtkProbeFilter                                              *_3Dslices;
105         vtkPlaneSource                                          *_pSource;
106         vtkStructuredPoints                                     *_stPoints;
107     vtkImageChangeInformation                   *_change;
108         vtkTransform                                            *_transform1; 
109         vtkTransform                                            *_transform2; 
110
111         vtkInteractorStylePlane2D                       *_interactorstyleplane2D;
112
113         vtkInfoTextImage                                        *_vtkInfoTextImage;
114         vtkInfoTextImageInteractorPlane2D       *_vtkInfoTextImageInteractorPlane2D;
115
116
117         void SetPSource(int sizeIma);
118         void HorizontalLine();
119         void ResetPlane();
120         void Extract_One_PlaneVTK();
121         void Extract_MIP_PlaneVTK();
122
123 protected:
124 };
125
126 #endif /*VTKPLANE2DVIEW_H_*/