DATAKIT API  V2025.4
dtk_StepReader.hpp
Go to the documentation of this file.
1 /**********************************************************
2  STR_VR.H
3 ***********************************************************/
4 #ifndef _DTK_STEP_READER_H_
5 #define _DTK_STEP_READER_H_
6 #include "util/dtk_reader.hpp"
7 #include "def/define.h"
8 
9 class StepReader : public Dtk_Reader
10 {
11 public:
12 
14  virtual ~StepReader();
15 
16  static Dtk_bool Enable();
17 
18  // ==== General inherited actions ====
19  Dtk_ErrorStatus CreateDocument( const Dtk_string& inInputFile, Dtk_MainDocPtr& outDocument );
20  Dtk_ErrorStatus GetFileVersion( const Dtk_string& inInputFile, Dtk_string& outVersion );
21 
22  Dtk_ErrorStatus PopulateComponentsTree( const Dtk_string& inInputFile, Dtk_MainDocPtr& inoutDocument, Dtk_ComponentPtr& outRootComponent );
23  Dtk_ErrorStatus PopulateComponentsTree( const Dtk_tab< Dtk_StreamPtr >& inArrayStream, Dtk_MainDocPtr& inoutDocument, Dtk_ComponentPtr& outRootComponent );
25 
26  Dtk_ErrorStatus ReadComponent( const Dtk_ComponentPtr& inComponent, Dtk_NodePtr& outRootNode );
28 
31 
34 
37 
39 
40 
41  // ==== Specific settings for STEP Read ====
47  static Dtk_ErrorStatus SetParseMode( const int inModeReader );
48 
54  static Dtk_ErrorStatus SetComponentNameMode( const int inModeName );
55 
63  SetAsDeprecated( "2025.4", "Use StepReader::SetModeFDTRepresentation method instead." )
64  static Dtk_ErrorStatus SetModeReadFDT( const int inMode );
65 
66  enum class FDTRepresentation
67  {
68  GraphicalOnly = 0,
69  SemanticWithFrozenGraphicPriority = 1, //In cases where multiple graphical representation exist for a same FDT, give priority to the purely graphical one.
70  SemanticWithPlaceholderPriority = 2 //In cases where multiple graphical representation exist for a same FDT, give priority to the placeholder one.
71  };
79 
87  static Dtk_ErrorStatus SetModeProperty( const int inModeProp, const int inModeValProp = 0 );
88 
95  static Dtk_ErrorStatus SetReadExtendedAsciiMode( const int inMode );
96 
102  static Dtk_ErrorStatus SetModeColorUnlisted( const int inMode );
103 
109  static Dtk_ErrorStatus SetModeOrphanBody( const int inMode );
110 
117 
125 
132 
133  // ==== Fields and internal actions ====
134 
135 protected:
136 
137  class StepReader_Handle;
138  StepReader_Handle* _Private;
139 
140  void _Init();
141  Dtk_ErrorStatus InitReader( const Dtk_string& inInputFile );
142 
143 };
144 
145 #endif
146 
StepReader::SetComponentNameMode
static Dtk_ErrorStatus SetComponentNameMode(const int inModeName)
Select Mode to give priority to specific STEP PRODUCT fields for Dtk_Component naming.
StepReader::ReadAdditionalInfos
Dtk_ErrorStatus ReadAdditionalInfos(Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
StepReader::ReadEntity
Dtk_ErrorStatus ReadEntity(Dtk_Node &inNode, Dtk_EntityPtr &outEntity)
StepReader::PopulateComponentsTree
Dtk_ErrorStatus PopulateComponentsTree(const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
StepReader::SetModeOrphanBody
static Dtk_ErrorStatus SetModeOrphanBody(const int inMode)
Set Mode to read orphan bodies (not belonging to a product), depending on the product structure of th...
StepReader::EndPopulateComponentsTree
Dtk_ErrorStatus EndPopulateComponentsTree()
Dtk_Reader
Definition: dtk_reader.hpp:15
StepReader::SetParseMode
static Dtk_ErrorStatus SetParseMode(const int inModeReader)
Select Parsing Mode on Reading.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
StepReader::GetVersion
Dtk_Int32 GetVersion()
StepReader::SetModeColorUnlisted
static Dtk_ErrorStatus SetModeColorUnlisted(const int inMode)
Set Mode to read colors not correctly defined (that is, not in a list).
StepReader::_Private
StepReader_Handle * _Private
Definition: dtk_StepReader.hpp:137
StepReader::Enable
static Dtk_bool Enable()
Dtk_bool
char Dtk_bool
Definition: define.h:727
StepReader::FDTRepresentation
FDTRepresentation
Definition: dtk_StepReader.hpp:67
StepReader::PopulateComponentsTree
Dtk_ErrorStatus PopulateComponentsTree(const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
StepReader::GetAssociatedEntities
Dtk_ErrorStatus GetAssociatedEntities(Dtk_Node &inNode, Dtk_tab< Dtk_NodeConnectorPtr > &outAssociatedEntities)
StepReader::GetConnectorsPointingToThisComponent
Dtk_ErrorStatus GetConnectorsPointingToThisComponent(Dtk_Component &inCompo, Dtk_tab< Dtk_NodeConnectorPtr > &outConnectedEntities)
StepReader::ReadComponent
Dtk_ErrorStatus ReadComponent(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
StepReader::ActivateReader
Dtk_ErrorStatus ActivateReader()
StepReader::SetAllowReadInvalidFiles
static Dtk_ErrorStatus SetAllowReadInvalidFiles(const Dtk_bool inMode)
Define if we should try to process potentially corrupted file.
StepReader::DesactivateReader
Dtk_ErrorStatus DesactivateReader()
StepReader::InitReader
Dtk_ErrorStatus InitReader(const Dtk_string &inInputFile)
Dtk_Node
This is the Node Class.
Definition: dtk_maindoc.hpp:230
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:689
StepReader::SetLayerDescriptionMode
static Dtk_ErrorStatus SetLayerDescriptionMode(const Dtk_bool inMode)
Select Mode to get Description of Layer added to its name.
StepReader::SetModePropagateColor
static Dtk_ErrorStatus SetModePropagateColor(const Dtk_bool inMode)
Set Mode to propagate colors of a body (solid, surfacic ..) to its faces.
StepReader::StepReader
StepReader()
StepReader::CreateDocument
Dtk_ErrorStatus CreateDocument(const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
StepReader::SetAsDeprecated
SetAsDeprecated("2025.4", "Use StepReader::SetModeFDTRepresentation method instead.") static Dtk_ErrorStatus SetModeReadFDT(const int inMode)
Activates/Deactivates Reading of FDT.
define.h
StepReader
Definition: dtk_StepReader.hpp:10
StepReader::SetReadExtendedAsciiMode
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 enco...
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
StepReader::EndComponent
Dtk_ErrorStatus EndComponent(Dtk_ComponentPtr &inComponent)
Dtk_Component
This is the Component Class. The Dtk_ComponentPtr object is used as element into an assembly tree....
Definition: dtk_maindoc.hpp:554
StepReader::~StepReader
virtual ~StepReader()
dtk_reader.hpp
StepReader::GetFileVersion
Dtk_ErrorStatus GetFileVersion(const Dtk_string &inInputFile, Dtk_string &outVersion)
StepReader::_Init
void _Init()
StepReader::SetModeFDTRepresentation
static Dtk_ErrorStatus SetModeFDTRepresentation(FDTRepresentation)
Choose a representation mode for FDT. See FDTRepresentation enum for more details.
StepReader::SetModeProperty
static Dtk_ErrorStatus SetModeProperty(const int inModeProp, const int inModeValProp=0)
Set Mode to read properties and attributes (PROPERTY_DEFINITION), and to compute Validation Propertie...