X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.cpp;h=5fa98fc5db0d58d8552e91a059219f65cfe97a00;hb=ed67f7abf2985c7225b7862c076257825a421993;hp=1d87b4ae22475427772f15b6eefe99eb075f9f67;hpb=6a7e53a3d3b52f1f798b7e3aa3c48de9c870d92b;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 1d87b4ae2..5fa98fc5d 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -5,11 +5,13 @@ // Author: Vitaly Smetannikov #include "ModuleBase_Tools.h" +#include #include #include #include #include +#include #include #include @@ -107,6 +109,13 @@ QPixmap lighter(const QString& theIcon, const int theLighterValue) return QPixmap::fromImage(aResult); } +void setSpinText(ModuleBase_ParamSpinBox* theSpin, const QString& theText) +{ + bool isBlocked = theSpin->blockSignals(true); + theSpin->setText(theText); + theSpin->blockSignals(isBlocked); +} + void setSpinValue(QDoubleSpinBox* theSpin, double theValue) { bool isBlocked = theSpin->blockSignals(true); @@ -179,6 +188,24 @@ TopAbs_ShapeEnum shapeType(const QString& theType) return TopAbs_SHAPE; } +void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFeature, bool& hasParameter) +{ + hasResult = false; + hasFeature = false; + hasParameter = false; + foreach(ObjectPtr aObj, theObjects) { + FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); + ResultPtr aResult = std::dynamic_pointer_cast(aObj); + ResultParameterPtr aConstruction = std::dynamic_pointer_cast(aResult); + + hasResult = (aResult.get() != NULL); + hasFeature = (aFeature.get() != NULL); + hasParameter = (aConstruction.get() != NULL); + if (hasFeature && hasResult && hasParameter) + break; + } +} + }