DATAKIT API  V2025.1
util_mesh_dtk.hpp
Go to the documentation of this file.
1 
2 #ifndef _UTIL_MESH_DTK_HPP_
3 #define _UTIL_MESH_DTK_HPP_
4 
5 #include "util_stl_dtk.hpp"
6 #include "util/util_ent_dtk.hpp"
7 #include "util/dtk_picture.hpp"
8 #include <cstdio>
9 #include "def/define.h"
17 #include "util/dtk_val.hpp"
18 #include "util/error_dtk.hpp"
19 #include "util/util_ptr_dtk.hpp"
20 
21 class Dtk_material;
22 class Dtk_mesh;
23 class Dtk_mesh_face;
27 
28 /* Filtres */
29 
30 #define DTK_MESH_XYZ 1
31 #define DTK_MESH_NORMAL 2
32 #define DTK_MESH_RGB 4
33 #define DTK_MESH_UV_TEXTURES 8 // textures
34 #define DTK_MESH_UV_BREP 16
35 #define DTK_MESH_DOUBLEPRECISION 32
36 // combinations
37 #define DTK_MESH_XYZ_NORMAL 3
38 #define DTK_MESH_XYZ_NORMAL_UVTEXTURES 11
39 #define DTK_MESH_XYZ_NORMAL_RGB 7
40 #define DTK_MESH_ALL 31
41 
42 /* Types de triangulation */
43 
45 
47 
48 #define DTK_VALUE_M 1000.0
49 #define DTK_VALUE_CM 10.0
50 #define DTK_VALUE_MM 1.0
51 #define DTK_VALUE_INCH 25.4
52 #define DTK_VALUE_FEET 304.8
53 
54 
56 struct Dtk_bounding_box
57 {
58  Dtk_pnt A;
59  Dtk_pnt B;
60  Dtk_pnt M;
61 };
62 
63 typedef Dtk_bounding_box dtk_mesh_face_bb;
64 typedef Dtk_tab<dtk_mesh_face_bb> dtk_mesh_body_face_bb;
65 
66 typedef Dtk_tab<dtk_mesh_body_face_bb> dtk_mesh_per_body_face_bb;
67 typedef Dtk_bounding_box dtk_mesh_body_bb;
68 
69 typedef Dtk_tab<dtk_mesh_body_bb> dtk_mesh_bodies_bb;
70 typedef Dtk_bounding_box dtk_mesh_all_bodies_bb;
71 
72 typedef Dtk_bounding_box dtk_mesh_crv_bb;
73 typedef Dtk_tab<dtk_mesh_crv_bb> dtk_mesh_per_crv_bb;
74 typedef Dtk_bounding_box dtk_mesh_all_crvs_bb;
75 
76 
77 class Dtk_material_value
78 {
79 public:
80  Dtk_string NameProperties;
81  Dtk_tab<Dtk_Val > PropertiesValue;
82  void _Copy(const Dtk_material_value & s)
83  {
84  NameProperties = s.NameProperties;
85  for(Dtk_Size_t i=0;i<s.PropertiesValue.size();i++)
86  {
87  PropertiesValue.push_back(Dtk_Val(s.PropertiesValue.at(i)));
88  }
89  }
90  Dtk_material_value( void )
91  {
92  }
93  ~Dtk_material_value()
94  {
95  }
96 };
97 
98 class Dtk_rendering
99 {
100 public:
101  Dtk_string name;
103  void _Copy(const Dtk_rendering * s)
104  {
105  if(s)
106  {
107  name = s->name;
108  for(Dtk_Size_t i=0;i<s->value.size();i++)
109  {
110  Dtk_material_value material_value;
111  material_value._Copy(s->value.at(i));
112  value.push_back(material_value);
113  }
114  }
115  }
116  Dtk_rendering( void )
117  {
118  value.clear();
119  }
120  ~Dtk_rendering()
121  {
122  value.clear();
123  }
124 };
125 
126 class Dtk_drw
127 {
128 public:
129  Dtk_string name;
131  Dtk_picture * picture;
133  Dtk_string picturename;
135 
136  void _Copy(const Dtk_drw * s)
137  {
138  if(s)
139  {
140  name = s->name;
141  picturename = s->picturename;
142  if(s->picture)
143  {
144  picture = new Dtk_picture();
145  picture->_Copy(s->picture);
146  }
147  for(Dtk_Size_t i=0;i<s->value.size();i++)
148  {
149  Dtk_material_value material_value;
150  material_value._Copy(s->value.at(i));
151  value.push_back(material_value);
152  }
153  }
154  }
155  Dtk_drw( void )
156  {
157  value.clear();
158  picture = NULL;
159  }
160  ~Dtk_drw()
161  {
162  value.clear();
163  delete picture;
164  picture = NULL;
165  }
166 };
167 
168 class Dtk_drafting
169 {
170 public:
171  Dtk_string name;
174 
175  void _Copy(const Dtk_drafting * s)
176  {
177  if(s)
178  {
179  name = s->name;
180  for(Dtk_Size_t i=0;i<s->drw.size();i++)
181  {
182  Dtk_drw * curDrw = new Dtk_drw();
183  curDrw->_Copy(s->drw.at(i));
184  drw.push_back(curDrw);
185  }
186  for(Dtk_Size_t i=0;i<s->value.size();i++)
187  {
188  Dtk_material_value material_value;
189  material_value._Copy(s->value.at(i));
190  value.push_back(material_value);
191  }
192  }
193  }
194  Dtk_drafting( void )
195  {
196  value.clear();
197  drw.clear();
198  }
199  ~Dtk_drafting()
200  {
201  value.clear();
202  for(Dtk_Size_t i=0;i<drw.size();i++)
203  {
204  delete drw.at(i);
205  drw.at(i) = NULL;
206  }
207  drw.clear();
208  }
209 };
210 
211 
212 class Dtk_analysis
213 {
214 public:
215  Dtk_string name;
217 
218  void _Copy(const Dtk_analysis * s)
219  {
220  if(s)
221  {
222  name = s->name;
223  for(Dtk_Size_t i=0;i<s->value.size();i++)
224  {
225  Dtk_material_value material_value;
226  material_value._Copy(s->value.at(i));
227  value.push_back(material_value);
228  }
229  }
230  }
231  Dtk_analysis( void )
232  {
233  value.clear();
234  }
235  ~Dtk_analysis()
236  {
237  for(Dtk_Size_t i=0;i<value.size();i++)
238  {
239  Dtk_material_value val = value.at(i);
240  val.PropertiesValue.clear();
241  }
242  value.clear();
243  }
244 };
245 
246 class Dtk_composites
247 {
248 public:
249  Dtk_string name;
251 
252  void _Copy(const Dtk_composites * s)
253  {
254  if(s)
255  {
256  name = s->name;
257  for(Dtk_Size_t i=0;i<s->value.size();i++)
258  {
259  Dtk_material_value material_value;
260  material_value._Copy(s->value.at(i));
261  value.push_back(material_value);
262  }
263  }
264  }
265  Dtk_composites( void )
266  {
267  value.clear();
268  }
269  ~Dtk_composites()
270  {
271  value.clear();
272  }
273 };
274 
275 class Dtk_positioned
276 {
277 public:
278  Dtk_string name;
280  Dtk_transfo * matrix;
281 
282  void _Copy(const Dtk_positioned * s)
283  {
284  if(s)
285  {
286  name = s->name;
287  for(Dtk_Size_t i=0;i<s->value.size();i++)
288  {
289  Dtk_material_value material_value;
290  material_value._Copy(s->value.at(i));
291  value.push_back(material_value);
292  }
293  if(s->matrix)
294  {
295  matrix = new Dtk_transfo(s->matrix->getXdir(), s->matrix->getYdir(), s->matrix->getZdir(), s->matrix->getOrigin(), s->matrix->getScale());
296  }
297  }
298  }
299  Dtk_positioned( void )
300  {
301  matrix = NULL;
302  }
303  ~Dtk_positioned()
304  {
305  delete matrix;
306  matrix = NULL;
307  }
308 };
309 
311 class Dtk_material:public Dtk_Object
312 {
313 protected:
314  enum
315  {
316  _typeID = DTK_TYPE_MATERIAL
317  };
318 private:
319  friend class Dtk_SmartPtr<Dtk_material>;
320 public:
322  Dtk_string label;
323 
324  double ambient;
325  double diffuse;
326  double specular;
327  double refraction;
328  double transparency;
329  double reflectivity;
330  double roughness;
331  double _Density;
332 
333  Dtk_Int32 _renderID;
334  Dtk_Int32 _physicalID;
336  Dtk_Int32 _identifier_library;
338  bool repeat_u;
340  bool repeat_v;
342  Dtk_picture * picture;
344  Dtk_string texture;
345 
347  Dtk_rendering * rendering;
348  Dtk_drafting * drafting;
349  Dtk_analysis * analysis;
350  Dtk_composites * composites;
351  Dtk_positioned * positioned;
352 
354  Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
355  {
356  if (inId == _typeID)
357  {
358  return 1;
359  }
360  return Dtk_material::DtkDynamicType(inId);
361  }
363  static Dtk_material * DtkDynamicCast(Dtk_Object * s)
364  {
365  if(s->DtkDynamicType(_typeID))
366  return static_cast<Dtk_material * >(s);
367  return NULL;
368  }
369 
370  void _Copy(const Dtk_MaterialPtr & s)
371  {
372  if(s.IsNotNULL())
373  {
374  label = s->label;
375  ambient = s->ambient;
376  diffuse = s->diffuse;
377  specular = s->specular;
378  refraction = s->refraction;
379  transparency = s->transparency;
380  reflectivity = s->reflectivity;
381  roughness = s->roughness;
382  _Density = s->_Density;
383  _renderID = s->_renderID;
384  repeat_u = s->repeat_u;
385  repeat_v = s->repeat_v;
386  texture = s->texture;
387  _identifier_library = s->_identifier_library;
388  if(s->picture)
389  {
390  picture = new Dtk_picture();
391  picture->_Copy(s->picture);
392  }
393  if(s->rendering)
394  {
395  rendering = new Dtk_rendering();
396  rendering->_Copy(s->rendering);
397  }
398  if(s->drafting)
399  {
400  drafting = new Dtk_drafting();
401  drafting->_Copy(s->drafting);
402  }
403  if(s->analysis)
404  {
405  analysis = new Dtk_analysis();
406  analysis->_Copy(s->analysis);
407  }
408  if(s->composites)
409  {
410  composites = new Dtk_composites();
411  composites->_Copy(s->composites);
412  }
413  if(s->positioned)
414  {
415  positioned = new Dtk_positioned();
416  positioned->_Copy(s->positioned);
417  }
418  }
419  }
420 
421  //Constructor
422  Dtk_material( void )
423  {
424  roughness = 0.0;
425  refraction = 0.0;
426  ambient = 0.0;
427  diffuse = 0.0;
428  specular = 0.0;
429  transparency = 0.0;
430  reflectivity = 0.0;
431  repeat_u = 0;
432  repeat_v = 0;
433  rendering = NULL;
434  drafting = NULL;
435  analysis = NULL;
436  composites = NULL;
437  positioned = NULL;
438  picture = NULL;
439  _Density = 0.0;
440  _renderID = -1;
441  _physicalID = -1;
442  _identifier_library = 0;
443  }
444 
445  // Destructor
446  ~Dtk_material()
447  {
448  delete picture;
449  picture = NULL;
450  delete drafting;
451  drafting = NULL;
452  delete rendering;
453  rendering = NULL;
454  delete analysis;
455  analysis = NULL;
456  delete composites;
457  composites = NULL;
458  delete positioned;
459  positioned = NULL;
460  }
461 
462  inline Dtk_Double64 GetDensity() const {return _Density;}
463  inline void SetDensity(const Dtk_Double64 inDensity) {_Density = inDensity;}
464  inline Dtk_Int32 GetRenderID() const {return _renderID;}
465  inline void SetRenderID(const Dtk_Int32 inRenderID) {_renderID = inRenderID;}
466  inline Dtk_Int32 GetPhysicalMaterialID() const { return _physicalID; }
467  inline void SetPhysicalMaterialID(const Dtk_Int32 inPhysicalID) { _physicalID = inPhysicalID; }
468 
469 };
471 
472 /* Class mesh */
473 
474 class Dtk_mesh_vertex;
475 class Dtk_facet;
476 class Dtk_mesh_face;
477 
478 
479 
484 class Dtk_mesh:public Dtk_Entity
485 {
486  private:
487  friend class Dtk_SmartPtr<Dtk_mesh>;
488  protected:
489  enum {
491  };
492  int id;
496 #ifdef NOCOMPRESSEDVERTICES
497  Dtk_tab<Dtk_mesh_vertex *> vertices; // hide, and hide subclasses.
498 #else
501  void C_GetVertex(Dtk_Size_t i,Dtk_pnt& out) const;
502  void C_GetNormal(Dtk_Size_t i,Dtk_dir& out) const;
503  void C_GetRGB(Dtk_Size_t i,Dtk_RGB& out) const;
508  void C_SetVertex(Dtk_Size_t i,const Dtk_pnt& out);
509  void C_SetNormal(Dtk_Size_t i,const Dtk_dir& out);
510  void C_SetRGB(Dtk_Size_t i,const Dtk_RGB& out);
514 #endif
517  friend class Dtk_mesh_face;
518  Dtk_bool check_params(const Dtk_pnt * inVertex, const Dtk_dir * inNormal, const Dtk_RGB * inColor, Dtk_Float32 inU, Dtk_Float32 inV);
519  Dtk_bool check_params(const Dtk_tab<Dtk_pnt> * inVertices, const Dtk_tab<Dtk_dir> * inNormals, const Dtk_tab<Dtk_RGB> * inColors, const Dtk_tab<Dtk_Float32> * inU, const Dtk_tab<Dtk_Float32> * inV);
520  void clean_up();
521  inline virtual Dtk_Object* Clone() { return new Dtk_mesh(*this); }
522 public:
523  Dtk_mesh(int inVertex_format = DTK_MESH_XYZ, Dtk_bool inBack_face_culling = true);
524  Dtk_mesh(const Dtk_mesh &inMesh);
525  Dtk_mesh& operator=(const Dtk_mesh &inMesh);
527 
528  public:
531 
534 
550  //void dump_vertices();
551  static Dtk_MeshPtr Create(int inVertex_format = DTK_MESH_XYZ, Dtk_bool inBack_face_culling = true);
552 
554  static Dtk_MeshPtr Create(const Dtk_mesh &inToBeCopied);
555 
559  Dtk_bool check_format(int inFormat);
560 
565 
569  int compute_bb(Dtk_pnt * min, Dtk_pnt * max);
570 
575 
579  int explode();
580 
584  int explode(Dtk_bool ExplodeTristrips, Dtk_bool ExplodeTrifans, Dtk_bool ExplodePolygons, Dtk_bool ExplodeMockups);
585 
588  int makestrips();
589 
593  int change_vertex_format(int inVertex_format);
594 
598  int transform(Dtk_matrix * inMatrix);
599 
603  int transform(Dtk_transfo * inMatrix);
604 
609 
613  int to_stl(Dtk_string inFilename,Dtk_bool inIsAciiMode=DTK_FALSE);
614 
623 
630  int add_vertex(const Dtk_pnt * inVertex,const Dtk_dir * inNormal = NULL,const Dtk_RGB * inColor = NULL, Dtk_Float32 inU = 0., Dtk_Float32 inV = 0., Dtk_Float32 inUBrep = 0., Dtk_Float32 inVBrep = 0.);
631 
636  int add_mesh_face(Dtk_mesh_face * inMesh_face);
637 
645  int set_vertex(Dtk_Size_t inPos, const Dtk_pnt * inVertex, const Dtk_dir * inNormal = NULL, const Dtk_RGB * inColor = NULL, Dtk_Float32 inU = 0., Dtk_Float32 inV = 0., Dtk_Float32 inUBrep = 0., Dtk_Float32 inVBrep = 0.);
646 
651  int set_normal(Dtk_Size_t inPos, const Dtk_dir * inNormal);
652 
657  int set_color(Dtk_Size_t inPos, const Dtk_RGB * inColor);
658 
664 
669  int get_texcoords(Dtk_Size_t inPos, Dtk_Float32 * outU, Dtk_Float32 * outV);
670 
673 
678  int get_vertex(Dtk_Size_t inPos, Dtk_pnt * outVertex);
679 
684 
691  int get_normal(Dtk_Size_t inPos, Dtk_dir * outNormal,Dtk_mesh_face * inMeshFace = NULL);
692 
698 
699 
702 
705 
710  int get_color(Dtk_Size_t inPos, Dtk_RGB * outColor);
711 
714 
718 
722 
725 
728  void set_id(int inId);
729 
731  int get_id();
732 
734  void set_mesh_color(const Dtk_RGB & inColor);
735 
738 
741 
743  void set_Infos(const Dtk_InfoPtr& inDtkInfosPtr);
744 
747 
750 
753  int rescale_model(float ratio);
754 
758  void reduce();
759 
762  void merge(const Dtk_mesh* inMesh);
763  void merge(const Dtk_SmartPtr<Dtk_mesh>& inMesh);
764 
765  void mergemove( Dtk_tab<Dtk_MeshPtr>& inArraymesh );
767  void mergemove( Dtk_mesh* inmesh );
769 
770 
773 
776 
777  enum type_detk get_type_detk() const;
779 
781 
784 
785 
786  Dtk_ErrorStatus Store(FILE* inFile, Dtk_Size_t inIo = 1);
787  Dtk_ErrorStatus Store(const Dtk_string& inFile, Dtk_Size_t inIo = 1);
788  void SetStream(Dtk_StreamPtr inStream);
790 };
791 
792 /* Class mesh_vertex : vertex data */
793 
799 {
800 protected:
802 public:
804  Dtk_mesh_vertex(const Dtk_pnt * inVertex);
805  virtual ~Dtk_mesh_vertex();
806  virtual Dtk_pnt GetVertex() const;
807  virtual Dtk_dir GetNormal() const;
808  virtual Dtk_RGB GetRGB() const;
809  virtual Dtk_Float32 GetU() const;
810  virtual Dtk_Float32 GetV() const;
811  virtual Dtk_Int32 SetVertex(const Dtk_pnt&);
812  virtual Dtk_Int32 SetNormal(const Dtk_dir&);
813  virtual Dtk_Int32 SetRGB(const Dtk_RGB&);
817  virtual Dtk_Size_t GetSize() const ;
818 };
819 
821 {
822 protected:
824 public:
826  Dtk_mesh_vertex_norm(const Dtk_pnt * inVertex,const Dtk_dir * inNorm);
830  Dtk_Size_t GetSize() const ;
831 };
832 
834 {
835 protected:
837 public:
839  Dtk_mesh_vertex_norm_color(const Dtk_pnt * inVertex,const Dtk_dir * inNorm,const Dtk_RGB* inRGB);
840  Dtk_RGB GetRGB() const;
842  Dtk_Size_t GetSize() const ;
843 };
844 
846 {
847 protected:
849 public:
851  Dtk_mesh_vertex_norm_color_uv(const Dtk_pnt * inVertex,const Dtk_dir * inNorm,const Dtk_RGB* inRGB,Dtk_Float32 inU,Dtk_Float32 inV);
852  Dtk_Float32 GetU() const;
853  Dtk_Float32 GetV() const;
856  Dtk_Size_t GetSize() const ;
857 };
858 
859 
860 /* --------------------------------------------- */
861 
864 
870 {
871 private:
872  friend class Dtk_SmartPtr<Dtk_mesh_face>;
873 protected:
874  enum {
876  };
878 // all types
887 // additionnal
889  friend class Dtk_mesh;
890 private:
891  int explode_tristrips(Dtk_tab<Dtk_UInt32>* ret);
892  int explode_trifans(Dtk_tab<Dtk_UInt32>* ret);
893  int explode_polygons(Dtk_tab<Dtk_UInt32>* ret);
894  int explode_mockups(Dtk_tab<Dtk_UInt32>* ret);
895  int add_shapevertices(const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals,const Dtk_tab<Dtk_RGB> * inColors,const Dtk_tab<Dtk_Float32> * inU, const Dtk_tab<Dtk_Float32> * inV);
896 
897  int _finddoublonstriangles();
898 // forbidden
899  Dtk_mesh_face& operator=(const Dtk_mesh_face& inMesh);
900 public:
904 
907  Dtk_mesh_face(const Dtk_mesh_face& inMeshface,Dtk_mesh* inMesh,Dtk_UInt32 shift=0);
908 
911 
912 public:
915 
918 
920  static Dtk_mesh_facePtr Create(const Dtk_mesh_face &inToBeCopied);
921 
926 
930  int compute_bb(Dtk_pnt * min, Dtk_pnt * max);
931 
936 
940  int explode();
941 
945  int explode(Dtk_bool ExplodeTristrips, Dtk_bool ExplodeTrifans, Dtk_bool ExplodePolygons, Dtk_bool ExplodeMockups);
946 
947  int makestrips();
948 
952 
957 
959 
960 
961 // triangles
962 
968  int add_triangles(const Dtk_UInt32* inIndices,Dtk_Size_t nb);
969 
978  int add_triangles(const Dtk_tab<Dtk_UInt32> * inIndices,const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals = NULL,const Dtk_tab<Dtk_RGB> * inColors = NULL,const Dtk_tab<Dtk_Float32> * inU = NULL,const Dtk_tab<Dtk_Float32> * inV = NULL);
979 
983 
994 
1000 
1005 
1009 
1010 // trianglestrip
1015  int add_triangle_strip(const Dtk_tab<Dtk_UInt32> * inIndices);
1016 
1018 
1027  int add_triangle_strip(const Dtk_tab<Dtk_UInt32> * inIndices,const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals = NULL,const Dtk_tab<Dtk_RGB> * inColors = NULL,const Dtk_tab<Dtk_Float32> * inU = NULL,const Dtk_tab<Dtk_Float32> * inV = NULL);
1028 
1032 
1037 
1038 // trianglefan
1043  int add_triangle_fan(const Dtk_tab<Dtk_UInt32> * inIndices);
1044 
1053  int add_triangle_fan(const Dtk_tab<Dtk_UInt32> * inIndices,const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals = NULL,const Dtk_tab<Dtk_RGB> * inColors = NULL,const Dtk_tab<Dtk_Float32> * inU = NULL,const Dtk_tab<Dtk_Float32> * inV = NULL);
1054 
1059 
1063 
1064 // polygons
1070  int add_polygon(const Dtk_tab<Dtk_UInt32> * inIndices);
1071 
1081  int add_polygon(const Dtk_tab<Dtk_UInt32> * inIndices,const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals = NULL,const Dtk_tab<Dtk_RGB> * inColors = NULL,const Dtk_tab<Dtk_Float32> * inU = NULL,const Dtk_tab<Dtk_Float32> * inV = NULL);
1082 
1086 
1091 
1092 
1094 
1095 // mockups
1102  int add_mockup(const Dtk_tab<Dtk_tab<Dtk_UInt32> > * inIndices);
1103 
1115  int add_mockup(const Dtk_tab<Dtk_tab<Dtk_UInt32> > * inIndices, const Dtk_tab<Dtk_pnt> * inVertices, const Dtk_tab<Dtk_dir> * inNormals = NULL, const Dtk_tab<Dtk_RGB> * inColors = NULL, const Dtk_tab<Dtk_Float32> * inU = NULL, const Dtk_tab<Dtk_Float32> * inV = NULL);
1116 
1117  int add_mockups(const Dtk_tab<Dtk_tab<Dtk_tab<Dtk_UInt32> > >* inIndices, const Dtk_tab<Dtk_pnt> * inVertices, const Dtk_tab<Dtk_dir> * inNormals = NULL, const Dtk_tab<Dtk_RGB> * inColors = NULL, const Dtk_tab<Dtk_Float32> * inU =NULL , const Dtk_tab<Dtk_Float32> * inV = NULL);
1118 
1122 
1126 
1128 
1129 // polylines
1130 
1135  int add_polyline(const Dtk_tab<Dtk_UInt32> * inIndices);
1136 
1145  int add_polyline(const Dtk_tab<Dtk_UInt32> * inIndices,const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals = NULL,const Dtk_tab<Dtk_RGB> * inColors = NULL,const Dtk_tab<Dtk_Float32> * inU = NULL,const Dtk_tab<Dtk_Float32> * inV = NULL);
1146 
1151 
1156 
1157 // points
1158 
1159  int add_point(Dtk_UInt32 inpnt);
1160  int add_points(const Dtk_tab<Dtk_UInt32> * pnts);
1161  int add_points(const Dtk_tab<Dtk_UInt32> * inIndices,const Dtk_tab<Dtk_pnt> * inVertices,const Dtk_tab<Dtk_dir> * inNormals = NULL,const Dtk_tab<Dtk_RGB> * inColors = NULL,const Dtk_tab<Dtk_Float32> * inU = NULL,const Dtk_tab<Dtk_Float32> * inV = NULL);
1164 
1165 
1166 // subinfos
1167 
1172 
1176  void reduce();
1177 
1180  void merge(Dtk_mesh_face* inMeshface);
1181 
1182 // additionnal infos
1186  const Dtk_InfoPtr& info() const;
1187 
1190  void set_id(int inId);
1192  int get_id();
1193 
1196  void set_face_color(const Dtk_RGB& inColor);
1199 
1204  void set_face_icolor(int inColor);
1205 
1211 
1217 
1221  void set_face_normal(const Dtk_dir&);
1222 
1227  void set_face_name(const Dtk_string& inName);
1228 
1229  virtual Dtk_Size_t GetSize() const;
1230 
1232 };
1233 
1234 /*
1235 
1240 class Dtk_facet
1241 {
1242  protected:
1243 
1244  // indices
1245  Dtk_tab<int> indices;
1246  Dtk_mesh * mesh;
1247 
1248  Dtk_Size_t numset;
1249 
1250  friend class Dtk_mesh;
1251  friend class Dtk_mesh_face;
1252 
1253  void set_numset(Dtk_Size_t);
1254  void set_mesh(Dtk_mesh* inMesh);
1255 
1256  public:
1257 
1259  Dtk_facet();
1260 
1264  Dtk_facet(Dtk_tab<int> * inIndices);
1265 
1267  ~Dtk_facet();
1268 
1270  void clean_up();
1271 
1274  virtual int compute_normal(Dtk_dir * outNormal) = 0;
1275 
1278  virtual Dtk_bool is_valid() = 0;
1279 
1283  Dtk_Size_t add_indice(int inIndice);
1284 
1292  int add_vertex(Dtk_pnt * inPnt, Dtk_dir * inNormal = NULL, Dtk_RGB * inColor = NULL, Dtk_Float32 inU = 0., Dtk_Float32 inV = 0.);
1293 
1295  Dtk_Size_t get_nb_vertices();
1296 
1301  int get_vertex(Dtk_Size_t inIndice, Dtk_pnt* outPnt);
1302 
1307  int get_normal(Dtk_Size_t inIndice, Dtk_dir* outNormal);
1308 
1313  int get_color(Dtk_Size_t inIndice, Dtk_RGB* outColor);
1314 
1319  int get_texcoords(Dtk_Size_t inIndice, double* ouU, double* outV);
1320 
1322  Dtk_Size_t get_nb_indices();
1323 
1325  Dtk_tab<int>get_indices();
1326 
1329  int get_indice(int inIndice);
1330 
1332  Dtk_mesh * get_mesh();
1333 };
1334 
1335 */
1336 /*
1337 
1338 // n points, n normales
1343 class Dtk_triangle: public Dtk_facet
1344 {
1345  public:
1346 
1348  Dtk_triangle();
1349 
1352  Dtk_triangle(Dtk_tab<int> * inIndices);
1353 
1355  ~Dtk_triangle();
1356 
1358  Dtk_bool is_valid();
1359 
1363  int compute_normal(Dtk_dir * outNormal);
1364 };
1365 
1366 */
1367 
1368 /*
1369 
1370 class Dtk_planar_facet: public Dtk_facet
1371 {
1372  friend class Dtk_mesh;
1375  public:
1376 
1377  Dtk_planar_facet();
1378  Dtk_planar_facet(Dtk_tab<int> *);
1379  ~Dtk_planar_facet();
1380 
1381  Dtk_bool is_valid();
1382  int compute_normal(Dtk_dir *);
1383 
1384  Dtk_triangle * to_strip();
1385  Dtk_triangle * to_triangles();
1386 };
1387 
1388 */
1389 
1390 
1391 class Dtk_mesh_circle_data;
1392 
1393 
1400 {
1401  int type; // kind or crv
1402  DTK_MESH_CRV_TYPE crv_type; // crv type
1403  Dtk_tab<int> indices; // si type != 120
1404  Dtk_tab<Dtk_pnt> vertices; // si type == 120
1405  Dtk_RGB color;
1406  unsigned long id;
1407  int line_type;
1408  float thickness;
1409  Dtk_mesh_circle_data * circle_data;
1410 
1411  public:
1412 
1417 
1420  void add_indice(int inIndice);
1425  int pop_indice();
1426 
1429  void add_vertex(Dtk_pnt inVertex);
1434  int get_vertex(Dtk_Size_t inIndice, Dtk_pnt * outVertex);
1437 
1442 
1445  void set_id(unsigned long inID);
1447  unsigned long get_id();
1448 
1460  void set_type(int inType);
1462  int get_type();
1470 
1473  void set_color(int R, int G, int B);
1477 
1479  void set_thickness(float inThickness);
1480 
1482  float get_thickness();
1483 
1485  void set_linetype(int inLineType);
1486 
1489 
1496 };
1497 
1498 
1499 
1503 {
1504  Dtk_dir axis;
1505  Dtk_pnt center;
1506  double radius;
1507 
1508  public:
1513 
1516  void set_axis(Dtk_dir inAxis);
1519 
1522  void set_center(Dtk_pnt inCenter);
1525 
1528  void set_radius(double inRadius);
1530  double get_radius() const;
1531 };
1532 
1533 
1534 
1535 // new class Dtk_MeshPolyline
1539 
1541 {
1542 private:
1543  friend class Dtk_SmartPtr<Dtk_MeshPolyline>;
1544  Dtk_tab<Dtk_UInt32> points; // array of indice in vertex array from Dtk_MEsh of Polyline
1545  int TopoID;
1546 
1547 public:
1550  void AddVertex(const Dtk_UInt32 ind);
1552  int GetTopoID() { return (TopoID); };
1553  void SetTopoID(const int ival);
1554  Dtk_Size_t GetNbVertex() { return (points.size()); };
1555 
1556  //downcasting
1557  int DtkDynamicType(const int& inId);
1559 
1560 
1561 };
1562 
1564 
1565 
1566 
1567 
1568 #endif
Dtk_mesh_face::get_nbtriangle_fans
Dtk_Size_t get_nbtriangle_fans() const
Get the number of triangle fans kept in the class instance.
Dtk_mesh::has_colors
Dtk_bool has_colors()
Return true if the current vertex format includes color (RGB)
Dtk_mesh_curve::set_type
void set_type(int inType)
Set the curve type.
Dtk_mesh_curve::set_linetype
void set_linetype(int inLineType)
Set line type in Dtk_mesh_curve.
Dtk_mesh::set_vertex
int set_vertex(Dtk_Size_t inPos, const Dtk_pnt *inVertex, const Dtk_dir *inNormal=NULL, const Dtk_RGB *inColor=NULL, Dtk_Float32 inU=0., Dtk_Float32 inV=0., Dtk_Float32 inUBrep=0., Dtk_Float32 inVBrep=0.)
Set a vertex.
Dtk_mesh::get_id
int get_id()
Return the mesh id.
Dtk_mesh_vertex_norm::SetNormal
Dtk_Int32 SetNormal(const Dtk_dir &)
Dtk_mesh_vertex::GetNormal
virtual Dtk_dir GetNormal() const
Dtk_mesh_vertex
For internal use.
Definition: util_mesh_dtk.hpp:799
DTK_FACET_TYPE
DTK_FACET_TYPE
Definition: util_mesh_dtk.hpp:44
Dtk_MeshPolyline::DtkDynamicType
int DtkDynamicType(const int &inId)
Dtk_mesh_face::trifans
Dtk_tab< Dtk_tab< Dtk_UInt32 > > trifans
Definition: util_mesh_dtk.hpp:882
Dtk_mesh::check_params
Dtk_bool check_params(const Dtk_pnt *inVertex, const Dtk_dir *inNormal, const Dtk_RGB *inColor, Dtk_Float32 inU, Dtk_Float32 inV)
DTK_MESH_PLANE
@ DTK_MESH_PLANE
Definition: util_mesh_dtk.hpp:862
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_mesh_vertex::GetU
virtual Dtk_Float32 GetU() const
Dtk_mesh_vertex::SetV
virtual Dtk_Int32 SetV(Dtk_Float32)
Dtk_mesh_face::Create
static Dtk_mesh_facePtr Create(const Dtk_mesh_face &inToBeCopied)
Copy constructor.
Dtk_mesh::_typeID
@ _typeID
Definition: util_mesh_dtk.hpp:490
Dtk_mesh_face
This is a high level face class.
Definition: util_mesh_dtk.hpp:870
dtk_matrix.hpp
Dtk_mesh::Clone
virtual Dtk_Object * Clone()
Definition: util_mesh_dtk.hpp:521
Dtk_mesh::Store
Dtk_ErrorStatus Store(const Dtk_string &inFile, Dtk_Size_t inIo=1)
Dtk_mesh_face::Dtk_mesh_face
Dtk_mesh_face(Dtk_mesh *inMesh)
Constructor.
Dtk_mesh::compute_bb
int compute_bb(Dtk_pnt *min, Dtk_pnt *max)
Compute the mesh Bounding Box.
Dtk_mesh::_stream
Dtk_StreamPtr _stream
Definition: util_mesh_dtk.hpp:515
Dtk_mesh_face::get_mockup_indices
const Dtk_tab< Dtk_tab< Dtk_UInt32 > > * get_mockup_indices(Dtk_Size_t inI) const
Get inI-th mockup.
Dtk_mesh::get_Infos
const Dtk_InfoPtr & get_Infos()
Return DtkInfosPtr of this Dtk_Mesh may be NULL.
Dtk_mesh_face::add_polygon
int add_polygon(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one polygon.
dtk_dir.hpp
DTK_TYPE_MESH_FACE
@ DTK_TYPE_MESH_FACE
Definition: define.h:537
Dtk_mesh_face::compute_round_normals
int compute_round_normals()
Compute round normals from geometry.
Dtk_mesh_face::triangles
Dtk_tab< Dtk_UInt32 > triangles
Definition: util_mesh_dtk.hpp:879
DTK_TYPE_MESH
@ DTK_TYPE_MESH
Definition: define.h:477
Dtk_mesh_face::add_polygon
int add_polygon(const Dtk_tab< Dtk_UInt32 > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Add one polygon and the corresponding vertices.
Dtk_mesh::set_material
void set_material(Dtk_MaterialPtr inMat)
Set the material of the mesh.
Dtk_mesh_vertex_norm::Dtk_mesh_vertex_norm
Dtk_mesh_vertex_norm()
Dtk_Float32
float Dtk_Float32
Definition: define.h:700
Dtk_mesh::set_Infos
void set_Infos(const Dtk_InfoPtr &inDtkInfosPtr)
Set DtkInfosPtr of this Dtk_Mesh.
Dtk_mesh_face::add_triangles
int add_triangles(const Dtk_tab< Dtk_UInt32 > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Add one of multiple triangles and the corresponding vertices.
Dtk_mesh::get_normal
int get_normal(Dtk_Size_t inPos, Dtk_dir *outNormal, Dtk_mesh_face *inMeshFace=NULL)
Return a normal (if vertex format includes normal)
Dtk_MeshPolyline::Dtk_MeshPolyline
Dtk_MeshPolyline()
Dtk_mesh_face::tristrips
Dtk_tab< Dtk_tab< Dtk_UInt32 > > tristrips
Definition: util_mesh_dtk.hpp:881
Dtk_mesh::DtkDynamicType
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Dtk_mesh::ofsUVBrep
Dtk_Size_t ofsUVBrep
Definition: util_mesh_dtk.hpp:500
Dtk_mesh_face::get_face_color
Dtk_RGB get_face_color()
Return the RGB face color.
Dtk_mesh::get_normal
Dtk_dir get_normal(Dtk_Size_t inPos)
Return a vertex (2nd form of get_normal)
Dtk_mesh_face::_Store
Dtk_ErrorStatus _Store(void *)
Dtk_mesh_curve::get_thickness
float get_thickness()
Get thickness of Dtk_mesh_curve.
Dtk_mesh::compute_round_normals
int compute_round_normals()
Compute round normals from geometry.
Dtk_mesh_face::set_id
void set_id(int inId)
Set an Id to the face.
Dtk_mesh_face::set_face_type
void set_face_type(DTK_MESH_TYPE_FACE inType)
Set a face type.
Dtk_mesh_vertex_norm::GetNormal
Dtk_dir GetNormal() const
Dtk_mesh::get_nb_mesh_face
Dtk_Size_t get_nb_mesh_face() const
Return the faces array size.
Dtk_SmartPtr::IsNotNULL
Dtk_bool IsNotNULL() const
Definition: util_ptr_dtk.hpp:119
Dtk_mesh_vertex::SetRGB
virtual Dtk_Int32 SetRGB(const Dtk_RGB &)
Dtk_MeshPolyline::GetVertexInd
Dtk_UInt32 GetVertexInd(const Dtk_UInt32 ival)
DTK_MESH_OTHERSRF
@ DTK_MESH_OTHERSRF
Definition: util_mesh_dtk.hpp:862
Dtk_mesh_face::add_triangles
int add_triangles(const Dtk_UInt32 *inIndices, Dtk_Size_t nb)
Dtk_mesh_face::_typeID
@ _typeID
Definition: util_mesh_dtk.hpp:875
Dtk_mesh_vertex_norm_color_uv::GetV
Dtk_Float32 GetV() const
Dtk_mesh_face::get_polygon_indices
const Dtk_tab< Dtk_UInt32 > * get_polygon_indices(Dtk_Size_t inI) const
Get inI-th polygon.
Dtk_mesh::HasTextureValues
Dtk_bool HasTextureValues
Definition: util_mesh_dtk.hpp:494
Dtk_mesh_face::polygons
Dtk_tab< Dtk_tab< Dtk_UInt32 > > polygons
Definition: util_mesh_dtk.hpp:880
Dtk_mesh_face::GetSize
virtual Dtk_Size_t GetSize() const
Dtk_mesh_curve::transform2Cpy
Dtk_mesh_curve * transform2Cpy(Dtk_transfo *inMatrix)
Dtk_mesh_face::DtkDynamicType
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Dtk_mesh::back_face_culling
Dtk_bool back_face_culling
Definition: util_mesh_dtk.hpp:493
Dtk_mesh_curve::get_linetype
int get_linetype()
Get line type of Dtk_mesh_curve.
Dtk_mesh_face::explode
int explode(Dtk_bool ExplodeTristrips, Dtk_bool ExplodeTrifans, Dtk_bool ExplodePolygons, Dtk_bool ExplodeMockups)
Decompose complex geometry (triangle strips, fan, polygons) according to specified parameters into tr...
Dtk_mesh::Create
static Dtk_MeshPtr Create(int inVertex_format=1, Dtk_bool inBack_face_culling=true)
Constructor.
Dtk_mesh::DtkDynamicCast
static Dtk_mesh * DtkDynamicCast(Dtk_Object *s)
Performs a dynamic cast - doesn't need RTTI -.
Dtk_mesh::ofsRGB
Dtk_Size_t ofsRGB
Definition: util_mesh_dtk.hpp:500
Dtk_mesh_face::get_mockup_normal
Dtk_dir get_mockup_normal(Dtk_Size_t inI) const
Dtk_mesh_face::add_triangle_fan
int add_triangle_fan(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one triangle fan.
Dtk_mesh_face::points
Dtk_tab< Dtk_UInt32 > points
Definition: util_mesh_dtk.hpp:885
Dtk_mesh::is_backface_culled
Dtk_bool is_backface_culled()
Return the true of false if culled or not.
Dtk_mesh_face::Dtk_mesh_face
Dtk_mesh_face(const Dtk_mesh_face &inMeshface, Dtk_mesh *inMesh, Dtk_UInt32 shift=0)
Copy Constructor.
Dtk_UInt32
uint32_t Dtk_UInt32
Definition: define.h:688
Dtk_mesh::submeshes
Dtk_tab< Dtk_mesh_face * > submeshes
Definition: util_mesh_dtk.hpp:516
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_mesh_face::get_face_name
Dtk_string get_face_name()
Get a name for the face.
Dtk_mesh_face::get_triangle_fan_indices
const Dtk_tab< Dtk_UInt32 > * get_triangle_fan_indices(Dtk_Size_t inI) const
Get inI-th triangle fan.
Dtk_mesh_face::reduce
void reduce()
Reduce memory cost of the Dtk_mesh, to call after adding all geometry.
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:712
Dtk_mesh_face::set_mesh_circle_data
void set_mesh_circle_data(const Dtk_mesh_circle_data &inCircle)
Set a mesh_circle_data object to the face, in order to add circular datas (for cylinders)
Dtk_mesh::C_GetU
Dtk_Float32 C_GetU(Dtk_Size_t i) const
Dtk_mesh_circle_data::get_center
Dtk_pnt get_center() const
Return the circle/cylinder center.
Dtk_mesh_circle_data::get_radius
double get_radius() const
Return the circle/cylinder radius.
Dtk_mesh_face::get_polyline_indices
const Dtk_tab< Dtk_UInt32 > * get_polyline_indices(Dtk_Size_t inI) const
Get inI-th polygon.
Dtk_mesh_face::add_triangle_strip
int add_triangle_strip(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one triangle strip.
Dtk_mesh_vertex_norm_color::GetRGB
Dtk_RGB GetRGB() const
Dtk_mesh::mergemove
void mergemove(Dtk_SmartPtr< Dtk_mesh > &inmesh)
Dtk_mesh_face::mesh
Dtk_mesh * mesh
Definition: util_mesh_dtk.hpp:877
Dtk_mesh_vertex_norm_color::Dtk_mesh_vertex_norm_color
Dtk_mesh_vertex_norm_color()
Dtk_mesh_face::get_triangle_normal
Dtk_dir get_triangle_normal(Dtk_Size_t inI) const
Get the center normal of the inI-th triangle.
Dtk_mesh::has_normals
Dtk_bool has_normals()
Return true if the current vertex format includes normal.
Dtk_mesh::GetVTexture
Dtk_Float32 GetVTexture(Dtk_Size_t inPos) const
Dtk_mesh_curve::set_id
void set_id(unsigned long inID)
Set an ID to the curve.
Dtk_mesh_curve::add_vertex
void add_vertex(Dtk_pnt inVertex)
Add a vertex to the vertices array.
Dtk_mesh::Store
Dtk_ErrorStatus Store(FILE *inFile, Dtk_Size_t inIo=1)
dtk_val.hpp
Dtk_mesh_vertex::GetV
virtual Dtk_Float32 GetV() const
Dtk_mesh::C_ComputeOffsets
void C_ComputeOffsets()
DTK_MESH_XYZ
#define DTK_MESH_XYZ
Definition: util_mesh_dtk.hpp:30
Dtk_MeshPolyline::GetTopoID
int GetTopoID()
Definition: util_mesh_dtk.hpp:1552
Dtk_mesh_face::get_nb_vertices
Dtk_Size_t get_nb_vertices(int inOnce=1)
Compute the total number of vertices used in the face.
Dtk_mesh::vertex_format
int vertex_format
Definition: util_mesh_dtk.hpp:495
Dtk_mesh_face::compute_bb
int compute_bb(Dtk_pnt *min, Dtk_pnt *max)
Compute the mesh Bounding Box.
Dtk_mesh::set_texcoords
int set_texcoords(Dtk_Size_t inPos, Dtk_Float32 inU, Dtk_Float32 inV)
Set texture coords to a point (if vertex format includes tex coords)
DTK_FALSE
#define DTK_FALSE
Definition: define.h:728
Dtk_mesh_vertex_norm::transform
Dtk_Int32 transform(Dtk_transfo &)
Dtk_bool
char Dtk_bool
Definition: define.h:725
Dtk_mesh::merge
void merge(const Dtk_mesh *inMesh)
Merge another Dtk_mesh.
Dtk_mesh_vertex_norm_color_uv::SetU
Dtk_Int32 SetU(Dtk_Float32)
DTK_TYPE_MATERIAL
@ DTK_TYPE_MATERIAL
Definition: define.h:524
Dtk_mesh::SetStream
void SetStream(Dtk_StreamPtr inStream)
Dtk_mesh::add_vertex
int add_vertex(const Dtk_pnt *inVertex, const Dtk_dir *inNormal=NULL, const Dtk_RGB *inColor=NULL, Dtk_Float32 inU=0., Dtk_Float32 inV=0., Dtk_Float32 inUBrep=0., Dtk_Float32 inVBrep=0.)
Add a vertex to the mesh vertices list.
DTK_MESH_CYLINDER
@ DTK_MESH_CYLINDER
Definition: util_mesh_dtk.hpp:862
DTK_MESH_LINE
@ DTK_MESH_LINE
Definition: util_mesh_dtk.hpp:46
Dtk_mesh_face::get_nbmockups
Dtk_Size_t get_nbmockups() const
Get the number of mockups kept in the class instance.
Dtk_mesh::~Dtk_mesh
~Dtk_mesh()
Dtk_mesh::reducesubfaces
void reducesubfaces()
Merge subfaces that have the same properties.
Dtk_mesh_face::get_subinfo
Dtk_InfoPtr & get_subinfo(Dtk_Size_t inI)
Dtk_mesh::C_GetRGB
void C_GetRGB(Dtk_Size_t i, Dtk_RGB &out) const
Dtk_mesh::apply_render_infos
Dtk_bool apply_render_infos(Dtk_RenderInfosPtr)
Apply texture mapping to the mesh. It will modify points texture UV coordinates.
Dtk_mesh_face::reserve_polylines
void reserve_polylines(Dtk_Size_t nb)
Dtk_mesh::transform
int transform(Dtk_transfo *inMatrix)
Apply a transformation matrix to the Mesh.
Dtk_MeshPolyline::GetNbVertex
Dtk_Size_t GetNbVertex()
Definition: util_mesh_dtk.hpp:1554
Dtk_Double64
double Dtk_Double64
Definition: define.h:699
Dtk_MeshPolyline::~Dtk_MeshPolyline
virtual ~Dtk_MeshPolyline()
Dtk_mesh_face::subinfos
Dtk_tab< Dtk_InfoPtr > subinfos
Definition: util_mesh_dtk.hpp:886
Dtk_mesh_vertex::Dtk_mesh_vertex
Dtk_mesh_vertex(const Dtk_pnt *inVertex)
DTK_MOCKUP
@ DTK_MOCKUP
Definition: util_mesh_dtk.hpp:44
Dtk_mesh_face::get_nbpolylines
Dtk_Size_t get_nbpolylines() const
Get the number of polylines kept in the class instance.
Dtk_mesh::to_stl
int to_stl(Dtk_string inFilename, Dtk_bool inIsAciiMode=DTK_FALSE)
DTK_MESH_CIRCLE
@ DTK_MESH_CIRCLE
Definition: util_mesh_dtk.hpp:46
Dtk_mesh_curve::set_color
void set_color(int R, int G, int B)
Set a RGB color to the curve.
Dtk_mesh
This is a high level mesh class.
Definition: util_mesh_dtk.hpp:485
Dtk_mesh::reserve_submesh
void reserve_submesh(Dtk_Size_t nb)
Dtk_mesh_face::get_subinfo
const Dtk_InfoPtr & get_subinfo(Dtk_Size_t inI) const
Dtk_mesh::check_format
Dtk_bool check_format(int inFormat)
Checks The current vertex format of the Dtk_mesh object.
Dtk_mesh::explode
int explode(Dtk_bool ExplodeTristrips, Dtk_bool ExplodeTrifans, Dtk_bool ExplodePolygons, Dtk_bool ExplodeMockups)
Decompose complex geometry (triangle strips, fan, polygons) according to specified parameters into tr...
Dtk_mesh::get_mesh_faces
Dtk_tab< Dtk_mesh_face * > & get_mesh_faces()
Return the array of mesh faces.
Dtk_mesh_vertex::SetU
virtual Dtk_Int32 SetU(Dtk_Float32)
Dtk_Val
Definition: dtk_val.hpp:67
Dtk_mesh::get_type_detk
enum type_detk get_type_detk() const
Dtk_mesh_face::add_subinfo
int add_subinfo(Dtk_InfoPtr &ininf)
Dtk_mesh::get_mesh_color
Dtk_RGB get_mesh_color()
get color in Dtk_mesh
Dtk_Object::DtkDynamicCast
static Dtk_Object * DtkDynamicCast(Dtk_Object *s)
Dtk_mesh::C_SetRGB
void C_SetRGB(Dtk_Size_t i, const Dtk_RGB &out)
Dtk_mesh_curve
This is a high level curve class.
Definition: util_mesh_dtk.hpp:1400
dtk_pnt.hpp
Dtk_mesh::get_nb_vertices
Dtk_Size_t get_nb_vertices() const
Return the vertices array size.
dtk_picture.hpp
Dtk_mesh::GetVBrep
Dtk_Float32 GetVBrep(Dtk_Size_t inPos) const
Dtk_mesh_face::get_triangle_vertex
Dtk_pnt get_triangle_vertex(Dtk_Size_t inI, Dtk_Size_t inV) const
Get the V-th vertex of the inI-th triangle.
Dtk_mesh_face::polylines
Dtk_tab< Dtk_tab< Dtk_UInt32 > > polylines
Definition: util_mesh_dtk.hpp:884
Dtk_mesh_circle_data
This class gathers circle datas.
Definition: util_mesh_dtk.hpp:1503
Dtk_mesh_vertex_norm::normal
Dtk_Float32 normal[3]
Definition: util_mesh_dtk.hpp:823
Dtk_mesh_face::compute_bb_center
int compute_bb_center(Dtk_pnt *i)
Compute the mesh Bounding Box.
Dtk_mesh_face::mockup
Dtk_tab< Dtk_tab< Dtk_tab< Dtk_UInt32 > > > mockup
Definition: util_mesh_dtk.hpp:883
Dtk_mesh_face::add_mockup
int add_mockup(const Dtk_tab< Dtk_tab< Dtk_UInt32 > > *inIndices)
Add one mockup.
Dtk_picture
This class defines a picture.
Definition: dtk_picture.hpp:45
Dtk_mesh_curve::get_vertex
int get_vertex(Dtk_Size_t inIndice, Dtk_pnt *outVertex)
Get a vertex from the verxtex array.
Dtk_mesh_curve::get_indice
int get_indice(Dtk_Size_t inNum)
Get an indice from the indices array. Indices array size must be greater than inNum.
Dtk_mesh::operator=
Dtk_mesh & operator=(const Dtk_mesh &inMesh)
Dtk_mesh::ofsNRM
Dtk_Size_t ofsNRM
Definition: util_mesh_dtk.hpp:500
util_ent_dtk.hpp
Dtk_mesh_face::get_face_normal
Dtk_dir get_face_normal()
Some interfaces need to keep a normal for a specific type of face. Use this to retrieve a global face...
Dtk_mesh_face::get_face_icolor
int get_face_icolor()
Return the RGB face color (indice)
Dtk_mesh_vertex::~Dtk_mesh_vertex
virtual ~Dtk_mesh_vertex()
Dtk_mesh::mergemove
void mergemove(Dtk_mesh *inmesh)
Dtk_mesh::rescale_model
int rescale_model(float ratio)
Perform a scale of the model.
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:687
Dtk_mesh_circle_data::get_axis
Dtk_dir get_axis() const
Return the circle/cylinder axis.
Dtk_mesh_vertex_norm_color::Dtk_mesh_vertex_norm_color
Dtk_mesh_vertex_norm_color(const Dtk_pnt *inVertex, const Dtk_dir *inNorm, const Dtk_RGB *inRGB)
Dtk_mesh_face::set_face_normal
void set_face_normal(const Dtk_dir &)
Some interfaces need to keep a normal for a specific type of face. Use this to store a global face no...
Dtk_mesh_vertex::Dtk_mesh_vertex
Dtk_mesh_vertex()
Dtk_mesh::ofsUV
Dtk_Size_t ofsUV
Definition: util_mesh_dtk.hpp:500
Dtk_mesh_face::get_id
int get_id()
Return the face Id.
Dtk_mesh_vertex::vertex
Dtk_Float32 vertex[3]
Definition: util_mesh_dtk.hpp:801
Dtk_mesh_vertex_norm
Definition: util_mesh_dtk.hpp:821
Dtk_mesh::C_SetVertex
void C_SetVertex(Dtk_Size_t i, const Dtk_pnt &out)
Dtk_mesh::compute_bb_center
int compute_bb_center(Dtk_pnt *i)
Compute the mesh Bounding Box.
Dtk_mesh_face::get_triangle_indices
const Dtk_UInt32 * get_triangle_indices(Dtk_Size_t inI) const
Get pointer of triangle indices of i-th triangle.
Dtk_mesh::has_xyz
Dtk_bool has_xyz()
Return true if the current vertex format includes 3D coords (XYZ)
Dtk_mesh_vertex_norm_color_uv
Definition: util_mesh_dtk.hpp:846
Dtk_mesh::get_texcoords
int get_texcoords(Dtk_Size_t inPos, Dtk_Float32 *outU, Dtk_Float32 *outV)
Return texture coords (if vertex format includes tex coords)
Dtk_mesh_vertex::transform
virtual Dtk_Int32 transform(Dtk_transfo &)
Dtk_mesh_face::get_polygon_normal
Dtk_dir get_polygon_normal(Dtk_Size_t inI) const
Dtk_mesh_face::explode
int explode()
Decompose all complex geometry (triangle strips, fan, polygons) into triangles, and append it into th...
Dtk_MeshPolylinePtr
Dtk_SmartPtr< Dtk_MeshPolyline > Dtk_MeshPolylinePtr
Definition: util_mesh_dtk.hpp:1563
Dtk_MeshPolyline::AddVertex
void AddVertex(const Dtk_UInt32 ind)
Dtk_MeshPolyline::DtkDynamicCast
static Dtk_MeshPolyline * DtkDynamicCast(Dtk_Object *nObject)
Dtk_mesh_face::add_point
int add_point(Dtk_UInt32 inpnt)
Dtk_mesh_face::get_face_type
DTK_MESH_TYPE_FACE get_face_type()
Return the current face type.
Dtk_mesh_vertex_norm_color_uv::GetSize
Dtk_Size_t GetSize() const
Dtk_mesh::set_mesh_color
void set_mesh_color(const Dtk_RGB &inColor)
set color in Dtk_mesh
Dtk_mesh_circle_data::set_radius
void set_radius(double inRadius)
Used to set the circle/cylinder radius.
error_dtk.hpp
Dtk_mesh_face::add_triangle_strip
int add_triangle_strip(const Dtk_tab< Dtk_UInt32 > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Add one triangle strip and the corresponding vertices.
Dtk_mesh::sizeonevertex
Dtk_Size_t sizeonevertex
Definition: util_mesh_dtk.hpp:500
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
DTK_MESH_UNKNOWN_CRV_TYPE
@ DTK_MESH_UNKNOWN_CRV_TYPE
Definition: util_mesh_dtk.hpp:46
Dtk_mesh::reserve_vertex
int reserve_vertex(Dtk_Size_t nb)
Dtk_mesh_face::get_point_indice
Dtk_UInt32 get_point_indice(Dtk_Size_t inI) const
Dtk_matrix
Definition: dtk_matrix.hpp:8
Dtk_mesh_face::info
const Dtk_InfoPtr & info() const
acces to class info of mesh_face
Dtk_mesh_vertex::SetNormal
virtual Dtk_Int32 SetNormal(const Dtk_dir &)
DTK_UNKNOWN_FACET
@ DTK_UNKNOWN_FACET
Definition: util_mesh_dtk.hpp:44
Dtk_mesh::id
int id
Definition: util_mesh_dtk.hpp:492
Dtk_mesh::change_vertex_format
int change_vertex_format(int inVertex_format)
Change Vertex format, check constructor comment to see options.
Dtk_mesh::get_color
int get_color(Dtk_Size_t inPos, Dtk_RGB *outColor)
Return a color (if vertex format includes color)
Dtk_mesh::GetSize
Dtk_Size_t GetSize() const
Dtk_SmartPtr< Dtk_material >
Dtk_mesh_vertex::GetRGB
virtual Dtk_RGB GetRGB() const
Dtk_mesh::get_mesh_face
Dtk_mesh_face * get_mesh_face(Dtk_Size_t inPos)
Return a face.
Dtk_mesh::set_normal
int set_normal(Dtk_Size_t inPos, const Dtk_dir *inNormal)
Set a normal to a point (if vertex format includes normal)
Dtk_mesh_face::get_nbpoints
Dtk_Size_t get_nbpoints() const
DTK_MESH_UNKNOWN_TYPE_FACE
@ DTK_MESH_UNKNOWN_TYPE_FACE
Definition: util_mesh_dtk.hpp:862
A
</td ></tr >< tr >< td width="33%"> Translucency</td >< td width="45%"> Alpha A() into Dtk_RGB</td >< td width
Dtk_mesh_face::get_nb_facets
Dtk_Size_t get_nb_facets()
Compute all facets (triangles) holded by the class, including trianglestrips, fans,...
Dtk_mesh_face::get_nbsubinfos
Dtk_Size_t get_nbsubinfos() const
Dtk_mesh_face::set_face_icolor
void set_face_icolor(int inColor)
Set a color to the face (indexed). Sometimes, one needs to set a color to a face, not the vertices.
Dtk_mesh_face::add_mockups
int add_mockups(const Dtk_tab< Dtk_tab< Dtk_tab< Dtk_UInt32 > > > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Dtk_mesh::merge
void merge(const Dtk_SmartPtr< Dtk_mesh > &inMesh)
Dtk_mesh_face::_infos
Dtk_InfoPtr _infos
Definition: util_mesh_dtk.hpp:888
Dtk_mesh_vertex::SetVertex
virtual Dtk_Int32 SetVertex(const Dtk_pnt &)
Dtk_MeshPtr
Dtk_SmartPtr< Dtk_mesh > Dtk_MeshPtr
Definition: util_mesh_dtk.hpp:25
dtk_transfo.hpp
Dtk_mesh::Dtk_mesh
Dtk_mesh(int inVertex_format=1, Dtk_bool inBack_face_culling=true)
Dtk_mesh_face::reserve_triangle_strip
int reserve_triangle_strip(Dtk_Size_t nb)
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
type_detk
type_detk
Definition: define.h:32
Dtk_mesh_circle_data::set_center
void set_center(Dtk_pnt inCenter)
Used to set the circle/cylinder center.
Dtk_mesh::ofsVTX
Dtk_Size_t ofsVTX
Definition: util_mesh_dtk.hpp:500
Dtk_mesh::Transform
Dtk_ErrorStatus Transform(const Dtk_transfo &)
Dtk_mesh_curve::pop_indice
int pop_indice()
Pop the last indice from the indices array.
util_stl_dtk.hpp
Dtk_mesh::mergemove
void mergemove(Dtk_tab< Dtk_MeshPtr > &inArraymesh)
Dtk_mesh::clean_up
void clean_up()
Dtk_mesh_facePtr
Dtk_SmartPtr< Dtk_mesh_face > Dtk_mesh_facePtr
Definition: util_mesh_dtk.hpp:26
Dtk_mesh_curve::get_type
int get_type()
Return the curve type.
Dtk_mesh_face::get_nbtriangles
Dtk_Size_t get_nbtriangles() const
Get the number of simple triangles kept in the class instance.
Dtk_mesh::GetUTexture
Dtk_Float32 GetUTexture(Dtk_Size_t inPos) const
Dtk_mesh::GetUBrep
Dtk_Float32 GetUBrep(Dtk_Size_t inPos) const
util_ptr_dtk.hpp
Dtk_mesh_circle_data::~Dtk_mesh_circle_data
~Dtk_mesh_circle_data()
Default destructor.
Dtk_mesh::makestrips
int makestrips()
Assemble all simple triangle, try to make triange-strips.
define.h
Dtk_mesh_curve::get_mesh_circle_data
Dtk_mesh_circle_data * get_mesh_circle_data()
Dtk_mesh_face::DtkDynamicCast
static Dtk_mesh_face * DtkDynamicCast(Dtk_Object *s)
Performs a dynamic cast - doesn't need RTTI -.
Dtk_mesh::reduce
void reduce()
Reduce memory cost of the Dtk_mesh, to call after adding all geometry.
Dtk_mesh::get_nb_facets
Dtk_Size_t get_nb_facets()
Return total number of facets.
Dtk_mesh_vertex::GetSize
virtual Dtk_Size_t GetSize() const
Dtk_mesh_curve::set_mesh_circle_data
void set_mesh_circle_data(Dtk_mesh_circle_data *inCircle)
Set a mesh_circle_data object to the face, in order to add circular datas (for circles)
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
DTK_MESH_CRV_TYPE
DTK_MESH_CRV_TYPE
Definition: util_mesh_dtk.hpp:46
Dtk_mesh::set_id
void set_id(int inId)
Set an id to the mesh.
Dtk_mesh::C_GetNormal
void C_GetNormal(Dtk_Size_t i, Dtk_dir &out) const
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:502
Dtk_mesh_vertex_norm_color::GetSize
Dtk_Size_t GetSize() const
Dtk_mesh_face::get_nbpolygons
Dtk_Size_t get_nbpolygons() const
Get the number of polygons kept in the class instance.
Dtk_mesh_face::get_mesh_circle_data
Dtk_mesh_circle_data get_mesh_circle_data()
Return the mesh_circle_data of the current face. If it doesn't exist, NULL is returned.
DTK_TRIANGLE_STRIP
@ DTK_TRIANGLE_STRIP
Definition: util_mesh_dtk.hpp:44
Dtk_mesh_curve::add_indice
void add_indice(int inIndice)
Add an indexed vertex to the curve (indice to an external vertices array, like the one inside Dtk_mes...
Dtk_mesh::explode
int explode()
Decompose all complex geometry (triangle strips, fan, polygons) into triangles, and append it into th...
Dtk_mesh_vertex_norm_color_uv::Dtk_mesh_vertex_norm_color_uv
Dtk_mesh_vertex_norm_color_uv()
Dtk_mesh_curve::Dtk_mesh_curve
Dtk_mesh_curve()
Default constructor.
Dtk_MeshPolyline::SetTopoID
void SetTopoID(const int ival)
Dtk_mesh_vertex_norm_color::SetRGB
Dtk_Int32 SetRGB(const Dtk_RGB &)
Dtk_mesh::Dtk_mesh
Dtk_mesh(const Dtk_mesh &inMesh)
Dtk_mesh::transform
int transform(Dtk_matrix *inMatrix)
Apply a transformation matrix to the Mesh (Deprecated method)
Dtk_mesh_curve::get_nb_vertices
Dtk_Size_t get_nb_vertices()
Return the vertices array size.
Dtk_mesh::C_GetVertex
void C_GetVertex(Dtk_Size_t i, Dtk_pnt &out) const
Dtk_mesh_face::merge
void merge(Dtk_mesh_face *inMeshface)
Merge a face into the current face.
DTK_MESH_TYPE_FACE
DTK_MESH_TYPE_FACE
Definition: util_mesh_dtk.hpp:862
DTK_MESH_OTHERCRV
@ DTK_MESH_OTHERCRV
Definition: util_mesh_dtk.hpp:46
Dtk_mesh_vertex_norm::GetSize
Dtk_Size_t GetSize() const
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_mesh::get_mesh_faces
Dtk_tab< Dtk_mesh_face * > const & get_mesh_faces() const
Dtk_mesh_face::get_nbtriangle_strips
Dtk_Size_t get_nbtriangle_strips() const
Get the number of triangle strips kept in the class instance.
Dtk_mesh_vertex_norm_color_uv::u
Dtk_Float32 u
Definition: util_mesh_dtk.hpp:848
Dtk_mesh_face::add_polyline
int add_polyline(const Dtk_tab< Dtk_UInt32 > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Add one polyline and the corresponding vertices.
Dtk_mesh::C_SetUVBrep
void C_SetUVBrep(Dtk_Size_t i, Dtk_Float32 u, Dtk_Float32 v)
DTK_TRIANGLE_FAN
@ DTK_TRIANGLE_FAN
Definition: util_mesh_dtk.hpp:44
Dtk_Object
Definition: dtk_object.hpp:8
Dtk_mesh::get_vertex
int get_vertex(Dtk_Size_t inPos, Dtk_pnt *outVertex)
Return a vertex.
Dtk_mesh_curve::set_thickness
void set_thickness(float inThickness)
Set thickness in Dtk_mesh_curve.
Dtk_mesh_face::~Dtk_mesh_face
~Dtk_mesh_face()
Destructor.
dtk_string.hpp
Dtk_mesh_vertex_norm_color::color
Dtk_RGB color
Definition: util_mesh_dtk.hpp:836
Dtk_mesh_face::set_face_name
void set_face_name(const Dtk_string &inName)
Set a name for the face.
Dtk_mesh_circle_data::set_axis
void set_axis(Dtk_dir inAxis)
Used to set the circle/cylinder axis.
Dtk_tab::at
T & at(Dtk_Size_t k)
Definition: util_stl_dtk.hpp:396
Dtk_mesh::C_SetNormal
void C_SetNormal(Dtk_Size_t i, const Dtk_dir &out)
Dtk_tab::push_back
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:415
Dtk_mesh_face::info
Dtk_InfoPtr & info()
acces to class info of mesh_face
Dtk_mesh_face::add_triangle_fan
int add_triangle_fan(const Dtk_tab< Dtk_UInt32 > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Add one triangle fan and the corresponding vertices.
Dtk_mesh::C_GetVBrep
Dtk_Float32 C_GetVBrep(Dtk_Size_t i) const
Dtk_mesh_vertex_norm_color_uv::SetV
Dtk_Int32 SetV(Dtk_Float32)
Dtk_mesh_face::add_mockup
int add_mockup(const Dtk_tab< Dtk_tab< Dtk_UInt32 > > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Add one polygon and the corresponding vertices.
Dtk_mesh_vertex_norm_color_uv::v
Dtk_Float32 v
Definition: util_mesh_dtk.hpp:848
Dtk_mesh_curve::~Dtk_mesh_curve
~Dtk_mesh_curve()
Default destructor.
Dtk_mesh_vertex::GetVertex
virtual Dtk_pnt GetVertex() const
Dtk_tab::clear
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:351
Dtk_mesh_face::reverse_triangle
void reverse_triangle(Dtk_Size_t inI)
Reverse the i-th triangle of the set of triangle, so that the normal will be inversed.
Dtk_mesh::get_mesh_face_array
Dtk_tab< Dtk_mesh_face * > & get_mesh_face_array()
Get a reference to the mesh face array // DEPRECATED, UNSAFE.
Dtk_mesh_face::makestrips
int makestrips()
Dtk_mesh::Create
static Dtk_MeshPtr Create(const Dtk_mesh &inToBeCopied)
Copy constructor.
dtk_rgb.hpp
Dtk_RGB
Definition: dtk_rgb.hpp:7
Dtk_mesh::set_color
int set_color(Dtk_Size_t inPos, const Dtk_RGB *inColor)
Set a color to a point (if vertex format includes color)
Dtk_mesh_vertex_norm::Dtk_mesh_vertex_norm
Dtk_mesh_vertex_norm(const Dtk_pnt *inVertex, const Dtk_dir *inNorm)
Dtk_mesh_face::add_points
int add_points(const Dtk_tab< Dtk_UInt32 > *inIndices, const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals=NULL, const Dtk_tab< Dtk_RGB > *inColors=NULL, const Dtk_tab< Dtk_Float32 > *inU=NULL, const Dtk_tab< Dtk_Float32 > *inV=NULL)
Dtk_mesh_face::get_mesh
Dtk_mesh * get_mesh()
Dtk_mesh_face::get_triangle_strip_indices
const Dtk_tab< Dtk_UInt32 > * get_triangle_strip_indices(Dtk_Size_t inI) const
Get inI-th triangle strip.
DTK_TRIANGLES
@ DTK_TRIANGLES
Definition: util_mesh_dtk.hpp:44
Dtk_MeshPolyline
This is the Polyline in Mesh mode.
Definition: util_mesh_dtk.hpp:1541
Dtk_mesh_curve::set_crv_type
void set_crv_type(DTK_MESH_CRV_TYPE type)
Set the curve nature.
Dtk_mesh_face::set_face_color
void set_face_color(const Dtk_RGB &inColor)
Set a color to the face. Sometimes, one needs to set a color to a face, not the vertices.
Dtk_mesh::C_GetV
Dtk_Float32 C_GetV(Dtk_Size_t i) const
Dtk_mesh::add_mesh_face
int add_mesh_face(Dtk_mesh_face *inMesh_face)
Add a face (Dtk_mesh_face) to the mesh.
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
DTK_POLYGONS
@ DTK_POLYGONS
Definition: util_mesh_dtk.hpp:44
Dtk_mesh_curve::pop_vertex
int pop_vertex(Dtk_pnt *)
Pop the last vertex from the vertices array.
Dtk_mesh_face::add_polyline
int add_polyline(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one polyline.
Dtk_mesh_curve::get_id
unsigned long get_id()
Return the ID of the curve.
Dtk_mesh::cvertices
Dtk_tab< Dtk_UChar8 > cvertices
Definition: util_mesh_dtk.hpp:499
Dtk_mesh_circle_data::Dtk_mesh_circle_data
Dtk_mesh_circle_data()
Default constructor.
Dtk_mesh_face::add_points
int add_points(const Dtk_tab< Dtk_UInt32 > *pnts)
dtk_object.hpp
Dtk_MaterialPtr
Dtk_SmartPtr< Dtk_material > Dtk_MaterialPtr
Definition: util_mesh_dtk.hpp:23
Dtk_mesh::check_params
Dtk_bool check_params(const Dtk_tab< Dtk_pnt > *inVertices, const Dtk_tab< Dtk_dir > *inNormals, const Dtk_tab< Dtk_RGB > *inColors, const Dtk_tab< Dtk_Float32 > *inU, const Dtk_tab< Dtk_Float32 > *inV)
Dtk_mesh_curve::get_color
Dtk_RGB get_color()
Return the curve color.
Dtk_mesh_vertex_norm_color_uv::GetU
Dtk_Float32 GetU() const
Dtk_mesh_face::add_triangles
int add_triangles(Dtk_tab< Dtk_UInt32 > *inIndices)
Add one of multiple triangles.
Dtk_mesh::get_vertex
Dtk_pnt get_vertex(Dtk_Size_t inPos)
Return a vertex (2nd form of get_vertex)
Dtk_mesh::get_material
Dtk_MaterialPtr get_material()
Get the material of the mesh.
Dtk_mesh::has_texcoords
Dtk_bool has_texcoords()
Return true if the current vertex format includes texture coords (UVTEXTURES)
Dtk_mesh_curve::get_crv_type
DTK_MESH_CRV_TYPE get_crv_type()
Return the curve nature.
Dtk_mesh::transform2Cpy
Dtk_mesh * transform2Cpy(Dtk_transfo *inMatrix)
Make a copy of the current mesh, applying a transformation on it.
Dtk_mesh::C_GetUBrep
Dtk_Float32 C_GetUBrep(Dtk_Size_t i) const
Dtk_mesh_vertex_norm_color
Definition: util_mesh_dtk.hpp:834
Dtk_mesh::C_SetUV
void C_SetUV(Dtk_Size_t i, Dtk_Float32 u, Dtk_Float32 v)
Dtk_Entity
Definition: util_ent_dtk.hpp:329
Dtk_mesh::GetStream
Dtk_StreamPtr GetStream() const
Dtk_mesh_curve::get_nb_indices
Dtk_Size_t get_nb_indices()
Return the indices array size.
Dtk_mesh_vertex_norm_color_uv::Dtk_mesh_vertex_norm_color_uv
Dtk_mesh_vertex_norm_color_uv(const Dtk_pnt *inVertex, const Dtk_dir *inNorm, const Dtk_RGB *inRGB, Dtk_Float32 inU, Dtk_Float32 inV)