]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Avoid shading mode for sketcher
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 29 Dec 2014 09:08:31 +0000 (12:08 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 29 Dec 2014 09:08:31 +0000 (12:08 +0300)
src/ModuleBase/ModuleBase_ResultPrs.h
src/XGUI/XGUI_Displayer.cpp

index 941ef15c4cb85591138c391e83f87198fa09679b..e009a03aef08ff4aa1d75ec5e89b6138de9baf9f 100644 (file)
@@ -23,6 +23,8 @@ public:
 
   Standard_EXPORT ResultPtr getResult() const { return myResult; }
 
+  Standard_EXPORT bool isSketchMode() const { return myIsSketchMode; }
+
   DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs)
 protected:
   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
index 11136aece45b8ded7d89920b04b7147d8183d867..22b76ad2eafae3bb03d009aaf614b84982cedaba 100644 (file)
@@ -116,8 +116,13 @@ bool canBeShaded(Handle(AIS_InteractiveObject) theAIS)
     TopAbs_ShapeEnum aType = aShape.ShapeType();
     if ((aType == TopAbs_VERTEX) || (aType == TopAbs_EDGE) || (aType == TopAbs_WIRE))
       return false;
-    else
+    else {
+      // Check that the presentation is not a sketch
+      Handle(ModuleBase_ResultPrs) aPrs = Handle(ModuleBase_ResultPrs)::DownCast(theAIS);
+      if (!aPrs.IsNull()) 
+        return !aPrs->isSketchMode();
       return true;
+    }
   }
   return false;
 }