-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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"
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()));
initName(tr("GEOM_PIPE_TSHAPE"));
updateTshapeScreenshotLabel();
- DisplayPreview();
+ processPreview();
}
//=================================================================================
MainTubeGroupParams->SpinBox_DZ->setToolTip("");
MainTubeGroupParams->SpinBox_DZ->setStyleSheet("background-color: rgb(255, 255, 255);");
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
}
}
IncidentTubeGroupParams->SpinBox_DZ->setToolTip("");
IncidentTubeGroupParams->SpinBox_DZ->setStyleSheet("background-color: rgb(255, 255, 255);");
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
}
}
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
JunctionPointsSel->LineEdit4->setText("");
JunctionPointsSel->LineEdit5->setText("");
- DisplayPreview();
+ processPreview();
}
}
{
if (JunctionPointsSel->GroupBox1->isChecked() && myOkPoint1 && myOkPoint2 && myOkPoint3)
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
//=================================================================================
if (myOkPoint1 && myOkPoint2 && myOkPoint3) {
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
// GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
// purpose :
//=================================================================================
void AdvancedGUI_PipeTShapeDlg::ClickOnOk() {
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
// currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
//=================================================================================
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);
updateTshapeScreenshotLabel();
if (myOkPoint1 && myOkPoint2 && myOkPoint3)
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
}
GEOM::GEOM_Object_var obj = *it;
displayPreview(obj, true, activate, false, lineWidth, displayMode, color);
if (toRemoveFromEngine)
- obj->Destroy();
+ obj->UnRegister();
}
HexMeshCheckBox->setChecked(hexMeshState);
} catch (const SALOME::SALOME_Exception& e) {
}
}
+
+//=================================================================================
+// function : processPreview()
+// purpose : Display preview if CheckBoxPreview is checked
+//=================================================================================
+void AdvancedGUI_PipeTShapeDlg::processPreview() {
+ if(mainFrame()->CheckBoxPreview->isChecked())
+ DisplayPreview();
+ else
+ erasePreview(true);
+}