Salome HOME
Fix for the issue #3195 : The groups built by "Group Addtion" are not in ShaperResults
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Tools.cpp
index 0147ba521d38ed1f2be00ff5aa870a3d85f3f6a3..68765a14e9620b12df1d15b5c1c00f9648d186a1 100644 (file)
@@ -120,7 +120,8 @@ std::set<FeaturePtr> findCoincidentConstraints(const FeaturePtr& theFeature)
   std::set<AttributePtr>::const_iterator aIt;
   for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
     FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>((*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