DATAKIT API  V2025.3
StepReader Class Reference
+ Inheritance diagram for StepReader:

Public Member Functions

virtual Dtk_ErrorStatus _ReadConnectedEntity (const Dtk_NodeConnectorPtr &inConnector, Dtk_tab< Dtk_EntityPtr > &outEntity)
 
Dtk_ErrorStatus ActivateReader ()
 
Dtk_ErrorStatus CreateDocument (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
 
virtual Dtk_ErrorStatus CreateDocumentGraphical (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
 
Dtk_ErrorStatus DesactivateReader ()
 
Dtk_ErrorStatus EndComponent (Dtk_ComponentPtr &inComponent)
 
Dtk_ErrorStatus EndPopulateComponentsTree ()
 
Dtk_ErrorStatus GetAssociatedEntities (Dtk_Node &inNode, Dtk_tab< Dtk_NodeConnectorPtr > &outAssociatedEntities)
 
Dtk_ErrorStatus GetConnectorsPointingToThisComponent (Dtk_Component &inCompo, Dtk_tab< Dtk_NodeConnectorPtr > &outConnectedEntities)
 
virtual Dtk_ErrorStatus GetFilePreview (const Dtk_string &inInputFile, Dtk_PreviewPtr &outPreview)
 
Dtk_ErrorStatus GetFileVersion (const Dtk_string &inInputFile, Dtk_string &outVersion)
 
Dtk_Int32 GetVersion ()
 
Dtk_ErrorStatus PopulateComponentsTree (const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
 
Dtk_ErrorStatus PopulateComponentsTree (const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
 
Dtk_ErrorStatus ReadAdditionalInfos (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
 
virtual Dtk_ErrorStatus ReadAdvancedFeature (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
 
Dtk_ErrorStatus ReadComponent (const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
 
virtual Dtk_ErrorStatus ReadComponentGraphic (const Dtk_ComponentPtr &inComponent, Dtk_GraphicalDataPtr &outGraphicalData)
 
Dtk_ErrorStatus ReadEntity (Dtk_Node &inNode, Dtk_EntityPtr &outEntity)
 
 StepReader ()
 
virtual ~StepReader ()
 

Static Public Member Functions

static Dtk_bool Enable ()
 
static Dtk_ErrorStatus SetAllowReadInvalidFiles (const Dtk_bool inMode)
 Define if we should try to process potentially corrupted file. More...
 
static Dtk_ErrorStatus SetComponentNameMode (const int inModeName)
 Select Mode to give priority to specific STEP PRODUCT fields for Dtk_Component naming. More...
 
static Dtk_ErrorStatus SetLayerDescriptionMode (const Dtk_bool inMode)
 Select Mode to get Description of Layer added to its name. More...
 
static Dtk_ErrorStatus SetModeColorUnlisted (const int inMode)
 Set Mode to read colors not correctly defined (that is, not in a list). More...
 
static Dtk_ErrorStatus SetModeOrphanBody (const int inMode)
 Set Mode to read orphan bodies (not belonging to a product), depending on the product structure of the STEP file. More...
 
static Dtk_ErrorStatus SetModePropagateColor (const Dtk_bool inMode)
 Set Mode to propagate colors of a body (solid, surfacic ..) to its faces. More...
 
static Dtk_ErrorStatus SetModeProperty (const int inModeProp, const int inModeValProp=0)
 Set Mode to read properties and attributes (PROPERTY_DEFINITION), and to compute Validation Properties when present (result in the log file). More...
 
static Dtk_ErrorStatus SetModeReadFDT (const int inMode)
 Activates/Deactivates Reading of FDT. More...
 
static Dtk_ErrorStatus SetParseMode (const int inModeReader)
 Select Parsing Mode on Reading. More...
 
static Dtk_ErrorStatus SetReadExtendedAsciiMode (const int inMode)
 Set mode to choose the code page or encoding to be used in case of non-standard ASCII characters encountered. More...
 

Protected Member Functions

void _Init ()
 
void _Reset ()
 
Dtk_ErrorStatus _WriteInventoryInLogFile (Dtk_ID inID, int inNum, int *inCount, char **inEntitiesName)
 
Dtk_ErrorStatus InitReader (const Dtk_string &inInputFile)
 

Protected Attributes

Dtk_string _InputFile
 
FILE * _InputFilePtr
 
StepReader_Handle * _Private
 

Constructor & Destructor Documentation

◆ StepReader()

StepReader::StepReader ( )

◆ ~StepReader()

virtual StepReader::~StepReader ( )
virtual

Member Function Documentation

◆ _Init()

void StepReader::_Init ( )
protected

◆ _ReadConnectedEntity()

virtual Dtk_ErrorStatus Dtk_Reader::_ReadConnectedEntity ( const Dtk_NodeConnectorPtr inConnector,
Dtk_tab< Dtk_EntityPtr > &  outEntity 
)
virtualinherited

Reimplemented in GltfReader.

◆ _Reset()

void Dtk_Reader::_Reset ( )
protectedinherited

◆ _WriteInventoryInLogFile()

Dtk_ErrorStatus Dtk_Reader::_WriteInventoryInLogFile ( Dtk_ID  inID,
int  inNum,
int *  inCount,
char **  inEntitiesName 
)
protectedinherited

◆ ActivateReader()

Dtk_ErrorStatus StepReader::ActivateReader ( )
virtual

Implements Dtk_Reader.

◆ CreateDocument()

Dtk_ErrorStatus StepReader::CreateDocument ( const Dtk_string inInputFile,
Dtk_MainDocPtr outDocument 
)
virtual

Implements Dtk_Reader.

◆ CreateDocumentGraphical()

virtual Dtk_ErrorStatus Dtk_Reader::CreateDocumentGraphical ( const Dtk_string inInputFile,
Dtk_MainDocPtr outDocument 
)
virtualinherited

Reimplemented in ProeReader, and GltfReader.

◆ DesactivateReader()

Dtk_ErrorStatus StepReader::DesactivateReader ( )
virtual

Implements Dtk_Reader.

◆ Enable()

static Dtk_bool StepReader::Enable ( )
static

◆ EndComponent()

Dtk_ErrorStatus StepReader::EndComponent ( Dtk_ComponentPtr inComponent)
virtual

Implements Dtk_Reader.

◆ EndPopulateComponentsTree()

Dtk_ErrorStatus StepReader::EndPopulateComponentsTree ( )
virtual

Implements Dtk_Reader.

◆ GetAssociatedEntities()

Dtk_ErrorStatus StepReader::GetAssociatedEntities ( Dtk_Node inNode,
Dtk_tab< Dtk_NodeConnectorPtr > &  outAssociatedEntities 
)
virtual

Reimplemented from Dtk_Reader.

◆ GetConnectorsPointingToThisComponent()

Dtk_ErrorStatus StepReader::GetConnectorsPointingToThisComponent ( Dtk_Component inCompo,
Dtk_tab< Dtk_NodeConnectorPtr > &  outConnectedEntities 
)
virtual

Reimplemented from Dtk_Reader.

◆ GetFilePreview()

virtual Dtk_ErrorStatus Dtk_Reader::GetFilePreview ( const Dtk_string inInputFile,
Dtk_PreviewPtr outPreview 
)
virtualinherited

Reimplemented in SolidEdgeReader, ProeReader, and _3dmReader.

34  {DTK_UNUSED(inInputFile); outPreview = NULL; return dtkErrorNotYetImplemented;}

◆ GetFileVersion()

Dtk_ErrorStatus StepReader::GetFileVersion ( const Dtk_string inInputFile,
Dtk_string outVersion 
)
virtual

Implements Dtk_Reader.

◆ GetVersion()

Dtk_Int32 StepReader::GetVersion ( )
virtual

Implements Dtk_Reader.

◆ InitReader()

Dtk_ErrorStatus StepReader::InitReader ( const Dtk_string inInputFile)
protected

◆ PopulateComponentsTree() [1/2]

Dtk_ErrorStatus StepReader::PopulateComponentsTree ( const Dtk_string inInputFile,
Dtk_MainDocPtr inoutDocument,
Dtk_ComponentPtr outRootComponent 
)
virtual

Implements Dtk_Reader.

◆ PopulateComponentsTree() [2/2]

Dtk_ErrorStatus StepReader::PopulateComponentsTree ( const Dtk_tab< Dtk_StreamPtr > &  inArrayStream,
Dtk_MainDocPtr inoutDocument,
Dtk_ComponentPtr outRootComponent 
)
virtual

Implements Dtk_Reader.

◆ ReadAdditionalInfos()

Dtk_ErrorStatus StepReader::ReadAdditionalInfos ( Dtk_Node inNode,
Dtk_ObjectPtr outEntity 
)
virtual

Implements Dtk_Reader.

◆ ReadAdvancedFeature()

virtual Dtk_ErrorStatus Dtk_Reader::ReadAdvancedFeature ( Dtk_Node inNode,
Dtk_ObjectPtr outEntity 
)
virtualinherited

◆ ReadComponent()

Dtk_ErrorStatus StepReader::ReadComponent ( const Dtk_ComponentPtr inComponent,
Dtk_NodePtr outRootNode 
)
virtual

Implements Dtk_Reader.

◆ ReadComponentGraphic()

virtual Dtk_ErrorStatus Dtk_Reader::ReadComponentGraphic ( const Dtk_ComponentPtr inComponent,
Dtk_GraphicalDataPtr outGraphicalData 
)
virtualinherited

◆ ReadEntity()

Dtk_ErrorStatus StepReader::ReadEntity ( Dtk_Node inNode,
Dtk_EntityPtr outEntity 
)
virtual

Implements Dtk_Reader.

◆ SetAllowReadInvalidFiles()

static Dtk_ErrorStatus StepReader::SetAllowReadInvalidFiles ( const Dtk_bool  inMode)
static

Define if we should try to process potentially corrupted file.

Parameters
[in]inModeDTK_TRUE to allow invalid file reading, DTK_FALSE otherwise.
Remarks
Default mode is DTK_FALSE.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetComponentNameMode()

static Dtk_ErrorStatus StepReader::SetComponentNameMode ( const int  inModeName)
static

Select Mode to give priority to specific STEP PRODUCT fields for Dtk_Component naming.

Parameters
[in]inModeReader: 0 to consider only PRODUCT.ID, 1 to give priority to PRODUCT.ID, over PRODUCT.NAME (if not empty), 2 to give priority to PRODUCT.NAME, over PRODUCT.ID (if not empty), 3 to concatenate PRODUCT.ID and PRODUCT.NAME (if different)
Remarks
Default mode is 1.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetLayerDescriptionMode()

static Dtk_ErrorStatus StepReader::SetLayerDescriptionMode ( const Dtk_bool  inMode)
static

Select Mode to get Description of Layer added to its name.

Parameters
[in]inModeLayerName: DTK_FALSE to deactivate this mode, DTK_TRUE otherwise.
Remarks
When active, a LayerInfoSet is created with a Layer Filter per Layer, with its name and description, if not empty
Default mode is DTK_FALSE.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetModeColorUnlisted()

static Dtk_ErrorStatus StepReader::SetModeColorUnlisted ( const int  inMode)
static

Set Mode to read colors not correctly defined (that is, not in a list).

Parameters
[in]inMode: 0 to ignore them, 1 to ignore them only if some colors are correctly defined, 2 to read them all.
Remarks
Default mode is 0.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetModeOrphanBody()

static Dtk_ErrorStatus StepReader::SetModeOrphanBody ( const int  inMode)
static

Set Mode to read orphan bodies (not belonging to a product), depending on the product structure of the STEP file.

Parameters
[in]inMode: 0 to ingore them , 1 to ignore them only if no product is defined, 2 to ignore them only if no product is defined, or several products are defined but no assembly, 3 to read them all.
Remarks
Default mode is 0.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetModePropagateColor()

static Dtk_ErrorStatus StepReader::SetModePropagateColor ( const Dtk_bool  inMode)
static

Set Mode to propagate colors of a body (solid, surfacic ..) to its faces.

Parameters
[in]inMode: DTK_TRUE to allow propagation, DTK_FALSE otherwise.
Remarks
Default mode is DTK_TRUE.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetModeProperty()

static Dtk_ErrorStatus StepReader::SetModeProperty ( const int  inModeProp,
const int  inModeValProp = 0 
)
static

Set Mode to read properties and attributes (PROPERTY_DEFINITION), and to compute Validation Properties when present (result in the log file).

Parameters
[in]inModeProp: 0 to deactivate properties reading (default), 1 to read properties and record them in Dtk_Info, 2 to also read properties concerning Dtk_Component and record them as Dtk_Metadata, 3 to also read properties concerning Dtk_Component and record them both in Dtk_Info and as Dtk_Metadata
[in]inModeValPropoptional : 0 to deactivate validation properties computation (default), 1 to compute only light validation properties (counts), 2 to compute also geometry-based validation properties (volume, area, center), 3 to compute cloud-of-points-based validation properties.
Remarks
Computation of validation properties can be CPU consuming, that's why several levels of computation are proposed
Default mode for properties is 0. Default mode for validation properties is 0. //!
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetModeReadFDT()

static Dtk_ErrorStatus StepReader::SetModeReadFDT ( const int  inMode)
static

Activates/Deactivates Reading of FDT.

Parameters
[in]inMode: 0 to deactivate FDT reading, 1 to read only FDT graphical information, 2 to read fully semantic FDT, and give priorirty to "frozen" graphics (3D tessellation, polylines), 3 to read fully semantic and give priorirty to the "placeholder" graphics
Remarks
"Placeholder" is a notion introduced in AP242E3, allowing to represent FDT graphics with light and minimal information. The receiving system is in charge of recreated the graphics based on those information.
Default mode is 0.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetParseMode()

static Dtk_ErrorStatus StepReader::SetParseMode ( const int  inModeReader)
static

Select Parsing Mode on Reading.

Parameters
[in]inModeReader: 1 to use Datakit parser with full computation, 2 to use Datakit parser with light computation.
Remarks
Default mode is 1.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetReadExtendedAsciiMode()

static Dtk_ErrorStatus StepReader::SetReadExtendedAsciiMode ( const int  inMode)
static

Set mode to choose the code page or encoding to be used in case of non-standard ASCII characters encountered.

Parameters
[in]inModeExtAscii: 0 to use UTF-8, 1 to use code page 936 (Microsfot Windows, simplified chinese), 2 to use code page 855 (Cyrillic).
Remarks
These characters are NOT ALLOWED, but some writers can use them anyway.
Default mode is 0.
Warning
call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

Field Documentation

◆ _InputFile

Dtk_string Dtk_Reader::_InputFile
protectedinherited

◆ _InputFilePtr

FILE* Dtk_Reader::_InputFilePtr
protectedinherited

◆ _Private

StepReader_Handle* StepReader::_Private
protected
dtkErrorNotYetImplemented
@ dtkErrorNotYetImplemented
Definition: error_dtk.hpp:32
DTK_UNUSED
#define DTK_UNUSED(a)
Definition: define.h:730