1 /*=========================================================================
4 Module: $RCSfile: vtk3DSurfaceWidget.h,v $
6 Date: $Date: 2009/05/14 13:54:57 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
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.
16 =========================================================================*/
17 #ifndef __VTK3DSURFACEWIDGET__
18 #define __VTK3DSURFACEWIDGET__
20 #include "wxVTKRenderWindowInteractorEditContour.h"
22 #include "vtkImagePolyDataSeedConnectivity.h"
23 #include "vtkInteractorStyleCutter.h"
24 #include "marInterface.h"
25 #include "kernel/marInterfaceCT.h"
26 #include "InterfaceVtkPanelWidgets.h"
28 #include <vtkImageData.h>
29 #include <vtkProperty2D.h>
30 #include <vtkPolyData.h>
32 #include <vtkMarchingCubes.h>
33 #include <vtkPolyDataMapper.h>
34 #include <vtkRenderer.h>
35 #include <vtkRenderWindow.h>
36 #include <vtkSphereSource.h>
37 #include <vtkOutlineFilter.h>
38 #include <vtkProperty.h>
41 //------------------------------------------------------------------
42 //------------------------------------------------------------------
43 //------------------------------------------------------------------
46 * \brief Class that brigde to VTK, override double click...
48 class vtk3DSurfaceWidget : public wxVTKRenderWindowInteractor
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
58 const wxString& name = wxPanelNameStr
60 ~vtk3DSurfaceWidget();
61 void OnLeftDClick( wxMouseEvent& event );
62 virtual void OnMouseWheel( wxMouseEvent& event );
67 void ShowMARACASData( marInterface* mar );
68 void ShowMARACASDataCT( marInterfaceCT* mar );
69 void SetSurfaceColor(float red, float green, float blue );
70 void SetSurfaceVisibility( bool visible );
71 void SetSurfaceIsoValue( int isoval );
72 void SetSurfaceOpacity( int opaval );
74 void GetSphereCenter( double center[3] );
75 void SetAxis( vtkPolyData *axis );
79 vtkImageData* _marImageData;
80 vtkPolyData* _marPolyData;
82 vtkGetMacro(InitialSphere, int);
84 void SetInterfaceVtkPanelWidgets(InterfaceVtkPanelWidgets * intVtkPanWid) {_intVtkPanWid=intVtkPanWid;};
85 void SetInitialPoint();
86 void GetLast3DClickPoint( double *pp, double *cp );
87 void InitCameraReset( );
88 vtkRenderer *GetRenderer();
92 void SetInitialPoint( float* pickPoint, float* cameraPos );
93 void SetLast3DClickPoint( double *pp, double *cp );
96 marInterfaceCT *_marCT;
97 vtkRenderer *_pRenderer;
98 vtkRenderWindow *_pRenderWindow;
99 vtkOutlineFilter *_outLine;
100 vtkPolyDataMapper *_outMapper;
102 vtkMarchingCubes *_mCubes;
103 vtkPolyDataMapper *_surfMapper;
104 vtkActor *_surfActor;
106 vtkPolyData *_centralLine;
107 vtkPolyDataMapper *_centralLineMapper;
108 vtkActor *_centralLineActor;
110 vtkSphereSource *_spheres[ 4 ];
111 vtkPolyDataMapper *_spheresMapper[ 4 ];
112 vtkActor *_spheresActor[ 4 ];
114 vtkPolyDataMapper *_axesMapper;
115 vtkActor *_axesActor;
119 InterfaceVtkPanelWidgets *_intVtkPanWid;
127 float _lastPickPoint[3];
128 float _lastCameraPos[3];
130 DECLARE_EVENT_TABLE( );
134 #endif //__VTK3DSURFACEWIDGET__