 |
DATAKIT SDK
V2026.4
|
|
◆ ColladaWriteSample()
Entry point: writes cube, cylinder, wireframe meshes with render infos and model display views into sample.dae.
35 std::cout << std::endl <<
"----------------------------------------------" << std::endl;
36 std::cout <<
"Collada Write start" << std::endl;
39 outputDirectory = inResultDirectory + L
"Collada/";
41 outputDirectory.
mkdir();
42 outputFileName = outputDirectory + L
"sample.dae";
80 transfo.
setXdir( 0.0, 1.0, 0.0 );
81 transfo.
setYdir( 0.0, 0.0, 1.0 );
82 transfo.
setZdir( 1.0, 0.0, 0.0 );
87 nodeName =
"RootNode";
93 nodeName =
"Facetted data";
105 cubeMesh->info()->AddRenderInfos( renderInfos );
116 nodeName =
"Cylinder";
134 nodeName =
"Facetted data (Reinstanciated)";
151 std::cout <<
"=> " << outputFileName.
c_str() << std::endl <<
"Collada Write end" << std::endl;
static Dtk_SmartPtr< Dtk_Info > Create()
Calls default constructor to allocate a new object.
uint32_t Dtk_ID
Definition: define.h:688
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:207
DtkErrorStatus EndNode()
End the node.
void setZdir(const Dtk_dir &Z)
Set a new Z vector.
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, WriteOptions &inOptions)
Initialize the Collada Writer
#define DTK_TRUE
Definition: define.h:726
This is a high level string class.
Definition: dtk_string.hpp:53
char Dtk_bool
Definition: define.h:724
DtkErrorStatus EndWrite()
Creation of the output file and free the Collada Writer
void setXdir(const Dtk_dir &X)
Set a new X vector.
void FillFacesColors(Dtk_MeshPtr &inoutCubeMesh)
Filling mesh faces with colors.
Definition: testcreatemesh.cpp:244
This class provides several options to tune Collada Writer. It must be provided to Colladaw::InitWrit...
Definition: colladaw.hpp:23
Dtk_bool ConvertRenderInfos
Definition: colladaw.hpp:33
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_RenderInfosPtr CreateCubeRenderInfos()
Creates a Dtk_RenderInfos object with ambient, diffuse, and specular lighting and a texture for use o...
Definition: testcreatemesh.cpp:501
Definition: util_ptr_dtk.hpp:37
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:338
void setYdir(const Dtk_dir &Y)
Set a new Y vector.
int mkdir() const
File Utility : Create a Directory.
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
DtkErrorStatus ReinstanciatePrototype(Dtk_ID inID)
Reinstanciate a node.
This is a high level array class.
Definition: util_stl_dtk.hpp:84
void addTranslate(const Dtk_dir &V)
Translate the Dtk_transfo.
DtkErrorStatus InitNode(Dtk_string &inNodeName, const Dtk_transfo &inTransfo, Dtk_InfoPtr &inInfo, Dtk_ID &outID)
Initialize a node.
@ dtkNoError
Definition: error_dtk.hpp:151
Dtk_ErrorStatus WriteEntity(const Dtk_EntityPtr &inEntity)
Write the entity provided in parameter in a node.
This is a mathematical direction class.
Definition: dtk_dir.hpp:14