vtk3DSurfaceWidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __VTK3DSURFACEWIDGET__
00018 #define __VTK3DSURFACEWIDGET__
00019
00020 #include "wxVTKRenderWindowInteractorEditContour.h"
00021
00022 #include "vtkImagePolyDataSeedConnectivity.h"
00023 #include "vtkInteractorStyleCutter.h"
00024 #include "marInterface.h"
00025 #include "kernel/marInterfaceCT.h"
00026 #include "InterfaceVtkPanelWidgets.h"
00027
00028 #include <vtkImageData.h>
00029 #include <vtkProperty2D.h>
00030 #include <vtkPolyData.h>
00031 #include <vtkActor.h>
00032 #include <vtkMarchingCubes.h>
00033 #include <vtkPolyDataMapper.h>
00034 #include <vtkRenderer.h>
00035 #include <vtkRenderWindow.h>
00036 #include <vtkSphereSource.h>
00037 #include <vtkOutlineFilter.h>
00038 #include <vtkProperty.h>
00039
00040
00041
00042
00043
00044
00048 class vtk3DSurfaceWidget : public wxVTKRenderWindowInteractor
00049 {
00050 public:
00051
00052 vtk3DSurfaceWidget(
00053 wxWindow* parent,
00054 wxWindowID id,
00055 const wxPoint& pos = wxDefaultPosition,
00056 const wxSize& size = wxDefaultSize,
00057 long style = 0,
00058 const wxString& name = wxPanelNameStr
00059 );
00060 ~vtk3DSurfaceWidget();
00061 void OnLeftDClick( wxMouseEvent& event );
00062 virtual void OnMouseWheel( wxMouseEvent& event );
00063 void Render( );
00064
00065 void ConfigureVTK( );
00066
00067 void ShowMARACASData( marInterface* mar );
00068 void ShowMARACASDataCT( marInterfaceCT* mar );
00069 void SetSurfaceColor(float red, float green, float blue );
00070 void SetSurfaceVisibility( bool visible );
00071 void SetSurfaceIsoValue( int isoval );
00072 void SetSurfaceOpacity( int opaval );
00073
00074 void GetSphereCenter( double center[3] );
00075 void SetAxis( vtkPolyData *axis );
00076 void RemoveAxis( );
00077
00079 vtkImageData* _marImageData;
00080 vtkPolyData* _marPolyData;
00081
00082 vtkGetMacro(InitialSphere, int);
00083
00084 void SetInterfaceVtkPanelWidgets(InterfaceVtkPanelWidgets * intVtkPanWid) {_intVtkPanWid=intVtkPanWid;};
00085 void SetInitialPoint();
00086 void GetLast3DClickPoint( double *pp, double *cp );
00087 void InitCameraReset( );
00088 vtkRenderer *GetRenderer();
00089
00090 protected:
00091
00092 void SetInitialPoint( float* pickPoint, float* cameraPos );
00093 void SetLast3DClickPoint( double *pp, double *cp );
00094
00095 marInterface *_mar;
00096 marInterfaceCT *_marCT;
00097 vtkRenderer *_pRenderer;
00098 vtkRenderWindow *_pRenderWindow;
00099 vtkOutlineFilter *_outLine;
00100 vtkPolyDataMapper *_outMapper;
00101 vtkActor *_outActor;
00102 vtkMarchingCubes *_mCubes;
00103 vtkPolyDataMapper *_surfMapper;
00104 vtkActor *_surfActor;
00105
00106 vtkPolyData *_centralLine;
00107 vtkPolyDataMapper *_centralLineMapper;
00108 vtkActor *_centralLineActor;
00109
00110 vtkSphereSource *_spheres[ 4 ];
00111 vtkPolyDataMapper *_spheresMapper[ 4 ];
00112 vtkActor *_spheresActor[ 4 ];
00113
00114 vtkPolyDataMapper *_axesMapper;
00115 vtkActor *_axesActor;
00116
00117 double _range[2];
00118
00119 InterfaceVtkPanelWidgets *_intVtkPanWid;
00120
00121 private:
00122
00123 int _width;
00124 int _height;
00125 int _depth;
00126 int InitialSphere;
00127 float _lastPickPoint[3];
00128 float _lastCameraPos[3];
00129
00130 DECLARE_EVENT_TABLE( );
00131
00132 };
00133
00134 #endif //__VTK3DSURFACEWIDGET__