]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fixed Bug GVIEW10172 : Second viewer is opened immediately after generation of Gauss...
authorouv <ouv@opencascade.com>
Fri, 7 Oct 2005 09:03:22 +0000 (09:03 +0000)
committerouv <ouv@opencascade.com>
Fri, 7 Oct 2005 09:03:22 +0000 (09:03 +0000)
src/VVTK/VVTK_MainWindow.cxx
src/VVTK/VVTK_MainWindow.h
src/VVTK/VVTK_Renderer.cxx
src/VVTK/VVTK_SegmentationCursorDlg.cxx
src/VVTK/VVTK_ViewWindow.cxx

index dba80f7947f65d1cdca4405e07b3e2d5f45c1866..bb7f00180dd2001b2cfd3ae3350e42f9c54b0797 100644 (file)
@@ -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);
-}
index bee6727a71397eda3edfe49a7589d1a945dfd220..4220d5cee2db0acf6555258f1931c3dc399cbc78 100644 (file)
@@ -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;
 };
 
 
index d57532e17d84c1603e0c056563e53c055b5f174d..3020edcfd379c20c67bd87ac2c1eacdfd5a73337 100644 (file)
@@ -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<vtkRenderer*>(theViewport)){
     static float aTol = 1.e-6;
index 64cf9945155c4ea86e0027af68f1c321f46302c0..a683d937700db92b7700eacb9e3bb697b779f831 100644 (file)
@@ -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 );
index 06f7305dd52f120b1c215a94b52eba2fbba282fe..00bb81c7ec3da208c05d55c160f09df93f093d2d 100755 (executable)
@@ -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<int> aSizes;
+    aSizes.append( h );
+    aSizes.append( h );
+    aSplitter->setSizes( aSizes );
+    myMainWindow2->hide();
+
     myMainWindow = myMainWindow1;
     myView = myView1;
   }