From 67443c96d7f8b228d92dfb25b74e41711d060ff5 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 29 Dec 2014 12:08:31 +0300 Subject: [PATCH] Avoid shading mode for sketcher --- src/ModuleBase/ModuleBase_ResultPrs.h | 2 ++ src/XGUI/XGUI_Displayer.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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; } -- 2.39.2