CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdIfcFile Class Reference

#include <IfcFile.h>

Inheritance diagram for OdIfcFile:

Public Types

typedef OdArray< OdIfcDatabaseReactor *, OdMemoryAllocator< OdIfcDatabaseReactor * > > Reactors
 

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdIfcFile)
 
 OdIfcFile ()
 
 ~OdIfcFile ()
 
OdIfcHostAppServicesgetAppServices () const
 
void setAppServices (OdIfcHostAppServices *svcs)
 
OdResult initialize (IfcSchema schema)
 
OdDAIObjectId getProjectId () const
 
const OdDAIObjectIds getRootIds () override
 
OdDAIObjectId getEntityId (const OdDAI::CompressedGUID &ifcGUID) const
 
OdIfcModelContextgetContext ()
 
void setContext (const OdIfcModelContext &context)
 
void setActiveView (OdGsView *pActiveView)
 
OdGsViewgetActiveView () const
 
OdResult composeEntities ()
 
OdResult composeEntitiesbyIds (const OdDAIObjectIds &entitiesToCompose)
 
OdResult unresolveEntities ()
 
OdResult setContextSelection (const OdDAIObjectIds &contexts)
 
bool getContextSelected (const OdDAIObjectId &idCtx) const
 
OdResult getGeomExtents (OdGeExtents3d &extents) const
 
OdDAI::OdUnitConverterPtr getUnitConverter ()
 
virtual OdDAI::OdCompoundPtr getCompound (const OdDAIObjectId &id) override
 
OdIfc::OdIfcInstancePtr get (const OdDAIObjectId &id) const
 
OdResult get (const OdDAIObjectIds &ids) const
 
bool registerProduct (OdDAI::ApplicationInstance *pProduct)
 
bool updateProduct (OdDAI::ApplicationInstance *pProduct)
 
void addReactor (OdIfcDatabaseReactor *pReactor)
 
void fireObjectErased (OdIfc::OdIfcCompound *pProduct, bool pErased)
 
void fireObjectAppended (OdIfc::OdIfcCompound *pProduct)
 
void fireObjectModified (OdIfc::OdIfcCompound *pProduct)
 
virtual void setGsNode (OdGsCache *pGsNode)
 
virtual OdGsCachegsNode () const
 
OdResult initializeUnitConverter ()
 

Public Attributes

OdMutex m_mutex
 

Protected Member Functions

virtual OdResult onReadFileEnd () override
 
virtual OdResult checkSchema (const OdAnsiString &schemaIdentifier) const override
 

Detailed Description

A class that implements working with an IFC file header and data sections (header and model), takes responsibility for the geometry creation and visualization, higher-level features like the access to unit conversions and mapping IfcGuid - OdDAIObjectId.

Definition at line 50 of file IfcFile.h.

Member Typedef Documentation

◆ Reactors

typedef OdArray<OdIfcDatabaseReactor*, OdMemoryAllocator<OdIfcDatabaseReactor*> > OdIfcFile::Reactors

Definition at line 211 of file IfcFile.h.

Constructor & Destructor Documentation

◆ OdIfcFile()

OdIfcFile::OdIfcFile ( )

Creates a new IFC file object with default parameters.

◆ ~OdIfcFile()

OdIfcFile::~OdIfcFile ( )

Destroys the IFC file object.

Member Function Documentation

◆ addReactor()

void OdIfcFile::addReactor ( OdIfcDatabaseReactor * pReactor)

Function adds reactor instanse to the OdIfcFile.

Parameters
pReactor[in] Pointer to the notification class.

◆ checkSchema()

virtual OdResult OdIfcFile::checkSchema ( const OdAnsiString & schemaIdentifier) const
overrideprotectedvirtual

Checks if schema with identifier provided is supported by OdIfcFile.

Parameters
schemaIdentifier[in] A string that contains the schema identifier.
Returns
true if schema is supported by OdIfcFile instance; otherwise returns false.
Remarks
Schema identifier may be empty, or must contain IFC letters.

◆ composeEntities()

OdResult OdIfcFile::composeEntities ( )

Composes geometry of entities in the IFC model using the assigned <exref target="https://docs.opendesign.com/tifc_api_cpp/resolver.html>resolver</exref> object.

Returns
eOk if geometry of entities was composed successfully; otherwise, the method returns an appropriate error code.

◆ composeEntitiesbyIds()

OdResult OdIfcFile::composeEntitiesbyIds ( const OdDAIObjectIds & entitiesToCompose)

Composes geometry of entities subset in the IFC model using the assigned <link OdIfcEntResolver, resolver> object.

Parameters
entitiesToCompose[in] A set of <link OdDAIObjectId, identifiers of SDAI objects>, which represent the entities selection.
Returns
eOk if geometry of entities was composed successfully; otherwise, the method returns an appropriate error code.

◆ fireObjectAppended()

