From 9e2306216e57069ab95d01423b7fec8548eb9c40 Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Fri, 20 Dec 2024 17:47:38 +0100 Subject: [PATCH] #3569 mprbasedata SetXYZ withObserver --- .../bbcreaMaracasVisuManualPaint_UndoRedo.cxx | 18 +++------- bbtk/src/bbcreaMaracasVisuSetPosition.cxx | 4 +-- .../wxWindows/Contour/ContourVOIWidget.cxx | 6 ++-- .../manualContour3DControler.cpp | 10 ++---- .../manualPaint/ManualPaintControler.cpp | 4 +-- .../interface/wxWindows/widgets/vtkBaseData.h | 5 ++- .../widgets/vtkInteractorStyle3DView.cxx | 5 +-- .../widgets/vtkInteractorStylePlane2D.cxx | 14 ++++---- .../wxWindows/widgets/vtkPlane2DView.cxx | 5 ++- .../widgets/vtkmyPWCallback_3DPointWidget.cxx | 4 +-- .../wxWindows/widgets/wxMPRBaseData.cxx | 9 +++++ .../wxWindows/widgets/wxMPRBaseData.h | 12 +++++-- .../wxWindows/widgets/wxMPRWidget.cxx | 5 +-- .../widgets/wxMaracasRenderTabbedPanel.cpp | 14 ++------ .../widgets/wxMaracas_ViewerWidget.cxx | 14 ++------ .../wxWindows/widgets/wxSphereView.cxx | 4 +-- .../wxWindows/widgets/wxVtk2DBaseView.cxx | 2 +- .../wxWindows/widgets/wxVtkMPR2DView.cxx | 18 +++++----- .../wxWindows/widgets/wxVtkMPR3DView.cxx | 10 +++--- .../widgets/wxVtkMPR3DViewCntrlPanel.cxx | 36 ++++++++----------- 20 files changed, 81 insertions(+), 118 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_UndoRedo.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_UndoRedo.cxx index 11c935b..1456565 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_UndoRedo.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_UndoRedo.cxx @@ -41,15 +41,12 @@ void ManualPaint_UndoRedo::Process() { bbGetInputManualpaintmodel()->Redo(); } // if Type 2 - - if (bbGetInputwxvtkbaseview()!=NULL) { - vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxvtkbaseview()->GetVtkBaseData()); - vtkmprbasedata->SetX( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointX() ); - vtkmprbasedata->SetY( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointY() ); - vtkmprbasedata->SetZ( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointZ() ); + vtkmprbasedata->SetXYZ( bbGetInputManualpaintmodel()->GetRestorBaseInitialPointX() , + bbGetInputManualpaintmodel()->GetRestorBaseInitialPointY() , + bbGetInputManualpaintmodel()->GetRestorBaseInitialPointY() ); wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 #if wxMAJOR_VERSION <= 2 @@ -58,15 +55,10 @@ void ManualPaint_UndoRedo::Process() bbGetInputwxvtkbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent( newevent ); #endif } // if bbGetInputwxvtkbaseview() - - } // if bbGetInputManualpaintmodel() - - - - } -//===== + +//===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void ManualPaint_UndoRedo::bbUserSetDefaultValues() diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx index 9a52ed0..c4a8677 100644 --- a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx +++ b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx @@ -35,9 +35,7 @@ auto start1 = std::chrono::high_resolution_clock::now(); vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxVtkBaseView()->GetVtkBaseData()); if (bbGetInputPoint().size()==3) { - vtkmprbasedata->SetX( bbGetInputPoint()[0],false ); - vtkmprbasedata->SetY( bbGetInputPoint()[1],false ); - vtkmprbasedata->SetZ( bbGetInputPoint()[2],false ); + vtkmprbasedata->SetXYZ( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] ); bool tmpFixAxis = vtkmprbasedata->GetFixAxis2D( ); vtkmprbasedata->SetFixAxis2D( bbGetInputFixAxis2D() ); int codeEvent; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourVOIWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourVOIWidget.cxx index aa5e8c4..daf5377 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourVOIWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourVOIWidget.cxx @@ -61,14 +61,14 @@ { std::cout << "wxWidgetSliderMinMaxVOI ::onActualChange_Bar" << std::endl; wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)mcontourtool->GetWxVtkBaseView(); - wxvtk2dbaseview->GetVtkBaseData()->SetZ(modBarRange->GetActual()); + wxvtk2dbaseview->GetVtkBaseData()->SetZ( modBarRange->GetActual() , true ); wxvtk2dbaseview->Refresh(); } void wxWidgetSliderMinMaxVOI :: onStartChange_Bar(wxCommandEvent& event) { std::cout << "wxWidgetSliderMinMaxVOI ::onStartChange_Bar" << std::endl; wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)mcontourtool->GetWxVtkBaseView(); - wxvtk2dbaseview->GetVtkBaseData()->SetZ(modBarRange->GetStart()); + wxvtk2dbaseview->GetVtkBaseData()->SetZ(modBarRange->GetStart() , true ); wxvtk2dbaseview->Refresh(); //EED mcontourtool->ProcessOutputs(); } @@ -76,7 +76,7 @@ std::cout << "wxWidgetSliderMinMaxVOI ::onStartChange_Bar" << std::endl; { std::cout << "wxWidgetSliderMinMaxVOI ::onEndChange_Bar" << std::endl; wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)mcontourtool->GetWxVtkBaseView(); - wxvtk2dbaseview->GetVtkBaseData()->SetZ(modBarRange->GetEnd()); + wxvtk2dbaseview->GetVtkBaseData()->SetZ(modBarRange->GetEnd() , true); wxvtk2dbaseview->Refresh(); //EED mcontourtool->ProcessOutputs(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.cpp index 2682cae..6e8a1b3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.cpp @@ -74,6 +74,7 @@ void manualContour3DControler::ResetOrientationPlane() this->GetManualContourModel()->GetNearestPointAndNormal(p,rp,rn); this->GetVtkMPRBaseData()->SetNormal(rn[0],rn[1],rn[2]); } + // ---------------------------------------------------------------------------- void manualContour3DControler::MouseClickLeft(int x, int y) // virtual { @@ -82,18 +83,13 @@ void manualContour3DControler::MouseClickLeft(int x, int y) // virtual if ( (GetState()==0) && (id!=-1) ) { manualPoint *mp = this->GetManualContourModel()->GetManualPoint(id); - - this->GetVtkMPRBaseData()->SetX( mp->GetX() ); - this->GetVtkMPRBaseData()->SetY( mp->GetY() ); - this->GetVtkMPRBaseData()->SetZ( mp->GetZ() ); + this->GetVtkMPRBaseData()->SetXYZ( mp->GetX() ,mp->GetY() ,mp->GetZ() ); ResetOrientationPlane(); this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); } - - manualContourControler::MouseClickLeft(x,y); - } + // ---------------------------------------------------------------------------- bool manualContour3DControler::OnChar() { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp index 4e841be..2f36e7b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp @@ -129,9 +129,7 @@ void ManualPaintControler::Refresh_UndoRedo() if (wxvtk2Dbaseview!=NULL) { vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (wxvtk2Dbaseview->GetVtkBaseData()); - vtkmprbasedata->SetX( _manualPaintModel->GetRestorBaseInitialPointX() ); - vtkmprbasedata->SetY( _manualPaintModel->GetRestorBaseInitialPointY() ); - vtkmprbasedata->SetZ( _manualPaintModel->GetRestorBaseInitialPointZ() ); + vtkmprbasedata->SetXYZ( _manualPaintModel->GetRestorBaseInitialPointX() , _manualPaintModel->GetRestorBaseInitialPointY() , _manualPaintModel->GetRestorBaseInitialPointZ() ); wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 #if wxMAJOR_VERSION <= 2 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h index f4fe07b..aed33a7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h @@ -41,7 +41,10 @@ public: void SetMarImageData(marImageData *marimagedata); virtual void Configure(); double GetZ(); - void SetZ(double z, bool withObserver=true); + +// void SetZ(double z, bool withObserver=true); + void SetZ(double z, bool withObserver); + int GetT(); void SetT(double t); virtual double GetX(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx index ef444aa..bb9225f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx @@ -105,9 +105,7 @@ bool vtkInteractorStyle3DView::SelectMarchibCubePoint() { xc = ( x2 + x1 ) * 0.5; //EED 27 sep 2006 (2/2) - this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX(xc(0)/spc[0]); - this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xc(1)/spc[1]); - this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xc(2)/spc[2]); + this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetXYZ( xc(0)/spc[0] , xc(1)/spc[1] , xc(2)/spc[2] ); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 #if wxMAJOR_VERSION <= 2 @@ -115,7 +113,6 @@ bool vtkInteractorStyle3DView::SelectMarchibCubePoint() #else this->_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); #endif - ok=true; } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx index 959bcf6..4a5ffef 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx @@ -107,20 +107,18 @@ bool vtkInteractorStylePlane2D::OnMouseMove () // virtual //------------------------------------------------------------------- bool vtkInteractorStylePlane2D::OnLeftDClick() // virtual { - int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; - int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1]; - double xx=fx; - double yy=fy; - double zz=0; + int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; + int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1]; + double xx = fx; + double yy = fy; + double zz = 0; vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()); vtkMPRBaseData *vtkmprbasedata = vtkplane2Dview->GetVtkmprbasedata(); vtkplane2Dview->TransfromCoordViewWorld2(xx,yy,zz); - vtkmprbasedata->SetX( xx ); - vtkmprbasedata->SetY( yy ); - vtkmprbasedata->SetZ( zz ); + vtkmprbasedata->SetXYZ( xx , yy , zz); this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); return true; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx index 306b6e3..166a12a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx @@ -540,10 +540,9 @@ int vtkPlane2DView::GetMipWidth() void vtkPlane2DView::SetActualSlice(int slice) // Virtual { double dir=(double)slice/3.0; - GetVtkmprbasedata()->SetX( _cx + (_n[0]*dir) ); - GetVtkmprbasedata()->SetY( _cy + (_n[1]*dir) ); - GetVtkmprbasedata()->SetZ( _cz + (_n[2]*dir) ); + GetVtkmprbasedata()->SetXYZ( _cx+(_n[0]*dir) , _cy+(_n[1]*dir) , _cz+(_n[2]*dir) ); } + //--------------------------------------------------------------------------- vtkInteractorStylePlane2D *vtkPlane2DView::GetInteractorstyleplane2D() { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.cxx index 1d20277..1a108b6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.cxx @@ -80,9 +80,7 @@ void vtkmyPWCallback_3DPointWidget::Execute(vtkObject *caller, unsigned long, vo // Position Change if ( (fabs(tx-p[0])>delta) || (fabs(ty-p[1])>delta) || (fabs(tz-p[2])>delta) ) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( p[0] ); - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( p[1] ); - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( p[2] ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetXYZ( p[0] ,p[1] ,p[2] ); vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView(); isbv->BlockRefresh(); isbv->vtkInteractorStyleBaseView::OnLeftButtonDown(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx index 05bcbd7..d672837 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx @@ -210,6 +210,15 @@ void vtkMPRBaseData::SetY(double y, bool withObserver) // default withObserve }// if img } +void vtkMPRBaseData::SetXYZ(double x, double y, double z) +{ + // this order lets just one refresh with the observer mechanism (example ColorLayer ) + this->SetX( x , false ); + this->SetY( y , false ); + this->SetZ( z , true ); +} + + //------------------------------------------------------------------- vtkTransform *vtkMPRBaseData::GetTransformOrientation() { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h index 88baa71..5230681 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h @@ -95,9 +95,15 @@ public: int GetMaxPositionY( ); int GetMaxPositionZ( ); double GetX(); - double GetY(); - void SetX(double x, bool withObserver=true); - void SetY(double y, bool withObserver=true); + double GetY(); + +// void SetX(double x, bool withObserver=true); +// void SetY(double y, bool withObserver=true); + + void SetX(double x, bool withObserver); + void SetY(double y, bool withObserver); + void SetXYZ(double x, double y, double z); + void GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2); vtkTransform* GetTransformOrientation(); void SetNormal(double nx, double ny, double nz); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx index 6760629..79d5d98 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx @@ -649,10 +649,7 @@ void wxMPRWidget::ConfigureVTK(){ x = _vtkmprbasedata->GetMaxPositionX()/2; y = _vtkmprbasedata->GetMaxPositionY()/2; z = _vtkmprbasedata->GetMaxPositionZ()/2; - _vtkmprbasedata->SetX( x ); - _vtkmprbasedata->SetY( y ); - _vtkmprbasedata->SetZ( z ); - + _vtkmprbasedata->SetXYZ( x , y , z); } if(_vtkmpr2Dview[0]!=NULL) { _vtkmpr2Dview[0]->Configure(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp index 4cf5975..678600e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp @@ -341,20 +341,12 @@ void wxMaracasRenderTabbedPanel::addMPROptions() mvtkmprbasedata->GetImageData()->GetExtent(ext); mvtkmprbasedata->GetImageData()->GetOrigin(org); mvtkmprbasedata->GetImageData()->GetSpacing(spc); - x = (ext[0]+ext[1])/2; y = (ext[2]+ext[3])/2; z = (ext[4]+ext[5])/2; - - mvtkmprbasedata->SetX( x ); - mvtkmprbasedata->SetY( y ); - mvtkmprbasedata->SetZ( z ); - } - else - { - mvtkmprbasedata->SetX( 0 ); - mvtkmprbasedata->SetY( 0 ); - mvtkmprbasedata->SetZ( 0 ); + mvtkmprbasedata->SetXYZ( x , y ,z ); + } else { + mvtkmprbasedata->SetXYZ( 0,0,0 ); } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index 93c0ed8..2bb8a84 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -299,20 +299,12 @@ mvtkmprbasedata->GetImageData()->GetExtent(ext); mvtkmprbasedata->GetImageData()->GetOrigin(org); mvtkmprbasedata->GetImageData()->GetSpacing(spc); - x = (ext[0]+ext[1])/2; y = (ext[2]+ext[3])/2; z = (ext[4]+ext[5])/2; - - mvtkmprbasedata->SetX( x ); - mvtkmprbasedata->SetY( y ); - mvtkmprbasedata->SetZ( z ); - } - else - { - mvtkmprbasedata->SetX( 0 ); - mvtkmprbasedata->SetY( 0 ); - mvtkmprbasedata->SetZ( 0 ); + mvtkmprbasedata->SetXYZ( x , y ,z ); + } else { + mvtkmprbasedata->SetXYZ( 0 , 0 ,0 ); } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.cxx index 180e4cd..6b298b7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.cxx @@ -347,9 +347,7 @@ void wxSphereView::SetXYZtoParent(double i, double j) (pp[2]>=0) && (pp[2]SetX(pp[0]); - _vtkmprbasedata->SetY(pp[1]); - _vtkmprbasedata->SetZ(pp[2]); + _vtkmprbasedata->SetXYZ( pp[0] , pp[1] , pp[2] ); } } // if pp } // if radio diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index daea638..3271432 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -294,7 +294,7 @@ int wxVtk2DBaseView::GetActualSlice() // virtual //------------------------------------------------------------------- void wxVtk2DBaseView::SetActualSlice(int slice) // Virtual { - GetVtkBaseData()->SetZ(slice); + GetVtkBaseData()->SetZ(slice,true); } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index b6f7f3c..afe7d1a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -433,15 +433,15 @@ void wxVtkMPR2DView::SetActualSlice(int slice) // virtual { if (_direction==0) { - GetVtkmprbasedata()->SetX(slice); + GetVtkmprbasedata()->SetX(slice, true); } if (_direction==1) { - GetVtkmprbasedata()->SetY(slice); + GetVtkmprbasedata()->SetY(slice, true); } if (_direction==2) { - GetVtkmprbasedata()->SetZ(slice); + GetVtkmprbasedata()->SetZ(slice, true); } } //------------------------------------------------------------------- @@ -524,11 +524,11 @@ void wxVtkMPR2DView::MoveX(double x, double y, double z) } if (_direction==1) { - GetVtkmprbasedata()->SetX(x); + GetVtkmprbasedata()->SetX(x,true); } if (_direction==2) { - GetVtkmprbasedata()->SetX(x); + GetVtkmprbasedata()->SetX(x,true); } } //------------------------------------------------------------------- @@ -536,14 +536,14 @@ void wxVtkMPR2DView::MoveY(double x, double y, double z) { if (_direction==0) { - GetVtkmprbasedata()->SetY(y); + GetVtkmprbasedata()->SetY(y,true); } if (_direction==1) { } if (_direction==2) { - GetVtkmprbasedata()->SetY(y); + GetVtkmprbasedata()->SetY(y,true); } } //------------------------------------------------------------------- @@ -551,11 +551,11 @@ void wxVtkMPR2DView::MoveZ(double x, double y, double z) { if (_direction==0) { - GetVtkmprbasedata()->SetZ(z); + GetVtkmprbasedata()->SetZ(z,true); } if (_direction==1) { - GetVtkmprbasedata()->SetZ(z); + GetVtkmprbasedata()->SetZ(z,true); } if (_direction==2) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index cdd4054..ee951ba 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -77,9 +77,7 @@ class vtkWindowLevelImagePlaneWidgetCallback : public vtkCommand { double xyzv[4]; ipw->GetCursorData(xyzv); - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX(xyzv[0]); - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xyzv[1]); - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xyzv[2]); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetXYZ( xyzv[0] , xyzv[1] ,xyzv[2] ); } else { vtkImageData *image = _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData(); double spc[3]; @@ -93,17 +91,17 @@ class vtkWindowLevelImagePlaneWidgetCallback : public vtkCommand // FreePlaneX if ((normal[0]==1)&&(normal[1]==0)&&(normal[2]==0)) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( slicePosition/spc[0] ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( slicePosition/spc[0] , true ); } // FreePlaneY if ((normal[0]==0)&&(normal[1]==1)&&(normal[2]==0)) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( slicePosition/spc[1] ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( slicePosition/spc[1] , true ); } // FreePlaneZ if ((normal[0]==0)&&(normal[1]==0)&&(normal[2]==1)) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( slicePosition/spc[2] ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( slicePosition/spc[2] , true ); } }// ipw->GetCursorDataStatus }// ev diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx index ef538d4..5541ae1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx @@ -54,11 +54,11 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV wxButton *btnColorTable = new wxButton (panel, -1, _T("Edit Color Table") ); */ - _ckBoxX = new wxCheckBox(panel,-1,_T("X ")); + _ckBoxX = new wxCheckBox(panel,-1,_T("X ")); // X plano YZ _positionX = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS); - _ckBoxY = new wxCheckBox(panel,-1,_T("Y ")); + _ckBoxY = new wxCheckBox(panel,-1,_T("Y ")); // Y plano XZ _positionY = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS); - _ckBoxZ = new wxCheckBox(panel,-1,_T("Z ")); + _ckBoxZ = new wxCheckBox(panel,-1,_T("Z ")); // Z plano XY _positionZ = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS); _ckBoxXYZ = new wxCheckBox(panel,-1,_T("3D Axis ")); @@ -70,9 +70,9 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV wxButton *btnColorTable = new wxButton (panel, -1, _T("Color table") ); wxButton *btnFreePlanesOrtho= new wxButton (panel, -1, _T("Orthogonal planes GL") ); - _ckFreePlaneX= new wxCheckBox(panel,-1,_T("X ")); - _ckFreePlaneY= new wxCheckBox(panel,-1,_T("Y ")); - _ckFreePlaneZ= new wxCheckBox(panel,-1,_T("Z ")); + _ckFreePlaneX= new wxCheckBox(panel,-1,_T("Sagittal ")); + _ckFreePlaneY= new wxCheckBox(panel,-1,_T("Coronal ")); + _ckFreePlaneZ= new wxCheckBox(panel,-1,_T("Axial ")); _ckFreePlaneInteraction= new wxCheckBox(panel,-1,_T("Interaction planes GL")); //EED: If-else statements added 30 Nov 2009 @@ -434,7 +434,7 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event) std::vector *ctfunVectorPoint = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorPoint(); std::vector *ctfunVectorRed = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorRed(); std::vector *ctfunVectorGreen = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorGreen(); - std::vector *ctfunVectorBlue = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorBlue(); + std::vector *ctfunVectorBlue = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorBlue(); //void *p=this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer(); // JPRx @@ -473,8 +473,7 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event) //hDlg->setMPR3Dview(_wxvtkmpr3Dview); if(hDlg->ShowModal()== wxID_OK ) - { - + { // -- vtkColorTransferFunction -- ctfun->RemoveAllPoints (); //clean colors @@ -482,7 +481,6 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event) ctfunVectorRed->clear(); ctfunVectorGreen->clear(); ctfunVectorBlue->clear(); - int nCTFpoints=hDlg->getSizeBarColor(); // Machete .. Ojo Eduardo i=0; @@ -505,14 +503,8 @@ void wxVtkMPR3DViewCntrlPanel::OnEditColorTable(wxCommandEvent& event) ctfunVectorGreen->push_back(g/255.0); ctfunVectorBlue->push_back(b/255.0); i++; - } - - } - - else - { - + } else { if(hDlg->getRefreshed()) { // -- vtkColorTransferFunction -- @@ -643,7 +635,7 @@ void wxVtkMPR3DViewCntrlPanel::OnVisiblePlane(wxCommandEvent& event) //------------------------------------------------------------------- void wxVtkMPR3DViewCntrlPanel::OnPositionX(wxScrollEvent& event) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( _positionX->GetValue() ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetX( _positionX->GetValue() , true ); _wxvtkmpr3Dview->RefreshView(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh @@ -654,10 +646,11 @@ void wxVtkMPR3DViewCntrlPanel::OnPositionX(wxScrollEvent& event) _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); #endif } + //------------------------------------------------------------------- void wxVtkMPR3DViewCntrlPanel::OnPositionY(wxScrollEvent& event) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( _positionY->GetValue() ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( _positionY->GetValue() , true); _wxvtkmpr3Dview->RefreshView(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 @@ -667,10 +660,11 @@ void wxVtkMPR3DViewCntrlPanel::OnPositionY(wxScrollEvent& event) _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); #endif } + //------------------------------------------------------------------- void wxVtkMPR3DViewCntrlPanel::OnPositionZ(wxScrollEvent& event) { - _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( _positionZ->GetValue() ); + _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( _positionZ->GetValue() , true ); _wxvtkmpr3Dview->RefreshView(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 @@ -681,8 +675,6 @@ void wxVtkMPR3DViewCntrlPanel::OnPositionZ(wxScrollEvent& event) #endif } - - //------------------------------------------------------------------- bool wxVtkMPR3DViewCntrlPanel::GetVisibleX() { -- 2.47.1