-// 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();
}
//=================================================================================
// nbSel == 1
if (aSelList.Extent() == 1) {
- Standard_Boolean aRes = Standard_False;
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
- if (!CORBA::is_nil(aSelectedObject) && aRes) {
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO);
+ if (!CORBA::is_nil(aSelectedObject)) {
QString aName = GEOMBase::GetName(aSelectedObject);
TopoDS_Shape aShape;
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
//Find SubShape Object in Father
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
- if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+ if (aFindedObject->_is_nil()) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations(getStudyId());
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
if (myOkPoint1 && myOkPoint2 && myOkPoint3) {
CheckCompatiblePosition(myPoint1, myPoint2, myPoint3, 0.01);
- DisplayPreview();
+ processPreview();
}
-// Standard_Boolean testResult = Standard_False;
-// GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
-// if (!testResult || aSelectedObject->_is_nil())
+// GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
+// if (aSelectedObject->_is_nil())
// return;
//
// myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
// 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);
+}