0032171: Data Exchange - RWGltf_TriangulationReader doesn't copy cached bounding box
[occt.git] / src / RWGltf / RWGltf_TriangulationReader.cxx
index de4db86..25c7534 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <RWGltf_TriangulationReader.hxx>
 
+#include <RWGltf_GltfLatePrimitiveArray.hxx>
 #include <RWMesh_CoordinateSystemConverter.hxx>
 #include <Standard_ReadBuffer.hxx>
 
@@ -85,6 +86,24 @@ Handle(Poly_Triangulation) RWGltf_TriangulationReader::result()
   return myTriangulation;
 }
 
+// =======================================================================
+// function : load
+// purpose  :
+// =======================================================================
+bool RWGltf_TriangulationReader::load (const Handle(RWGltf_GltfLatePrimitiveArray)& theMesh,
+                                       const Handle(OSD_FileSystem)& theFileSystem)
+{
+  if (!RWGltf_PrimitiveArrayReader::load (theMesh, theFileSystem))
+  {
+    return false;
+  }
+  if (!theMesh->CachedMinMax().IsVoid())
+  {
+    myTriangulation->SetCachedMinMax (theMesh->CachedMinMax());
+  }
+  return true;
+}
+
 // =======================================================================
 // function : readBuffer
 // purpose  :