1 /*=========================================================================
4 Module: $RCSfile: wxMPRWidget.h,v $
6 Date: $Date: 2009/05/04 07:35:42 $
7 Version: $Revision: 1.8 $
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 =========================================================================*/
18 #ifndef __WX__MPR__WIDGET__HXX__
19 #define __WX__MPR__WIDGET__HXX__
24 #include <vtkObjectBase.h>
25 #include <vtkCommand.h>
27 #include <vtkPoints.h>
28 #include <vtkPolyData.h>
29 #include <vtkPolyDataMapper.h>
30 #include <vtkProbeFilter.h>
31 #include <vtkPlaneSource.h>
32 #include <vtkImageChangeInformation.h>
33 #include <vtkStructuredPoints.h>
34 #include <vtkTransform.h>
35 #include <vtkImageViewer2.h>
36 #include <vtkBoxWidget.h>
37 #include <vtkPointWidget.h>
38 #include <vtkPlaneWidget.h>
40 #include <vtkCubeSource.h>
41 #include <vtkCylinderSource.h>
42 #include <vtkSphereSource.h>
43 #include <vtkProperty2D.h>
44 #include <vtkTextProperty.h>
45 #include <vtkXYPlotActor.h>
48 //#include "kernel/marInterface.h"
49 #include "manualContour.h"
51 #include "wxMPRBaseData.h"
52 #include "wxVtkBaseView.h"
54 #include <wx/notebook.h>
55 #include <wx/listbox.h>
56 #include <wx/tglbtn.h>
57 #include <wx/splitter.h>
63 //------------------------------------------------------------------
64 //------------------------------------------------------------------
65 //------------------------------------------------------------------
67 class vtkInteractorStyleSphere : public InteractorStyleMaracas
70 vtkInteractorStyleSphere();
71 ~vtkInteractorStyleSphere();
72 virtual bool OnLeftButtonUp();
73 virtual bool OnLeftButtonDown();
74 virtual bool OnMouseMove();
75 virtual bool OnRightButtonUp();
76 virtual bool OnRightButtonDown();
92 //------------------------------------------------------------------
93 //------------------------------------------------------------------
94 //------------------------------------------------------------------
101 idAlBeRa(int id, double radio,int deltavoxel);
105 //------------------------------------------------------------------
106 //------------------------------------------------------------------
107 //------------------------------------------------------------------
109 class wxSphereView : public wxVtk2DBaseView
112 wxSphereView( wxWindow *parent, vtkMPRBaseData *vtkmprbasedata, vtkImageData *imageData);
114 virtual void Configure();
116 void RotationStart(double vx, double vy, bool ok_v, bool ok_ang);
117 virtual void RefreshView();
118 virtual void SetVoxel(double i, double j, int delta, double id, unsigned short gris);
119 void SetDeltaVoxel(int delta);
121 void SetRadio(double radio);
122 int GetIdOfImage(double radio);
123 void SetXYZtoParent(double i, double j);
127 std::vector<idAlBeRa*> _lstId;
140 vtkImageData *_imageDataOriginal;
141 vtkImageData *_imageSphere;
143 vtkMPRBaseData *_vtkmprbasedata;
144 vtkInteractorStyleSphere *_vtkinteractorstylesphere;
146 vtkTransform *_transform;
147 vtkTransform *_transform1;
148 vtkTransform *_transform2;
150 void FiltreImage(int id, double radio);
151 void FiltreImageB(int id, double radio, bool ok,int deltaTMP);
152 void DefineImageSphere();
155 void InitSphere(double points[4][3]);
156 double SphereFindCenter(double P[4][3], double cc[3]);
157 double determinant(double a[4][4], int n);
159 void GetPointSphere(double p[3],double r1,double angA,double angB);
160 void RotatePointOverTheSphere( double pp[3], double p[3],double cc[3]);
161 void TransferePoints(double pp1[3],double pp2[3],double AngX,double AngY,vtkImageData *image);
164 //-------------------------------------------------------------------
165 //-------------------------------------------------------------------
166 //-------------------------------------------------------------------
168 class vtkInteractorStylePlane2D;
169 class vtkInfoTextImageInteractorPlane2D;
171 class vtkPlane2DView : public wxVtk2DBaseView
174 vtkPlane2DView(wxWindow *parent);
179 void SetImgSize( int imgSize );
181 void RotationStart();
182 void RotationDrag(double vx, double vy, bool ok_v, bool ok_ang);
184 virtual int GetActualSlice();
185 virtual void SetActualSlice(int slice);
187 virtual void Refresh( );
189 vtkMPRBaseData *GetVtkmprbasedata();
190 vtkInteractorStylePlane2D *GetInteractorstyleplane2D();
192 void SetActive(bool active);
193 void SetVisibleLine(bool ok);
195 void TransfromeCoordViewWorld2(double &X, double &Y, double &Z);
198 void SetMipWidth(int value);
199 bool GetMipVisualization();
200 void SetMipVisualization(bool ok);
207 bool _mip_visualization;
212 double _backOrient[4];
217 double _n[3]; // Normal
225 vtkImageData * _imageResult;
229 vtkActor *_lineActor;
230 vtkPolyDataMapper *_lineMapper;
233 vtkProbeFilter *_3Dslices;
234 vtkPlaneSource *_pSource;
235 vtkStructuredPoints *_stPoints;
236 vtkImageChangeInformation *_change;
237 vtkTransform *_transform1;
238 vtkTransform *_transform2;
240 vtkInteractorStylePlane2D *_interactorstyleplane2D;
242 vtkInfoTextImage *_vtkInfoTextImage;
243 vtkInfoTextImageInteractorPlane2D *_vtkInfoTextImageInteractorPlane2D;
246 void SetPSource(int sizeIma);
247 void HorizontalLine();
249 void Extract_One_PlaneVTK();
250 void Extract_MIP_PlaneVTK();
256 //------------------------------------------------------------------
257 //------------------------------------------------------------------
258 //------------------------------------------------------------------
260 class vtkInfoTextImageInteractorPlane2D : public vtkInfoTextImageInteractor{
262 vtkInfoTextImageInteractorPlane2D();
263 ~vtkInfoTextImageInteractorPlane2D();
267 virtual bool OnMouseMove();
273 //------------------------------------------------------------------
274 //------------------------------------------------------------------
275 //------------------------------------------------------------------
277 class vtkInteractorStylePlane2D : public InteractorStyleMaracas
280 vtkInteractorStylePlane2D();
281 ~vtkInteractorStylePlane2D();
282 virtual bool OnLeftButtonDown();
283 virtual bool OnLeftButtonUp();
284 virtual bool OnMouseMove();
285 virtual bool OnRightButtonUp();
286 virtual bool OnLeftDClick();
287 bool GetStateRotate();
298 // ----------------------------------------------------------------------------
299 // ----------------------------------------------------------------------------
300 // ----------------------------------------------------------------------------
302 class manualViewPerpPlaneContour : public manualViewContour
305 manualViewPerpPlaneContour();
306 ~manualViewPerpPlaneContour();
307 virtual manualViewPerpPlaneContour * Clone();
308 void CopyAttributesTo( manualViewPerpPlaneContour *cloneObject );
310 virtual void UpdateViewPoint(int id);
311 virtual void RefreshContour();
312 virtual void TransfromeCoordViewWorld( double &X,double &Y,double &Z,int type );
313 virtual bool ifTouchContour( int x, int y, int z);
317 void FilterCordinateXYZ (double &x, double &y, double &z);
322 //------------------------------------------------------------------
323 //------------------------------------------------------------------
324 //------------------------------------------------------------------
326 class vtkInteractorStyleMPRView;
328 class creaMaracasVisu_EXPORT wxVtkMPR2DView : public wxVtk2DBaseView
331 wxVtkMPR2DView( wxWindow *parent, int direction );
334 virtual void Refresh();
335 vtkMPRBaseData *GetVtkmprbasedata();
336 virtual int GetActualSlice();
337 virtual void SetActualSlice(int slice);
339 bool IfMouseTouchX(double x, double y, double z);
340 bool IfMouseTouchY(double x, double y, double z);
341 bool IfMouseTouchZ(double x, double y, double z);
342 void MoveX(double x, double y, double z);
343 void MoveY(double x, double y, double z);
344 void MoveZ(double x, double y, double z);
345 void ChangeAxisColor(double x, double y, double z);
346 virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type);
347 void SetVisibleAxis(bool ok);
360 vtkActor *_lineAActor;
361 vtkPolyDataMapper *_lineAMapper;
364 vtkActor *_lineBActor;
365 vtkPolyDataMapper *_lineBMapper;
367 // vtkInteractorStyle2DMaracas *_interactorStyle2DMaracas;
368 vtkInteractorStyleMPRView *_interactorstylemprview;
374 //------------------------------------------------------------------
375 //------------------------------------------------------------------
376 //------------------------------------------------------------------
378 class vtkInteractorStyleMPRView : public InteractorStyleMaracas
381 vtkInteractorStyleMPRView();
382 ~vtkInteractorStyleMPRView();
384 virtual bool OnMouseMove();
385 virtual bool OnLeftButtonDown();
386 virtual bool OnLeftButtonUp();
387 virtual bool OnLeftDClick();
394 bool _stateMoveAxisX;
395 bool _stateMoveAxisY;
396 bool _stateMoveAxisZ;
404 //------------------------------------------------------------------
405 //------------------------------------------------------------------
406 //------------------------------------------------------------------
407 class wxVtkMPR3DView;
409 class wxVtkMPR3DViewCntrlPanel: public wxPanel
412 wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DView *wxvtkmpr3Dview);
413 ~wxVtkMPR3DViewCntrlPanel();
414 void OnVisibleAxisX(wxCommandEvent& event);
415 void OnVisibleAxisY(wxCommandEvent& event);
416 void OnVisibleAxisZ(wxCommandEvent& event);
417 void OnPositionX(wxScrollEvent& event);
418 void OnPositionY(wxScrollEvent& event);
419 void OnPositionZ(wxScrollEvent& event);
420 void OnVisibleAxisXYZ(wxCommandEvent& event);
421 void OnVisiblePlane(wxCommandEvent& event);
422 void OnEditColorTable(wxCommandEvent& event);
423 virtual void Refresh();
424 void UpdateControlPanel();
427 wxVtkMPR3DView *_wxvtkmpr3Dview;
431 wxSlider *_isoValueSpin;
432 wxStaticText *_isoValueText;
433 wxRadioButton *_surfA;
434 wxRadioButton *_surfB;
435 wxRadioButton *_surfC;
436 wxRadioButton *_surfD;
437 wxCheckBox *_visible;
439 wxSlider *_positionX;
440 wxSlider *_positionY;
441 wxSlider *_positionZ;
443 wxCheckBox *_ckBoxXYZ;
444 wxCheckBox *_ckBoxPlane;
452 //------------------------------------------------------------------
453 //------------------------------------------------------------------
454 //------------------------------------------------------------------
455 class wxVtkClipping3DView;
459 class wxVtkClipping3DViewCntrlPanel: public wxPanel
462 wxVtkClipping3DViewCntrlPanel(wxWindow *parent, wxVtkClipping3DView *_wxvtkclipping3Dview);
463 ~wxVtkClipping3DViewCntrlPanel();
464 void OnSurface(wxCommandEvent& event);
465 void OnRepresentationSurfaceWireFrame(wxCommandEvent& event);
466 void OnVisibleVolume(wxCommandEvent& event);
467 void OnVisibleBoxSurface(wxCommandEvent& event);
468 void OnVisibleBoxVolume(wxCommandEvent& event);
469 void OnColor(wxCommandEvent& event);
470 void OnVisibleSurface(wxCommandEvent& event);
471 void OnOpacity(wxScrollEvent& event);
472 void OnIsoValue(wxScrollEvent& event);
473 void OnIsoValueSpin(wxScrollEvent& event);
474 virtual void Refresh();
475 void OnBtnCreateFileSTL(wxCommandEvent& event);
476 void OnBtnSaveRawVolume(wxCommandEvent& event);
477 void OnBtnVolumeFunctions(wxCommandEvent& event);
478 void OnBtnMeshVTKLoad(wxCommandEvent& event);
482 wxVtkClipping3DView *_wxvtkclipping3Dview;
485 wxSlider *_isoValueSpin;
486 wxRadioButton *_surfA;
487 wxRadioButton *_surfB;
488 wxRadioButton *_surfC;
489 wxRadioButton *_surfD;
490 wxCheckBox *_visible;
493 wxRadioButton *_wireFrameRep;
494 wxRadioButton *_surfaceRep;
502 //------------------------------------------------------------------
503 //------------------------------------------------------------------
504 //------------------------------------------------------------------
507 class vtkmyPWCallback_3DPointWidget : public vtkCommand
510 static vtkmyPWCallback_3DPointWidget *New()
511 { return new vtkmyPWCallback_3DPointWidget; }
512 virtual void Execute(vtkObject *caller, unsigned long, void*);
513 vtkmyPWCallback_3DPointWidget(){}
514 void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview );
515 void SetVtkPointWidget( vtkPointWidget *pointWidget );
516 void SetVtkPlaneWidget( vtkPlaneWidget *planeWidget );
519 double _backNormal[3];
520 vtkPlaneWidget *_planeWidget;
521 vtkPointWidget *_pointWidget;
522 wxVtkMPR3DView *_wxvtkmpr3Dview;
526 //------------------------------------------------------------------
527 //------------------------------------------------------------------
528 //------------------------------------------------------------------
530 class creaMaracasVisu_EXPORT wxVtkMPR3DView
533 wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview );
534 virtual ~wxVtkMPR3DView();
535 void VisibleImageActor(int idPosition, bool visible);
536 void VisiblePointWidget( bool visible );
537 void VisiblePlaneWidget( bool visible );
539 void SetVisibleTissue(int idTissue, bool visible);
540 bool GetVisibleTissue(int idTissue);
541 virtual void Refresh();
542 virtual void RefreshView();
543 virtual void Configure();
544 void SetVtkMPR3DDataViewer( vtkMPR3DDataViewer *vtkmpr3Ddataviewer );
545 wxPanel* CreateControlPanel(wxWindow *parent);
547 vtkMPR3DDataViewer* GetVtkMPR3DDataViewer()throw (char*);
548 wxVtk3DBaseView* GetWxvtk3Dbaseview();
550 void InitOrientationPointWidget();
552 // EED 25 Janvier 2007 testLoic
556 void RemoveActor(vtkActor* actor);
557 void ResetCamera(int *ext=NULL, double* origin=NULL,double* spc=NULL);
560 wxVtk3DBaseView *_wxvtk3Dbaseview;
561 vtkMPR3DDataViewer *_vtkmpr3Ddataviewer;
562 wxVtkMPR3DViewCntrlPanel *_wxvtkmpr3DviewCntrlPanel;
565 vtkPolyData *_vtkplane;
566 vtkActor *_contourPlaneActor;
567 vtkPlaneWidget *_planeWidget;
570 vtkPointWidget *_pointWidget;
571 vtkmyPWCallback_3DPointWidget *_myCallback;
572 vtkProbeFilter *_probe;
573 vtkPolyDataMapper *_contourMapper;
583 //------------------------------------------------------------------
584 //------------------------------------------------------------------
585 //------------------------------------------------------------------
587 class wxVtkClipping3DView
590 wxVtkClipping3DView( wxVtk3DBaseView* wxvtk3Dbaseview );
591 virtual ~wxVtkClipping3DView();
592 virtual void Refresh();
593 virtual void Configure();
594 void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
595 wxPanel* CreateControlPanel(wxWindow *parent);
596 vtkClipping3DDataViewer* GetVtkClipping3DDataViewer();
598 void VisibleActor(int idTissue, bool visTissue);
599 void VisibleVolumeActor( bool visVolume );
600 void SetVisibleBoxSurface(bool visible);
601 void SetVisibleBoxVolume(bool visible);
602 void SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation );
604 wxVtk3DBaseView* GetWxvtk3Dbaseview()throw(char*);
607 wxVtk3DBaseView *_wxvtk3Dbaseview;
608 vtkClipping3DDataViewer *_vtkclipping3Ddataviewer;
609 vtkBoxWidget *_boxWidgetS1;
610 vtkBoxWidget *_boxWidgetVolume;
611 wxVtkClipping3DViewCntrlPanel *_wxvtkclipping3DviewCntrlPanel;
617 //------------------------------------------------------------------
618 //------------------------------------------------------------------
619 //------------------------------------------------------------------
621 class vtkInteractorStyle3DView : public InteractorStyleMaracas
624 vtkInteractorStyle3DView();
625 ~vtkInteractorStyle3DView();
627 virtual bool OnLeftDClick();
628 bool SelectMarchibCubePoint();
631 wxVtkMPR3DView *GetWxVtkMPR3DView();
632 void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview );
634 wxVtkClipping3DView *GetWxVtkClipping3DView();
635 void SetWxVtkClipping3DView( wxVtkClipping3DView *wxvtkclipping3Dview);
639 wxVtkMPR3DView *_wxvtkmpr3Dview;
640 wxVtkClipping3DView *_wxvtkclipping3Dview;
644 //------------------------------------------------------------------
645 //------------------------------------------------------------------
646 //------------------------------------------------------------------
648 class figureCuttingModel
651 figureCuttingModel();
652 virtual ~figureCuttingModel();
654 void SetPosition(double x,double y, double z);
655 double GetPositionX();
656 double GetPositionY();
657 double GetPositionZ();
659 void SetScale(double sx,double sy, double sz);
664 void SetRotation(double alfa,double beta, double teta);
665 double GetAngleAlfa();
666 double GetAngleBeta();
667 double GetAngleTeta();
669 void SetSpacing(double spcX,double spcY, double spcZ);
671 void CalculeMatrix();
672 void CalculeInversMatrix();
673 virtual bool IfPointInside(double x, double y, double z);
674 vtkTransform *GetVtkTransform();
675 // void SetVtkTransform(vtkTransform *matrix);
676 virtual double GetTheoricVolume();
677 virtual char *GetName();
693 vtkTransform *_inversModel;
694 vtkTransform *_matrixModel;
695 vtkTransform *_matrixVisual;
701 //------------------------------------------------------------------
702 //------------------------------------------------------------------
703 //------------------------------------------------------------------
706 class figureCuttingSphereModel : public figureCuttingModel
709 figureCuttingSphereModel();
710 virtual ~figureCuttingSphereModel();
711 virtual bool IfPointInside(double x, double y, double z);
712 virtual double GetTheoricVolume();
713 virtual char *GetName();
718 //------------------------------------------------------------------
719 //------------------------------------------------------------------
720 //------------------------------------------------------------------
722 class figureCuttingCubeModel : public figureCuttingModel
725 figureCuttingCubeModel();
726 virtual ~figureCuttingCubeModel();
727 virtual bool IfPointInside(double x, double y, double z);
728 virtual double GetTheoricVolume();
729 virtual char *GetName();
734 //------------------------------------------------------------------
735 //------------------------------------------------------------------
736 //------------------------------------------------------------------
738 class figureCuttingCylinderModel : public figureCuttingModel
741 figureCuttingCylinderModel();
742 virtual ~figureCuttingCylinderModel();
743 virtual bool IfPointInside(double x, double y, double z);
744 virtual double GetTheoricVolume();
745 virtual char *GetName();
751 //------------------------------------------------------------------
752 //------------------------------------------------------------------
753 //------------------------------------------------------------------
755 class wxPanelCuttingImageData : public wxPanel
758 wxPanelCuttingImageData (wxWindow *parent);
759 ~wxPanelCuttingImageData ();
760 void OnTransform(wxScrollEvent& event);
761 void OnOpacityFig(wxScrollEvent& event);
762 void OnTypeFig(wxCommandEvent& event);
763 void OnExtract(wxCommandEvent& event);
764 void SetVtkMPRBaseData( vtkMPRBaseData *vtkmprbasedata );
765 void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
766 void SetWxVtk3DBaseView( wxVtk3DBaseView * wxvtk3Dbaseview );
768 void SetParamsOfTransformation( );
776 wxSlider *_opacityFig;
780 wxSlider *_rotationX;
781 wxSlider *_rotationY;
782 wxSlider *_rotationZ;
784 wxRadioButton *_volIntern;
785 wxRadioButton *_volExtern;
786 wxCheckBox *_histogrammeAccumulated;
788 wxSlider *_valueBeforeIsoValue;
789 wxSlider *_valueAfterIsoValue;
792 wxStaticText *_infoToVo;
793 wxStaticText *_infoSuVo;
794 wxStaticText *_infoSuVoA;
795 wxStaticText *_infoPixLe;
796 wxStaticText *_infoPixHi;
799 figureCuttingCylinderModel *_modelCylinder;
800 figureCuttingCubeModel *_modelCube;
801 figureCuttingSphereModel *_modelSphere;
802 figureCuttingModel *_actualCuttingModel;
805 vtkCubeSource *_vtkcube;
806 vtkSphereSource *_vtksphere;
807 vtkCylinderSource *_vtkcylinder;
808 vtkPolyDataMapper *_cubeMapper;
809 vtkPolyDataMapper *_sphereMapper;
810 vtkPolyDataMapper *_cylinderMapper;
811 vtkActor *_cubeActor;
812 vtkActor *_sphereActor;
813 vtkActor *_cylinderActor;
814 vtkActor *_actualActor;
817 vtkMPRBaseData *_vtkmprbasedata;
818 wxVtk3DBaseView *_wxvtk3Dbaseview;
819 vtkImageData *_imageData;
820 vtkClipping3DDataViewer *_vtkclipping3Ddataviewer;
822 vtkImageData *_histogrammeVector;
823 vtkXYPlotActor *_xyplot;
824 wxVtkBaseView *_wxvtkbaseView;
825 vtkRenderer *_renplotter;
828 void CreateInterface();
829 void Create3DViewObjects();
830 void RefreshOpacity();
831 wxWindow *CreatePlotHistogrammeInterface();
832 void InitHistogramme();
838 //------------------------------------------------------------------
839 //------------------------------------------------------------------
840 //------------------------------------------------------------------
842 class wxWidgetMesure2D : public wxSplitterWindow
845 wxWidgetMesure2D( wxWindow *parent );
848 void OnActiveMessureTool(wxCommandEvent& event);
849 void OnVisibleMessureTool(wxCommandEvent& event);
850 void OnCloseContour(wxCommandEvent& event);
851 void OnVisibleInformation(wxCommandEvent& event);
853 void SetMesureScale(double mesureScale);
855 manualContourModel* GetManualContourModel();
856 virtual void ConfigureA(wxVtk2DBaseView *wxvtk2Dbaseview);
859 wxVtk2DBaseView *_wxvtk2Dbaseview;
860 virtual wxWindow *CreateWin1a(wxWindow *parent);
862 wxCheckBox *_cb_messuretool;
863 wxCheckBox *_cb_mt_visible;
864 wxCheckBox *_cb_closeContour;
865 wxCheckBox *_cb_visibleText;
867 manualContourControler *_manContourControl_1;
868 manualContourModel *_mContourModel_1;
869 manualViewContour *_mViewContour_1;
871 void ActiveMessureTool(bool ok);
873 // DECLARE_EVENT_TABLE();
876 //------------------------------------------------------------------
877 //------------------------------------------------------------------
878 //------------------------------------------------------------------
880 class wxWidgetMesure2D_Plane : public wxWidgetMesure2D
883 wxWidgetMesure2D_Plane(wxWindow *parent);
884 ~wxWidgetMesure2D_Plane();
885 void OnActiveLine(wxCommandEvent& event);
886 void OnActiveCirlcle(wxCommandEvent& event);
887 virtual void ConfigureA(wxVtk2DBaseView *wxvtk2Dbaseview);
888 void ConfigureCircleLine();
892 virtual wxWindow *CreateWin1a(wxWindow *parent);
894 wxCheckBox *_cb_line;
895 wxCheckBox *_cb_circle;
898 vtkPoints *_ptsCircle1;
899 vtkActor *_circle1Actor;
900 vtkPolyDataMapper *_circle1Mapper;
901 vtkPolyData *_pdCircle1;
903 vtkPoints *_ptsCircle2;
904 vtkActor *_circle2Actor;
905 vtkPolyDataMapper *_circle2Mapper;
906 vtkPolyData *_pdCircle2;
908 vtkPoints *_ptsLineRef1;
909 vtkActor *_lineRef1Actor;
910 vtkPolyDataMapper *_lineRef1Mapper;
911 vtkPolyData *_pdLineRef1;
913 vtkPoints *_ptsLineRef2;
914 vtkActor *_lineRef2Actor;
915 vtkPolyDataMapper *_lineRef2Mapper;
916 vtkPolyData *_pdLineRef2;
918 void SetVisibleCircle( bool ok );
922 //------------------------------------------------------------------
923 //------------------------------------------------------------------
924 //------------------------------------------------------------------
927 class wxWidgetMesure2D_Plane_in_MPR : public wxWidgetMesure2D_Plane
930 wxWidgetMesure2D_Plane_in_MPR(wxWindow *parent);
931 ~wxWidgetMesure2D_Plane_in_MPR();
932 void OnActiveLink(wxCommandEvent& event);
933 void SetVtkPlane2DView(vtkPlane2DView *vtkplane2Dview);
934 void SetActiveLink(bool ok);
937 virtual wxWindow *CreateWin1a(wxWindow *parent);
939 wxCheckBox *_cb_link;
940 vtkPlane2DView *_vtkplane2Dview;
944 //------------------------------------------------------------------
945 //------------------------------------------------------------------
946 //------------------------------------------------------------------
950 class creaMaracasVisu_EXPORT wxMPRWidget : public wxPanel
953 wxMPRWidget(wxWindow* parent,marImageData *marimageData = NULL,double voxelSize = -1);
957 virtual void OnRefreshView(wxCommandEvent & event);
958 void OnDClickLeft(wxCommandEvent & event);
960 void OnPageAChanged(wxNotebookEvent & event);
961 void OnPageBChanged(wxNotebookEvent & event);
963 vtkMPRBaseData *GetVtkMPRBaseData();
964 vtkPlane2DView *GetVtkPlane2DView();
966 //returns the 3d view of the widget
967 wxVtkMPR3DView *GetWxvtkmpr3Dview_BB();
969 void RefreshView(bool firsttime=false);
971 wxVtkBaseView *GetWxVtkBaseView(int page, int id);
973 //returns the 2d view of the specific direction (0|1|2)
974 wxVtkMPR2DView *GetWxvtkMPR2Dview(int direction);
976 void setImageData(vtkImageData * img, double voxelsize);
980 marImageData *_marImageData;
981 vtkMPRBaseData *_vtkmprbasedata;
982 wxVtkMPR2DView *_vtkmpr2Dview[3];
983 vtkPlane2DView *_vtkplane2Dview;
984 wxSphereView *_wxsphereview;
985 wxVtkMPR2DView *_vtkmpr2Dview_B[3];
986 vtkPlane2DView *_vtkplane2Dview_B;
987 wxSphereView *_wxsphereview_B;
989 wxVtk3DBaseView *_wxvtk3Dbaseview_MPRClipping3D;
990 wxVtkMPR3DView *_wxvtkmpr3Dview;
991 wxVtkClipping3DView *_wxvtkclipping3Dview;
993 wxVtk3DBaseView *_wxvtk3Dbaseview_MPR3D_B;
994 wxVtkMPR3DView *_wxvtkmpr3Dview_B;
996 wxVtk3DBaseView *_wxvtk3Dbaseview_Clipping3D_BB;
997 wxVtkMPR3DView *_wxvtkmpr3Dview_BB;
998 wxVtkClipping3DView *_wxvtkclipping3Dview_BB;
1004 wxFrame *_framePanelCutting;
1005 wxCheckBox *_btnCutImageData;
1006 wxPanelCuttingImageData *_panelCutting;
1008 wxWidgetMesure2D_Plane_in_MPR *_widgetMesure;
1009 wxWidgetMesure2D_Plane_in_MPR *_widgetMesure_B;
1011 wxPanel *CreateControlPanel(wxWindow *parent);
1012 wxPanel *CreateMPRPanel(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
1013 wxPanel *CreateMPRPanel4View(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
1014 wxPanel *CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
1016 void OnCutImagaData( wxCommandEvent &event);
1018 DECLARE_EVENT_TABLE( );
1022 class creaMaracasVisu_EXPORT wxMPRWidget2 : public wxMPRWidget
1025 wxMPRWidget2(wxWindow* parent,marImageData *marimagedata,double voxelSize);
1027 virtual void OnRefreshView(wxCommandEvent & event);
1035 #endif // __WX__MPR__WIDGET__HXX__
1039 // EOF - wxMPRWidget.h