]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
External edges color should not be changed when sketch is fully constrained.
authornds <nds@opencascade.com>
Fri, 7 Apr 2017 12:02:11 +0000 (15:02 +0300)
committernds <nds@opencascade.com>
Fri, 7 Apr 2017 12:02:11 +0000 (15:02 +0300)
src/PartSet/PartSet_OverconstraintListener.cpp
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h

index d0de78c04d9b6eb02430594c34384ccd382d4b1d..2fd930ca72643356bb5882aed156e81e801d269d 100755 (executable)
@@ -79,7 +79,8 @@ void PartSet_OverconstraintListener::getCustomColor(const ObjectPtr& theObject,
   if (myIsFullyConstrained) {
     FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
     // only entity features has custom color when sketch is fully constrained
-    if (aFeature.get() && PartSet_SketcherMgr::isEntity(aFeature->getKind())) {
+    if (aFeature.get() && PartSet_SketcherMgr::isEntity(aFeature->getKind()) &&
+        !PartSet_SketcherMgr::isExternalFeature(aFeature)) {
       PartSet_Module* aModule = module();
       CompositeFeaturePtr aSketch = aModule->sketchMgr()->activeSketch();
       // the given object is sub feature of the current sketch(created or edited)
index 6128e4038f9ae45e55609ff4b37134cc7eed8d3b..774fc1fcbe014e098bdfb13977457cec375d5fe8 100755 (executable)
@@ -838,6 +838,13 @@ bool PartSet_SketcherMgr::isEntity(const std::string& theId)
          (theId == SketchPlugin_Circle::ID());
 }
 
+bool PartSet_SketcherMgr::isExternalFeature(const FeaturePtr& theFeature)
+{
+  std::shared_ptr<SketchPlugin_Feature> aSPFeature =
+          std::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
+  return aSPFeature.get() && aSPFeature->isExternal();
+}
+
 bool PartSet_SketcherMgr::isDistanceOperation(ModuleBase_Operation* theOperation)
 {
   std::string anId = theOperation ? theOperation->id().toStdString() : "";
index 08d8ffd799d77d803612480d67d9a2b5c368b658..5fb1931fdddd1906234e344882fdb88262c90ccc 100644 (file)
@@ -129,6 +129,11 @@ public:
   /// \return a boolean value
   static bool isEntity(const std::string& theId);
 
+  /// Returns whether the feature has external attribute filled with 'true' value
+  /// \param theFeature a feature object
+  /// \return a boolean value
+  static bool isExternalFeature(const FeaturePtr& theFeature);
+
   /// Returns whether the current operation is a sketch distance - lenght, distance or radius
   /// \param theOperation the operation
   /// \return a boolean value