From: nds Date: Thu, 6 Nov 2014 09:41:39 +0000 (+0300) Subject: Deactivate an arc AIS preview object. X-Git-Tag: V_0.5~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f7524bf45be53d97fbf271c1aca3776d8a9ff72;p=modules%2Fshaper.git Deactivate an arc AIS preview object. If the AIS exists immediatelly after the feature create, it is not deactivated because of Wokshop's realization. The deactivation happens by the signal about the feature redisplay. The result on a signal about the feature create is display, but not the deactivate. In case of the AIS object exists immediatelly, the slot onFeatureCreated should be corrected to deactivate the AIS after display. --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index 26eabc918..7d25c48c3 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -93,8 +93,6 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) if (aSketch) { // if the feature is valid, the execute() method should be performed, AIS object is empty if (!isFeatureValid()) { - std::list > aShapes; - // compute a circle point in 3D view boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::CENTER_ID())); @@ -114,21 +112,25 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) boost::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc( aCenter, aStartPoint, aStartPoint, aNormal); if (aCircleShape) { + std::list > aShapes; // make a visible point boost::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); aShapes.push_back(aCenterPointShape); aShapes.push_back(aCircleShape); + if (!aShapes.empty()) + { + boost::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes); + AISObjectPtr anAIS = thePrevious; + if (!anAIS) + anAIS = AISObjectPtr(new GeomAPI_AISObject); + anAIS->createShape(aCompound); + return anAIS; + } } } } } - boost::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes); - AISObjectPtr anAIS = thePrevious; - if (!anAIS) - anAIS = AISObjectPtr(new GeomAPI_AISObject); - anAIS->createShape(aCompound); - return anAIS; } } return AISObjectPtr();