void OdIfcFile::fireObjectAppended ( OdIfc::OdIfcCompound * pProduct)

Performs notifications whenever an OdIfcCompound inner entity has been appended to an OdIfcFile.

Parameters
pProduct[in] Pointer to the object being appended.

◆ fireObjectErased()

void OdIfcFile::fireObjectErased ( OdIfc::OdIfcCompound * pProduct,
bool pErased )

Performs notifications whenever an OdIfcCompound inner entity has been erased in the current OdIfcFile.

Parameters
pProduct[in] Pointer to the object being erased.

◆ fireObjectModified()

void OdIfcFile::fireObjectModified ( OdIfc::OdIfcCompound * pProduct)

Performs notifications whenever an OdIfcCompound inner entity has been modified in the current OdIfcFile.

Parameters
pProduct[in] Pointer to the object being modified.

◆ get() [1/2]

OdIfc::OdIfcInstancePtr OdIfcFile::get ( const OdDAIObjectId & id) const

Performs an attempt to compose an instance using the specified resolver object.

Parameters
id[in] An <exref target="https://docs.opendesign.com/tifc_api_cpp/identifier.html>identifier</exref> of an object to compose.
Returns
A smart pointer to the entity with the attached compound object.

◆ get() [2/2]

OdResult OdIfcFile::get ( const OdDAIObjectIds & ids) const

Performs an attempt to compose entities using the specified resolver object.

Parameters
ids[in] An array of <exref target="https://docs.opendesign.com/tifc_api_cpp/identifiers.html>identifiers</exref> of objects to compose.
Returns
eOk if the compose operation was successful; otherwise the method returns an appropriate error code.

◆ getActiveView()

OdGsView * OdIfcFile::getActiveView ( ) const

Retrieves the current active view of the IFC file object.

Returns
Returns a raw pointer to the <exref target="https://docs.opendesign.com/tv_api_cpp/OdGsView.html">OdGsView</exref> object that represents the currently active view.

◆ getAppServices()

OdIfcHostAppServices * OdIfcFile::getAppServices ( ) const

Retrieves the application services object that is associated with the IFC file object.

Returns
Returns a raw pointer to the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcHostAppServices.html>OdIfcHostAppServices</exref> object associated with the file object.

◆ getCompound()

virtual OdDAI::OdCompoundPtr OdIfcFile::getCompound ( const OdDAIObjectId & id)
overridevirtual

Performs an attempt the compose object for an entity instance, if application instance doesn't have associated compound object. If application instance already has associated compound, it will be returned by this method.

Parameters
id[in] An <exref target="https://docs.opendesign.com/tifc_api_cpp/identifier.html>identifier</exref> of an object to compose.
Returns
A smart pointer to the attached compound object.

◆ getContext()

OdIfcModelContext & OdIfcFile::getContext ( )

Retrieves the current model context of the file object.

Returns
An instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcModelContext.html>OdIfcModelContext</exref> class.

◆ getContextSelected()

bool OdIfcFile::getContextSelected ( const OdDAIObjectId & idCtx) const

Determines whether an instance of the IfcGeometricRepresentationContext class is selected to build the geometry.

Parameters
idCtx[in] Object ID of geometric context to test.
Returns
true if an IfcGeometricRepresentationContext object is selected; otherwise, the method returns false.

◆ getEntityId()

OdDAIObjectId OdIfcFile::getEntityId ( const OdDAI::CompressedGUID & ifcGUID) const

Retrieves entity database id by IFC GUID.

Parameters
ifcGUID[in] An IFC GUID identifier of entity.
Returns
An <exref target="https://docs.opendesign.com/tifc_api_cpp/identifier.html>identifier</exref> of the entity.

◆ getGeomExtents()

OdResult OdIfcFile::getGeomExtents ( OdGeExtents3d & extents) const

Retrieves the current geometrical extents of the model.

Parameters
extents[out] A placeholder for the current geometry extents object to be returned to a calling subroutine.
Returns
eOk if the current extents were successfully returned; otherwise, the method returns an appropriate error code.
Remarks
The method returns the model extents only if the model was created by calling the setGeomResource() method. The method accepts an instance of the OdGeExtents3d class, fills it with the data about the model's extents and returns it to a calling subroutine.

◆ getProjectId()

OdDAIObjectId OdIfcFile::getProjectId ( ) const

Retrieves the IFC model's root entity.

Returns
The identifier of the root entity of the model.
Remarks
Each valid IFC file must have exactly one root entity.

◆ getRootIds()

const OdDAIObjectIds OdIfcFile::getRootIds ( )
override

Returns all found IfcProject instances object identifiers within a model.

Returns
An <exref target="https://docs.opendesign.com/tkernel_api_cpp/OdArray@classT@classA.html">OdArray</exref> of identifiers of the root instances of the model.
Remarks
Each valid IFC model must have exactly one root instance.

