]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtk3DQuantSurfaceWidget.h
c871c1d72bbd4a634da69707a8855f4430b338c0
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtk3DQuantSurfaceWidget.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: vtk3DQuantSurfaceWidget.h,v $
5   Language:  C++
6   Date:      $Date: 2008/10/31 16:32:41 $
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 #ifndef __VTK3DQUANTSURFACEWIDGET__
18 #define __VTK3DQUANTSURFACEWIDGET__
19
20
21
22
23
24 #include "vtk3DSurfaceWidget.h"
25 #include "kernel/marInterface.h"
26 #include "kernel/marInterfaceCT.h"
27 #include <vtkDataSetMapper.h>
28 #include <vtkActor.h>
29 #include <vtkProbeFilter.h>
30 #include <vtkWindowLevelLookupTable.h>
31 #include <vtkLookupTable.h>
32
33 #include <vtkPolyLine.h>
34
35 //----------------------------------------------------------------------------
36
37 class RectangleGuideVtk{
38 public:
39         RectangleGuideVtk();
40         ~RectangleGuideVtk();
41         bool                                    _showActor;
42         vtkActor*                               _actor;
43         vtkPoints*                              _points;
44         vtkPolyLine*                    _poly_line;
45     vtkDataSetMapper*           _mapper;
46         vtkUnstructuredGrid*    _grid; 
47         int                                             _iSlice;
48 };
49
50 //----------------------------------------------------------------------------
51
52 class vtk3DQuantSurfaceWidget;
53
54 class listContourVTK {
55 public:
56         listContourVTK(vtk3DQuantSurfaceWidget *quantSurfaceWidget);
57         ~listContourVTK();
58         void EraseListContourActor();
59         void EraseSliceContourActor(int slice, bool refresh=true);
60         void InitListContourActor(int nos);
61         void Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor);
62         void Show3DContourActor();
63         void Hide3DContourActor();
64         void SetColour(int r,int g,int b);
65
66 private:
67         int _r,_g,_b;
68         vtk3DQuantSurfaceWidget *_vtk3DQuantSurfaceWidget;
69         std::vector< vtkActor* >                        _lst3DContoursVtkActor;
70         std::vector< vtkUnstructuredGrid* >     _lst3DContoursVtkUnstructuredGrid;
71         std::vector< vtkDataSetMapper* >        _lst3DContoursVtkDataSetMapper;
72         std::vector< vtkPolyLine* >                     _lst3DContoursVtkPolyLine;
73 };
74 //----------------------------------------------------------------------------
75
76
77 /**
78  * \brief Class that brigde to VTK, override double click...
79  */
80 class vtk3DQuantSurfaceWidget : public vtk3DSurfaceWidget
81 {
82 public:
83
84     vtk3DQuantSurfaceWidget(
85         wxWindow* parent,
86         wxWindowID id,
87         const   wxPoint& pos    = wxDefaultPosition,
88         const   wxSize& size    = wxDefaultSize,
89         long    style                   = 0,
90         const   wxString& name  = wxPanelNameStr
91         );
92     ~vtk3DQuantSurfaceWidget();
93     void ShowMARACASDataAndAxe( marInterface* mar );
94         void ShowMARACASDataAndAxeCT( marInterfaceCT* mar);
95
96     void SetImage( vtkProbeFilter* pFilter );
97
98
99         void InitListContourActor( int type, int nos);
100     void Show3DContourActor( int type=0 );
101     void Hide3DContourActor( int type=0 );
102         void Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor, int type=0 );
103         void Erase3DContourActor( int slice);
104
105     void Show3DSliceActor( );
106     void Hide3DSliceActor( );
107
108     void SetColorLookUp( );
109     void SetBWLookUp( );
110
111         void Show3DHealthySliceActor();
112         void Hide3DHealthySliceActor();
113         void Set3DHealthySliceActor( );
114
115         void Set3DRegionSliceActor( int type, int k1,int k2 );
116         void Set3DStartRegionSliceActor( int type, int k );
117         void Set3DEndRegionSliceActor( int type, int k );
118
119         void Show3DRegionSliceActor(int type );
120         void Show3DStartRegionSliceActor(int type );
121         void Show3DEndRegionSliceActor(int type );
122
123         void Hide3DRegionSliceActor(int type );
124         void Hide3DStartRegionSliceActor(int type );
125         void Hide3DEndRegionSliceActor(int type );
126    
127         void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
128
129         int  GetAnalysisTypeStenosis();
130         void SetAnalysisTypeStenosis(int analysisTypeStenosis);
131
132
133         vtkRenderer*            QuantSurfaceWidget_GetRenderer() {return _pRenderer; };
134         vtkRenderWindow*        QuantSurfaceWidget_GetRenderWindow() {return _pRenderWindow; };
135
136 protected:
137
138     vtkDataSetMapper                                    *_3DSliceMapper;
139     vtkActor                                                    *_3DSliceActor;
140
141         RectangleGuideVtk                                       *_hs_rectGuide;
142         RectangleGuideVtk                                       *_s1_rectGuide;
143         RectangleGuideVtk                                       *_s2_rectGuide;
144         RectangleGuideVtk                                       *_sA_rectGuide;
145         RectangleGuideVtk                                       *_sB_rectGuide;
146
147     vtkWindowLevelLookupTable*                  _bwlookup;
148     vtkLookupTable*                                             _collookup;
149
150
151 private:
152
153         int                             _analysisTypeStenosis;
154         listContourVTK  *_lstContVtk;
155         listContourVTK  *_lstContHealtyVtk;
156
157 //    DECLARE_EVENT_TABLE( );
158         void Set3DSliceActor( RectangleGuideVtk *_rectGuide ,float scale, int k,int r,int g,int b);
159 };
160
161 #endif //__VTK3DQUANTSURFACEWIDGET__