From: azv Date: Thu, 5 May 2016 06:31:36 +0000 (+0300) Subject: Projection feature should not be displayed in the viewer X-Git-Tag: V_2.3.0~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=947de864e5ab5bb127e34c316b9ac37a5418cc4b;p=modules%2Fshaper.git Projection feature should not be displayed in the viewer --- diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index d59619780..8769ea22f 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -292,7 +292,7 @@ void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& theResultShape, std::shared_ptr aGeomShape = aConstr->shape(); if (aGeomShape.get()) { const TopoDS_Shape& aShape = aGeomShape->impl(); - if (!aShape.IsNull() && aShape.ShapeType() != TopAbs_EDGE) + if (aShape.ShapeType() != TopAbs_EDGE) anAuxiliaryResults.push_back(aConstr); } } diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 319f200cb..5cccf4c2b 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -31,12 +31,6 @@ static const double tolerance = 1.e-7; -static std::shared_ptr emptyEdge() -{ - static std::shared_ptr anEdge(new GeomAPI_Edge); - return anEdge; -} - SketchPlugin_Projection::SketchPlugin_Projection() : SketchPlugin_SketchEntity(), myIsComputing(false) @@ -64,7 +58,7 @@ void SketchPlugin_Projection::execute() if (!lastResult().get() && aProjection->lastResult().get()) { ResultConstructionPtr aConstr = document()->createConstruction(data()); - aConstr->setShape(emptyEdge()); + aConstr->setShape(aProjection->lastResult()->shape()); aConstr->setIsInHistory(false); aConstr->setDisplayed(false); setResult(aConstr); @@ -202,7 +196,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) selection(EXTERNAL_ID())->setValue(aExtFeature->context(), aExtFeature->context()->shape()); if (aResult) { - aResult->setShape(emptyEdge()); + aResult->setShape(aProjection->lastResult()->shape()); setResult(aResult); aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape()); } diff --git a/src/SketchPlugin/SketchPlugin_Projection.h b/src/SketchPlugin/SketchPlugin_Projection.h index f71b899ca..b9ae2611f 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.h +++ b/src/SketchPlugin/SketchPlugin_Projection.h @@ -45,6 +45,10 @@ public: virtual bool isFixed() { return true; } + /// Returns true if object must be displayed in the viewer + virtual bool isDisplayed() + { return false; } + /// Creates a new part document if needed SKETCHPLUGIN_EXPORT virtual void execute();