X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Tools.cpp;h=68765a14e9620b12df1d15b5c1c00f9648d186a1;hb=4cb749258f33b7de231da5bb50140407c0599d30;hp=0147ba521d38ed1f2be00ff5aa870a3d85f3f6a3;hpb=584f97832c77adf0c9df154b2f3eb1835bd3ce9e;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Tools.cpp b/src/SketchPlugin/SketchPlugin_Tools.cpp index 0147ba521..68765a14e 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.cpp +++ b/src/SketchPlugin/SketchPlugin_Tools.cpp @@ -120,7 +120,8 @@ std::set findCoincidentConstraints(const FeaturePtr& theFeature) std::set::const_iterator aIt; for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) { FeaturePtr aConstrFeature = std::dynamic_pointer_cast((*aIt)->owner()); - if (aConstrFeature && aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) + if (aConstrFeature && (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID() || + aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidenceInternal::ID())) aCoincident.insert(aConstrFeature); } return aCoincident; @@ -563,6 +564,17 @@ void setDimensionColor(const AISObjectPtr& theDimPrs) theDimPrs->setColor(aColor[0], aColor[1], aColor[2]); } +void replaceInName(ObjectPtr theObject, const std::string& theSource, const std::string& theDest) +{ + std::string aName = theObject->data()->name(); + size_t aPos = aName.find(theSource); + if (aPos != std::string::npos) { + std::string aNewName = aName.substr(0, aPos) + theDest + + aName.substr(aPos + theSource.size()); + theObject->data()->setName(aNewName); + } +} + } // namespace SketchPlugin_Tools