X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FAdvancedGUI%2FAdvancedGUI_PipeTShapeDlg.cxx;h=17eae604c718af3c272dd23ae243145fa5c37608;hb=7f46e5fa52cfe13e206ab10e628556e7e393aaf5;hp=e514c2a12be27856391ea22d7adb5a569ac349b7;hpb=8f50d474d5a2bb42bf5a562005fc9cfa5f1ee153;p=modules%2Fgeom.git diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx index e514c2a12..17eae604c 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx @@ -1,20 +1,20 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "AdvancedGUI_PipeTShapeDlg.h" @@ -217,6 +217,8 @@ void AdvancedGUI_PipeTShapeDlg::Init() { CssAcceptable = "QDoubleSpinBox, QPushButton {background-color: rgb(85, 170, 127)}"; CssRefused = "QDoubleSpinBox, QPushButton {background-color: rgb(255, 0, 0)}"; + showOnlyPreviewControl(); + // Signal/slot connections connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -249,7 +251,7 @@ void AdvancedGUI_PipeTShapeDlg::Init() { initName(tr("GEOM_PIPE_TSHAPE")); updateTshapeScreenshotLabel(); - DisplayPreview(); + processPreview(); } //================================================================================= @@ -271,7 +273,7 @@ void AdvancedGUI_PipeTShapeDlg::ApplyNewDimensions() { MainTubeGroupParams->SpinBox_DZ->setToolTip(""); MainTubeGroupParams->SpinBox_DZ->setStyleSheet("background-color: rgb(255, 255, 255);"); CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } } } @@ -285,7 +287,7 @@ void AdvancedGUI_PipeTShapeDlg::ApplyNewDimensions() { IncidentTubeGroupParams->SpinBox_DZ->setToolTip(""); IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet("background-color: rgb(255, 255, 255);"); CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } } } @@ -369,7 +371,7 @@ void AdvancedGUI_PipeTShapeDlg::SetPosition(bool isChecked) { disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); JunctionPointsSel->LineEdit4->setText(""); JunctionPointsSel->LineEdit5->setText(""); - DisplayPreview(); + processPreview(); } } @@ -381,7 +383,7 @@ void AdvancedGUI_PipeTShapeDlg::ValueChangedInSpinBox(double newValue) { if (JunctionPointsSel->GroupBox1->isChecked() && myOkPoint1 && myOkPoint2 && myOkPoint3) CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } //================================================================================= @@ -467,7 +469,7 @@ void AdvancedGUI_PipeTShapeDlg::SelectionIntoArgument() { if (myOkPoint1 && myOkPoint2 && myOkPoint3) { CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } // GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First()); @@ -568,6 +570,7 @@ void AdvancedGUI_PipeTShapeDlg::SetDoubleSpinBoxStep(double step) { // purpose : //================================================================================= void AdvancedGUI_PipeTShapeDlg::ClickOnOk() { + setIsApplyAndClose( true ); if (ClickOnApply()) ClickOnCancel(); } @@ -596,7 +599,7 @@ void AdvancedGUI_PipeTShapeDlg::ActivateThisDialog() { // currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); if (myOkPoint1 && myOkPoint2 && myOkPoint3) CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } //================================================================================= @@ -649,7 +652,7 @@ void AdvancedGUI_PipeTShapeDlg::ChamferOrFillet(bool) { updateTshapeScreenshotLabel(); if (myOkPoint1 && myOkPoint2 && myOkPoint3) CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } else if (send == FilletGroupParams->GroupBox1) { if (send->isChecked()) { disconnect(ChamferGroupParams->GroupBox1, SIGNAL(toggled(bool)), this, 0); @@ -662,7 +665,7 @@ void AdvancedGUI_PipeTShapeDlg::ChamferOrFillet(bool) { updateTshapeScreenshotLabel(); if (myOkPoint1 && myOkPoint2 && myOkPoint3) CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01); - DisplayPreview(); + processPreview(); } } @@ -973,3 +976,14 @@ void AdvancedGUI_PipeTShapeDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, S } } + +//================================================================================= +// function : processPreview() +// purpose : Display preview if CheckBoxPreview is checked +//================================================================================= +void AdvancedGUI_PipeTShapeDlg::processPreview() { + if(mainFrame()->CheckBoxPreview->isChecked()) + DisplayPreview(); + else + erasePreview(true); +}