DATAKIT SDK  V2026.2
gltfw.hpp
Go to the documentation of this file.
1 #ifndef _DTK_GLTFW_HPP
2 #define _DTK_GLTFW_HPP
3 
4 #include "def/define.h"
8 #include "util/error_dtk.hpp"
9 #include "util/util_mesh_dtk.hpp"
10 
11 //! \defgroup gltfw_utils Gltf Write Util Functions
12 //! \brief.
13 
14 namespace DtkGltf
15 {
16  class GLTF_Writer_Private;
17 }//namespace DtkGltf
18 
19 //! \class Dtk_GltfWriter
20 //! \brief GLTF Writer main class.
22 {
23 private:
24  DtkGltf::GLTF_Writer_Private * _Private;// = new GLTF_Writer_Private;
25 private:
26  // Anticopy methods.
27  Dtk_GltfWriter( const Dtk_GltfWriter& ) {}
28  Dtk_GltfWriter& operator=( const Dtk_GltfWriter& ) { return *this; }
29 public:
30  //! \ingroup gltfw_utils
31  //! \brief Constructor : Initialize the writer for a Gltf File.
32  //! \param [in] inFicout : File to write.
33  //! \param [out] outErr : dtkNoError if ok
34  Dtk_GltfWriter( const Dtk_string& inFicout, Dtk_ErrorStatus& outErr );
35  //! \ingroup gltfw_utils
36  //! \brief Set config to use Texture or Color in mesh writing
37  //! \param [in] inValue : DTK_TRUE to write Texture / DTK_FALSE to write Color
38  void ConfigUseTexture( Dtk_bool inValue );
39  //! \ingroup gltfw_utils
40  //! \brief Set config to use Embedded mode
41  //! \param [in] inValue : DTK_TRUE to write Embedded files / DTK_FALSE to write Gltf + Bin files
42  void ConfigWriteEmbedded( Dtk_bool inValue );
43  //! \ingroup gltfw_utils
44  //! \brief Destructor
46  //! \ingroup gltfw_utils
47  //! \brief Add a Mesh in current instance node. Supports colors, normals per vertex.
48  //! \return dtkNoError if ok.
49  //! \param [in] inMesh : Mesh to write
50  //! \param [in] inWriteWireframe : Flag to indicate if wireframe should be written
51  Dtk_ErrorStatus WriteMesh( const Dtk_MeshPtr& inMesh, Dtk_bool inWriteWireframe = DTK_TRUE );
52  //! \ingroup gltfw_utils
53  //! \brief Open a new instance node for internal tree.
54  //! \return dtkNoError if ok.
55  //! \param [in] inInstanceName : Instance name
56  //! \param [in] inProtoID : provide a proto ID if you need to reinstanciate it later. Provide -1 if not.
57  //! \param [out] isnewInstance : return true if an instance has already been added with the same protoID, the instance will be copied in the tree.
58  //! \param [in] inTrans : Matrice to apply on the instance
59  //! \param [in] inRgb : Instance color
61  Dtk_bool& isnewInstance, const Dtk_transfo& inTrans = Dtk_transfo(), const Dtk_RGB& inRgb = Dtk_RGB(), const Dtk_tab<Dtk_MetaDataPtr> &inMetaTab = Dtk_tab<Dtk_MetaDataPtr>() );
62  //! \ingroup gltfw_utils
63  //! \brief Close last instance node for internal tree. It should be called as many time as OpenInstance is called.
64  //! \return dtkNoError if ok.
66 };
67 
68 #endif // _DTK_gltfw_HPP
Dtk_GltfWriter::ConfigWriteEmbedded
void ConfigWriteEmbedded(Dtk_bool inValue)
Set config to use Embedded mode.
DtkGltf
Definition: gltfw.hpp:15
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
DTK_TRUE
#define DTK_TRUE
Definition: define.h:719
Dtk_GltfWriter
GLTF Writer main class.
Definition: gltfw.hpp:22
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_GltfWriter::OpenInstance
Dtk_ErrorStatus OpenInstance(const Dtk_string &inInstanceName, Dtk_Int64 inProtoID, Dtk_bool &isnewInstance, const Dtk_transfo &inTrans=Dtk_transfo(), const Dtk_RGB &inRgb=Dtk_RGB(), const Dtk_tab< Dtk_MetaDataPtr > &inMetaTab=Dtk_tab< Dtk_MetaDataPtr >())
Open a new instance node for internal tree.
Dtk_GltfWriter::~Dtk_GltfWriter
~Dtk_GltfWriter()
Destructor.
Dtk_GltfWriter::ConfigUseTexture
void ConfigUseTexture(Dtk_bool inValue)
Set config to use Texture or Color in mesh writing.
Dtk_bool
char Dtk_bool
Definition: define.h:717
Dtk_GltfWriter::WriteMesh
Dtk_ErrorStatus WriteMesh(const Dtk_MeshPtr &inMesh, Dtk_bool inWriteWireframe=DTK_TRUE)
Add a Mesh in current instance node. Supports colors, normals per vertex.
util_mesh_dtk.hpp
Dtk_Int64
int64_t Dtk_Int64
Definition: define.h:684
error_dtk.hpp
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
dtk_transfo.hpp
define.h
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
dtk_string.hpp
Dtk_GltfWriter::Dtk_GltfWriter
Dtk_GltfWriter(const Dtk_string &inFicout, Dtk_ErrorStatus &outErr)
Constructor : Initialize the writer for a Gltf File.
catiav5w::inInstanceName
const Dtk_string & inInstanceName
Definition: catiav5w.hpp:621
Dtk_GltfWriter::CloseLastInstance
Dtk_ErrorStatus CloseLastInstance()
Close last instance node for internal tree. It should be called as many time as OpenInstance is calle...
dtk_rgb.hpp
Dtk_RGB
Definition: dtk_rgb.hpp:7