From: nds Date: Thu, 7 Apr 2016 08:43:56 +0000 (+0300) Subject: Correction for case: Start Arc, select "2 points type", move mouse in viewer, result... X-Git-Tag: V_2.3.0~275 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=55e617293ff16f58590f66fe0111d3a88c636ba6;p=modules%2Fshaper.git Correction for case: Start Arc, select "2 points type", move mouse in viewer, result: crash(in background mode) --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index c2b9e4ea7..f6d4ec763 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -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 > aShapes; + // make a visible point + std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); + aShapes.push_back(aCenterPointShape); + std::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc( aCenter, aStartPoint, aEndPoint, aNormal); - if (aCircleShape) { - std::list > aShapes; - // make a visible point - std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); - aShapes.push_back(aCenterPointShape); - + if (aCircleShape) aShapes.push_back(aCircleShape); - if (!aShapes.empty()) - { - std::shared_ptr 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 aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes); + AISObjectPtr anAIS = thePrevious; + if (!anAIS) + anAIS = AISObjectPtr(new GeomAPI_AISObject); + anAIS->createShape(aCompound); + anAIS->setWidth(3); + return anAIS; } } }