]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/creaMaracasVisu
[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 "wxMPRBaseData.h"
34 #include "wxVtk2DBaseView.h"
35
36 #include "vtkTransform.h"
37 #include "vtkImageChangeInformation.h"
38 #include "vtkStructuredPoints.h"
39 #include "vtkPlaneSource.h"
40 #include "vtkProbeFilter.h"
41 #include "vtkPolyDataMapper.h"
42
43 class vtkPlane2DView : public wxVtk2DBaseView
44 {
45 public:
46         vtkPlane2DView(wxWindow *parent);
47         ~vtkPlane2DView();
48         void                    Configure();
49         void                    ExtractPlane();
50         int                             GetImgSize();
51         void                    SetImgSize( int imgSize );
52
53         void                    RotationStart();
54         void                    RotationDrag(double vx, double vy,  bool ok_v, bool ok_ang);
55
56         virtual int             GetActualSlice(); 
57         virtual void    SetActualSlice(int slice);
58
59         virtual void    Refresh( );
60
61         vtkMPRBaseData                          *GetVtkmprbasedata();
62         vtkInteractorStylePlane2D       *GetInteractorstyleplane2D();
63
64         void                    SetActive(bool active);
65         void                    SetVisibleLine(bool ok);
66
67         void                    TransfromCoordViewWorld2(double &X, double &Y, double &Z);
68
69         int                             GetMipWidth();
70         void                    SetMipWidth(int value);
71         bool                    GetMipVisualization();
72         void                    SetMipVisualization(bool ok);
73
74         void                    ResetBack();
75
76 private:
77         bool                    _active;
78         int                             _mip_width;
79         bool                    _mip_visualization;
80
81         double                  _backX;
82         double                  _backY;
83         double                  _backZ;
84         double                  _backOrient[4];
85
86         double                  _ang;
87         double                  _vxb;
88         double                  _vyb;
89         double                  _n[3];   // Normal
90
91         double                  _cx;
92         double                  _cy;
93         double                  _cz;
94
95         int                             _sizeIma;
96
97         vtkImageData *  _imageResult;
98
99         // Horizontal line
100         vtkPoints                                                       *_pts;
101         vtkActor                                                        *_lineActor;
102         vtkPolyDataMapper                                       *_lineMapper;
103     vtkPolyData                                                 *_pd;
104
105     vtkProbeFilter                                              *_3Dslices;
106         vtkPlaneSource                                          *_pSource;
107         vtkStructuredPoints                                     *_stPoints;
108     vtkImageChangeInformation                   *_change;
109         vtkTransform                                            *_transform1; 
110         vtkTransform                                            *_transform2; 
111
112         vtkInteractorStylePlane2D                       *_interactorstyleplane2D;
113
114         vtkInfoTextImage                                        *_vtkInfoTextImage;
115         vtkInfoTextImageInteractorPlane2D       *_vtkInfoTextImageInteractorPlane2D;
116
117
118         void SetPSource(int sizeIma);
119         void HorizontalLine();
120         void ResetPlane();
121         void Extract_One_PlaneVTK();
122         void Extract_MIP_PlaneVTK();
123
124 protected:
125 };
126
127 #endif /*VTKPLANE2DVIEW_H_*/