DATAKIT API  V2025.1
Gltf Write Util Functions

Functions

Dtk_ErrorStatus Dtk_GltfWriter::CloseLastInstance ()
 Close last instance node for internal tree. It should be called as many time as OpenInstance is called. More...
 
void Dtk_GltfWriter::ConfigUseTexture (Dtk_bool inValue)
 Set config to use Texture or Color in mesh writing. More...
 
 Dtk_GltfWriter::Dtk_GltfWriter (const Dtk_string &inFicout, Dtk_ErrorStatus &outErr)
 Constructor : Initialize the writer for a Gltf File. More...
 
Dtk_ErrorStatus Dtk_GltfWriter::OpenInstance (const Dtk_string &inInstanceName, Dtk_Int64 inProtoID, Dtk_bool &isnewInstance, const Dtk_transfo &inTrans=Dtk_transfo(), const Dtk_RGB &inRgb=Dtk_RGB())
 Open a new instance node for internal tree. More...
 
Dtk_ErrorStatus Dtk_GltfWriter::WriteMesh (const Dtk_MeshPtr &inMesh)
 Add a Mesh in current instance node. Supports colors, normals per vertex. More...
 
 Dtk_GltfWriter::~Dtk_GltfWriter ()
 Destructor. More...
 

Detailed Description

Function Documentation

◆ CloseLastInstance()

Dtk_ErrorStatus Dtk_GltfWriter::CloseLastInstance ( )

Close last instance node for internal tree. It should be called as many time as OpenInstance is called.

Returns
dtkNoError if ok.

◆ ConfigUseTexture()

void Dtk_GltfWriter::ConfigUseTexture ( Dtk_bool  inValue)

Set config to use Texture or Color in mesh writing.

Parameters
[in]inValue: DTK_TRUE to write Texture / DTK_FALSE to write Color

◆ Dtk_GltfWriter()

Dtk_GltfWriter::Dtk_GltfWriter ( const Dtk_string inFicout,
Dtk_ErrorStatus outErr 
)

Constructor : Initialize the writer for a Gltf File.

Parameters
[in]inFicout: File to write.
[out]outErr: dtkNoError if ok

◆ OpenInstance()

Dtk_ErrorStatus Dtk_GltfWriter::OpenInstance ( const Dtk_string inInstanceName,
Dtk_Int64  inProtoID,
Dtk_bool isnewInstance,
const Dtk_transfo inTrans = Dtk_transfo(),
const Dtk_RGB inRgb = Dtk_RGB() 
)

Open a new instance node for internal tree.

Returns
dtkNoError if ok.
Parameters
[in]inInstanceName: Instance name
[in]inProtoID: provide a proto ID if you need to reinstanciate it later. Provide -1 if not.
[out]isnewInstance: return true if an instance has already been added with the same protoID, the instance will be copied in the tree.
[in]inTrans: Matrice to apply on the instance
[in]inRgb: Instance color

◆ WriteMesh()

Dtk_ErrorStatus Dtk_GltfWriter::WriteMesh ( const Dtk_MeshPtr inMesh)

Add a Mesh in current instance node. Supports colors, normals per vertex.

Returns
dtkNoError if ok.
Parameters
[in]inMesh: Mesh to write

◆ ~Dtk_GltfWriter()

Dtk_GltfWriter::~Dtk_GltfWriter ( )

Destructor.