]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correction for case: Start Arc, select "2 points type", move mouse in viewer, result...
authornds <nds@opencascade.com>
Thu, 7 Apr 2016 08:43:56 +0000 (11:43 +0300)
committernds <nds@opencascade.com>
Thu, 7 Apr 2016 08:44:23 +0000 (11:44 +0300)
src/SketchPlugin/SketchPlugin_Arc.cpp

index c2b9e4ea7a3c12b7ba7de4d3d0d1a438b469d5ed..f6d4ec763d7de07ff1e6204c5e3898d457c1a808 100644 (file)
@@ -241,25 +241,25 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious)
             if (aTypeAttr && aTypeAttr->isInitialized() &&
                 aTypeAttr->value() == ARC_TYPE_THREE_POINTS() && aEndAttr->isInitialized())
               aEndPoint = aSketch->to3D(aEndAttr->x(), aEndAttr->y());
+
+            std::list<std::shared_ptr<GeomAPI_Shape> > aShapes;
+            // make a visible point
+            std::shared_ptr<GeomAPI_Shape> aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter);
+            aShapes.push_back(aCenterPointShape);
+
             std::shared_ptr<GeomAPI_Shape> aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc(
                                                             aCenter, aStartPoint, aEndPoint, aNormal);
-            if (aCircleShape) {
-              std::list<std::shared_ptr<GeomAPI_Shape> > aShapes;
-              // make a visible point
-              std::shared_ptr<GeomAPI_Shape> aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter);
-              aShapes.push_back(aCenterPointShape);
-
+            if (aCircleShape)
               aShapes.push_back(aCircleShape);
-              if (!aShapes.empty())
-              {
-                std::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes);
-                AISObjectPtr anAIS = thePrevious;
-                if (!anAIS)
-                  anAIS = AISObjectPtr(new GeomAPI_AISObject);
-                anAIS->createShape(aCompound);
-                anAIS->setWidth(3);
-                return anAIS;
-              }
+
+            if (!aShapes.empty()) {
+              std::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes);
+              AISObjectPtr anAIS = thePrevious;
+              if (!anAIS)
+                anAIS = AISObjectPtr(new GeomAPI_AISObject);
+              anAIS->createShape(aCompound);
+              anAIS->setWidth(3);
+              return anAIS;
             }
           }
         }