]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/include/vtk3DQuantSurfaceWidget.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / include / vtk3DQuantSurfaceWidget.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 /*=========================================================================
27
28   Program:   wxMaracas
29   Module:    $RCSfile: vtk3DQuantSurfaceWidget.h,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:15:18 $
32   Version:   $Revision: 1.2 $
33
34   Copyright: (c) 2002, 2003
35   License:
36   
37      This software is distributed WITHOUT ANY WARRANTY; without even 
38      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
39      PURPOSE.  See the above copyright notice for more information.
40
41 =========================================================================*/
42 #ifndef __VTK3DQUANTSURFACEWIDGET__
43 #define __VTK3DQUANTSURFACEWIDGET__
44
45
46
47
48
49 #include "vtk3DSurfaceWidget.h"
50 #include "kernel/marInterface.h"
51 #include "kernel/marInterfaceCT.h"
52 #include <vtkDataSetMapper.h>
53 #include <vtkActor.h>
54 #include <vtkProbeFilter.h>
55 #include <vtkWindowLevelLookupTable.h>
56 #include <vtkLookupTable.h>
57
58 #include <vtkPolyLine.h>
59
60 //----------------------------------------------------------------------------
61
62 class RectangleGuideVtk{
63 public:
64         RectangleGuideVtk();
65         ~RectangleGuideVtk();
66         bool                                    _showActor;
67         vtkActor*                               _actor;
68         vtkPoints*                              _points;
69         vtkPolyLine*                    _poly_line;
70     vtkDataSetMapper*           _mapper;
71         vtkUnstructuredGrid*    _grid; 
72         int                                             _iSlice;
73 };
74
75 //----------------------------------------------------------------------------
76
77 class vtk3DQuantSurfaceWidget;
78
79 class listContourVTK {
80 public:
81         listContourVTK(vtk3DQuantSurfaceWidget *quantSurfaceWidget);
82         ~listContourVTK();
83         void EraseListContourActor();
84         void EraseSliceContourActor(int slice, bool refresh=true);
85         void InitListContourActor(int nos);
86         void Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor);
87         void Show3DContourActor();
88         void Hide3DContourActor();
89         void SetColour(int r,int g,int b);
90
91 private:
92         int _r,_g,_b;
93         vtk3DQuantSurfaceWidget *_vtk3DQuantSurfaceWidget;
94         std::vector< vtkActor* >                        _lst3DContoursVtkActor;
95         std::vector< vtkUnstructuredGrid* >     _lst3DContoursVtkUnstructuredGrid;
96         std::vector< vtkDataSetMapper* >        _lst3DContoursVtkDataSetMapper;
97         std::vector< vtkPolyLine* >                     _lst3DContoursVtkPolyLine;
98 };
99 //----------------------------------------------------------------------------
100
101
102 /**
103  * \brief Class that brigde to VTK, override double click...
104  */
105 class vtk3DQuantSurfaceWidget : public vtk3DSurfaceWidget
106 {
107 public:
108
109     vtk3DQuantSurfaceWidget(
110         wxWindow* parent,
111         wxWindowID id,
112         const   wxPoint& pos    = wxDefaultPosition,
113         const   wxSize& size    = wxDefaultSize,
114         long    style                   = 0,
115         const   wxString& name  = wxPanelNameStr
116         );
117     ~vtk3DQuantSurfaceWidget();
118     void ShowMARACASDataAndAxe( marInterface* mar );
119         void ShowMARACASDataAndAxeCT( marInterfaceCT* mar);
120
121     void SetImage( vtkProbeFilter* pFilter );
122
123
124         void InitListContourActor( int type, int nos);
125     void Show3DContourActor( int type=0 );
126     void Hide3DContourActor( int type=0 );
127         void Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor, int type=0 );
128         void Erase3DContourActor( int slice);
129
130     void Show3DSliceActor( );
131     void Hide3DSliceActor( );
132
133     void SetColorLookUp( );
134     void SetBWLookUp( );
135
136         void Show3DHealthySliceActor();
137         void Hide3DHealthySliceActor();
138         void Set3DHealthySliceActor( );
139
140         void Set3DRegionSliceActor( int type, int k1,int k2 );
141         void Set3DStartRegionSliceActor( int type, int k );
142         void Set3DEndRegionSliceActor( int type, int k );
143
144         void Show3DRegionSliceActor(int type );
145         void Show3DStartRegionSliceActor(int type );
146         void Show3DEndRegionSliceActor(int type );
147
148         void Hide3DRegionSliceActor(int type );
149         void Hide3DStartRegionSliceActor(int type );
150         void Hide3DEndRegionSliceActor(int type );
151    
152         void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
153
154         int  GetAnalysisTypeStenosis();
155         void SetAnalysisTypeStenosis(int analysisTypeStenosis);
156
157
158         vtkRenderer*            QuantSurfaceWidget_GetRenderer() {return _pRenderer; };
159         vtkRenderWindow*        QuantSurfaceWidget_GetRenderWindow() {return _pRenderWindow; };
160
161 protected:
162
163     vtkDataSetMapper                                    *_3DSliceMapper;
164     vtkActor                                                    *_3DSliceActor;
165
166         RectangleGuideVtk                                       *_hs_rectGuide;
167         RectangleGuideVtk                                       *_s1_rectGuide;
168         RectangleGuideVtk                                       *_s2_rectGuide;
169         RectangleGuideVtk                                       *_sA_rectGuide;
170         RectangleGuideVtk                                       *_sB_rectGuide;
171
172     vtkWindowLevelLookupTable*                  _bwlookup;
173     vtkLookupTable*                                             _collookup;
174
175
176 private:
177
178         int                             _analysisTypeStenosis;
179         listContourVTK  *_lstContVtk;
180         listContourVTK  *_lstContHealtyVtk;
181
182 //    DECLARE_EVENT_TABLE( );
183         void Set3DSliceActor( RectangleGuideVtk *_rectGuide ,float scale, int k,int r,int g,int b);
184 };
185
186 #endif //__VTK3DQUANTSURFACEWIDGET__