]> Creatis software - creaMaracasVisu.git/commitdiff
#3347 creaMaracasVisu Bug New Normal - ViewerMPR2D Reset back position when set...
authorEduardo DAVILA <davila@localhost.localdomain>
Tue, 21 Jan 2020 09:39:20 +0000 (10:39 +0100)
committerEduardo DAVILA <davila@localhost.localdomain>
Tue, 21 Jan 2020 09:39:20 +0000 (10:39 +0100)
bbtk/src/bbmaracasvisuViewerNV.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h

index 4a8cd289c570fc71555f0974e79ef580ad744bca..262107d1ba0ee8f63f44fd481b6970533d8d7e64 100644 (file)
@@ -83,8 +83,8 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNV,bbtk::WxBlackBox);
 //-------------------------------------------------------------
 void ViewerNV::Process()
 {
-       vtkImageData* img = bbGetInputIn();
-       std::vector<int> type = bbGetInputnTypeView();
+       vtkImageData* img               = bbGetInputIn();
+       std::vector<int> type   = bbGetInputnTypeView();
        if(img != NULL && _mwxwidget != NULL)
        {
                if(!compareVectors(type, _currenttype))
@@ -98,15 +98,15 @@ void ViewerNV::Process()
                _currenttype    = type;
                _currentimg     = img;
                _point.clear();
-               _point.push_back((int)_mwxwidget->GetX());
-               _point.push_back((int)_mwxwidget->GetY());
-               _point.push_back((int)_mwxwidget->GetZ());
-               bbSetOutputPoint(_point);
-
-               wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView(1);
-               wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView(2);
-               wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView(3);
-               wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView(4);
+               _point.push_back( (int)_mwxwidget->GetX() );
+               _point.push_back( (int)_mwxwidget->GetY() );
+               _point.push_back( (int)_mwxwidget->GetZ() );
+               bbSetOutputPoint( _point                                  );
+
+               wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView( 1 );
+               wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView( 2 );
+               wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView( 3 );
+               wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView( 4 );
                //wxwidget->RefreshView();
                bbSetOutputwxVtkBaseView1( wvbv1 );
                bbSetOutputwxVtkBaseView2( wvbv2 );
@@ -135,6 +135,24 @@ void ViewerNV::Process()
                        }
                }
                _mwxwidget->SetInterpolate( bbGetInputInterpolate() );
+
+/* Borrame
+               if (wvbv1!=NULL) 
+               {
+                       wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
+                       //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+                       #if wxMAJOR_VERSION <= 2
+                               wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+                       #else
+                               wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
+                       #endif                          
+               }
+
+*/
+
+
+
+
        }//  mwxwidget != NULL
 }
 
index a77e08ea570ef7e0712c68c4ba98319f2fae4318..d2124d8b85f9a6a6ee8a776c35a3cd6da298c1b2 100644 (file)
@@ -109,6 +109,8 @@ protected:
 private:
        double                  _x,_y;
        vtkTransform    *_transformOrientation;
+//EED 2020-01-21
+       double                  _xBack,_yBack;
 };
 
 
index a40409ec2e72d4943fcf182c1b9d07bf2ea97cc4..5fe704df34b3df6fd0bb6552f645e6ee579c5e6d 100644 (file)
 
        void wxMaracas_N_ViewersWidget::RefreshView()
        {
-
                if (wxwindow1!=NULL) {wxwindow1->RefreshView(); }
                if (wxwindow2!=NULL) {wxwindow2->RefreshView(); }
                if (wxwindow3!=NULL) {wxwindow3->RefreshView(); }
index a9e9e1da583d5186dde889eefc5918258bf86cd6..c899c9ba9d0bda21dce1ae74ef02d52f9400452d 100644 (file)
@@ -425,14 +425,17 @@ void wxMaracas_ViewerWidget::SetImage( vtkImageData *image )
        if (mvtkmpr2Dview_X!=NULL)
        {
                mvtkmpr2Dview_X->SetImageToVtkViewer(image);
+               mvtkmpr2Dview_X->ResetBackXYZ();
        }
        if (mvtkmpr2Dview_Y!=NULL)
        {
                mvtkmpr2Dview_Y->SetImageToVtkViewer(image);
+               mvtkmpr2Dview_Y->ResetBackXYZ();
        }
        if (mvtkmpr2Dview_Z!=NULL)
        {
                mvtkmpr2Dview_Z->SetImageToVtkViewer(image);
+               mvtkmpr2Dview_Z->ResetBackXYZ();
        }       
        if (mvtkplane2Dview!=NULL)
        {
index d4752bd5f9ed62d1205455a8e350ac860dc7d69a..517ca87925bd997bb706ddf1109daea013f4478c 100644 (file)
@@ -232,9 +232,9 @@ void wxVtkMPR2DView::Configure()
 
 void wxVtkMPR2DView::SetVisibleAxis(bool ok)
 {
-       if (ok!=_visibleAxis)
+       if (ok != _visibleAxis)
        {
-               _visibleAxis=ok;
+               _visibleAxis = ok;
                if (_visibleAxis==true)
                {
                        _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
@@ -248,6 +248,16 @@ void wxVtkMPR2DView::SetVisibleAxis(bool ok)
        } // ok
 }
 
+
+//-------------------------------------------------------------------
+void wxVtkMPR2DView::ResetBackXYZ()
+{
+       _backX=-9999;
+       _backY=-9999;
+       _backZ=-9999;
+}
+
+
 //-------------------------------------------------------------------
 void wxVtkMPR2DView::Refresh()
 {
@@ -274,12 +284,12 @@ void wxVtkMPR2DView::Refresh()
                y2 += origin[1];
                z1 += origin[2];
                z2 += origin[2];
-               xx1 =           x1*spc[0];
-               yy1 =           y1*spc[1];
-               zz1 =           z1*spc[2];
-               xx2 =           x2*spc[0];
-               yy2 =           y2*spc[1];
-               zz2 =           z2*spc[2];
+               xx1 = x1*spc[0];
+               yy1 = y1*spc[1];
+               zz1 = z1*spc[2];
+               xx2 = x2*spc[0];
+               yy2 = y2*spc[1];
+               zz2 = z2*spc[2];
                x1      = (int)(x1*spc[0]);
                y1      = (int)(y1*spc[1]);
                z1      = (int)(z1*spc[2]);
@@ -289,10 +299,6 @@ void wxVtkMPR2DView::Refresh()
                xx      = (int)(GetVtkmprbasedata()->GetX());
                yy      = (int)(GetVtkmprbasedata()->GetY());
                zz      = (int)(GetVtkmprbasedata()->GetZ());
-//EED 02/08/2013
-//             x =  round(xx*spc[0]);
-//             y =  round(yy*spc[1]);
-//             z =  round(zz*spc[2]);
                x       =  xx*spc[0];
                y       =  yy*spc[1];
                z       =  zz*spc[2];
index 4f5e2267fb61360fa9314c8d4faa7cfb92668cf2..56bb7bb59f9c6a58a6ee080d8e8c8d7365c9a3dc 100644 (file)
@@ -57,15 +57,14 @@ public:
        virtual void                    TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2);
                        void                    SetVisibleAxis(bool ok);
     virtual int             GetDirection();
+                       void                    ResetBackXYZ();
 
 private:
        int                                                     _backX;
        int                                                     _backY;
        int                                                     _backZ;
-
        bool                                            _backFixAxis2D;
        double                                          _backOpacityAxis;
-
        bool                                            _visibleAxis;
        int                                                     _direction;
        vtkPoints                                       *_ptsA;