![Logo](tetiere_ht.jpg) |
DATAKIT API
V2025.1
|
|
Go to the documentation of this file.
2 #ifndef _UTIL_MESH_DTK_HPP_
3 #define _UTIL_MESH_DTK_HPP_
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
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
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
56 struct Dtk_bounding_box
63 typedef Dtk_bounding_box dtk_mesh_face_bb;
67 typedef Dtk_bounding_box dtk_mesh_body_bb;
70 typedef Dtk_bounding_box dtk_mesh_all_bodies_bb;
72 typedef Dtk_bounding_box dtk_mesh_crv_bb;
74 typedef Dtk_bounding_box dtk_mesh_all_crvs_bb;
77 class Dtk_material_value
82 void _Copy(
const Dtk_material_value & s)
84 NameProperties = s.NameProperties;
85 for(
Dtk_Size_t i=0;i<s.PropertiesValue.size();i++)
90 Dtk_material_value(
void )
103 void _Copy(
const Dtk_rendering * s)
110 Dtk_material_value material_value;
111 material_value._Copy(s->value.at(i));
116 Dtk_rendering(
void )
136 void _Copy(
const Dtk_drw * s)
141 picturename = s->picturename;
145 picture->_Copy(s->picture);
149 Dtk_material_value material_value;
150 material_value._Copy(s->value.at(i));
175 void _Copy(
const Dtk_drafting * s)
182 Dtk_drw * curDrw =
new Dtk_drw();
183 curDrw->_Copy(s->drw.at(i));
188 Dtk_material_value material_value;
189 material_value._Copy(s->value.at(i));
218 void _Copy(
const Dtk_analysis * s)
225 Dtk_material_value material_value;
226 material_value._Copy(s->value.at(i));
239 Dtk_material_value val = value.
at(i);
240 val.PropertiesValue.clear();
252 void _Copy(
const Dtk_composites * s)
259 Dtk_material_value material_value;
260 material_value._Copy(s->value.at(i));
265 Dtk_composites(
void )
282 void _Copy(
const Dtk_positioned * s)
289 Dtk_material_value material_value;
290 material_value._Copy(s->value.at(i));
295 matrix =
new Dtk_transfo(s->matrix->getXdir(), s->matrix->getYdir(), s->matrix->getZdir(), s->matrix->getOrigin(), s->matrix->getScale());
299 Dtk_positioned(
void )
347 Dtk_rendering * rendering;
348 Dtk_drafting * drafting;
349 Dtk_analysis * analysis;
350 Dtk_composites * composites;
351 Dtk_positioned * positioned;
360 return Dtk_material::DtkDynamicType(inId);
366 return static_cast<Dtk_material *
>(s);
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;
391 picture->_Copy(s->picture);
395 rendering =
new Dtk_rendering();
396 rendering->_Copy(s->rendering);
400 drafting =
new Dtk_drafting();
401 drafting->_Copy(s->drafting);
405 analysis =
new Dtk_analysis();
406 analysis->_Copy(s->analysis);
410 composites =
new Dtk_composites();
411 composites->_Copy(s->composites);
415 positioned =
new Dtk_positioned();
416 positioned->_Copy(s->positioned);
442 _identifier_library = 0;
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; }
496 #ifdef NOCOMPRESSEDVERTICES
897 int _finddoublonstriangles();
Dtk_Size_t get_nbtriangle_fans() const
Get the number of triangle fans kept in the class instance.
Dtk_bool has_colors()
Return true if the current vertex format includes color (RGB)
void set_type(int inType)
Set the curve type.
void set_linetype(int inLineType)
Set line type in Dtk_mesh_curve.
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.
int get_id()
Return the mesh id.
Dtk_Int32 SetNormal(const Dtk_dir &)
virtual Dtk_dir GetNormal() const
For internal use.
Definition: util_mesh_dtk.hpp:799
DTK_FACET_TYPE
Definition: util_mesh_dtk.hpp:44
int DtkDynamicType(const int &inId)
Dtk_tab< Dtk_tab< Dtk_UInt32 > > trifans
Definition: util_mesh_dtk.hpp:882
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
Definition: util_mesh_dtk.hpp:862
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
virtual Dtk_Float32 GetU() const
virtual Dtk_Int32 SetV(Dtk_Float32)
static Dtk_mesh_facePtr Create(const Dtk_mesh_face &inToBeCopied)
Copy constructor.
@ _typeID
Definition: util_mesh_dtk.hpp:490
This is a high level face class.
Definition: util_mesh_dtk.hpp:870
virtual Dtk_Object * Clone()
Definition: util_mesh_dtk.hpp:521
Dtk_ErrorStatus Store(const Dtk_string &inFile, Dtk_Size_t inIo=1)
Dtk_mesh_face(Dtk_mesh *inMesh)
Constructor.
int compute_bb(Dtk_pnt *min, Dtk_pnt *max)
Compute the mesh Bounding Box.
Dtk_StreamPtr _stream
Definition: util_mesh_dtk.hpp:515
const Dtk_tab< Dtk_tab< Dtk_UInt32 > > * get_mockup_indices(Dtk_Size_t inI) const
Get inI-th mockup.
const Dtk_InfoPtr & get_Infos()
Return DtkInfosPtr of this Dtk_Mesh may be NULL.
int add_polygon(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one polygon.
@ DTK_TYPE_MESH_FACE
Definition: define.h:537
int compute_round_normals()
Compute round normals from geometry.
Dtk_tab< Dtk_UInt32 > triangles
Definition: util_mesh_dtk.hpp:879
@ DTK_TYPE_MESH
Definition: define.h:477
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.
void set_material(Dtk_MaterialPtr inMat)
Set the material of the mesh.
float Dtk_Float32
Definition: define.h:700
void set_Infos(const Dtk_InfoPtr &inDtkInfosPtr)
Set DtkInfosPtr of this Dtk_Mesh.
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.
int get_normal(Dtk_Size_t inPos, Dtk_dir *outNormal, Dtk_mesh_face *inMeshFace=NULL)
Return a normal (if vertex format includes normal)
Dtk_tab< Dtk_tab< Dtk_UInt32 > > tristrips
Definition: util_mesh_dtk.hpp:881
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Dtk_Size_t ofsUVBrep
Definition: util_mesh_dtk.hpp:500
Dtk_RGB get_face_color()
Return the RGB face color.
Dtk_dir get_normal(Dtk_Size_t inPos)
Return a vertex (2nd form of get_normal)
Dtk_ErrorStatus _Store(void *)
float get_thickness()
Get thickness of Dtk_mesh_curve.
int compute_round_normals()
Compute round normals from geometry.
void set_id(int inId)
Set an Id to the face.
void set_face_type(DTK_MESH_TYPE_FACE inType)
Set a face type.
Dtk_dir GetNormal() const
Dtk_Size_t get_nb_mesh_face() const
Return the faces array size.
Dtk_bool IsNotNULL() const
Definition: util_ptr_dtk.hpp:119
virtual Dtk_Int32 SetRGB(const Dtk_RGB &)
Dtk_UInt32 GetVertexInd(const Dtk_UInt32 ival)
@ DTK_MESH_OTHERSRF
Definition: util_mesh_dtk.hpp:862
int add_triangles(const Dtk_UInt32 *inIndices, Dtk_Size_t nb)
@ _typeID
Definition: util_mesh_dtk.hpp:875
const Dtk_tab< Dtk_UInt32 > * get_polygon_indices(Dtk_Size_t inI) const
Get inI-th polygon.
Dtk_bool HasTextureValues
Definition: util_mesh_dtk.hpp:494
Dtk_tab< Dtk_tab< Dtk_UInt32 > > polygons
Definition: util_mesh_dtk.hpp:880
virtual Dtk_Size_t GetSize() const
Dtk_mesh_curve * transform2Cpy(Dtk_transfo *inMatrix)
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Dtk_bool back_face_culling
Definition: util_mesh_dtk.hpp:493
int get_linetype()
Get line type of Dtk_mesh_curve.
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...
static Dtk_MeshPtr Create(int inVertex_format=1, Dtk_bool inBack_face_culling=true)
Constructor.
static Dtk_mesh * DtkDynamicCast(Dtk_Object *s)
Performs a dynamic cast - doesn't need RTTI -.
Dtk_Size_t ofsRGB
Definition: util_mesh_dtk.hpp:500
Dtk_dir get_mockup_normal(Dtk_Size_t inI) const
int add_triangle_fan(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one triangle fan.
Dtk_tab< Dtk_UInt32 > points
Definition: util_mesh_dtk.hpp:885
Dtk_bool is_backface_culled()
Return the true of false if culled or not.
Dtk_mesh_face(const Dtk_mesh_face &inMeshface, Dtk_mesh *inMesh, Dtk_UInt32 shift=0)
Copy Constructor.
uint32_t Dtk_UInt32
Definition: define.h:688
Dtk_tab< Dtk_mesh_face * > submeshes
Definition: util_mesh_dtk.hpp:516
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_string get_face_name()
Get a name for the face.
const Dtk_tab< Dtk_UInt32 > * get_triangle_fan_indices(Dtk_Size_t inI) const
Get inI-th triangle fan.
void reduce()
Reduce memory cost of the Dtk_mesh, to call after adding all geometry.
size_t Dtk_Size_t
Definition: define.h:712
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_Float32 C_GetU(Dtk_Size_t i) const
Dtk_pnt get_center() const
Return the circle/cylinder center.
double get_radius() const
Return the circle/cylinder radius.
const Dtk_tab< Dtk_UInt32 > * get_polyline_indices(Dtk_Size_t inI) const
Get inI-th polygon.
int add_triangle_strip(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one triangle strip.
void mergemove(Dtk_SmartPtr< Dtk_mesh > &inmesh)
Dtk_mesh * mesh
Definition: util_mesh_dtk.hpp:877
Dtk_mesh_vertex_norm_color()
Dtk_dir get_triangle_normal(Dtk_Size_t inI) const
Get the center normal of the inI-th triangle.
Dtk_bool has_normals()
Return true if the current vertex format includes normal.
Dtk_Float32 GetVTexture(Dtk_Size_t inPos) const
void set_id(unsigned long inID)
Set an ID to the curve.
void add_vertex(Dtk_pnt inVertex)
Add a vertex to the vertices array.
Dtk_ErrorStatus Store(FILE *inFile, Dtk_Size_t inIo=1)
virtual Dtk_Float32 GetV() const
#define DTK_MESH_XYZ
Definition: util_mesh_dtk.hpp:30
int GetTopoID()
Definition: util_mesh_dtk.hpp:1552
Dtk_Size_t get_nb_vertices(int inOnce=1)
Compute the total number of vertices used in the face.
int vertex_format
Definition: util_mesh_dtk.hpp:495
int compute_bb(Dtk_pnt *min, Dtk_pnt *max)
Compute the mesh Bounding Box.
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)
#define DTK_FALSE
Definition: define.h:728
Dtk_Int32 transform(Dtk_transfo &)
char Dtk_bool
Definition: define.h:725
void merge(const Dtk_mesh *inMesh)
Merge another Dtk_mesh.
Dtk_Int32 SetU(Dtk_Float32)
@ DTK_TYPE_MATERIAL
Definition: define.h:524
void SetStream(Dtk_StreamPtr inStream)
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
Definition: util_mesh_dtk.hpp:862
@ DTK_MESH_LINE
Definition: util_mesh_dtk.hpp:46
Dtk_Size_t get_nbmockups() const
Get the number of mockups kept in the class instance.
void reducesubfaces()
Merge subfaces that have the same properties.
Dtk_InfoPtr & get_subinfo(Dtk_Size_t inI)
void C_GetRGB(Dtk_Size_t i, Dtk_RGB &out) const
Dtk_bool apply_render_infos(Dtk_RenderInfosPtr)
Apply texture mapping to the mesh. It will modify points texture UV coordinates.
void reserve_polylines(Dtk_Size_t nb)
int transform(Dtk_transfo *inMatrix)
Apply a transformation matrix to the Mesh.
Dtk_Size_t GetNbVertex()
Definition: util_mesh_dtk.hpp:1554
double Dtk_Double64
Definition: define.h:699
virtual ~Dtk_MeshPolyline()
Dtk_tab< Dtk_InfoPtr > subinfos
Definition: util_mesh_dtk.hpp:886
Dtk_mesh_vertex(const Dtk_pnt *inVertex)
@ DTK_MOCKUP
Definition: util_mesh_dtk.hpp:44
Dtk_Size_t get_nbpolylines() const
Get the number of polylines kept in the class instance.
int to_stl(Dtk_string inFilename, Dtk_bool inIsAciiMode=DTK_FALSE)
@ DTK_MESH_CIRCLE
Definition: util_mesh_dtk.hpp:46
void set_color(int R, int G, int B)
Set a RGB color to the curve.
This is a high level mesh class.
Definition: util_mesh_dtk.hpp:485
void reserve_submesh(Dtk_Size_t nb)
const Dtk_InfoPtr & get_subinfo(Dtk_Size_t inI) const
Dtk_bool check_format(int inFormat)
Checks The current vertex format of the Dtk_mesh object.
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_tab< Dtk_mesh_face * > & get_mesh_faces()
Return the array of mesh faces.
virtual Dtk_Int32 SetU(Dtk_Float32)
Definition: dtk_val.hpp:67
enum type_detk get_type_detk() const
int add_subinfo(Dtk_InfoPtr &ininf)
Dtk_RGB get_mesh_color()
get color in Dtk_mesh
static Dtk_Object * DtkDynamicCast(Dtk_Object *s)
void C_SetRGB(Dtk_Size_t i, const Dtk_RGB &out)
This is a high level curve class.
Definition: util_mesh_dtk.hpp:1400
Dtk_Size_t get_nb_vertices() const
Return the vertices array size.
Dtk_Float32 GetVBrep(Dtk_Size_t inPos) const
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_tab< Dtk_tab< Dtk_UInt32 > > polylines
Definition: util_mesh_dtk.hpp:884
This class gathers circle datas.
Definition: util_mesh_dtk.hpp:1503
Dtk_Float32 normal[3]
Definition: util_mesh_dtk.hpp:823
int compute_bb_center(Dtk_pnt *i)
Compute the mesh Bounding Box.
Dtk_tab< Dtk_tab< Dtk_tab< Dtk_UInt32 > > > mockup
Definition: util_mesh_dtk.hpp:883
int add_mockup(const Dtk_tab< Dtk_tab< Dtk_UInt32 > > *inIndices)
Add one mockup.
This class defines a picture.
Definition: dtk_picture.hpp:45
int get_vertex(Dtk_Size_t inIndice, Dtk_pnt *outVertex)
Get a vertex from the verxtex array.
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=(const Dtk_mesh &inMesh)
Dtk_Size_t ofsNRM
Definition: util_mesh_dtk.hpp:500
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...
int get_face_icolor()
Return the RGB face color (indice)
virtual ~Dtk_mesh_vertex()
void mergemove(Dtk_mesh *inmesh)
int rescale_model(float ratio)
Perform a scale of the model.
int32_t Dtk_Int32
Definition: define.h:687
Dtk_dir get_axis() const
Return the circle/cylinder axis.
Dtk_mesh_vertex_norm_color(const Dtk_pnt *inVertex, const Dtk_dir *inNorm, const Dtk_RGB *inRGB)
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_Size_t ofsUV
Definition: util_mesh_dtk.hpp:500
int get_id()
Return the face Id.
Dtk_Float32 vertex[3]
Definition: util_mesh_dtk.hpp:801
Definition: util_mesh_dtk.hpp:821
void C_SetVertex(Dtk_Size_t i, const Dtk_pnt &out)
int compute_bb_center(Dtk_pnt *i)
Compute the mesh Bounding Box.
const Dtk_UInt32 * get_triangle_indices(Dtk_Size_t inI) const
Get pointer of triangle indices of i-th triangle.
Dtk_bool has_xyz()
Return true if the current vertex format includes 3D coords (XYZ)
Definition: util_mesh_dtk.hpp:846
int get_texcoords(Dtk_Size_t inPos, Dtk_Float32 *outU, Dtk_Float32 *outV)
Return texture coords (if vertex format includes tex coords)
virtual Dtk_Int32 transform(Dtk_transfo &)
Dtk_dir get_polygon_normal(Dtk_Size_t inI) const
int explode()
Decompose all complex geometry (triangle strips, fan, polygons) into triangles, and append it into th...
Dtk_SmartPtr< Dtk_MeshPolyline > Dtk_MeshPolylinePtr
Definition: util_mesh_dtk.hpp:1563
void AddVertex(const Dtk_UInt32 ind)
static Dtk_MeshPolyline * DtkDynamicCast(Dtk_Object *nObject)
int add_point(Dtk_UInt32 inpnt)
DTK_MESH_TYPE_FACE get_face_type()
Return the current face type.
Dtk_Size_t GetSize() const
void set_mesh_color(const Dtk_RGB &inColor)
set color in Dtk_mesh
void set_radius(double inRadius)
Used to set the circle/cylinder radius.
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_Size_t sizeonevertex
Definition: util_mesh_dtk.hpp:500
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
@ DTK_MESH_UNKNOWN_CRV_TYPE
Definition: util_mesh_dtk.hpp:46
int reserve_vertex(Dtk_Size_t nb)
Dtk_UInt32 get_point_indice(Dtk_Size_t inI) const
Definition: dtk_matrix.hpp:8
const Dtk_InfoPtr & info() const
acces to class info of mesh_face
virtual Dtk_Int32 SetNormal(const Dtk_dir &)
@ DTK_UNKNOWN_FACET
Definition: util_mesh_dtk.hpp:44
int id
Definition: util_mesh_dtk.hpp:492
int change_vertex_format(int inVertex_format)
Change Vertex format, check constructor comment to see options.
int get_color(Dtk_Size_t inPos, Dtk_RGB *outColor)
Return a color (if vertex format includes color)
Dtk_Size_t GetSize() const
virtual Dtk_RGB GetRGB() const
Dtk_mesh_face * get_mesh_face(Dtk_Size_t inPos)
Return a face.
int set_normal(Dtk_Size_t inPos, const Dtk_dir *inNormal)
Set a normal to a point (if vertex format includes normal)
Dtk_Size_t get_nbpoints() const
@ DTK_MESH_UNKNOWN_TYPE_FACE
Definition: util_mesh_dtk.hpp:862
</td ></tr >< tr >< td width="33%"> Translucency</td >< td width="45%"> Alpha A() into Dtk_RGB</td >< td width
Dtk_Size_t get_nb_facets()
Compute all facets (triangles) holded by the class, including trianglestrips, fans,...
Dtk_Size_t get_nbsubinfos() const
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.
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)
void merge(const Dtk_SmartPtr< Dtk_mesh > &inMesh)
Dtk_InfoPtr _infos
Definition: util_mesh_dtk.hpp:888
virtual Dtk_Int32 SetVertex(const Dtk_pnt &)
Dtk_SmartPtr< Dtk_mesh > Dtk_MeshPtr
Definition: util_mesh_dtk.hpp:25
Dtk_mesh(int inVertex_format=1, Dtk_bool inBack_face_culling=true)
int reserve_triangle_strip(Dtk_Size_t nb)
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
type_detk
Definition: define.h:32
void set_center(Dtk_pnt inCenter)
Used to set the circle/cylinder center.
Dtk_Size_t ofsVTX
Definition: util_mesh_dtk.hpp:500
Dtk_ErrorStatus Transform(const Dtk_transfo &)
int pop_indice()
Pop the last indice from the indices array.
void mergemove(Dtk_tab< Dtk_MeshPtr > &inArraymesh)
Dtk_SmartPtr< Dtk_mesh_face > Dtk_mesh_facePtr
Definition: util_mesh_dtk.hpp:26
int get_type()
Return the curve type.
Dtk_Size_t get_nbtriangles() const
Get the number of simple triangles kept in the class instance.
Dtk_Float32 GetUTexture(Dtk_Size_t inPos) const
Dtk_Float32 GetUBrep(Dtk_Size_t inPos) const
~Dtk_mesh_circle_data()
Default destructor.
int makestrips()
Assemble all simple triangle, try to make triange-strips.
Dtk_mesh_circle_data * get_mesh_circle_data()
static Dtk_mesh_face * DtkDynamicCast(Dtk_Object *s)
Performs a dynamic cast - doesn't need RTTI -.
void reduce()
Reduce memory cost of the Dtk_mesh, to call after adding all geometry.
Dtk_Size_t get_nb_facets()
Return total number of facets.
virtual Dtk_Size_t GetSize() const
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)
This is a high level array class.
Definition: util_stl_dtk.hpp:85
DTK_MESH_CRV_TYPE
Definition: util_mesh_dtk.hpp:46
void set_id(int inId)
Set an id to the mesh.
void C_GetNormal(Dtk_Size_t i, Dtk_dir &out) const
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:502
Dtk_Size_t GetSize() const
Dtk_Size_t get_nbpolygons() const
Get the number of polygons kept in the class instance.
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
Definition: util_mesh_dtk.hpp:44
void add_indice(int inIndice)
Add an indexed vertex to the curve (indice to an external vertices array, like the one inside Dtk_mes...
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_curve()
Default constructor.
void SetTopoID(const int ival)
Dtk_Int32 SetRGB(const Dtk_RGB &)
Dtk_mesh(const Dtk_mesh &inMesh)
int transform(Dtk_matrix *inMatrix)
Apply a transformation matrix to the Mesh (Deprecated method)
Dtk_Size_t get_nb_vertices()
Return the vertices array size.
void C_GetVertex(Dtk_Size_t i, Dtk_pnt &out) const
void merge(Dtk_mesh_face *inMeshface)
Merge a face into the current face.
DTK_MESH_TYPE_FACE
Definition: util_mesh_dtk.hpp:862
@ DTK_MESH_OTHERCRV
Definition: util_mesh_dtk.hpp:46
Dtk_Size_t GetSize() const
virtual int DtkDynamicType(const int &inId)=0
Dtk_tab< Dtk_mesh_face * > const & get_mesh_faces() const
Dtk_Size_t get_nbtriangle_strips() const
Get the number of triangle strips kept in the class instance.
Dtk_Float32 u
Definition: util_mesh_dtk.hpp:848
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.
void C_SetUVBrep(Dtk_Size_t i, Dtk_Float32 u, Dtk_Float32 v)
@ DTK_TRIANGLE_FAN
Definition: util_mesh_dtk.hpp:44
Definition: dtk_object.hpp:8
int get_vertex(Dtk_Size_t inPos, Dtk_pnt *outVertex)
Return a vertex.
void set_thickness(float inThickness)
Set thickness in Dtk_mesh_curve.
~Dtk_mesh_face()
Destructor.
Dtk_RGB color
Definition: util_mesh_dtk.hpp:836
void set_face_name(const Dtk_string &inName)
Set a name for the face.
void set_axis(Dtk_dir inAxis)
Used to set the circle/cylinder axis.
T & at(Dtk_Size_t k)
Definition: util_stl_dtk.hpp:396
void C_SetNormal(Dtk_Size_t i, const Dtk_dir &out)
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:415
Dtk_InfoPtr & info()
acces to class info of mesh_face
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_Float32 C_GetVBrep(Dtk_Size_t i) const
Dtk_Int32 SetV(Dtk_Float32)
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_Float32 v
Definition: util_mesh_dtk.hpp:848
~Dtk_mesh_curve()
Default destructor.
virtual Dtk_pnt GetVertex() const
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:351
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_tab< Dtk_mesh_face * > & get_mesh_face_array()
Get a reference to the mesh face array // DEPRECATED, UNSAFE.
static Dtk_MeshPtr Create(const Dtk_mesh &inToBeCopied)
Copy constructor.
Definition: dtk_rgb.hpp:7
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(const Dtk_pnt *inVertex, const Dtk_dir *inNorm)
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)
const Dtk_tab< Dtk_UInt32 > * get_triangle_strip_indices(Dtk_Size_t inI) const
Get inI-th triangle strip.
@ DTK_TRIANGLES
Definition: util_mesh_dtk.hpp:44
This is the Polyline in Mesh mode.
Definition: util_mesh_dtk.hpp:1541
void set_crv_type(DTK_MESH_CRV_TYPE type)
Set the curve nature.
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_Float32 C_GetV(Dtk_Size_t i) const
int add_mesh_face(Dtk_mesh_face *inMesh_face)
Add a face (Dtk_mesh_face) to the mesh.
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
@ DTK_POLYGONS
Definition: util_mesh_dtk.hpp:44
int pop_vertex(Dtk_pnt *)
Pop the last vertex from the vertices array.
int add_polyline(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one polyline.
unsigned long get_id()
Return the ID of the curve.
Dtk_tab< Dtk_UChar8 > cvertices
Definition: util_mesh_dtk.hpp:499
Dtk_mesh_circle_data()
Default constructor.
int add_points(const Dtk_tab< Dtk_UInt32 > *pnts)
Dtk_SmartPtr< Dtk_material > Dtk_MaterialPtr
Definition: util_mesh_dtk.hpp:23
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_RGB get_color()
Return the curve color.
int add_triangles(Dtk_tab< Dtk_UInt32 > *inIndices)
Add one of multiple triangles.
Dtk_pnt get_vertex(Dtk_Size_t inPos)
Return a vertex (2nd form of get_vertex)
Dtk_MaterialPtr get_material()
Get the material of the mesh.
Dtk_bool has_texcoords()
Return true if the current vertex format includes texture coords (UVTEXTURES)
DTK_MESH_CRV_TYPE get_crv_type()
Return the curve nature.
Dtk_mesh * transform2Cpy(Dtk_transfo *inMatrix)
Make a copy of the current mesh, applying a transformation on it.
Dtk_Float32 C_GetUBrep(Dtk_Size_t i) const
Definition: util_mesh_dtk.hpp:834
void C_SetUV(Dtk_Size_t i, Dtk_Float32 u, Dtk_Float32 v)
Definition: util_ent_dtk.hpp:329
Dtk_StreamPtr GetStream() const
Dtk_Size_t get_nb_indices()
Return the indices array size.
Dtk_mesh_vertex_norm_color_uv(const Dtk_pnt *inVertex, const Dtk_dir *inNorm, const Dtk_RGB *inRGB, Dtk_Float32 inU, Dtk_Float32 inV)