]> OCCT Git - occt-copy.git/commitdiff
Bug #297 Fix IsSubShape method in ShapeTool
authorika <ika@opencascade.com>
Tue, 8 May 2018 10:22:01 +0000 (13:22 +0300)
committerika <ika@opencascade.com>
Tue, 8 May 2018 10:22:01 +0000 (13:22 +0300)
Pick a part of commit for 0029599

src/XCAFDoc/XCAFDoc_ShapeTool.cxx

index 75f010b75d5ab5dc4ff8895030885bddfb5355ea..22977f51a313880272d33147880bc3ed93a659b1 100644 (file)
@@ -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);
 }