Salome HOME
Correction of icon
[modules/shaper.git] / src / PartSet / PartSet_SketcherMgr.cpp
index 9567abc7c3667719690f4566353f38574eb4495d..a6ae7a8a5bcb4f656210a239a4d08275dbb4878f 100644 (file)
@@ -51,6 +51,7 @@
 #include <SketchPlugin_ConstraintHorizontal.h>
 #include <SketchPlugin_ConstraintVertical.h>
 #include <SketchPlugin_ConstraintEqual.h>
+#include <SketchPlugin_ConstraintTangent.h>
 
 #include <SelectMgr_IndexedMapOfOwner.hxx>
 #include <StdSelect_BRepOwner.hxx>
@@ -584,6 +585,7 @@ QStringList PartSet_SketcherMgr::sketchOperationIdList()
     aIds << SketchPlugin_ConstraintHorizontal::ID().c_str();
     aIds << SketchPlugin_ConstraintVertical::ID().c_str();
     aIds << SketchPlugin_ConstraintEqual::ID().c_str();
+    aIds << SketchPlugin_ConstraintTangent::ID().c_str();
   }
   return aIds;
 }
@@ -778,8 +780,10 @@ bool PartSet_SketcherMgr::canSetAuxiliary(bool& theValue) const
     anObjects.append(anOperation->feature());
   }
   else {
-    if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
-      anOperation->abort();
+    /// The operation should not be aborted here, because the method does not changed
+    /// the auxilliary state, but checks the possibility to perform this
+    ///if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
+    ///  anOperation->abort();
     // 2. change auxiliary type of selected sketch entities
     ModuleBase_ISelection* aSelection = myModule->workshop()->selection();
     anObjects = aSelection->selectedPresentations();
@@ -799,7 +803,8 @@ bool PartSet_SketcherMgr::canSetAuxiliary(bool& theValue) const
 
           std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr = 
             std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
-          isNotAuxiliaryFound = !anAuxiliaryAttr->value();
+          if (anAuxiliaryAttr)
+            isNotAuxiliaryFound = !anAuxiliaryAttr->value();
         }
       }
     }
@@ -852,7 +857,8 @@ void PartSet_SketcherMgr::setAuxiliary(const bool isChecked)
 
           std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr = 
             std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
-          anAuxiliaryAttr->setValue(isChecked);
+          if (anAuxiliaryAttr)
+            anAuxiliaryAttr->setValue(isChecked);
         }
       }
     }