From: vsv Date: Mon, 29 Dec 2014 09:08:31 +0000 (+0300) Subject: Avoid shading mode for sketcher X-Git-Tag: V_0.7.0_rc1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=67443c96d7f8b228d92dfb25b74e41711d060ff5;p=modules%2Fshaper.git Avoid shading mode for sketcher --- diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 941ef15c4..e009a03ae 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -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, diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 11136aece..22b76ad2e 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -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; }