]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Projection feature should not be displayed in the viewer
authorazv <azv@opencascade.com>
Thu, 5 May 2016 06:31:36 +0000 (09:31 +0300)
committerazv <azv@opencascade.com>
Thu, 5 May 2016 06:31:45 +0000 (09:31 +0300)
src/PartSet/PartSet_ResultSketchPrs.cpp
src/SketchPlugin/SketchPlugin_Projection.cpp
src/SketchPlugin/SketchPlugin_Projection.h

index d59619780139f74ec118fa62d7be50f22f06625f..8769ea22fa39ebd04f4cb6caf9924ce37131d04a 100755 (executable)
@@ -292,7 +292,7 @@ void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& theResultShape,
           std::shared_ptr<GeomAPI_Shape> aGeomShape = aConstr->shape();
           if (aGeomShape.get()) {
             const TopoDS_Shape& aShape = aGeomShape->impl<TopoDS_Shape>();
-            if (!aShape.IsNull() && aShape.ShapeType() != TopAbs_EDGE)
+            if (aShape.ShapeType() != TopAbs_EDGE)
               anAuxiliaryResults.push_back(aConstr);
           }
         }
index 319f200cb3069c54aa30ec91c47907a27d60f2bf..5cccf4c2bad3ed7b5be4c778e7eb6fe502da12a5 100644 (file)
 
 static const double tolerance = 1.e-7;
 
-static std::shared_ptr<GeomAPI_Edge> emptyEdge()
-{
-  static std::shared_ptr<GeomAPI_Edge> 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());
     }
index f71b899ca72c832fd656f812e755b2b5b172e57f..b9ae2611f049a1269254581afb075e1c52ef105b 100644 (file)
@@ -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();