DATAKIT API  V2025.4
stepw.hpp
Go to the documentation of this file.
1 #ifndef _STEPW_HEADER_
2 #define _STEPW_HEADER_
3 class stepw_ER;
4 
7 
18 DtkErrorStatus stepw_InitFile( const Dtk_string& inFileName, const char* inOriginatingSystem = " user ", const int inSchema = 0 );
19 
26 DtkErrorStatus stepw_SetHeaderData( const int inNumItem, const wchar_t* inValItem );
27 
34 DtkErrorStatus stepw_SetHeaderData( const int inNumItem, const Dtk_string& inValItem );
35 
43 DtkErrorStatus stepw_SetModeFdt( const int inMode, const int inPolyline = 2 );
44 
50 DtkErrorStatus stepw_SetModeProp( const int inMode );
51 
58 
65 
72 DtkErrorStatus stepw_SetModeInfoFirstFace( bool inModeInfoFirstFace );
73 
82 Dtk_ErrorStatus stepw_SetContextUnit( const int inLength, const int inAngle = 0 );
83 
84 
93 
102 
108 
122 Dtk_ErrorStatus stepw_AddExternalReference( const Dtk_string& inProductName, const Dtk_string& inFileName, int& outID, Dtk_ID inInstCompId = 0 );
123 
135 
140 int stepw_WhichProductID( const Dtk_string& inProductName );
141 
148 
158 DtkErrorStatus stepw_InitProduct( const Dtk_string& inProductName, int& outAssignedID, Dtk_ID inProductUserID = 0 );
159 
168 
177 DtkErrorStatus stepw_AddInstance( const int inFatherProductID, const int inChildProductID, const Dtk_transfo& inPosition, const Dtk_string& inInstanceName ); // 0 OK, -1 ERROR
178 
188 DtkErrorStatus stepw_AddInstanceWithInfo( const int inFatherProductID, const int inChildProductID, const Dtk_transfo& inPosition, const Dtk_string& inInstanceName, const Dtk_InfoPtr& inInstanceInfo );
189 
202 DtkErrorStatus stepw_AddInstanceWithInfo( const int inFatherProductID, const int inChildProductID, const Dtk_transfo& inPosition, const Dtk_string& inInstanceName, const Dtk_InfoPtr& inInstanceInfo,
203 int& outInstanceID, const int inInstanceUserID = 0, const Dtk_string& inReferenceDesignator = "" );
204 
205 
207 SetAsDeprecated( "2025.4", "Use stepw_SetInstanceUserID instead." )
208 DtkErrorStatus stepw_SetAnchorInstance( const int inInstanceID, const int inInstanceUserID );
209 
216 DtkErrorStatus stepw_SetInstanceUserID( const int inInstanceID, const int inInstanceUserID );
217 
219 SetAsDeprecated( "2025.4", "Use stepw_WhichInstanceID instead." )
220 int stepw_AnchorInstanceID( const int inUserID );
221 
226 int stepw_WhichInstanceID( const int inUserID );
227 
239 
248 
261 
267 DtkErrorStatus stepw_Init3DPart( const int inProductID );
268 
273 void stepw_InitNodeContext( const int inNodeID );
274 
279 void stepw_InitNodeContext( const int inNodeID, const Dtk_InfoPtr& inNodeInfo );
280 
283 void stepw_EndNodeContext( const int unused = 0 );
284 
286 
294 
305 DtkErrorStatus stepw_Write3DPartBodyWithMesh( const Dtk_BodyPtr& inBody, const Dtk_MeshPtr& inMesh, const int inMode = 0 );
306 
316 
326 
336 
347 
356 
366 
376 
377 
386 Dtk_ErrorStatus stepw_Add3DModelDisplay( const Dtk_ModelDisplayPtr& inModelDisplay, const int inMode );
387 
401 Dtk_ErrorStatus stepw_Add3DFdtModelDisplay( const Dtk_ModelDisplayPtr& inModelDisplay, const Dtk_FdtPtr& inFDT );
402 
403 
405 
411 
418 DtkErrorStatus stepw_WriteAssemblyInstances( const int inID ); // inID must repeat that of InitProduct.
419 
425 DtkErrorStatus stepw_EndProduct( const int inProductID );
426 
427 
432 
433 
434 //Classes to describe element references inside a product or between products.
435 class stepw_ER //Placeholder for element reference
436 {
437 public:
439  void* m_pData;
440 };
441 
442 class stepw_ERP //Placeholder for element reference path
443 {
444 public:
446  void* m_pData;
447 };
448 
464 DtkErrorStatus stepw_CreateReference( stepw_ER& inOutElementReference, const int inEntityID, const int inProductID = 0, const char* inReferenceKind = "");
465 
479 DtkErrorStatus stepw_CreateReferenceToNode( stepw_ER& inOutElementReference, const int inNodeID, const int inProductID = 0, const char* inReferenceKind = "");
480 
488 
498 DtkErrorStatus stepw_CreateReferenceToFdt( stepw_ER& inOutElementReference, const int inEntityID, const int inProductID );
499 
509 DtkErrorStatus stepw_CreateReferenceToGroup( stepw_ER& inOutElementReference, const int inEntityID, const int inProductID );
510 
519 DtkErrorStatus stepw_CreateInstancePath( stepw_ERP& inOutElementReferencePath );
520 
530 DtkErrorStatus stepw_AddInstanceToPath( stepw_ERP& inOutElementReferencePath, const int inInstanceID );
531 
540 Dtk_ErrorStatus stepw_DefineInstancePath( stepw_ERP& inOutElementReferencePath, const Dtk_tab<Dtk_ID>& inInstancePath, const bool unused = false );
541 
549 DtkErrorStatus stepw_SetReferencePath( stepw_ER& inOutElementReference, stepw_ERP& inElementReferencePath );
550 
561 Dtk_ErrorStatus stepw_AddOverrideInstanceInfo( stepw_ERP& inElementReferencePath, Dtk_InfoPtr& inOverrideInfo );
562 
571 DtkErrorStatus stepw_SetAnchorProduct( const int inProductID, const int inUserID );
572 
579 int stepw_AnchorProductID( const int inUserID );
580 
593 Dtk_ErrorStatus stepw_AddAnchorItem( const int inEntityID, const int inProductID, const Dtk_string& inGUID );
594 
595 
596 
597 #endif
stepw_CreateReferenceToGroup
DtkErrorStatus stepw_CreateReferenceToGroup(stepw_ER &inOutElementReference, const int inEntityID, const int inProductID)
Creates a reference to an entity located in the designated Product/Part context. The reference target...
stepw_SetModeInfoFirstFace
DtkErrorStatus stepw_SetModeInfoFirstFace(bool inModeInfoFirstFace)
On a solid or shell, allows the spreading of its first available face graphical attributes to the who...
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:691
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
stepw_ERP::m_pData
void * m_pData
Definition: stepw.hpp:446
stepw_AddOverrideInstanceInfo
Dtk_ErrorStatus stepw_AddOverrideInstanceInfo(stepw_ERP &inElementReferencePath, Dtk_InfoPtr &inOverrideInfo)
Assigns information on an instance in multi-level assembly context.
stepw_InitProduct
DtkErrorStatus stepw_InitProduct(const Dtk_string &inProductName, int &outAssignedID, Dtk_ID inProductUserID=0)
Initializes the definition context of a product.
stepw_ER::m_pData
void * m_pData
Definition: stepw.hpp:439
stepw_AddInstanceToPath
DtkErrorStatus stepw_AddInstanceToPath(stepw_ERP &inOutElementReferencePath, const int inInstanceID)
Appends an instance identifier to the element reference path. The instance identifier is provided by ...
stepw_SetProductLayerInfosSet
DtkErrorStatus stepw_SetProductLayerInfosSet(const Dtk_LayerInfosSetPtr inLayerInfoSet)
Sets the LayerInfosSet to refer to when writing the current product. It uses its mapping between laye...
stepw_Write3DConstructionGeometry
DtkErrorStatus stepw_Write3DConstructionGeometry(const Dtk_BodyPtr &inBody)
Writes a body as a construction geometry of a 3D part, of any kind (solid, shell / faces,...
stepw_ERP
Definition: stepw.hpp:443
stepw_WriteAssemblyInstances
DtkErrorStatus stepw_WriteAssemblyInstances(const int inID)
Writes instances detained by a product.
stepw_Write3DPartMesh
DtkErrorStatus stepw_Write3DPartMesh(const Dtk_MeshPtr &inMesh)
Writes a mesh of a 3D part (3D content of a product).
stepw_SetContextTolerance
Dtk_ErrorStatus stepw_SetContextTolerance(const double inTol)
Sets length tolerance for the 3D geometry (uncertainty).
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
stepw_SetInstanceUserID
DtkErrorStatus stepw_SetInstanceUserID(const int inInstanceID, const int inInstanceUserID)
Sets the designated instance its user-defined identifier.
stepw_DefineInstancePath
Dtk_ErrorStatus stepw_DefineInstancePath(stepw_ERP &inOutElementReferencePath, const Dtk_tab< Dtk_ID > &inInstancePath, const bool unused=false)
Define the whole instance identifier sequence of the element reference path.
stepw_WhichInstanceID
int stepw_WhichInstanceID(const int inUserID)
Checks if an instance (known by its user-defined identifier), is already registered.
stepw_Write3DPartBody
DtkErrorStatus stepw_Write3DPartBody(const Dtk_BodyPtr &inBody)
Writes a body of a 3D part (3D content of a product), of any kind (solid, shell / faces,...
stepw_Write3DPartBodyWithMesh
DtkErrorStatus stepw_Write3DPartBodyWithMesh(const Dtk_BodyPtr &inBody, const Dtk_MeshPtr &inMesh, const int inMode=0)
Writes a body of a 3D part (3D content of a product), associated with a mesh.
stepw_WriteExternalReference
Dtk_ErrorStatus stepw_WriteExternalReference(const int inID)
Writes a product as an external reference. Only one per file for a given product.
stepw_EndProduct
DtkErrorStatus stepw_EndProduct(const int inProductID)
Ends the writing of a product - calls WriteAssemblyInstances if not yet done.
stepw_SetModeProp
DtkErrorStatus stepw_SetModeProp(const int inMode)
Activates/Deactivates writing of properties : User Attributes, Product Data.
SetAsDeprecated
SetAsDeprecated("2025.4", "Use stepw_SetInstanceUserID instead.") DtkErrorStatus stepw_SetAnchorInstance(const int inInstanceID
stepw_Write3DPartMeshFromBody
DtkErrorStatus stepw_Write3DPartMeshFromBody(const Dtk_MeshPtr &inMesh, const Dtk_BodyPtr &inBody)
Writes a mesh of a 3D part (3D content of a product), coming from a body, without writing the body it...
stepw_GiveUniqueFileName
Dtk_string stepw_GiveUniqueFileName(const Dtk_string &inFileName)
Creates a unique file name for an external reference - applies to the current session (stepw_InitFile...
stepw_Add3DPartProperty
Dtk_ErrorStatus stepw_Add3DPartProperty(const Dtk_MetaDataPtr &inProperty)
Adds a roperty to a part (default), or to an entity, according to InitPropertySet mode.
stepw_SetReferencePath
DtkErrorStatus stepw_SetReferencePath(stepw_ER &inOutElementReference, stepw_ERP &inElementReferencePath)
Assigns the element reference path to the element reference.
stepw_InitFile
DtkErrorStatus stepw_InitFile(const Dtk_string &inFileName, const char *inOriginatingSystem=" user ", const int inSchema=0)
Initializes a file to be written.
stepw_CreateReference
DtkErrorStatus stepw_CreateReference(stepw_ER &inOutElementReference, const int inEntityID, const int inProductID=0, const char *inReferenceKind="")
Creates a reference to an entity located in the designated Product/Part context, or current context i...
inFDT
const Dtk_FdtPtr & inFDT
Definition: stepw.hpp:401
stepw_AnchorProductID
int stepw_AnchorProductID(const int inUserID)
Finds the product having an ANCHOR section, by user identifier.
stepw_AddExternalReference
Dtk_ErrorStatus stepw_AddExternalReference(const Dtk_string &inProductName, const Dtk_string &inFileName, int &outID, Dtk_ID inInstCompId=0)
Declares a product to be written as an external reference (separated file).
stepw_SetModeFdt
DtkErrorStatus stepw_SetModeFdt(const int inMode, const int inPolyline=2)
Activates/Deactivates writing of FDT.
stepw_Init3DPart
DtkErrorStatus stepw_Init3DPart(const int inProductID)
Initializes the writing of a 3D part for the designated product.
stepw_AddInstanceWithInfo
DtkErrorStatus stepw_AddInstanceWithInfo(const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes.
stepw_AddInstance
DtkErrorStatus stepw_AddInstance(const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
Adds an instance of a product ( child ) in an assembly product ( father ).
stepw_Add3DPartFDT
DtkErrorStatus stepw_Add3DPartFDT(const Dtk_FdtPtr &inFDT)
Adds a FDT in the current part context.
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
stepw_SetPartProperties
DtkErrorStatus stepw_SetPartProperties(const Dtk_InfoPtr &inInfo, const int inItem)
Defines properties to be attached directly to the product : considers the list of Dtk_Val in the Dtk_...
stepw_SetModeItemName
DtkErrorStatus stepw_SetModeItemName(const int inMode)
Selects a mode for topological 3D items naming policy (shells, faces, edges ).
stepw_SetAnchorProduct
DtkErrorStatus stepw_SetAnchorProduct(const int inProductID, const int inUserID)
Declares the product as having an ANCHOR section. If the designated product is already declared as su...
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
stepw_EndFile
DtkErrorStatus stepw_EndFile()
Ends the writing of the current STEP file.
stepw_End3DPart
DtkErrorStatus stepw_End3DPart()
Ends the writing of a product 3D part.
stepw_Write3DAxisSystem
DtkErrorStatus stepw_Write3DAxisSystem(const Dtk_AxisSystemPtr &inAxis)
Writes an axis system of a 3D part, in STEP, it is a construction geometry based on an axis placement...
stepw_ERP::stepw_ERP
stepw_ERP()
stepw_AddReference
DtkErrorStatus stepw_AddReference(stepw_ER &inElementReference)
Registers the previously created element reference in the writer.
stepw_Add3DModelDisplay
Dtk_ErrorStatus stepw_Add3DModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
Adds a view ( Dtk_ModelDisplay ) in the current part context.
stepw_Write3DPartRoot
DtkErrorStatus stepw_Write3DPartRoot()
stepw_CreateReferenceToFdt
DtkErrorStatus stepw_CreateReferenceToFdt(stepw_ER &inOutElementReference, const int inEntityID, const int inProductID)
Creates a reference to an entity located in the designated Product/Part context. The reference target...
stepw_SetContextUnit
Dtk_ErrorStatus stepw_SetContextUnit(const int inLength, const int inAngle=0)
Sets file units in which the geometries, properties are to be written.
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
stepw_ER
Definition: stepw.hpp:436
stepw_CreateInstancePath
DtkErrorStatus stepw_CreateInstancePath(stepw_ERP &inOutElementReferencePath)
Initializes a path for the element reference, identifying the sequence of instances to pass through.
stepw_SetHeaderData
DtkErrorStatus stepw_SetHeaderData(const int inNumItem, const wchar_t *inValItem)
Sets STEP file header fields value.
stepw_CreateReferenceToNode
DtkErrorStatus stepw_CreateReferenceToNode(stepw_ER &inOutElementReference, const int inNodeID, const int inProductID=0, const char *inReferenceKind="")
Creates a reference to a whole node (Dtk_Node), located in the designated Product/Part context.
Pdfw::inInfo
Dtk_tab< Dtk_dir > Dtk_ID Dtk_InfoPtr inInfo
Definition: pdfw.hpp:676
stepw_SetModeCompress
DtkErrorStatus stepw_SetModeCompress(const int inMode)
Selects a mode of writing compact or compressed step files.
inInstanceUserID
const int inInstanceUserID
Definition: stepw.hpp:208
stepw_EndNodeContext
void stepw_EndNodeContext(const int unused=0)
Ends current node context.
Pdfw::outID
Dtk_tab< Dtk_dir > Dtk_ID & outID
Definition: pdfw.hpp:675
stepw_GiveUniqueProductName
Dtk_string stepw_GiveUniqueProductName(const Dtk_string &inProductName)
Creates a unique product name.
catiav5w::inInstanceName
const Dtk_string & inInstanceName
Definition: catiav5w.hpp:621
stepw_ER::stepw_ER
stepw_ER()
stepw_SetConversionLengthUnit
Dtk_ErrorStatus stepw_SetConversionLengthUnit(const int inLength)
Sets file units in which the geometries, properties are to be written, and apply the conversion facto...
stepw_InitPropertySet
Dtk_ErrorStatus stepw_InitPropertySet(const int inMode)
Sets attachment mode for next property writing : the whole Part, or to the following entity to be wri...
stepw_InitNodeContext
void stepw_InitNodeContext(const int inNodeID)
Initializes the context to write entities in a node.
stepw_AddAnchorItem
Dtk_ErrorStatus stepw_AddAnchorItem(const int inEntityID, const int inProductID, const Dtk_string &inGUID)
Registers an entity in the ANCHOR section, with an assigned GUID (optional).
stepw_SetNextSubBody
Dtk_ErrorStatus stepw_SetNextSubBody(const int mode)
stepw_WhichProductID
int stepw_WhichProductID(const Dtk_string &inProductName)
Checks if a product (known by its unique name), is already registered.