From 2b34e50d7b585af1b770b1a81e8db70a23ca0829 Mon Sep 17 00:00:00 2001 From: ika Date: Tue, 8 May 2018 13:22:01 +0300 Subject: [PATCH] Bug #297 Fix IsSubShape method in ShapeTool Pick a part of commit for 0029599 --- src/XCAFDoc/XCAFDoc_ShapeTool.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx index 75f010b75d..22977f51a3 100644 --- a/src/XCAFDoc/XCAFDoc_ShapeTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ShapeTool.cxx @@ -1042,12 +1042,15 @@ Standard_Boolean XCAFDoc_ShapeTool::IsSubShape (const TDF_Label &shapeL, const TopoDS_Shape &sub) const { Handle(XCAFDoc_ShapeMapTool) A; - if ( ! shapeL.FindAttribute(XCAFDoc_ShapeMapTool::GetID(), A) ) - return Standard_False; - - //TopoDS_Shape S = GetShape ( shapeL ); - //return ! S.IsNull() && CheckSubShape ( S, sub ); - + if (!shapeL.FindAttribute(XCAFDoc_ShapeMapTool::GetID(), A)) + { + TopoDS_Shape aShape = GetShape(shapeL); + if (aShape.IsNull()) + return Standard_False; + A = XCAFDoc_ShapeMapTool::Set(shapeL); + A->SetShape(aShape); + } + return A->IsSubShape(sub); } -- 2.39.5