1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: vtk3DSurfaceWidget.h,v $
31 Date: $Date: 2012/11/15 14:15:18 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
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.
41 =========================================================================*/
42 #ifndef __VTK3DSURFACEWIDGET__
43 #define __VTK3DSURFACEWIDGET__
45 #include "wxVTKRenderWindowInteractorEditContour.h"
47 #include "vtkImagePolyDataSeedConnectivity.h"
48 #include "vtkInteractorStyleCutter.h"
49 #include "marInterface.h"
50 #include "kernel/marInterfaceCT.h"
51 #include "InterfaceVtkPanelWidgets.h"
53 #include <vtkImageData.h>
54 #include <vtkProperty2D.h>
55 #include <vtkPolyData.h>
57 #include <vtkMarchingCubes.h>
58 #include <vtkPolyDataMapper.h>
59 #include <vtkRenderer.h>
60 #include <vtkRenderWindow.h>
61 #include <vtkSphereSource.h>
62 #include <vtkOutlineFilter.h>
63 #include <vtkProperty.h>
66 //------------------------------------------------------------------
67 //------------------------------------------------------------------
68 //------------------------------------------------------------------
71 * \brief Class that brigde to VTK, override double click...
73 class vtk3DSurfaceWidget : public wxVTKRenderWindowInteractor
80 const wxPoint& pos = wxDefaultPosition,
81 const wxSize& size = wxDefaultSize,
83 const wxString& name = wxPanelNameStr
85 ~vtk3DSurfaceWidget();
86 void OnLeftDClick( wxMouseEvent& event );
87 virtual void OnMouseWheel( wxMouseEvent& event );
92 void ShowMARACASData( marInterface* mar );
93 void ShowMARACASDataCT( marInterfaceCT* mar );
94 void SetSurfaceColor(float red, float green, float blue );
95 void SetSurfaceVisibility( bool visible );
96 void SetSurfaceIsoValue( int isoval );
97 void SetSurfaceOpacity( int opaval );
99 void GetSphereCenter( double center[3] );
100 void SetAxis( vtkPolyData *axis );
104 vtkImageData* _marImageData;
105 vtkPolyData* _marPolyData;
107 vtkGetMacro(InitialSphere, int);
109 void SetInterfaceVtkPanelWidgets(InterfaceVtkPanelWidgets * intVtkPanWid) {_intVtkPanWid=intVtkPanWid;};
110 void SetInitialPoint();
111 void GetLast3DClickPoint( double *pp, double *cp );
112 void InitCameraReset( );
113 vtkRenderer *GetRenderer();
117 void SetInitialPoint( float* pickPoint, float* cameraPos );
118 void SetLast3DClickPoint( double *pp, double *cp );
121 marInterfaceCT *_marCT;
122 vtkRenderer *_pRenderer;
123 vtkRenderWindow *_pRenderWindow;
124 vtkOutlineFilter *_outLine;
125 vtkPolyDataMapper *_outMapper;
127 vtkMarchingCubes *_mCubes;
128 vtkPolyDataMapper *_surfMapper;
129 vtkActor *_surfActor;
131 vtkPolyData *_centralLine;
132 vtkPolyDataMapper *_centralLineMapper;
133 vtkActor *_centralLineActor;
135 vtkSphereSource *_spheres[ 4 ];
136 vtkPolyDataMapper *_spheresMapper[ 4 ];
137 vtkActor *_spheresActor[ 4 ];
139 vtkPolyDataMapper *_axesMapper;
140 vtkActor *_axesActor;
144 InterfaceVtkPanelWidgets *_intVtkPanWid;
152 float _lastPickPoint[3];
153 float _lastCameraPos[3];
155 DECLARE_EVENT_TABLE( );
159 #endif //__VTK3DSURFACEWIDGET__