 |
DATAKIT API
V2025.4
|
|
◆ GetTesselationStatus()
| int GetTesselationStatus |
( |
| ) |
|
◆ WriteBody()
31 if (NodeInfiniteGeometry == 0)
59 static int numbrep = 0;
65 if (bodyname.
len() == 0)
69 if (bodyname.
len() == 0) bodyname =
"???";
72 std::cout <<
"Writing ToOpenCascade Body " << numbrep <<
" name: " << bodyname.
c_str() << std::endl;
80 BRepTools::Write(res, filebrep.
c_str());
90 TopoDS_Shape facewithid;
91 TmpBody->GetLump(0,
Lump);
94 Lump->GetVolume(0, Vol);
97 Vol->GetShell(0,
Shell);
98 if (
Shell.IsNotNULL())
100 Shell->GetFace(0, Face, orient);
103 Dtk_ID faceid = Face->get_info()->GetId();
104 Dtk_string SampleBrepFileForFace =
"facewithid";
105 SampleBrepFileForFace.
add_int(faceid);
106 SampleBrepFileForFace +=
".brep";
108 BRepTools::Write(facewithid, SampleBrepFileForFace.
c_str());
116 if (!facewithid.IsNull())
119 Dtk_EntityPtr CorrespondingFace = TmpBody->GetEntity(DatakitFaceID);
142 std::cout <<
"NodeName = " << inNode->
Name().
c_str() <<
";";
147 for (i = 0; i < nbmeshes; i++)
◆ WriteDtk_Mesh()
| void WriteDtk_Mesh |
( |
const Dtk_MeshPtr & |
inMeshToWrite | ) |
|
11 inMeshToWrite->explode();
25 Dtk_RGB rgb = inMeshToWrite->get_mesh_color();
28 Dtk_Size_t nbvertices = inMeshToWrite->get_nb_vertices();
30 for (i = 0; i < nbvertices; i++)
37 inMeshToWrite->get_vertex(i, &pnt);
38 if (inMeshToWrite->has_normals())
39 inMeshToWrite->get_normal(i, &dir);
40 if (inMeshToWrite->has_colors())
41 inMeshToWrite->get_color(i, &color);
42 if (inMeshToWrite->has_texcoords())
44 u = inMeshToWrite->GetUTexture(i);
45 v = inMeshToWrite->GetVTexture(i);
49 Dtk_Size_t k, m, nbmeshfaces = inMeshToWrite->get_nb_mesh_face();
50 for (i = 0; i < nbmeshfaces; i++)
55 for (j = 0; j < nbtriangles; j++)
58 trianglesindices[0] = tri[0];
59 trianglesindices[1] = tri[1];
60 trianglesindices[2] = tri[2];
66 for (j = 0; j < nbpolyline; j++)
71 for (k = 0; k < nbvertex; k++)
74 Dtk_pnt pt = inMeshToWrite->get_vertex(m);
◆ CurrentMatrix
uint32_t Dtk_ID
Definition: define.h:691
void PdfWriteEntity(Dtk_EntityPtr inEntity)
Definition: PdfWrite.cpp:177
This is a high level face class.
Definition: util_mesh_dtk.hpp:865
Dtk_string GetName() const
Retrieves the entity name.
int GetInfiniteGeometryFlag() const
void XmlWriteMesh(const Dtk_MeshPtr &inMeshToWrite)
Definition: XmlWrite.cpp:63
Dtk_bool IsNotNULL() const
Definition: util_ptr_dtk.hpp:119
Dtk_ErrorStatus ConvertBody(const Dtk_BodyPtr &inBody)
Convert a Dtk_Body to set of TopoDS_Shape representing all topological entities.
@ Shell
Definition: testcreatecube.cpp:18
#define DTK_TRUE
Definition: define.h:729
Class DKOC_Body2OCCBRep This class allow the conversion from a Dtk_BodyPtr to a set of TopoDS_Shape b...
Definition: DKOC_Body2OCCBRep.hpp:14
uint32_t Dtk_UInt32
Definition: define.h:690
This is a high level string class.
Definition: dtk_string.hpp:58
size_t Dtk_Size_t
Definition: define.h:714
const Dtk_tab< Dtk_UInt32 > * get_polyline_indices(Dtk_Size_t inI) const
Get inI-th polygon.
char Dtk_bool
Definition: define.h:727
Dtk_Size_t get_nbpolylines() const
Get the number of polylines kept in the class instance.
void add_int(const int integer, int force_unsigned_int=0)
concat an int to the Dtk_string (convert the int to Dtk_string)
int GetDtkID(const int inShapeID) const
Get Dtk_ID from a ShapeID.
const Dtk_string & Name() const
Retrieves the Dtk_DocElement Name - read only -.
void SetConfigShapeFix(const Dtk_bool inMode)
Option to activate ShapeFix or not (activated by default)
int32_t Dtk_Int32
Definition: define.h:689
int GetTesselationStatus()
Definition: TesselationEngine.cpp:8
const Dtk_UInt32 * get_triangle_indices(Dtk_Size_t inI) const
Get pointer of triangle indices of i-th triangle.
TopoDS_Shape ShapeFromDtkID(const int inDtkID) const
Get Shape with inDtkID stored in Dtk_Entity->getinfo()->GetID()
Dtk_InfoPtr GetInfos() const
Retrieves the Dtk_DocElement Dtk_InfoPtr - read only -.
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
void SetConfigKeepPcurves(const Dtk_bool inMode)
Option to keep existing pcurves or not (activated by default)
TopoDS_Shape GetMainShape() const
Get the highest level TopoDS_Shape shape.
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
Definition: util_ptr_dtk.hpp:37
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
const char * c_str() const
Retrieve the ASCII conversion string.
@ Lump
Definition: testcreatecube.cpp:16
void XmlWriteBody(const Dtk_BodyPtr &inBody)
Definition: XmlWrite.cpp:118
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
void WriteDtk_Mesh(const Dtk_MeshPtr &inMeshToWrite)
Definition: WriteMesh.cpp:8
Dtk_Size_t get_nbtriangles() const
Get the number of simple triangles kept in the class instance.
Dtk_MeshPtr GetDtk_MeshPtr()
Retrieves the Dtk_Node as a Dtk_meshPtr - if exists -.
Dtk_ErrorStatus tess_BodyToMeshes(const Dtk_BodyPtr &inBodyToWrite, Dtk_tab< Dtk_MeshPtr > &outMeshes, Dtk_tab< Dtk_Int32 > &outIsSolid, Dtk_bool inTessWireframe=DTK_FALSE, Dtk_bool inApplyRenderInfos=DTK_FALSE)
: Make Tesselation from a Dtk_body and create a Set of Dtk_mesh if available
int GetShapeID(const TopoDS_Shape &inShape) const
Get ID from Shape.
This is a high level array class.
Definition: util_stl_dtk.hpp:85
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:504
int TessStatus
Definition: TesselationEngine.cpp:6
Dtk_bool IsXmlDumpActivated()
Definition: XmlWrite.cpp:17
int len() const
Retrieve the length of the Dtk_string.
@ dtkNoError
Definition: error_dtk.hpp:144
Definition: dtk_rgb.hpp:7
Dtk_transfo CurrentMatrix
Definition: WritePrototype.cpp:11
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
Dtk_bool IsPdfDumpActivated()
Definition: PdfWrite.cpp:30
Dtk_BodyPtr GetDtk_BodyPtr()
Retrieves the Dtk_Node as a Dtk_BodyPtr - if exists -.