DATAKIT SDK  V2026.2
psw.hpp
Go to the documentation of this file.
1 /**********************************************************
2  PSW.HPP : DATAKIT PARASOLID WRITE
3 ***********************************************************/
4 //! \defgroup ps_write Parasolid Write Functions
5 //! \brief .
6 
7 
8 //! \ingroup ps_write
9 //! \brief Initialise a file to be written
10 //! \param [in] inFileOut : Parasolid (x_t or x_b) File to write
11 //! \param [in] muteMode : no log file used
12 //! \param [in] inVersion : vesion to write, default = 100 (= 10.0)
13 //! \return 0 if OK , -4 if licence checking has failed
14 DtkErrorStatus psw_InitFile( const Dtk_string& inFileOut, Dtk_bool muteMode, Dtk_Int32 inVersion = 180 );
15 DtkErrorStatus psw_InitFile( Dtk_tab<char>& outParasolidStream, Dtk_bool muteMode, Dtk_Int32 inVersion = 180 );
16 
17 //! \ingroup ps_write
18 //! \brief Ends the writing of the Parasolid (x_t or x_b) file
19 //! \param [in] inTabIds : the tab of body/assembly-entry written at level 0 if size > 1, a start list is created
20 //! \param [in] binForceListOfBody : if true, no assembly created default = false
21 //! \return 0 if OK
22 DtkErrorStatus psw_EndFile( Dtk_tab<Dtk_ID>& inTabIds, Dtk_bool binForceListOfBody = DTK_FALSE );
23 
24 //! \ingroup ps_write
25 //! \brief Writes a Body of a 3D part (3D content of a product), of any kind (solid, shell / faces, wireframe / points)
26 //! \param [in] inBody : the Body to be written
27 //! \return 0 if done, -1 if body is null or conversion failed
29 
30 //! \ingroup ps_write
31 //! \brief Writes a Body of a 3D part (3D content of a product), of any kind (solid, shell / faces, wireframe / points)
32 //! \param [in] inBody : the Body to be written
33 //! \param [in] writeMode : [0] = one body per closed shell and one body per open shell, [1] = separate all faces, [2] one body per closed shell and only one body for all the open shells (combined values possible)
34 //! \param [out] outTabIds : the tab of body-entry written
35 //! \return 0 if done, -1 if body is null or conversion failed
36 Dtk_ErrorStatus psw_WriteBody( Dtk_BodyPtr& inBody, Dtk_tab<Dtk_ID>& outTabIds, Dtk_Int32 writeMode = 0 );
37 
38 //! \ingroup ps_write
39 //! \brief Writes a Mesh of a 3D part
40 //! \param [in] inMesh : the Mesh to be written
41 //! \param [in] bExplode : if true 1 body written per face
42 //! \param [out] outTabIds : the tab of body-entry written
43 //! \return 0 if done, -1 if body is null or conversion failed
45 
46 
47 //! \ingroup ps_write
48 //! \brief Writes a list of Bodies of a 3D part (3D content of a product), of any kind (solid, shell / faces, wireframe / points) with sewing or not
49 //! \param [in] bodies : the list of Bodies to be written
50 //! \param [in] bSewing : a sewing action of the bodies is performed or not
51 //! \param [in] tolmin : the start tolerance used for the sewing process
52 //! \param [in] tolmax : the last tolerance used for the sewing process
53 //! \param [in] iterationNumber : the number of iteration between start and last tolerance for the sewing process
54 //! \param [out] outTabIds : the tab of body-entry written
55 //! \return 0 if done, -1 if body is null or conversion failed
56 DtkErrorStatus psw_WriteBody( Dtk_tab<Dtk_ID>& outTabIds, Dtk_tab<Dtk_BodyPtr>& bodies, Dtk_bool bSewing = DTK_TRUE, Dtk_Double64 tolmin = 0.01, Dtk_Double64 tolmax = 0.05, int iterationNumber = 3 );
57 
58 //! \ingroup ps_write
59 //! \brief Create the entry item of an assembly
60 //! \param [out] outAssemblyId : the assembly item - entry written
61 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
63 
64 //! \ingroup ps_write
65 //! \brief Create an Instance item of a part referenced by inIdPart
66 //! \param [in] inAssemblyId: id of the father assembly's item
67 //! \param [in] inIdPart: id of the part (body or assembly) referenced
68 //! \param [in] Matrix: matrix used to position the instance on the assembly
69 //! \param [out] outIdInst : the instance item - entry written
70 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
71 DtkErrorStatus psw_CreateInstance( Dtk_ID inAssemblyId, Dtk_ID inIdPart, Dtk_transfoPtr& Matrix, Dtk_ID& outIdInst );
72 
73 //! \ingroup ps_write
74 //! \brief Create all attribut attached to a component (body, assembly, instance)
75 //! \param [in] inIdCompo: id of the component item
76 //! \param [in] info: attributs defined on the Dtk_InfoPtr object
77 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
79 
80 //! \ingroup ps_write
81 //! \brief Update name attribute only (body, assembly, instance)
82 //! \param [in] inIdCompo: id of the component item
83 //! \param [in] info: attributes defined on the Dtk_InfoPtr object
84 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
86 
87 //! \ingroup ps_write
88 //! \brief set name attribute if not defined only (body, assembly, instance)
89 //! \param [in] inIdCompo: id of the component item
90 //! \param [in] info: attributes defined on the Dtk_InfoPtr object
91 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
93 
94 
95 //! \ingroup ps_write
96 //! \brief link all attributes attached to an assembly
97 //! \param [in] inAssemblyId : id of the assembly item
98 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
100 
101 //! \ingroup ps_write
102 //! \brief Create Coordinate System attribute attached to a point body (body with 1 point only)
103 //! \param [in] inIdCompo: id of the component item
104 //! \param [in] transfo: matrix used to define the 3 axis
105 //! \param [in] bCurrent: define if this axis is current or not
106 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
107 DtkErrorStatus psw_CreateCSysAttribut( Dtk_ID inIdCompo, const Dtk_transfo& transfo, Dtk_bool bCurrent );
108 
109 //! \ingroup ps_write
110 //! \brief Writes a Body defined by one point only
111 //! \param [in] point : the point
112 //! \param [out] outTabIds : the tab of body-entry written
113 //! \return 0 if done, -1 if body is null or conversion failed
115 
116 //! \ingroup ps_write
117 //! \brief set the current reader used on the writer activated
118 //! \param [in] readertype : the reader
119 //! \return 0 if done, -1 if no writer activated
121 
122 
123 
124 //! \ingroup ps_write
125 //! \brief Create all publication attributes attached to a component (body)
126 //! \param [in] inIdCompo: id of the component item
127 //! \param [in] publication: Dtk_string defined the name of publication
128 //! \return dtkNoError if OK, dtkErrorUserBreak in case of calling sequence error
130 
131 // How should we write faces ? combined status possible
132 // 0 No change
133 // 1 No topology saved, faces unsewed
134 // 2 all open shell saved in one body
135 void psw_SetWritingFacesMode( Dtk_Int32 inPreference );
136 
137 // How should we write mesh ?
138 // 0 No topology (default value)
139 // 1 with topology if exist
140 void psw_SetWritingMeshMode( Dtk_Int32 inPreference );
141 
142 // How should we write nonmanifold topology ?
143 // 0 manifold translation (default value)
144 // 1 conserve nonmanifold if exist
146 
147 // should we write read custom attributes ? (default TRUE) available only in case of Keep Kernel Data reading mode
148 void psw_SetWritingCustomAttributMode( Dtk_bool bWriteCustomAttribut );
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:681
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
psw_WriteMesh
Dtk_ErrorStatus psw_WriteMesh(Dtk_MeshPtr &inMesh, Dtk_tab< Dtk_ID > &outTabIds, Dtk_bool bExplode=DTK_FALSE)
Writes a Mesh of a 3D part.
psw_InitFile
DtkErrorStatus psw_InitFile(const Dtk_string &inFileOut, Dtk_bool muteMode, Dtk_Int32 inVersion=180)
Initialise a file to be written.
psw_SetWritingCustomAttributMode
void psw_SetWritingCustomAttributMode(Dtk_bool bWriteCustomAttribut)
DTK_TRUE
#define DTK_TRUE
Definition: define.h:719
psw_LinkAttribut
DtkErrorStatus psw_LinkAttribut(Dtk_ID inAssemblyId)
link all attributes attached to an assembly
psw_SetNoNamedAttribut
DtkErrorStatus psw_SetNoNamedAttribut(Dtk_ID inIdCompo, Dtk_InfoPtr &info)
set name attribute if not defined only (body, assembly, instance)
psw_CreateCSysAttribut
DtkErrorStatus psw_CreateCSysAttribut(Dtk_ID inIdCompo, const Dtk_transfo &transfo, Dtk_bool bCurrent)
Create Coordinate System attribute attached to a point body (body with 1 point only)
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
psw_WritePointBody
Dtk_ErrorStatus psw_WritePointBody(const Dtk_AxisSystemPtr &inObject, Dtk_tab< Dtk_ID > &outTabIds)
Writes a Body defined by one point only.
DTK_FALSE
#define DTK_FALSE
Definition: define.h:720
Dtk_bool
char Dtk_bool
Definition: define.h:717
psw_UpdateNameAttribut
DtkErrorStatus psw_UpdateNameAttribut(Dtk_ID inIdCompo, Dtk_InfoPtr &info)
Update name attribute only (body, assembly, instance)
DtkReaderType
DtkReaderType
Definition: dtk_maindoc.hpp:29
Dtk_Double64
double Dtk_Double64
Definition: define.h:691
psw_CreateAttribut
DtkErrorStatus psw_CreateAttribut(Dtk_ID inIdCompo, Dtk_InfoPtr &info)
Create all attribut attached to a component (body, assembly, instance)
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:679
psw_SetWritingMeshMode
void psw_SetWritingMeshMode(Dtk_Int32 inPreference)
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
psw_SetReaderType
Dtk_ErrorStatus psw_SetReaderType(DtkReaderType readertype)
set the current reader used on the writer activated
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
psw_CreateInstance
DtkErrorStatus psw_CreateInstance(Dtk_ID inAssemblyId, Dtk_ID inIdPart, Dtk_transfoPtr &Matrix, Dtk_ID &outIdInst)
Create an Instance item of a part referenced by inIdPart.
psw_WriteBody
Dtk_ErrorStatus psw_WriteBody(Dtk_BodyPtr &inBody)
Writes a Body of a 3D part (3D content of a product), of any kind (solid, shell / faces,...
Dtk_tab< char >
psw_SetPublicationAttribut
Dtk_ErrorStatus psw_SetPublicationAttribut(Dtk_ID inIdCompo, const Dtk_string &publication)
Create all publication attributes attached to a component (body)
psw_CreateEmptyAssembly
DtkErrorStatus psw_CreateEmptyAssembly(Dtk_ID &outAssemblyId)
Create the entry item of an assembly.
psw_EndFile
DtkErrorStatus psw_EndFile(Dtk_tab< Dtk_ID > &inTabIds, Dtk_bool binForceListOfBody=DTK_FALSE)
Ends the writing of the Parasolid (x_t or x_b) file.
psw_SetWritingFacesMode
void psw_SetWritingFacesMode(Dtk_Int32 inPreference)
psw_SetWritingNonmanifoldTopolgyMode
void psw_SetWritingNonmanifoldTopolgyMode(Dtk_Int32 inPreference)