]> OCCT Git - occt-copy.git/commitdiff
refs #54: fix problem with subshapes in opened xbf file.
authorika <ika@opencascade.com>
Mon, 5 Jun 2017 11:29:34 +0000 (14:29 +0300)
committerika <ika@opencascade.com>
Mon, 5 Jun 2017 11:29:34 +0000 (14:29 +0300)
src/XCAFDoc/XCAFDoc_ShapeTool.cxx

index 36b0479d42db876677393d186df237fea053ce51..f550ad7e817e669af871e9f1d51c409079336a18 100644 (file)
@@ -1031,8 +1031,11 @@ 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;
+  if (!shapeL.FindAttribute(XCAFDoc_ShapeMapTool::GetID(), A)) {
+    A = XCAFDoc_ShapeMapTool::Set(shapeL);
+    TopoDS_Shape aShape = GetShape(shapeL);
+    A->SetShape(aShape);
+  }
   
   //TopoDS_Shape S = GetShape ( shapeL );
   //return ! S.IsNull() && CheckSubShape ( S, sub );