]> OCCT Git - occt.git/commitdiff
0033797: Add Draco compression parameters to GLTF provider CR33797
authorFtpSantos <fsantos6@opencascade.com>
Wed, 14 Aug 2024 17:00:19 +0000 (18:00 +0100)
committerFtpSantos <fsantos6@opencascade.com>
Wed, 14 Aug 2024 17:00:19 +0000 (18:00 +0100)
Added Draco parameters struct to GLTF configuration node and set that information on the GLTF provider

src/RWGltf/RWGltf_ConfigurationNode.hxx
src/RWGltf/RWGltf_Provider.cxx

index df01849bb5e173afdc0de3eda61ea3fc33f4a8af..1316cfb99572ad4c215d202ca31229eb072c4ded 100644 (file)
@@ -17,6 +17,7 @@
 #include <DE_ConfigurationNode.hxx>
 #include <RWMesh_CoordinateSystem.hxx>
 #include <RWGltf_WriterTrsfFormat.hxx>
+#include <RWGltf_DracoParameters.hxx>
 #include <RWMesh_NameFormat.hxx>
 
 //! The purpose of this class is to configure the transfer process for glTF format
@@ -111,6 +112,7 @@ public:
     bool WriteEmbedTexturesInGlb = true; //!< Flag to write image textures into GLB file
     bool WriteMergeFaces = false; //!< Flag to merge faces within a single part
     bool WriteSplitIndices16 = false; //!< Flag to prefer keeping 16-bit indexes while merging face
+    RWGltf_DracoParameters DracoParameters; //!< Struct with all draco parameters, default values on the corresponding header
   } InternalParameters;
 };
 
index 1331011aeb5ba336e82117c6d84275e23863dcf3..b8fcb09845d074842617e4c2cc4ac206a17bac55 100644 (file)
@@ -166,6 +166,7 @@ bool RWGltf_Provider::Write(const TCollection_AsciiString& thePath,
   aWriter.SetToEmbedTexturesInGlb(aNode->InternalParameters.WriteEmbedTexturesInGlb);
   aWriter.SetMergeFaces(aNode->InternalParameters.WriteMergeFaces);
   aWriter.SetSplitIndices16(aNode->InternalParameters.WriteSplitIndices16);
+  aWriter.SetCompressionParameters(aNode->InternalParameters.DracoParameters);
   if (!aWriter.Perform(theDocument, aFileInfo, theProgress))
   {
     Message::SendFail() << "Error in the RWGltf_Provider during writing the file " << thePath;