Salome HOME
Fix for some problems in the arc inversion and added a unit test for it
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Sketch.cpp
index 83f974248a3e14bacde8d043a0461dd4bb428c97..4de9585ee05cc0d914186d692e08254624155f13 100755 (executable)
@@ -39,8 +39,6 @@
 #include <math.h>
 #include <vector>
 
-using namespace std;
-
 SketchPlugin_Sketch::SketchPlugin_Sketch()
 {
 }
@@ -52,7 +50,7 @@ void SketchPlugin_Sketch::initAttributes()
   data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::typeId());
   data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::typeId());
   // the selected face, base for the sketcher plane, not obligatory
-  data()->addAttribute(SketchPlugin_SketchEntity::EXTERNAL_ID(), 
+  data()->addAttribute(SketchPlugin_SketchEntity::EXTERNAL_ID(),
     ModelAPI_AttributeSelection::typeId());
   ModelAPI_Session::get()->validators()->registerNotObligatory(
     getKind(), SketchPlugin_SketchEntity::EXTERNAL_ID());
@@ -149,7 +147,7 @@ void SketchPlugin_Sketch::removeFeature(std::shared_ptr<ModelAPI_Feature> theFea
   if (!data()->isValid()) // sketch is already removed (case on undo of sketch), sync is not needed
     return;
   AttributeRefListPtr aList = reflist(SketchPlugin_Sketch::FEATURES_ID());
-  // if the object is last, remove it from the list 
+  // if the object is last, remove it from the list
   // (needed to skip empty transaction on edit of sketch feature)
   if (aList->object(aList->size(true) - 1, true) == theFeature) {
     aList->remove(theFeature);
@@ -187,7 +185,7 @@ int SketchPlugin_Sketch::subFeatureId(const int theIndex) const
   int aResultIndex = 1; // number of the counted (created) features, started from 1
   int aFeatureIndex = -1; // number of the not-empty features in the list
   for (; anIt != aFeatures.end(); anIt++) {
-    if (anIt->get()) 
+    if (anIt->get())
       aFeatureIndex++;
     if (aFeatureIndex == theIndex)
       break;
@@ -214,7 +212,7 @@ bool SketchPlugin_Sketch::isSub(ObjectPtr theObject) const
 
 void SketchPlugin_Sketch::attributeChanged(const std::string& theID) {
   if (theID == SketchPlugin_SketchEntity::EXTERNAL_ID()) {
-    std::shared_ptr<GeomAPI_Shape> aSelection = 
+    std::shared_ptr<GeomAPI_Shape> aSelection =
       data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->value();
     if (aSelection) { // update arguments due to the selection value
       // update the sketch plane
@@ -232,7 +230,7 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) {
         std::shared_ptr<GeomAPI_Pnt> anOrigPnt(new GeomAPI_Pnt(aCoords));
         // X axis is preferable to be dirX on the sketch
         // here can not be very small value to avoid very close to X normal axis (issue 595)
-        static const double tol = 0.1; 
+        static const double tol = 0.1;
         bool isX = fabs(anA) - 1.0 < tol && fabs(aB) < tol && fabs(aC) < tol;
         std::shared_ptr<GeomAPI_Dir> aTempDir(
           isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));