From: ouv Date: Fri, 7 Oct 2005 09:03:22 +0000 (+0000) Subject: Fixed Bug GVIEW10172 : Second viewer is opened immediately after generation of Gauss... X-Git-Tag: BR-D5-38-2003_D2005-12-10~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d1a4fa9f6cceca6723842cf4056065185816e341;p=modules%2Fvisu.git Fixed Bug GVIEW10172 : Second viewer is opened immediately after generation of Gauss points presentation. --- diff --git a/src/VVTK/VVTK_MainWindow.cxx b/src/VVTK/VVTK_MainWindow.cxx index dba80f79..bb7f0018 100644 --- a/src/VVTK/VVTK_MainWindow.cxx +++ b/src/VVTK/VVTK_MainWindow.cxx @@ -196,12 +196,13 @@ VVTK_MainWindow1 SUIT_ResourceMgr* theResourceMgr, VISU_PickingSettings* thePickingSettings) { - VVTK_MainWindow2* aMainWindow2 = new VVTK_MainWindow2(theParent, - theName, - theResourceMgr, - thePickingSettings, - myStyleSwitchAction); - return aMainWindow2; + myMainWindow2 = new VVTK_MainWindow2(theParent, + theName, + theResourceMgr, + thePickingSettings, + myStyleSwitchAction); + //myMainWindow2->hide(); + return myMainWindow2; } @@ -244,36 +245,26 @@ VVTK_MainWindow1 return myPickingDlg->GetPickingSettings(); } - -//---------------------------------------------------------------------------- -QSize -VVTK_MainWindow1 -::sizeHint() const -{ - QWidget* aParent = parentWidget(); - static float aCoeff = 1.0/2.0; - int aWidth = int(aCoeff*aParent->width()); - int aHeight = int(aCoeff*aParent->height()); - - return QSize(aWidth,aHeight); -} - //---------------------------------------------------------------------------- void VVTK_MainWindow1 ::OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn) { myRenderer->GetImplicitFunctionWidget()->SetEnabled(theIsPlaneSegmentationOn); - mySplitter->setCollapsible(this,!theIsPlaneSegmentationOn); + //mySplitter->setCollapsible(this,!theIsPlaneSegmentationOn); if( theIsPlaneSegmentationOn ) { + myMainWindow2->show(); mySegmentationCursorDlg->UpdateSegmentation(); mySegmentationCursorDlg->UpdateOutsideCursor(); mySegmentationCursorDlg->show(); } else + { + myMainWindow2->hide(); mySegmentationCursorDlg->hide(); + } } @@ -296,15 +287,3 @@ VVTK_MainWindow2 ::~VVTK_MainWindow2() {} -//---------------------------------------------------------------------------- -QSize -VVTK_MainWindow2 -::sizeHint() const -{ - QWidget* aParent = parentWidget(); - static float aCoeff = 1.0/2.0; - int aWidth = int(aCoeff*aParent->width()); - int aHeight = int(aCoeff*aParent->height()); - - return QSize(aWidth,aHeight); -} diff --git a/src/VVTK/VVTK_MainWindow.h b/src/VVTK/VVTK_MainWindow.h index bee6727a..4220d5ce 100644 --- a/src/VVTK/VVTK_MainWindow.h +++ b/src/VVTK/VVTK_MainWindow.h @@ -87,10 +87,6 @@ public: VISU_PickingSettings* GetPickingSettings(); - virtual - QSize - sizeHint() const; - public slots: void OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn); @@ -102,6 +98,8 @@ public: protected: VVTK_Renderer1* myRenderer; + VVTK_MainWindow2* myMainWindow2; + QtxAction* myStyleSwitchAction; QToolBar* myPtsToolBar; QSplitter* mySplitter; @@ -126,10 +124,6 @@ class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindow public: virtual ~VVTK_MainWindow2(); - - virtual - QSize - sizeHint() const; }; diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx index d57532e1..3020edcf 100644 --- a/src/VVTK/VVTK_Renderer.cxx +++ b/src/VVTK/VVTK_Renderer.cxx @@ -95,6 +95,11 @@ int VISU_FPSActor ::RenderOpaqueGeometry(vtkViewport *theViewport) { + // It's impossible to render opaque geometry of text actor + // if the size of the viewport is less than 1.0 + int *size = theViewport->GetSize(); + if( size[0] <= 1.0 || size[1] <= 1.0 ) + return 1; if(vtkRenderer *aRenderer = dynamic_cast(theViewport)){ static float aTol = 1.e-6; diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 64cf9945..a683d937 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -155,7 +155,7 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c DepthGroupLayout->setMargin(11); QLabel* DepthLabel = new QLabel( tr( "DEPTH" ), DepthGroup ); - myDepthSpinBox = new QtxDblSpinBox( 0.0, 100.0, 0.1, DepthGroup ); + myDepthSpinBox = new QtxDblSpinBox( 0.0, VTK_LARGE_FLOAT, 0.1, DepthGroup ); myDepthSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myDepthSpinBox->setMinimumWidth( 100 ); myDepthSpinBox->setValue( 10.0 ); diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx index 06f7305d..00bb81c7 100755 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ b/src/VVTK/VVTK_ViewWindow.cxx @@ -63,7 +63,7 @@ VVTK_ViewWindow QBoxLayout* aLayout = new QVBoxLayout(aWidget); aLayout->setAutoAdd(true); QSplitter* aSplitter = new QSplitter(Qt::Vertical,aWidget); - aSplitter->setChildrenCollapsible(true); + //aSplitter->setChildrenCollapsible(true); VISU_ImplicitFunctionWidget* anImplicitFunctionWidget = NULL; VISU_OutsideCursorSettings* anOutsideCursorSettings = NULL; @@ -137,6 +137,13 @@ VVTK_ViewWindow } aSelector->Delete(); + int h = height() / 2; + QValueList aSizes; + aSizes.append( h ); + aSizes.append( h ); + aSplitter->setSizes( aSizes ); + myMainWindow2->hide(); + myMainWindow = myMainWindow1; myView = myView1; }