From: vsv Date: Tue, 2 Nov 2010 16:03:02 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: TRIPOLI_302~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2b195a425016d7fe28dee4159c4b29bacf150464;p=modules%2Fgui.git *** empty log message *** --- diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index 895377ea1..dab14bd5f 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -266,9 +266,9 @@ void OCCViewer_ClippingDlg::closeEvent( QCloseEvent* e ) erasePreview(); // Set the clipping plane back - Handle(V3d_View) aView3d = myView->getViewPort()->getView(); + /*Handle(V3d_View) aView3d = myView->getViewPort()->getView(); if ( !aView3d.IsNull() && !myClippingPlane.IsNull() ) - aView3d->SetPlaneOn( myClippingPlane ); + aView3d->SetPlaneOn( myClippingPlane );*/ myAction->setChecked( false ); @@ -281,7 +281,7 @@ void OCCViewer_ClippingDlg::closeEvent( QCloseEvent* e ) */ void OCCViewer_ClippingDlg::showEvent( QShowEvent* e ) { - ReserveClippingPlane(); + //ReserveClippingPlane(); QDialog::showEvent( e ); onPreview( PreviewChB->isChecked() ); @@ -306,10 +306,10 @@ void OCCViewer_ClippingDlg::ClickOnClose() erasePreview(); // Set the clipping plane back - Handle(V3d_View) aView3d = myView->getViewPort()->getView(); + /*Handle(V3d_View) aView3d = myView->getViewPort()->getView(); if ( !aView3d.IsNull() && !myClippingPlane.IsNull() ) aView3d->SetPlaneOn( myClippingPlane ); - + */ myAction->setChecked( false ); reject(); @@ -332,7 +332,7 @@ void OCCViewer_ClippingDlg::ClickOnApply() erasePreview(); - ReserveClippingPlane(); + //ReserveClippingPlane(); } /*! @@ -504,7 +504,8 @@ void OCCViewer_ClippingDlg::displayPreview() myPreviewPlane->SetSize( aSize, aSize ); // Deactivate clipping planes - myView->getViewPort()->getView()->SetPlaneOff(); + //myView->getViewPort()->getView()->SetPlaneOff(); + //myView->setPlaneOff(); ic->Display( myPreviewPlane, 1, -1, false ); ic->SetWidth( myPreviewPlane, 10, false ); @@ -575,13 +576,13 @@ bool OCCViewer_ClippingDlg::isValid() */ void OCCViewer_ClippingDlg::ReserveClippingPlane() { - Handle(V3d_View) aView3d = myView->getViewPort()->getView(); + /*Handle(V3d_View) aView3d = myView->getViewPort()->getView(); if ( !aView3d.IsNull() ) { aView3d->InitActivePlanes(); if ( aView3d->MoreActivePlanes() ) myClippingPlane = aView3d->ActivePlane(); - } + }*/ } void OCCViewer_ClippingDlg::onViewShow() diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.h b/src/OCCViewer/OCCViewer_ClippingDlg.h index a16ae7ccf..2baa05360 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.h +++ b/src/OCCViewer/OCCViewer_ClippingDlg.h @@ -94,7 +94,7 @@ private : OCCViewer_ViewWindow* myView; Handle(AIS_Plane) myPreviewPlane; - Handle(V3d_Plane) myClippingPlane; + //Handle(V3d_Plane) myClippingPlane; bool myBusy; diff --git a/src/OCCViewer/OCCViewer_ViewFrame.cxx b/src/OCCViewer/OCCViewer_ViewFrame.cxx index 3b45478cc..4946ec67a 100644 --- a/src/OCCViewer/OCCViewer_ViewFrame.cxx +++ b/src/OCCViewer/OCCViewer_ViewFrame.cxx @@ -113,6 +113,7 @@ void OCCViewer_ViewFrame::setCuttingPlane( bool on, const double x , const doubl { foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setCuttingPlane(on, x, y, z, dx, dy, dz); + aView->update(); } } @@ -121,6 +122,7 @@ void OCCViewer_ViewFrame::setCuttingPlane( bool on, const gp_Pln thePln ) { foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setCuttingPlane(on, thePln); + aView->update(); } } diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 8f66f23ff..121614a05 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -1395,23 +1395,26 @@ void OCCViewer_ViewWindow::onClipping( bool on ) else myActionsMap[ ClippingId ]->setIcon(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" ))); */ + OCCViewer_ViewWindow* aParent = dynamic_cast(parent()->parent()); + if (!aParent) + aParent = this; if ( on ) - { - if ( !myClippingDlg ) { - myClippingDlg = new OCCViewer_ClippingDlg( this ); - myClippingDlg->SetAction( myClippingAction ); - } + if ( !myClippingDlg ) + { + myClippingDlg = new OCCViewer_ClippingDlg( aParent ); + myClippingDlg->SetAction( myClippingAction ); + } - if ( !myClippingDlg->isVisible() ) - myClippingDlg->show(); - } + if ( !myClippingDlg->isVisible() ) + myClippingDlg->show(); + } else - { - if ( myClippingDlg->isVisible() ) - myClippingDlg->hide(); - setCuttingPlane(false); - } + { + if ( myClippingDlg->isVisible() ) + myClippingDlg->hide(); + aParent->setCuttingPlane(false); + } } /*! @@ -2031,3 +2034,4 @@ void OCCViewer_ViewWindow::setBackgroundColor( const QColor& theColor) return; myViewPort->setBackgroundColor(theColor); } + diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index fc5f4db1d..d7910dfa4 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -26,6 +26,7 @@ #include "OCCViewer.h" #include "SUIT_ViewWindow.h" #include +#include class QtxRectRubberBand; class SUIT_Desktop; @@ -107,6 +108,7 @@ public: virtual QColor backgroundColor() const; virtual void setBackgroundColor( const QColor& ); + public slots: virtual void onFrontView(); virtual void onViewFitAll(); @@ -236,6 +238,8 @@ private: MapOfTransformStatus myStatus; Mode2dType my2dMode; + + Handle(V3d_Plane) myReserveClippingPlane; }; #ifdef WIN32