DATAKIT API  V2025.1
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 SetComponentNameMode (const int inModeName)
 Select Mode to get Name of Components on Reading. More...
 
static Dtk_ErrorStatus SetLayerDescriptionMode (const int 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 listed - default is 0 (NO) 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 int inMode)
 Set Mode to propagate colors of a body (solid, surfacic ..) to its faces - default is YES. 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 read extended ASCII characters from a STEP file. Remark: these characters are NOT ALLOWED but some writers can use them anyway. 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.

◆ SetComponentNameMode()

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

Select Mode to get Name of Components on Reading.

Parameters
[in]inModeReader: 0 Get Product.ID only, 1 Product.ID or Product.Name (the most significant) ID as prior, 2 same but Product.Name as prior. Currently default mode is 1 (Product.ID, or Product.Name if more significant) Significant name or ID : void or empty can be ignored, then pure ID is significant, then name (with letters) is the most significant

◆ SetLayerDescriptionMode()

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

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

Parameters
[in]inModeLayerName: 0 inactive (default value), 1 active. When active, a LayerInfoSet is created with a Layer Filter per Layer, with its name and description if not empty

◆ SetModeColorUnlisted()

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

Set Mode to read colors not correctly listed - default is 0 (NO)

Parameters
[in]inMode: 0 NO (list only listed styles), 1 priority to listed styled if none read unlisted, 2 read all styles

◆ 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 NO , 1 only if no product at all, 2 also if product(s) but no assembly , 3 also if assemblies (= always)

◆ SetModePropagateColor()

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

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

Parameters
[in]inMode: 0 NO, 1 YES

◆ 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).

Computation of validation properties can be CPU consuming, it's why several levels of computation are proposed

Parameters
[in]inModeProp: 0 ignored (default), 1 recorded in Dtk_Info+Dtk_Val, 2 ppties of Dtk_Component and Dtk_Node ALSO recorded as Dtk_Metadata, 3=1+2
[in]inModeValPropoptional : 0 not computed (default), 1 simplest computed (counts, checksums ..), 2 geometry (volume area center..), 3 cloud of points on geometry

◆ SetModeReadFDT()

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

Activates/Deactivates Reading of FDT.

Parameters
[in]inMode: 0 not active, 1 reads views + graphics of FDT only, 2 or 3 also reads semantics of FDT. In case of dual graphics (both a frozen one and a placeholder) : 2 to prefer the frozen graphics, 3 to prefer the placeholder

◆ SetParseMode()

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

Select Parsing Mode on Reading.

Parameters
[in]inModeReader: 0 Datakit default, 1 DTK parser with full computation, 2 DTK parser with light computation. Currently default mode is 1

◆ SetReadExtendedAsciiMode()

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

Set mode to read extended ASCII characters from a STEP file. Remark: these characters are NOT ALLOWED but some writers can use them anyway.

Parameters
[in]inModeExtAscii: 0 as is (extended latin), 1 use microsoft codepage if activated (936 can be), 2 cyrillic. Current default mode is 1

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