DATAKIT SDK  V2026.3
dtk_IfcReader.hpp
Go to the documentation of this file.
1 #ifndef _DTK_IFC_READER_H_
2 #define _DTK_IFC_READER_H_
3 
4 class IfcReader: public Dtk_Reader
5 {
6 public:
9 
10  static Dtk_bool Enable();
11  Dtk_ErrorStatus CreateDocument(const Dtk_string& inInputFile, Dtk_MainDocPtr& outDocument);
12  Dtk_ErrorStatus GetFileVersion(const Dtk_string& inInputFile, Dtk_string& outVersion);
13  Dtk_ErrorStatus PopulateComponentsTree(const Dtk_string& inInputFile, Dtk_MainDocPtr& inoutDocument, Dtk_ComponentPtr& outRootComponent);
14  Dtk_ErrorStatus PopulateComponentsTree(const Dtk_tab< Dtk_StreamPtr >& inArrayStream, Dtk_MainDocPtr& inoutDocument, Dtk_ComponentPtr& outRootComponent );
16  Dtk_ErrorStatus ReadComponent(const Dtk_ComponentPtr& inComponent, Dtk_NodePtr& outRootNode);
22  Dtk_ErrorStatus InitReader(const Dtk_string& inInputFile);
24  Dtk_ErrorStatus GetFilePreview( const Dtk_string &inInputFile, Dtk_PreviewPtr& outPreview );
27 
28  //! [Options]
29  //! \brief Set Preference on keeping Opening solids
30  //! \param [in] inActivate : 1 to keep opening solids, 0 to remove them (default)
31  static void SetCfgIfcReadComputeOpening( Dtk_bool inActivate );
32 
33  //! \brief Set Preference on creating a catalog for IfcLayers
34  //! \param [in] inActivate : 1 create layer catalog, 0 does not create it (default)
35  static void SetCfgIfcReadComputeLayer( Dtk_bool inActivate );
36 
37  //! \brief Set Preference on creating a catalog for IfcGroups
38  //! \param [in] inActivate : 1 create group catalog, 0 does not create it (default)
39  static void SetCfgIfcReadComputeGroup( Dtk_bool inActivate );
40 
41  //! \brief Set Preference on keeping IfcSpace components
42  //! \param [in] inActivate : 1 keep IfcSpace, 0 does not keep them (default)
43  static void SetCfgIfcReadKeepIfcSpace( Dtk_bool inActivate );
44 
45  //! \brief Set Preference on setting the name of components
46  //! \param [in] inActivate : 1 each component name is as defined in the file for the corresponding IfcProduct (default), 2 the name only contains the GUID of the IfcProduct
47  static void SetCfgIfcDefineNameComponent( int inValue );
48 
49  //! \brief Set Preference on applying the IfcSite Transfo that is only stored as a metadata otherwise.
50  //! \param [in] inActivate : 1 apply the transfo, 0 does not apply it (default)
51  static void SetCfgIfcApplySiteTransfo( Dtk_bool inActivate );
52  //! [Options]
53 
54 private:
55  void _Init() ;
56  void _Reset();
57 
58  struct Dtk_Handle;
59  Dtk_Handle * _Private;
60 };
61 
62 //! \deprecated Use IfcReader::SetCfgIfcReadComputeOpening.
63 SetAsDeprecated( "2025.3", "Use IfcReader::SetCfgIfcReadComputeOpening." )
64 void ifcr_SetCfgIfcReadComputeOpening(Dtk_bool inActivate);
65 //! \deprecated Use IfcReader::SetCfgIfcReadComputeLayer.
66 SetAsDeprecated( "2025.3", "Use IfcReader::SetCfgIfcReadComputeLayer." )
67 void ifcr_SetCfgIfcReadComputeLayer(Dtk_bool inActivate);
68 //! \deprecated Use IfcReader::SetCfgIfcReadComputeGroup.
69 SetAsDeprecated( "2025.3", "Use IfcReader::SetCfgIfcReadComputeGroup." )
70 void ifcr_SetCfgIfcReadComputeGroup(Dtk_bool inActivate);
71 //! \deprecated Use IfcReader::SetCfgIfcReadKeepIfcSpace.
72 SetAsDeprecated( "2025.3", "Use IfcReader::SetCfgIfcReadKeepIfcSpace." )
73 void ifcr_SetCfgIfcReadKeepIfcSpace(Dtk_bool inActivate);
74 //! \deprecated Use IfcReader::SetCfgIfcDefineNameComponent.
75 SetAsDeprecated( "2025.3", "Use IfcReader::SetCfgIfcDefineNameComponent." )
76 void ifcr_SetCfgIfcDefineNameComponent(int inValue);
77 //! \deprecated Use IfcReader::SetCfgIfcApplySiteTransfo.
78 SetAsDeprecated( "2025.3", "Use IfcReader::SetCfgIfcApplySiteTransfo." )
79 void ifcr_SetCfgIfcApplySiteTransfo(Dtk_bool inActivate);
80 //! \deprecated Please contact us if you're using it.
81 SetAsDeprecated( "2025.3", "Please contact us if you're using it." )
82 void ifcr_SetCfgIfcKeepOldInstanceName( Dtk_bool inActivate );
83 //! \deprecated Please contact us if you're using it.
84 SetAsDeprecated( "2025.3", "Please contact us if you're using it." )
85 void ifcr_SetCfgIfcEnableStructuralItemPort( Dtk_bool inActivate );
86 
87 #endif
88 
IfcReader::SetCfgIfcDefineNameComponent
static void SetCfgIfcDefineNameComponent(int inValue)
Set Preference on setting the name of components.
IfcReader::GetFileVersion
Dtk_ErrorStatus GetFileVersion(const Dtk_string &inInputFile, Dtk_string &outVersion)
IfcReader::GetFilePreview
Dtk_ErrorStatus GetFilePreview(const Dtk_string &inInputFile, Dtk_PreviewPtr &outPreview)
IfcReader::SetCfgIfcApplySiteTransfo
static void SetCfgIfcApplySiteTransfo(Dtk_bool inActivate)
Set Preference on applying the IfcSite Transfo that is only stored as a metadata otherwise.
IfcReader::EndComponent
Dtk_ErrorStatus EndComponent(Dtk_ComponentPtr &inComponent)
IfcReader::~IfcReader
~IfcReader()
IfcReader::SetCfgIfcReadComputeGroup
static void SetCfgIfcReadComputeGroup(Dtk_bool inActivate)
Set Preference on creating a catalog for IfcGroups.
IfcReader::SetCfgIfcReadComputeOpening
static void SetCfgIfcReadComputeOpening(Dtk_bool inActivate)
Set Preference on keeping Opening solids.
IfcReader::SetCfgIfcReadComputeLayer
static void SetCfgIfcReadComputeLayer(Dtk_bool inActivate)
Set Preference on creating a catalog for IfcLayers.
Dtk_Reader
Definition: dtk_reader.hpp:15
IfcReader::ReadEntity
Dtk_ErrorStatus ReadEntity(Dtk_Node &inNode, Dtk_EntityPtr &outEntity)
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
IfcReader::ReadComponent
Dtk_ErrorStatus ReadComponent(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
Dtk_bool
char Dtk_bool
Definition: define.h:724
IfcReader
Definition: dtk_IfcReader.hpp:5
SetAsDeprecated
SetAsDeprecated("2025.3", "Use IfcReader::SetCfgIfcReadComputeOpening.") void ifcr_SetCfgIfcReadComputeOpening(Dtk_bool inActivate)
IfcReader::ReadAdditionalInfos
Dtk_ErrorStatus ReadAdditionalInfos(Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
IfcReader::ReadComponentGraphic
Dtk_ErrorStatus ReadComponentGraphic(const Dtk_ComponentPtr &inComponent, Dtk_GraphicalDataPtr &outGraphicalData)
IfcReader::IfcReader
IfcReader()
IfcReader::GetVersion
Dtk_Int32 GetVersion()
Dtk_Node
This is the Node Class.
Definition: dtk_maindoc.hpp:236
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:686
IfcReader::Enable
static Dtk_bool Enable()
IfcReader::PopulateComponentsTree
Dtk_ErrorStatus PopulateComponentsTree(const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
IfcReader::CreateDocumentGraphical
Dtk_ErrorStatus CreateDocumentGraphical(const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
IfcReader::InitReader
Dtk_ErrorStatus InitReader(const Dtk_string &inInputFile)
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
IfcReader::CreateDocument
Dtk_ErrorStatus CreateDocument(const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
IfcReader::SetCfgIfcReadKeepIfcSpace
static void SetCfgIfcReadKeepIfcSpace(Dtk_bool inActivate)
Set Preference on keeping IfcSpace components.
IfcReader::DesactivateReader
Dtk_ErrorStatus DesactivateReader()
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
IfcReader::EndPopulateComponentsTree
Dtk_ErrorStatus EndPopulateComponentsTree()
IfcReader::ActivateReader
Dtk_ErrorStatus ActivateReader()
IfcReader::PopulateComponentsTree
Dtk_ErrorStatus PopulateComponentsTree(const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)