From: ika Date: Tue, 8 May 2018 10:22:01 +0000 (+0300) Subject: Bug #297 Fix IsSubShape method in ShapeTool X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=2b34e50d7b585af1b770b1a81e8db70a23ca0829;p=occt-copy.git Bug #297 Fix IsSubShape method in ShapeTool Pick a part of commit for 0029599 --- 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); }