CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
IfcFile.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef _IFC_FILE_H
25#define _IFC_FILE_H
26
27#include "OdPlatformSettings.h"
28
29#define STL_USING_MAP
30#include "OdaSTL.h"
31
32#include "daiStepFile.h"
33#include "daiCompressedGUID.h"
34
35#include "IfcCore.h"
36#include "IfcModel.h"
37#include "IfcEntity.h"
38#include "IfcModelContext.h"
39#include "IfcUnitConverter.h"
40#include "IfcGeomModule.h"
41
44class OdIfcDatabaseReactor;
45
50class IFCCORE_EXPORT OdIfcFile : public OdStepFile
51{
52public:
53
54 //DOM-IGNORE-BEGIN
56 //DOM-IGNORE-END
57
62
67
73
79
88
95 OdDAIObjectId getProjectId() const;
96
103 const OdDAIObjectIds getRootIds() override;
104
110 OdDAIObjectId getEntityId(const OdDAI::CompressedGUID&ifcGUID) const;
111
117
122 void setContext(const OdIfcModelContext& context);
123
128 void setActiveView(OdGsView *pActiveView);
129
135
141
147 OdResult composeEntitiesbyIds(const OdDAIObjectIds &entitiesToCompose);
148
154
161 OdResult setContextSelection(const OdDAIObjectIds &contexts);
162
168 bool getContextSelected(const OdDAIObjectId &idCtx) const;
169
180
185 OdDAI::OdUnitConverterPtr getUnitConverter();
186
193 virtual OdDAI::OdCompoundPtr getCompound(const OdDAIObjectId& id) override;
194
200 OdIfc::OdIfcInstancePtr get(const OdDAIObjectId &id) const;
201
207 OdResult get(const OdDAIObjectIds &ids) const;
208
209//DOM-IGNORE-BEGIN
210
212
220 bool registerProduct(OdDAI::ApplicationInstance* pProduct);
221
227 bool updateProduct(OdDAI::ApplicationInstance * pProduct);
228
233 void addReactor(OdIfcDatabaseReactor* pReactor);
234
239 void fireObjectErased(OdIfc::OdIfcCompound* pProduct, bool pErased);
240
246
252
257 virtual void setGsNode(OdGsCache* pGsNode)
258 {
259 m_gsNode = pGsNode;
260 };
261
266 virtual OdGsCache* gsNode() const
267 {
268 return m_gsNode;
269 };
270
276
277 using OdStepFile::initialize;
278
279protected:
280
285 virtual OdResult onReadFileEnd() override;
286
293 virtual OdResult checkSchema(const OdAnsiString &schemaIdentifier) const override;
294
295private:
296
297 virtual const char* defaultRepoName() override;
298
299 OdResult setGeomResource();
300
305 OdResult collectEntityIds() const;
306
307 OdGsCache *m_gsNode = nullptr;
308 OdGsView *m_ActiveView = nullptr;
309 OdDAIObjectIds m_selContexts;
310 OdDAI::OdUnitConverterPtr m_pConverter;
312 OdIfcEntResolver *m_pEntResolver = nullptr;
313 mutable OdDAIObjectId m_ifcProjectId;
314 mutable std::map<OdDAI::CompressedGUID, OdDAIObjectId> m_ifcEntities;
315 Reactors m_Reactors;
316 bool m_bSuppressNotifications = false;
317
318public: //FELIX_CHANGE
319 OdMutex m_mutex; //FELIX_CHANGE
320//DOM-IGNORE-END
321};
322
327
328namespace OdIfc {
329 class OdIfcCompound;
330}
331
340{
341 //DOM-IGNORE-BEGIN
342protected:
343
345
347
349 //DOM-IGNORE-END
350
351public:
352
357 : m_pFile(nullptr)
358 {}
359
363 virtual ~OdIfcEntResolver() {};
364
369 void setFile(OdIfcFile *file) { m_pFile = file; };
370
378 void setComposeTypes(const OdArray<OdIfc::OdIfcEntityType> &composeTypes) { m_composeTypes = composeTypes; };
379
385 virtual bool resolve(OdIfc::OdIfcInstance* inst) = 0;
386};
387
388#endif // _IFC_CORE_H
OdSmartPtr< OdIfcFile > OdIfcFilePtr
#define IFCCORE_EXPORT
IfcSchema
Definition IfcCore.h:40
OdResult
Definition OdResult.h:29
Definition Gs.h:141
OdArray< OdIfc::OdIfcEntityType > m_composeTypes
Definition IfcFile.h:346
void setComposeTypes(const OdArray< OdIfc::OdIfcEntityType > &composeTypes)
Definition IfcFile.h:378
virtual ~OdIfcEntResolver()
Definition IfcFile.h:363
virtual bool resolve(OdIfc::OdIfcInstance *inst)=0
void assignEntity(OdIfc::OdIfcCompound *compound, OdIfc::OdIfcInstance *inst)
void setFile(OdIfcFile *file)
Definition IfcFile.h:369
OdIfcFile * m_pFile
Definition IfcFile.h:344
OdMutex m_mutex
Definition IfcFile.h:319
OdDAI::OdUnitConverterPtr getUnitConverter()
OdIfcModelContext & getContext()
OdResult composeEntities()
ODRX_DECLARE_MEMBERS(OdIfcFile)
OdArray< OdIfcDatabaseReactor *, OdMemoryAllocator< OdIfcDatabaseReactor * > > Reactors
Definition IfcFile.h:211
virtual void setGsNode(OdGsCache *pGsNode)
Definition IfcFile.h:257
virtual OdDAI::OdCompoundPtr getCompound(const OdDAIObjectId &id) override
bool updateProduct(OdDAI::ApplicationInstance *pProduct)
OdResult initializeUnitConverter()
OdIfc::OdIfcInstancePtr get(const OdDAIObjectId &id) const
void fireObjectErased(OdIfc::OdIfcCompound *pProduct, bool pErased)
bool getContextSelected(const OdDAIObjectId &idCtx) const
void setActiveView(OdGsView *pActiveView)
OdResult unresolveEntities()
void setAppServices(OdIfcHostAppServices *svcs)
OdResult initialize(IfcSchema schema)
virtual OdGsCache * gsNode() const
Definition IfcFile.h:266
virtual OdResult checkSchema(const OdAnsiString &schemaIdentifier) const override
void fireObjectAppended(OdIfc::OdIfcCompound *pProduct)
OdGsView * getActiveView() const
OdDAIObjectId getEntityId(const OdDAI::CompressedGUID &ifcGUID) const
OdIfcHostAppServices * getAppServices() const
OdResult composeEntitiesbyIds(const OdDAIObjectIds &entitiesToCompose)
OdDAIObjectId getProjectId() const
void setContext(const OdIfcModelContext &context)
const OdDAIObjectIds getRootIds() override
OdResult get(const OdDAIObjectIds &ids) const
OdResult getGeomExtents(OdGeExtents3d &extents) const
void addReactor(OdIfcDatabaseReactor *pReactor)
OdResult setContextSelection(const OdDAIObjectIds &contexts)
bool registerProduct(OdDAI::ApplicationInstance *pProduct)
void fireObjectModified(OdIfc::OdIfcCompound *pProduct)
virtual OdResult onReadFileEnd() override
OdSmartPtr< OdIfcGeomModule > OdIfcGeomModulePtr