From: FtpSantos Date: Wed, 14 Aug 2024 17:00:19 +0000 (+0100) Subject: 0033797: Add Draco compression parameters to GLTF provider X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR33797;p=occt.git 0033797: Add Draco compression parameters to GLTF provider Added Draco parameters struct to GLTF configuration node and set that information on the GLTF provider --- diff --git a/src/RWGltf/RWGltf_ConfigurationNode.hxx b/src/RWGltf/RWGltf_ConfigurationNode.hxx index df01849bb5..1316cfb995 100644 --- a/src/RWGltf/RWGltf_ConfigurationNode.hxx +++ b/src/RWGltf/RWGltf_ConfigurationNode.hxx @@ -17,6 +17,7 @@ #include #include #include +#include #include //! 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; }; diff --git a/src/RWGltf/RWGltf_Provider.cxx b/src/RWGltf/RWGltf_Provider.cxx index 1331011aeb..b8fcb09845 100644 --- a/src/RWGltf/RWGltf_Provider.cxx +++ b/src/RWGltf/RWGltf_Provider.cxx @@ -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;