X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Projection.cpp;h=2a034e0f5f72c8bd6db7f6e6ab68263df23e8c41;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=ac8b5679743382f6c05902e76c437ee3fe34e6e0;hpb=5a3893c9743dba1b09eb39123d308995bbbd94c0;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index ac8b56797..2a034e0f5 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -94,7 +94,8 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) std::shared_ptr anEdge; if (aExtFeature && aExtFeature->value() && aExtFeature->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aExtFeature->value())); - } else if (aExtFeature->context() && aExtFeature->context()->shape() && aExtFeature->context()->shape()->isEdge()) { + } else if (aExtFeature->context() && aExtFeature->context()->shape() && + aExtFeature->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aExtFeature->context()->shape())); } if (!anEdge.get()) @@ -125,7 +126,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) ResultConstructionPtr aResult = std::dynamic_pointer_cast(lastResult()); - if (aResult && aResult->shape()) { + if (aResult && aResult->shape() && theID == EXTERNAL_FEATURE_ID()) { aResult->setShape(std::shared_ptr()); aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape()); } @@ -161,7 +162,8 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection = sketch()->addFeature(SketchPlugin_Circle::ID()); // update attributes of projection - std::shared_ptr aCenterPnt = std::dynamic_pointer_cast( + std::shared_ptr aCenterPnt = + std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Circle::CENTER_ID())); aCenterPnt->setValue(aCenterInSketch); aProjection->real(SketchPlugin_Circle::RADIUS_ID())->setValue(aRadius); @@ -180,11 +182,14 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection = sketch()->addFeature(SketchPlugin_Arc::ID()); // update attributes of projection - std::shared_ptr aCenterPnt = std::dynamic_pointer_cast( + std::shared_ptr aCenterPnt = + std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::CENTER_ID())); - std::shared_ptr aStartPnt = std::dynamic_pointer_cast( + std::shared_ptr aStartPnt = + std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::START_ID())); - std::shared_ptr aEndPnt = std::dynamic_pointer_cast( + std::shared_ptr aEndPnt = + std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::END_ID())); aStartPnt->setValue(aFirstInSketch); aEndPnt->setValue(aLastInSketch); @@ -195,12 +200,6 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection->execute(); aRefAttr->setObject(aProjection); - if (!hasPrevProj) { - FeaturePtr aFixed = sketch()->addFeature(SketchPlugin_ConstraintRigid::ID()); - aFixed->refattr(SketchPlugin_Constraint::ENTITY_A())->setObject(aProjection->lastResult()); - aFixed->execute(); - } - if (theID == EXTERNAL_FEATURE_ID()) { selection(EXTERNAL_ID())->setValue(aExtFeature->context(), aExtFeature->value());