DATAKIT API  V2025.3
cgrw.hpp
Go to the documentation of this file.
1 /**********************************************************
2 CGRW.HPP
3 ***********************************************************/
4 #ifndef _CGRW_HPP_
5 #define _CGRW_HPP_
6 
9 
10  class Dtk_mesh_instance;
11 
12 
16  {
17  protected:
18  int id;
24 
25  public:
26 
28  Dtk_bounding_box BB;
29 
34 
38  Dtk_mesh_instance* get_instance(int i);
42  int add_mesh(Dtk_MeshPtr mesh);
46  void set_id(int inId);
48  void set_material(Dtk_MaterialPtr inMaterial);
51 
53  int get_id();
58 
61 
63  void set_color(Dtk_RGB& inColor);
64 
67  };
68 
69 
77  {
78  protected:
80  public:
83 
86 
90  inline void SetFileRelease(const Dtk_UInt32 inRelease)
91  {
92  switch (inRelease)
93  {
94  case 19:
95  _FileRelease = (Dtk_UChar8)inRelease; return;
96  case 14:
97  default:
98  _FileRelease = 14; return;
99  }
100  }
102  inline Dtk_UInt32 GetFileRelease() const { return _FileRelease; }
103  };
104 
114  int cgrw_InitWrite(Dtk_string inFileWritten, Dtk_string inLogFile, Licence_dtk inLicFct, Dtk_string inLicenceFile, const WriteOptions & inOptions = WriteOptions());
115 
120 
132  void SetCfgCgrWriteMaterial(const Dtk_bool &inVal);
133 
134 #endif
135 
136 
WriteOptions::_FileRelease
Dtk_UChar8 _FileRelease
Definition: cgrw.hpp:79
Dtk_mesh_asm_node
This class gathers asm node related datas.
Definition: cgrw.hpp:16
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_mesh_asm_node::set_material
void set_material(Dtk_MaterialPtr inMaterial)
Set an material.
Dtk_mesh_asm_node::set_id
void set_id(int inId)
Set an Id.
WriteOptions::WriteOptions
WriteOptions()
Base constructor.
Definition: cgrw.hpp:82
Dtk_mesh_asm_node::Dtk_mesh_asm_node
Dtk_mesh_asm_node()
Default constructor.
catiav5w::inTransfo
const Dtk_string const Dtk_transfo & inTransfo
Definition: catiav5w.hpp:619
Dtk_mesh_asm_node::add_axis_system
int add_axis_system(Dtk_AxisSystemPtr inAxisSystem)
Add an Dtk_AxisSystemPtr in Dtk_mesh_asm_node in the current asm node.
Dtk_UInt32
uint32_t Dtk_UInt32
Definition: define.h:688
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:712
Dtk_mesh_asm_node::render
Dtk_RenderInfosPtr render
Definition: cgrw.hpp:22
Dtk_mesh_asm_node::node_color
Dtk_RGB node_color
Definition: cgrw.hpp:20
Dtk_status
Definition: dtk_status.hpp:16
Dtk_bool
char Dtk_bool
Definition: define.h:725
Dtk_mesh_asm_node::get_id
int get_id()
Get an Id.
Dtk_mesh_asm_node::set_color
void set_color(Dtk_RGB &inColor)
set color on Dtk_mesh_asm_node
cgrw_EndWrite
int cgrw_EndWrite()
Free the Cgr Writer
Dtk_mesh_asm_node::get_instance
Dtk_mesh_instance * get_instance(int i)
Return the i-th instance.
WriteOptions::~WriteOptions
~WriteOptions()
Destructor.
Definition: cgrw.hpp:85
Dtk_mesh_asm_node::id
int id
Definition: cgrw.hpp:18
SetCfgCgrWriteMaterial
void SetCfgCgrWriteMaterial(const Dtk_bool &inVal)
write material
Dtk_mesh_asm_node::phys_mat
Dtk_PhysicalMaterialInfosPtr phys_mat
Definition: cgrw.hpp:23
cgrw_WriteMeshAsm
Dtk_status cgrw_WriteMeshAsm(Dtk_mesh_asm_node *inRoot)
Write a mesh assembly.
cgrw_InitWrite
int cgrw_InitWrite(Dtk_string inFileWritten, Dtk_string inLogFile, Licence_dtk inLicFct, Dtk_string inLicenceFile, const WriteOptions &inOptions=WriteOptions())
Initialize the Cgr Writer
Dtk_mesh_asm_node::get_color
Dtk_RGB get_color()
get color on Dtk_mesh_asm_node
Dtk_SmartPtr< Dtk_material >
WriteOptions::GetFileRelease
Dtk_UInt32 GetFileRelease() const
Retrieve the Written file release.
Definition: cgrw.hpp:102
Dtk_mesh_asm_node::get_nb_instances
Dtk_Size_t get_nb_instances()
Return the nb of instances in the current node.
Dtk_UChar8
unsigned char Dtk_UChar8
Definition: define.h:698
Dtk_mesh_asm_node::cgrw_ComputeBBs
Dtk_status cgrw_ComputeBBs()
Compute Bounding Boxes.
Dtk_mesh_asm_node::add_mesh
int add_mesh(Dtk_MeshPtr mesh)
Add an Dtk_mesh in Dtk_mesh_asm_node in the current asm node.
Dtk_mesh_asm_node::get_render_infos
Dtk_RenderInfosPtr get_render_infos()
Get an material.
Dtk_tab< Dtk_mesh_instance * >
WriteOptions
This class provides several options to tunes cgr Writter. It must be provided to cgr::cgrw_InitWrite ...
Definition: cgrw.hpp:77
Dtk_mesh_asm_node::get_material
Dtk_MaterialPtr get_material()
Get an material.
Dtk_mesh_asm_node::inst
Dtk_tab< Dtk_mesh_instance * > inst
Definition: cgrw.hpp:19
Dtk_mesh_asm_node::~Dtk_mesh_asm_node
~Dtk_mesh_asm_node()
Default destructor.
Dtk_mesh_asm_node::material
Dtk_MaterialPtr material
Definition: cgrw.hpp:21
Dtk_mesh_asm_node::set_render_infos
void set_render_infos(Dtk_RenderInfosPtr inRender)
Set an render.
Dtk_RGB
Definition: dtk_rgb.hpp:7
Dtk_mesh_asm_node::BB
Dtk_bounding_box BB
Used to store global computed bounding box.
Definition: cgrw.hpp:28
WriteOptions::SetFileRelease
void SetFileRelease(const Dtk_UInt32 inRelease)
Sets the release for the written files.
Definition: cgrw.hpp:90
Licence_dtk
char *(* Licence_dtk)(char *)
Definition: str_def.h:71
Dtk_mesh_asm_node::add_asm_instance
int add_asm_instance(Dtk_mesh_asm_node *inMeshAsm, Dtk_transfo *inTransfo)
Add an asm instance to the current asm node.