]> Creatis software - creaMaracasVisu.git/commitdiff
#3569 mprbasedata SetXYZ withObserver vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 20 Dec 2024 16:47:38 +0000 (17:47 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 20 Dec 2024 16:47:38 +0000 (17:47 +0100)
20 files changed:
bbtk/src/bbcreaMaracasVisuManualPaint_UndoRedo.cxx
bbtk/src/bbcreaMaracasVisuSetPosition.cxx
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourVOIWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3DControler.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSphereView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx

index 11c935b7fc0c20b9529eb1bcded2f36a70783e27..145656573ec151f4164759f02a6e4cd9eeb809e2 100644 (file)
@@ -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()
index 9a52ed02370bbd5a2ebd05a92474be5860e3a8ce..c4a86775cba29511b6989b6277a59567b738afd0 100644 (file)
@@ -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;
index aa5e8c4302ec0da75b0f0c7037baf2b562001944..daf5377a8edc75b2f8b3320e641883f1f1358a01 100644 (file)
                {
 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();
                }
index 2682cae3a4beeaf1e0686173790226e8c0924525..6e8a1b3cf901b0ecfce2997ba73956fa55e3a443 100644 (file)
@@ -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()
 {
index 4e841bec6fdef474304c4eb38600004f0553f95a..2f36e7b4d5e035d5cddc1b989322d3d9115b8ba3 100644 (file)
@@ -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
index f4fe07be9ecbe88094d35c177be97cab5a641ba1..aed33a78a7ce5a8638bc0a51f6e59df8076e58a9 100644 (file)
@@ -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();
index ef444aa2f969ea00d4f1cd4cd59ebe3c78780893..bb9225fb011013a92d09b3c1c91825d97f23bcaa 100644 (file)
@@ -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;
                        }
                }
index 959bcf6019bc643dbde0151d1f612d0364fd0315..4a5ffef81155497eae953c233db1dd858e86335e 100644 (file)
@@ -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;
index 306b6e3f60fef7d5d2ec4aff70c4bf74de16ec55..166a12a00c6ee5c7f8a80fe8ce2fcf43218bbea0 100644 (file)
@@ -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()
 {
index 1d202777ff92679d0b8579588a9db37a876bb010..1a108b620fa5db898c23872264e81c1589557f17 100644 (file)
@@ -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();
index 05bcbd707b297decbfb4fb490457e0aaac345cc4..d6728374712c703437aedd12b23cc2de0a6a3a61 100644 (file)
@@ -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()
 {      
index 88baa716badef0bc7b06003e9728fb88f301a0eb..5230681a16c98011ee3fc82c76914bbf257e757b 100644 (file)
@@ -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);
index 67606299255f14f666ae5337dec6a3314de33f35..79d5d989ab2f7146bc86e34f89c4464c279c6797 100644 (file)
@@ -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();                                        }
index 4cf5975c072369e3069f6a248f5b02da903b7e88..678600e1bf945a4e0eac3f95a76605213499b016 100644 (file)
@@ -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 );
                }
        }
 
index 93c0ed869bd8a2e73581abd089d730b6c79e4cf8..2bb8a84c2c562bd78fe29e31ee058be5152a0ebb 100644 (file)
                                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 );
                        }
                }
 
index 180e4cd182ed1326275d88a833816412853adf23..6b298b708da8825a8f708cb6263c6ae8e2feb812 100644 (file)
@@ -347,9 +347,7 @@ void wxSphereView::SetXYZtoParent(double i, double j)
                         (pp[2]>=0) && (pp[2]<dimOrig[2]) )
                {
                        if (_vtkmprbasedata){
-                               _vtkmprbasedata->SetX(pp[0]);
-                               _vtkmprbasedata->SetY(pp[1]);
-                               _vtkmprbasedata->SetZ(pp[2]);
+                               _vtkmprbasedata->SetXYZ( pp[0] , pp[1] , pp[2] );
                        }
                } // if pp
        } // if radio
index daea638fe33634042c60425a6d6bf96db5278df0..3271432a7d2326d6e4e2f0e7a1a591f108957a25 100644 (file)
@@ -294,7 +294,7 @@ int wxVtk2DBaseView::GetActualSlice()  // virtual
 //-------------------------------------------------------------------
 void wxVtk2DBaseView::SetActualSlice(int slice)  // Virtual
 {
-   GetVtkBaseData()->SetZ(slice);
+   GetVtkBaseData()->SetZ(slice,true);
 }
 
 //-------------------------------------------------------------------
index b6f7f3c802e05a643bf2aec59a310709ccdf0f69..afe7d1aa7654fffd701de7d9409c5613f7c70192 100644 (file)
@@ -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)
        {
index cdd4054afb381515a2e1e7c2e24c28906059bbcd..ee951baa9500e16e27c229865f07f6f26b7ec40e 100644 (file)
@@ -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
index ef538d40f592b77b19cfa8cbde3a7e05bf82c1d8..5541ae1eae6a5a2a16baf6b80384e7756e456dd7 100644 (file)
@@ -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<double> *ctfunVectorPoint   = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorPoint();
        std::vector<double> *ctfunVectorRed             = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorRed();
        std::vector<double> *ctfunVectorGreen   = this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorGreen();
-       std::vector<double> *ctfunVectorBlue    =   this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetctFunVectorBlue();
+       std::vector<double> *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()
 {