◆ getUnitConverter()

OdDAI::OdUnitConverterPtr OdIfcFile::getUnitConverter ( )

Retrieves the current model's unit converter.

Returns
An instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcUnitConverter.html>OdIfcUnitConverter</exref> class that represents the current model's unit converter.

◆ gsNode()

virtual OdGsCache * OdIfcFile::gsNode ( ) const
inlinevirtual

Retrieves the current Gs node object of the entity.

Returns
Returns a raw pointer to the <exref target="https://docs.opendesign.com/tv_api_cpp/OdGsCache.html">OdGsCache</exref> object associated with the entity.

Definition at line 266 of file IfcFile.h.

◆ initialize()

OdResult OdIfcFile::initialize ( IfcSchema schema)

Initializes the IFC file object with a specified schema.

Parameters
schema[in] A schema identifier.
Returns
eOk if the file was successfully initialized; otherwise, the method returns an appropriate error code.
Remarks
If the schema parameter equals the kScmUndefined value, the IFC file object will be created without an underlying <<exref target="https://docs.opendesign.com/tifc_api_cpp/OdDAI__Model.html>Model</exref> OdDAI::Model> object.

◆ initializeUnitConverter()

OdResult OdIfcFile::initializeUnitConverter ( )

Sets convertible unit from current <OdDAI::Model, Model> class.

Returns
eOk if initialization operation was successful; otherwise the method returns an appropriate error code.

◆ ODRX_DECLARE_MEMBERS()

OdIfcFile::ODRX_DECLARE_MEMBERS ( OdIfcFile )

◆ onReadFileEnd()

virtual OdResult OdIfcFile::onReadFileEnd ( )
overrideprotectedvirtual

Method is called just after file reading has ended, it initializes units converter for loaded model.

Returns
eOk if operation successfully done; otherwise, the method returns an appropriate error code.

◆ registerProduct()

bool OdIfcFile::registerProduct ( OdDAI::ApplicationInstance * pProduct)

Updates state of newly added to the model IfcProduct and allows reactor mechanism send appropiate notifications.

Parameters
pProduct[in] Pointer to the instance that has been appended to the file content.
Returns
true if the operation was successful; otherwise the method returns false.
Remarks
It is recommended registered product to be completely created within IFC Model, including geometric representation and other relationships, before registering.

◆ setActiveView()

void OdIfcFile::setActiveView ( OdGsView * pActiveView)

Sets a new active view for the IFC file's content.

Parameters
pActiveView[in] A raw pointer to the <exref target="https://docs.opendesign.com/tv_api_cpp/OdGsView.html">OdGsView</exref> object.

◆ setAppServices()

void OdIfcFile::setAppServices ( OdIfcHostAppServices * svcs)

Sets a new application services object with the IFC file object.

Parameters
svcs[in] A raw pointer to the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcHostAppServices.html>OdIfcHostAppServices</exref> object to be assigned with the file.

◆ setContext()

void OdIfcFile::setContext ( const OdIfcModelContext & context)

Sets a new model context for the IFC file object.

Parameters
context[in] An instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcModelContext.html>OdIfcModelContext</exref> class to be set as the model context object.

◆ setContextSelection()

OdResult OdIfcFile::setContextSelection ( const OdDAIObjectIds & contexts)

Sets geometrical context selection to build a geometrical representation for selected geometrical contexts. Only selected contexts will be composed and drawn.

Parameters
contexts[in] A set of <exref target="https://docs.opendesign.com/tifc_api_cpp/OdDAIObjectId.html>identifiers of SDAI objects</exref>, which represent the context selection.
Returns
eOk if the new context selection was successfully set; otherwise, the method returns an appropriate error code.

◆ setGsNode()

virtual void OdIfcFile::setGsNode ( OdGsCache * pGsNode)
inlinevirtual

Sets a new Gs node cache for the drawable.

Parameters
pGsNode[in] A raw pointer to an <exref target="https://docs.opendesign.com/tv_api_cpp/OdGsCache.html">OdGsCache</exref> object.

Definition at line 257 of file IfcFile.h.

◆ unresolveEntities()

OdResult OdIfcFile::unresolveEntities ( )

Unresolve entities in the IFC model.

Returns
eOk if the unresolve was successful; otherwise, the method returns an appropriate error code.

◆ updateProduct()

bool OdIfcFile::updateProduct ( OdDAI::ApplicationInstance * pProduct)

Updates state of modified IfcProduct with unresolve/resolve attempt and allows reactor mechanism send appropiate notifications.

Parameters
pProduct[in] Pointer to the instance that has been modified (including geometric representation and others).
Returns
true if the operation was successful; otherwise the method returns false.

Member Data Documentation

◆ m_mutex

OdMutex OdIfcFile::m_mutex

Definition at line 319 of file IfcFile.h.


The documentation for this class was generated from the following file: