]> OCCT Git - occt.git/commitdiff
0032087: Data Exchange, STEPCAFControl_Reader - NULL representation of shape for DGT
authordpasukhi <dpasukhi@opencascade.com>
Wed, 27 Jan 2021 12:12:46 +0000 (15:12 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 20 Feb 2021 07:43:17 +0000 (10:43 +0300)
- Fixed problem with find a Path for the DimensionType_Location_WithPath
- Added check for the null object within FindShapeIndexForDGT

src/STEPCAFControl/STEPCAFControl_Reader.cxx
tests/bugs/step/bug32087 [new file with mode: 0644]

index ae1f11569b727b8a69e961c1dc9e6311cc95ec5f..ba9dc91bc1750db6d7221c1abbbc15ff6c1b0747 100644 (file)
@@ -2244,7 +2244,7 @@ static Standard_Integer FindShapeIndexForDGT(const Handle(Standard_Transient)& t
   const Handle(Transfer_TransientProcess) &aTP = theWS->TransferReader()->TransientProcess();
   // try to find index of given entity
   Standard_Integer anIndex = aTP->MapIndex(theEnt);
-  if (anIndex > 0)
+  if (anIndex > 0 || theEnt.IsNull())
     return anIndex;
   // if theEnt is a geometry item try to find its topological item
   const Interface_Graph& aGraph = aTP->Graph();
@@ -3591,7 +3591,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
         if (aGRI.IsNull()) return;
         Handle(StepRepr_RepresentationItem) aPRI;
         Interface_EntityIterator anIterGRI = aGraph.Sharings(aGRI);
-        for (anIterGRI.Start(); anIterGRI.More() && aPGISU.IsNull(); anIterGRI.Next()) {
+        for (anIterGRI.Start(); anIterGRI.More() && aPRI.IsNull(); anIterGRI.Next()) {
           aPRI = Handle(StepRepr_RepresentationItem)::DownCast(anIterGRI.Value());
         }
         Standard_Integer anIndex = FindShapeIndexForDGT(aPRI, theWS);
diff --git a/tests/bugs/step/bug32087 b/tests/bugs/step/bug32087
new file mode 100644 (file)
index 0000000..3fb0caa
--- /dev/null
@@ -0,0 +1,11 @@
+puts "===================================="
+puts "0032087: Data Exchange, STEPCAFControl_Reader - NULL representation of shape for DGT"
+puts "===================================="
+puts ""
+
+pload OCAF
+
+# Read file
+ReadStep D [locate_data_file bug32087_part.stp]
+
+Close D