 |
DATAKIT SDK
V2026.4
|
|
◆ CgrWriteSample()
Entry point: builds an assembly tree with cube, cylinder, and wire meshes and writes it to sample.cgr.
29 std::cout << std::endl <<
"----------------------------------------------" << std::endl;
30 std::cout <<
"Cgr Write start" << std::endl;
33 outputDirectory = inResultDirectory + L
"Cgr/";
35 outputDirectory.
mkdir();
36 outputFileName = outputDirectory + L
"sample.cgr";
97 mesh_asm_4->
add_mesh( CylinderMesh );
107 int Status =
cgrw_InitWrite( outputFileName, outputDirectory + L
"testcgrw.log", NULL, L
"", options );
121 std::cout <<
"=> " << outputFileName.
c_str() << std::endl <<
"Cgr Write end" << std::endl;
This class gathers asm node related datas.
Definition: cgrw.hpp:21
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:207
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
void set_id(int inId)
Set an Id.
void setZdir(const Dtk_dir &Z)
Set a new Z vector.
int add_axis_system(Dtk_AxisSystemPtr inAxisSystem)
Add an Dtk_AxisSystemPtr in Dtk_mesh_asm_node in the current asm node.
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_AxisSystemPtr CreateAxisSystem()
Creates a named axis system with a custom orientation matrix, red color, layer 123,...
Definition: testcreatecube.cpp:1541
void set_color(Dtk_RGB &inColor)
set color on Dtk_mesh_asm_node
void setXdir(const Dtk_dir &X)
Set a new X vector.
int cgrw_EndWrite()
Free the Cgr Writer
Dtk_MeshPtr CreateMeshWire()
Wire mesh sample.
Definition: testcreatemesh.cpp:389
int cgrw_InitWrite(Dtk_string inFileWritten, Dtk_string inLogFile, Licence_dtk inLicFct, Dtk_string inLicenceFile, const WriteOptions &inOptions=WriteOptions())
Initialize the Cgr Writer
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
void setScale(Dtk_Double64 scale)
Set a new scale.
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
int add_mesh(Dtk_MeshPtr mesh)
Add an Dtk_mesh in Dtk_mesh_asm_node in the current asm node.
void setYdir(const Dtk_dir &Y)
Set a new Y vector.
int mkdir() const
File Utility : Create a Directory.
This is a mathematical point class.
Definition: dtk_pnt.hpp:20
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
Dtk_ErrorStatus cgrw_WriteMeshAsmNode(Dtk_mesh_asm_node *inRoot)
Write a mesh assembly.
This class provides several options to tunes cgr Writter. It must be provided to cgr::cgrw_InitWrite ...
Definition: cgrw.hpp:95
@ dtkNoError
Definition: error_dtk.hpp:151
Definition: dtk_rgb.hpp:8
void SetFileRelease(const Dtk_UInt32 inRelease)
Sets the release for the written files.
Definition: cgrw.hpp:108
This is a mathematical direction class.
Definition: dtk_dir.hpp:14
int add_asm_instance(Dtk_mesh_asm_node *inMeshAsm, Dtk_transfo *inTransfo)
Add an asm instance to the current asm node.