/*========================================================================= Program: wxMaracas Module: $RCSfile: wxMPRWidget.h,v $ Language: C++ Date: $Date: 2009/05/04 07:35:42 $ Version: $Revision: 1.8 $ Copyright: (c) 2002, 2003 License: This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef __WX__MPR__WIDGET__HXX__ #define __WX__MPR__WIDGET__HXX__ #include "marTypes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include "kernel/marInterface.h" #include "manualContour.h" #include "wxMPRBaseData.h" #include "wxVtkBaseView.h" #include #include #include #include #include "marTypes.h" class wxMPRWidget; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkInteractorStyleSphere : public InteractorStyleMaracas { public: vtkInteractorStyleSphere(); ~vtkInteractorStyleSphere(); virtual bool OnLeftButtonUp(); virtual bool OnLeftButtonDown(); virtual bool OnMouseMove(); virtual bool OnRightButtonUp(); virtual bool OnRightButtonDown(); private: bool _stateRotate; bool _stateRadio; int _fordwareX; int _fordwareY; double _radio; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class idAlBeRa { public: int _id; double _radio; int _deltavoxel; idAlBeRa(int id, double radio,int deltavoxel); }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxSphereView : public wxVtk2DBaseView { public: wxSphereView( wxWindow *parent, vtkMPRBaseData *vtkmprbasedata, vtkImageData *imageData); ~wxSphereView(); virtual void Configure(); void RotationEnd(); void RotationStart(double vx, double vy, bool ok_v, bool ok_ang); virtual void RefreshView(); virtual void SetVoxel(double i, double j, int delta, double id, unsigned short gris); void SetDeltaVoxel(int delta); double GetRadio(); void SetRadio(double radio); int GetIdOfImage(double radio); void SetXYZtoParent(double i, double j); void RefreshPoint(); private: std::vector _lstId; int _centerX; int _centerY; int _centerZ; double _radio; double _ang; double _vxb; double _vyb; int _delta; vtkImageData *_imageDataOriginal; vtkImageData *_imageSphere; vtkMPRBaseData *_vtkmprbasedata; vtkInteractorStyleSphere *_vtkinteractorstylesphere; vtkTransform *_transform; vtkTransform *_transform1; vtkTransform *_transform2; void FiltreImage(int id, double radio); void FiltreImageB(int id, double radio, bool ok,int deltaTMP); void DefineImageSphere(); void ResetlstId(); void InitSphere(double points[4][3]); double SphereFindCenter(double P[4][3], double cc[3]); double determinant(double a[4][4], int n); void GetPointSphere(double p[3],double r1,double angA,double angB); void RotatePointOverTheSphere( double pp[3], double p[3],double cc[3]); void TransferePoints(double pp1[3],double pp2[3],double AngX,double AngY,vtkImageData *image); }; //------------------------------------------------------------------- //------------------------------------------------------------------- //------------------------------------------------------------------- class vtkInteractorStylePlane2D; class vtkInfoTextImageInteractorPlane2D; class vtkPlane2DView : public wxVtk2DBaseView { public: vtkPlane2DView(wxWindow *parent); ~vtkPlane2DView(); void Configure(); void ExtractPlane(); int GetImgSize(); void SetImgSize( int imgSize ); void RotationStart(); void RotationDrag(double vx, double vy, bool ok_v, bool ok_ang); virtual int GetActualSlice(); virtual void SetActualSlice(int slice); virtual void Refresh( ); vtkMPRBaseData *GetVtkmprbasedata(); vtkInteractorStylePlane2D *GetInteractorstyleplane2D(); void SetActive(bool active); void SetVisibleLine(bool ok); void TransfromeCoordViewWorld2(double &X, double &Y, double &Z); int GetMipWidth(); void SetMipWidth(int value); bool GetMipVisualization(); void SetMipVisualization(bool ok); void ResetBack(); private: bool _active; int _mip_width; bool _mip_visualization; double _backX; double _backY; double _backZ; double _backOrient[4]; double _ang; double _vxb; double _vyb; double _n[3]; // Normal double _cx; double _cy; double _cz; int _sizeIma; vtkImageData * _imageResult; // Horizontal line vtkPoints *_pts; vtkActor *_lineActor; vtkPolyDataMapper *_lineMapper; vtkPolyData *_pd; vtkProbeFilter *_3Dslices; vtkPlaneSource *_pSource; vtkStructuredPoints *_stPoints; vtkImageChangeInformation *_change; vtkTransform *_transform1; vtkTransform *_transform2; vtkInteractorStylePlane2D *_interactorstyleplane2D; vtkInfoTextImage *_vtkInfoTextImage; vtkInfoTextImageInteractorPlane2D *_vtkInfoTextImageInteractorPlane2D; void SetPSource(int sizeIma); void HorizontalLine(); void ResetPlane(); void Extract_One_PlaneVTK(); void Extract_MIP_PlaneVTK(); protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkInfoTextImageInteractorPlane2D : public vtkInfoTextImageInteractor{ public: vtkInfoTextImageInteractorPlane2D(); ~vtkInfoTextImageInteractorPlane2D(); protected: virtual bool OnMouseMove(); private: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkInteractorStylePlane2D : public InteractorStyleMaracas { public: vtkInteractorStylePlane2D(); ~vtkInteractorStylePlane2D(); virtual bool OnLeftButtonDown(); virtual bool OnLeftButtonUp(); virtual bool OnMouseMove(); virtual bool OnRightButtonUp(); virtual bool OnLeftDClick(); bool GetStateRotate(); private: bool _stateRotate; int _fordwareX; int _fordwareY; }; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- class manualViewPerpPlaneContour : public manualViewContour { public: manualViewPerpPlaneContour(); ~manualViewPerpPlaneContour(); virtual manualViewPerpPlaneContour * Clone(); void CopyAttributesTo( manualViewPerpPlaneContour *cloneObject ); virtual void UpdateViewPoint(int id); virtual void RefreshContour(); virtual void TransfromeCoordViewWorld( double &X,double &Y,double &Z,int type ); virtual bool ifTouchContour( int x, int y, int z); protected: private: void FilterCordinateXYZ (double &x, double &y, double &z); }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkInteractorStyleMPRView; class creaMaracasVisu_EXPORT wxVtkMPR2DView : public wxVtk2DBaseView { public: wxVtkMPR2DView( wxWindow *parent, int direction ); ~wxVtkMPR2DView(); void Configure(); virtual void Refresh(); vtkMPRBaseData *GetVtkmprbasedata(); virtual int GetActualSlice(); virtual void SetActualSlice(int slice); bool IfMouseTouchX(double x, double y, double z); bool IfMouseTouchY(double x, double y, double z); bool IfMouseTouchZ(double x, double y, double z); void MoveX(double x, double y, double z); void MoveY(double x, double y, double z); void MoveZ(double x, double y, double z); void ChangeAxisColor(double x, double y, double z); virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type); void SetVisibleAxis(bool ok); private: int _backX; int _backY; int _backZ; bool _visibleAxis; int _direction; vtkPoints *_ptsA; vtkActor *_lineAActor; vtkPolyDataMapper *_lineAMapper; vtkPolyData *_pdA; vtkPoints *_ptsB; vtkActor *_lineBActor; vtkPolyDataMapper *_lineBMapper; vtkPolyData *_pdB; // vtkInteractorStyle2DMaracas *_interactorStyle2DMaracas; vtkInteractorStyleMPRView *_interactorstylemprview; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkInteractorStyleMPRView : public InteractorStyleMaracas { public: vtkInteractorStyleMPRView(); ~vtkInteractorStyleMPRView(); virtual bool OnMouseMove(); virtual bool OnLeftButtonDown(); virtual bool OnLeftButtonUp(); virtual bool OnLeftDClick(); protected: /*EED Borrame double _xBack; double _yBack; */ bool _stateMoveAxisX; bool _stateMoveAxisY; bool _stateMoveAxisZ; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxVtkMPR3DView; class wxVtkMPR3DViewCntrlPanel: public wxPanel { public: wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview); ~wxVtkMPR3DViewCntrlPanel(); void OnVisibleAxisX(wxCommandEvent& event); void OnVisibleAxisY(wxCommandEvent& event); void OnVisibleAxisZ(wxCommandEvent& event); void OnPositionX(wxScrollEvent& event); void OnPositionY(wxScrollEvent& event); void OnPositionZ(wxScrollEvent& event); void OnVisibleAxisXYZ(wxCommandEvent& event); void OnVisiblePlane(wxCommandEvent& event); void OnEditColorTable(wxCommandEvent& event); virtual void Refresh(); void UpdateControlPanel(); private: wxVtkMPR3DView *_wxvtkmpr3Dview; wxSlider *_opacity; wxSlider *_isoValue; wxSlider *_isoValueSpin; wxStaticText *_isoValueText; wxRadioButton *_surfA; wxRadioButton *_surfB; wxRadioButton *_surfC; wxRadioButton *_surfD; wxCheckBox *_visible; wxButton *_color; wxSlider *_positionX; wxSlider *_positionY; wxSlider *_positionZ; wxCheckBox *_ckBoxXYZ; wxCheckBox *_ckBoxPlane; protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxVtkClipping3DView; class wxVtkClipping3DViewCntrlPanel: public wxPanel { public: wxVtkClipping3DViewCntrlPanel(wxWindow *parent, wxVtkClipping3DView *_wxvtkclipping3Dview); ~wxVtkClipping3DViewCntrlPanel(); void OnSurface(wxCommandEvent& event); void OnRepresentationSurfaceWireFrame(wxCommandEvent& event); void OnVisibleVolume(wxCommandEvent& event); void OnVisibleBoxSurface(wxCommandEvent& event); void OnVisibleBoxVolume(wxCommandEvent& event); void OnColor(wxCommandEvent& event); void OnVisibleSurface(wxCommandEvent& event); void OnOpacity(wxScrollEvent& event); void OnIsoValue(wxScrollEvent& event); void OnIsoValueSpin(wxScrollEvent& event); virtual void Refresh(); void OnBtnCreateFileSTL(wxCommandEvent& event); void OnBtnSaveRawVolume(wxCommandEvent& event); void OnBtnVolumeFunctions(wxCommandEvent& event); void OnBtnMeshVTKLoad(wxCommandEvent& event); private: wxVtkClipping3DView *_wxvtkclipping3Dview; wxSlider *_opacity; wxSlider *_isoValue; wxSlider *_isoValueSpin; wxRadioButton *_surfA; wxRadioButton *_surfB; wxRadioButton *_surfC; wxRadioButton *_surfD; wxCheckBox *_visible; wxButton *_color; wxRadioButton *_wireFrameRep; wxRadioButton *_surfaceRep; int GetIdTissue(); protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkmyPWCallback_3DPointWidget : public vtkCommand { public: static vtkmyPWCallback_3DPointWidget *New() { return new vtkmyPWCallback_3DPointWidget; } virtual void Execute(vtkObject *caller, unsigned long, void*); vtkmyPWCallback_3DPointWidget(){} void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview ); void SetVtkPointWidget( vtkPointWidget *pointWidget ); void SetVtkPlaneWidget( vtkPlaneWidget *planeWidget ); private: double _backNormal[3]; vtkPlaneWidget *_planeWidget; vtkPointWidget *_pointWidget; wxVtkMPR3DView *_wxvtkmpr3Dview; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class creaMaracasVisu_EXPORT wxVtkMPR3DView { public: wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview ); virtual ~wxVtkMPR3DView(); void VisibleImageActor(int idPosition, bool visible); void VisiblePointWidget( bool visible ); void VisiblePlaneWidget( bool visible ); void SetVisibleTissue(int idTissue, bool visible); bool GetVisibleTissue(int idTissue); virtual void Refresh(); virtual void RefreshView(); virtual void Configure(); void SetVtkMPR3DDataViewer( vtkMPR3DDataViewer *vtkmpr3Ddataviewer ); wxPanel* CreateControlPanel(wxWindow *parent); vtkMPR3DDataViewer* GetVtkMPR3DDataViewer()throw (char*); wxVtk3DBaseView* GetWxvtk3Dbaseview(); void InitOrientationPointWidget(); // EED 25 Janvier 2007 testLoic void TestLoic1(); void TestLoic2(); void RemoveActor(vtkActor* actor); void ResetCamera(int *ext=NULL, double* origin=NULL,double* spc=NULL); private: wxVtk3DBaseView *_wxvtk3Dbaseview; vtkMPR3DDataViewer *_vtkmpr3Ddataviewer; wxVtkMPR3DViewCntrlPanel *_wxvtkmpr3DviewCntrlPanel; // Plane Widget (3D) vtkPolyData *_vtkplane; vtkActor *_contourPlaneActor; vtkPlaneWidget *_planeWidget; // Point Widget (3D) vtkPointWidget *_pointWidget; vtkmyPWCallback_3DPointWidget *_myCallback; vtkProbeFilter *_probe; vtkPolyDataMapper *_contourMapper; protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxVtkClipping3DView { public: wxVtkClipping3DView( wxVtk3DBaseView* wxvtk3Dbaseview ); virtual ~wxVtkClipping3DView(); virtual void Refresh(); virtual void Configure(); void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer ); wxPanel* CreateControlPanel(wxWindow *parent); vtkClipping3DDataViewer* GetVtkClipping3DDataViewer(); void VisibleActor(int idTissue, bool visTissue); void VisibleVolumeActor( bool visVolume ); void SetVisibleBoxSurface(bool visible); void SetVisibleBoxVolume(bool visible); void SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation ); wxVtk3DBaseView* GetWxvtk3Dbaseview()throw(char*); private: wxVtk3DBaseView *_wxvtk3Dbaseview; vtkClipping3DDataViewer *_vtkclipping3Ddataviewer; vtkBoxWidget *_boxWidgetS1; vtkBoxWidget *_boxWidgetVolume; wxVtkClipping3DViewCntrlPanel *_wxvtkclipping3DviewCntrlPanel; protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class vtkInteractorStyle3DView : public InteractorStyleMaracas { public: vtkInteractorStyle3DView(); ~vtkInteractorStyle3DView(); virtual bool OnLeftDClick(); bool SelectMarchibCubePoint(); wxVtkMPR3DView *GetWxVtkMPR3DView(); void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview ); wxVtkClipping3DView *GetWxVtkClipping3DView(); void SetWxVtkClipping3DView( wxVtkClipping3DView *wxvtkclipping3Dview); protected: private: wxVtkMPR3DView *_wxvtkmpr3Dview; wxVtkClipping3DView *_wxvtkclipping3Dview; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class figureCuttingModel { public: figureCuttingModel(); virtual ~figureCuttingModel(); void SetPosition(double x,double y, double z); double GetPositionX(); double GetPositionY(); double GetPositionZ(); void SetScale(double sx,double sy, double sz); double GetScaleX(); double GetScaleY(); double GetScaleZ(); void SetRotation(double alfa,double beta, double teta); double GetAngleAlfa(); double GetAngleBeta(); double GetAngleTeta(); void SetSpacing(double spcX,double spcY, double spcZ); void CalculeMatrix(); void CalculeInversMatrix(); virtual bool IfPointInside(double x, double y, double z); vtkTransform *GetVtkTransform(); // void SetVtkTransform(vtkTransform *matrix); virtual double GetTheoricVolume(); virtual char *GetName(); private: double _px; double _py; double _pz; double _alfa; double _beta; double _teta; double _spcX; double _spcY; double _spcZ; protected: double _sx; double _sy; double _sz; vtkTransform *_inversModel; vtkTransform *_matrixModel; vtkTransform *_matrixVisual; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class figureCuttingSphereModel : public figureCuttingModel { public: figureCuttingSphereModel(); virtual ~figureCuttingSphereModel(); virtual bool IfPointInside(double x, double y, double z); virtual double GetTheoricVolume(); virtual char *GetName(); private: protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class figureCuttingCubeModel : public figureCuttingModel { public: figureCuttingCubeModel(); virtual ~figureCuttingCubeModel(); virtual bool IfPointInside(double x, double y, double z); virtual double GetTheoricVolume(); virtual char *GetName(); private: protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class figureCuttingCylinderModel : public figureCuttingModel { public: figureCuttingCylinderModel(); virtual ~figureCuttingCylinderModel(); virtual bool IfPointInside(double x, double y, double z); virtual double GetTheoricVolume(); virtual char *GetName(); private: protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxPanelCuttingImageData : public wxPanel { public: wxPanelCuttingImageData (wxWindow *parent); ~wxPanelCuttingImageData (); void OnTransform(wxScrollEvent& event); void OnOpacityFig(wxScrollEvent& event); void OnTypeFig(wxCommandEvent& event); void OnExtract(wxCommandEvent& event); void SetVtkMPRBaseData( vtkMPRBaseData *vtkmprbasedata ); void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer ); void SetWxVtk3DBaseView( wxVtk3DBaseView * wxvtk3Dbaseview ); void SetParamsOfTransformation( ); void Configure(); void Refresh(); void RefreshView(); void RemoveActors(); private: wxSlider *_opacityFig; wxSlider *_scaleX; wxSlider *_scaleY; wxSlider *_scaleZ; wxSlider *_rotationX; wxSlider *_rotationY; wxSlider *_rotationZ; wxRadioButton *_volIntern; wxRadioButton *_volExtern; wxCheckBox *_histogrammeAccumulated; wxSlider *_isoValue; wxSlider *_valueBeforeIsoValue; wxSlider *_valueAfterIsoValue; wxChoice *_typeFig; wxStaticText *_infoToVo; wxStaticText *_infoSuVo; wxStaticText *_infoSuVoA; wxStaticText *_infoPixLe; wxStaticText *_infoPixHi; // Model figureCuttingCylinderModel *_modelCylinder; figureCuttingCubeModel *_modelCube; figureCuttingSphereModel *_modelSphere; figureCuttingModel *_actualCuttingModel; // view vtkCubeSource *_vtkcube; vtkSphereSource *_vtksphere; vtkCylinderSource *_vtkcylinder; vtkPolyDataMapper *_cubeMapper; vtkPolyDataMapper *_sphereMapper; vtkPolyDataMapper *_cylinderMapper; vtkActor *_cubeActor; vtkActor *_sphereActor; vtkActor *_cylinderActor; vtkActor *_actualActor; vtkMPRBaseData *_vtkmprbasedata; wxVtk3DBaseView *_wxvtk3Dbaseview; vtkImageData *_imageData; vtkClipping3DDataViewer *_vtkclipping3Ddataviewer; vtkImageData *_histogrammeVector; vtkXYPlotActor *_xyplot; wxVtkBaseView *_wxvtkbaseView; vtkRenderer *_renplotter; void CreateModel(); void CreateInterface(); void Create3DViewObjects(); void RefreshOpacity(); wxWindow *CreatePlotHistogrammeInterface(); void InitHistogramme(); protected: }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxWidgetMesure2D : public wxSplitterWindow { public: wxWidgetMesure2D( wxWindow *parent ); ~wxWidgetMesure2D(); void OnActiveMessureTool(wxCommandEvent& event); void OnVisibleMessureTool(wxCommandEvent& event); void OnCloseContour(wxCommandEvent& event); void OnVisibleInformation(wxCommandEvent& event); void SetMesureScale(double mesureScale); manualContourModel* GetManualContourModel(); virtual void ConfigureA(wxVtk2DBaseView *wxvtk2Dbaseview); protected: wxVtk2DBaseView *_wxvtk2Dbaseview; virtual wxWindow *CreateWin1a(wxWindow *parent); private: wxCheckBox *_cb_messuretool; wxCheckBox *_cb_mt_visible; wxCheckBox *_cb_closeContour; wxCheckBox *_cb_visibleText; manualContourControler *_manContourControl_1; manualContourModel *_mContourModel_1; manualViewContour *_mViewContour_1; void ActiveMessureTool(bool ok); // DECLARE_EVENT_TABLE(); }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxWidgetMesure2D_Plane : public wxWidgetMesure2D { public: wxWidgetMesure2D_Plane(wxWindow *parent); ~wxWidgetMesure2D_Plane(); void OnActiveLine(wxCommandEvent& event); void OnActiveCirlcle(wxCommandEvent& event); virtual void ConfigureA(wxVtk2DBaseView *wxvtk2Dbaseview); void ConfigureCircleLine(); void CircleLine(); protected: virtual wxWindow *CreateWin1a(wxWindow *parent); private: wxCheckBox *_cb_line; wxCheckBox *_cb_circle; // Circle 1 vtkPoints *_ptsCircle1; vtkActor *_circle1Actor; vtkPolyDataMapper *_circle1Mapper; vtkPolyData *_pdCircle1; // Circle 2 vtkPoints *_ptsCircle2; vtkActor *_circle2Actor; vtkPolyDataMapper *_circle2Mapper; vtkPolyData *_pdCircle2; // line reference 1 vtkPoints *_ptsLineRef1; vtkActor *_lineRef1Actor; vtkPolyDataMapper *_lineRef1Mapper; vtkPolyData *_pdLineRef1; // line reference 2 vtkPoints *_ptsLineRef2; vtkActor *_lineRef2Actor; vtkPolyDataMapper *_lineRef2Mapper; vtkPolyData *_pdLineRef2; void SetVisibleCircle( bool ok ); }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class wxWidgetMesure2D_Plane_in_MPR : public wxWidgetMesure2D_Plane { public: wxWidgetMesure2D_Plane_in_MPR(wxWindow *parent); ~wxWidgetMesure2D_Plane_in_MPR(); void OnActiveLink(wxCommandEvent& event); void SetVtkPlane2DView(vtkPlane2DView *vtkplane2Dview); void SetActiveLink(bool ok); protected: virtual wxWindow *CreateWin1a(wxWindow *parent); private: wxCheckBox *_cb_link; vtkPlane2DView *_vtkplane2Dview; }; //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ class creaMaracasVisu_EXPORT wxMPRWidget : public wxPanel { public: wxMPRWidget(wxWindow* parent,marImageData *marimageData = NULL,double voxelSize = -1); ~wxMPRWidget( ); void ConfigureVTK(); virtual void OnRefreshView(wxCommandEvent & event); void OnDClickLeft(wxCommandEvent & event); void OnPageAChanged(wxNotebookEvent & event); void OnPageBChanged(wxNotebookEvent & event); vtkMPRBaseData *GetVtkMPRBaseData(); vtkPlane2DView *GetVtkPlane2DView(); //returns the 3d view of the widget wxVtkMPR3DView *GetWxvtkmpr3Dview_BB(); void RefreshView(bool firsttime=false); wxVtkBaseView *GetWxVtkBaseView(int page, int id); //returns the 2d view of the specific direction (0|1|2) wxVtkMPR2DView *GetWxvtkMPR2Dview(int direction); void setImageData(vtkImageData * img, double voxelsize); private: double _voxelSize; marImageData *_marImageData; vtkMPRBaseData *_vtkmprbasedata; wxVtkMPR2DView *_vtkmpr2Dview[3]; vtkPlane2DView *_vtkplane2Dview; wxSphereView *_wxsphereview; wxVtkMPR2DView *_vtkmpr2Dview_B[3]; vtkPlane2DView *_vtkplane2Dview_B; wxSphereView *_wxsphereview_B; wxVtk3DBaseView *_wxvtk3Dbaseview_MPRClipping3D; wxVtkMPR3DView *_wxvtkmpr3Dview; wxVtkClipping3DView *_wxvtkclipping3Dview; wxVtk3DBaseView *_wxvtk3Dbaseview_MPR3D_B; wxVtkMPR3DView *_wxvtkmpr3Dview_B; wxVtk3DBaseView *_wxvtk3Dbaseview_Clipping3D_BB; wxVtkMPR3DView *_wxvtkmpr3Dview_BB; wxVtkClipping3DView *_wxvtkclipping3Dview_BB; int _refreshAPage; int _refreshBPage; wxFrame *_framePanelCutting; wxCheckBox *_btnCutImageData; wxPanelCuttingImageData *_panelCutting; wxWidgetMesure2D_Plane_in_MPR *_widgetMesure; wxWidgetMesure2D_Plane_in_MPR *_widgetMesure_B; wxPanel *CreateControlPanel(wxWindow *parent); wxPanel *CreateMPRPanel(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata); wxPanel *CreateMPRPanel4View(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata); wxPanel *CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkmprbasedata); void OnCutImagaData( wxCommandEvent &event); DECLARE_EVENT_TABLE( ); }; class creaMaracasVisu_EXPORT wxMPRWidget2 : public wxMPRWidget { public: wxMPRWidget2(wxWindow* parent,marImageData *marimagedata,double voxelSize); ~wxMPRWidget2(); virtual void OnRefreshView(wxCommandEvent & event); private: protected: }; #endif // __WX__MPR__WIDGET__HXX__ // EOF - wxMPRWidget.h