X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Projection.cpp;h=2a034e0f5f72c8bd6db7f6e6ab68263df23e8c41;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=795cfe4fb896f90ae14c111daf27b04de152648a;hpb=bb5bba6e567f9cae87f9fbaf584d2d0502ec372e;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 795cfe4fb..2a034e0f5 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -94,7 +94,7 @@ 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() && + } else if (aExtFeature->context() && aExtFeature->context()->shape() && aExtFeature->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aExtFeature->context()->shape())); } @@ -126,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()); } @@ -162,7 +162,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection = sketch()->addFeature(SketchPlugin_Circle::ID()); // update attributes of projection - std::shared_ptr aCenterPnt = + std::shared_ptr aCenterPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Circle::CENTER_ID())); aCenterPnt->setValue(aCenterInSketch); @@ -182,13 +182,13 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection = sketch()->addFeature(SketchPlugin_Arc::ID()); // update attributes of projection - std::shared_ptr aCenterPnt = + std::shared_ptr aCenterPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::CENTER_ID())); - std::shared_ptr aStartPnt = + std::shared_ptr aStartPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::START_ID())); - std::shared_ptr aEndPnt = + std::shared_ptr aEndPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::END_ID())); aStartPnt->setValue(aFirstInSketch); @@ -200,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());