CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
IfcFile.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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
34#include "IfcCore.h"
35#include "IfcModel.h"
36#include "IfcEntity.h"
37#include "IfcModelContext.h"
38#include "IfcUnitConverter.h"
39#include "IfcGeomModule.h"
40
43
48class IFCCORE_EXPORT OdIfcFile : public OdStepFile
49{
50public:
51
52 //DOM-IGNORE-BEGIN
54 //DOM-IGNORE-END
55
60
65
71
77
86
93 OdDAIObjectId getProjectId() const;
94
100 OdDAIObjectId getEntityId(const OdIfcGUID &ifcGUID) const;
101
107
112 void setContext(const OdIfcModelContext& context);
113
118 void setActiveView(OdGsView *pActiveView);
119
125
132
138
145 OdResult setContextSelection(const OdDAIObjectIds &contexts);
146
152 bool getContextSelected(const OdDAIObjectId &idCtx) const;
153
164
170
176 OdIfc::OdIfcEntityPtr get(const OdDAIObjectId &id) const;
177
183 OdResult get(const OdDAIObjectIds &ids) const;
184
185//DOM-IGNORE-BEGIN
186
191 virtual void setGsNode(OdGsCache* pGsNode)
192 {
193 m_gsNode = pGsNode;
194 };
195
200 virtual OdGsCache* gsNode() const
201 {
202 return m_gsNode;
203 };
204
210
211 using OdStepFile::initialize;
212
213protected:
214
219 virtual OdResult onReadFileEnd() override;
220
227 virtual OdResult checkSchema(const OdAnsiString &schemaIdentifier) const override;
228
234 virtual OdResult checkRepo(const OdDAI::Repository* repo) const override;
235
236
237private:
238
239 virtual const char* defaultRepoName() override;
240
241 OdResult setGeomResource();
242
247 OdResult collectEntityIds() const;
248
249 OdGsCache *m_gsNode = nullptr;
250 OdGsView *m_ActiveView = nullptr;
251 OdDAIObjectIds m_selContexts;
252 OdIfcUnitConverterPtr m_pConverter;
253 OdIfcModelContext m_context;
255 OdIfcEntResolver *m_pEntResolver = nullptr;
256 mutable OdDAIObjectId m_ifcProjectId;
257 mutable std::map<OdIfcGUID, OdDAIObjectId> m_ifcEntities;
258public: //FELIX_CHANGE
259 OdMutex m_mutex; //FELIX_CHANGE
260//DOM-IGNORE-END
261};
262
267
268namespace OdIfc {
269 class OdIfcCompound;
270 class OdIfcEntity;
271}
272
281{
282 //DOM-IGNORE-BEGIN
283protected:
284
286
288
290 //DOM-IGNORE-END
291
292public:
293
298 : m_pFile(nullptr)
299 {}
300
304 virtual ~OdIfcEntResolver() {};
305
310 void setFile(OdIfcFile *file) { m_pFile = file; };
311
316 void setComposeTypes(const OdArray<OdIfc::OdIfcEntityType> &composeTypes) { m_composeTypes = composeTypes; };
317
323 virtual bool resolve(OdIfc::OdIfcEntity* inst) = 0;
324};
325
326#endif // _IFC_CORE_H
#define IFCCORE_EXPORT
IfcSchema
Definition: IfcCore.h:40
OdSmartPtr< OdIfcFile > OdIfcFilePtr
Definition: IfcFile.h:266
OdResult
Definition: OdResult.h:29
Definition: Gs.h:140
OdArray< OdIfc::OdIfcEntityType > m_composeTypes
Definition: IfcFile.h:287
void setComposeTypes(const OdArray< OdIfc::OdIfcEntityType > &composeTypes)
Definition: IfcFile.h:316
virtual ~OdIfcEntResolver()
Definition: IfcFile.h:304
virtual bool resolve(OdIfc::OdIfcEntity *inst)=0
void setFile(OdIfcFile *file)
Definition: IfcFile.h:310
OdIfcFile * m_pFile
Definition: IfcFile.h:285
void assignEntity(OdIfc::OdIfcCompound *compound, OdIfc::OdIfcEntity *inst)
OdMutex m_mutex
Definition: IfcFile.h:259
OdIfc::OdIfcEntityPtr get(const OdDAIObjectId &id) const
OdResult composeEntities()
ODRX_DECLARE_MEMBERS(OdIfcFile)
virtual void setGsNode(OdGsCache *pGsNode)
Definition: IfcFile.h:191
OdResult initializeUnitConverter()
OdIfcUnitConverterPtr getUnitConverter()
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:200
virtual OdResult checkSchema(const OdAnsiString &schemaIdentifier) const override
OdGsView * getActiveView() const
virtual OdResult checkRepo(const OdDAI::Repository *repo) const override
OdIfcHostAppServices * getAppServices() const
OdDAIObjectId getProjectId() const
OdDAIObjectId getEntityId(const OdIfcGUID &ifcGUID) const
void setContext(const OdIfcModelContext &context)
OdResult get(const OdDAIObjectIds &ids) const
OdIfcModelContext getContext() const
OdResult getGeomExtents(OdGeExtents3d &extents) const
OdResult setContextSelection(const OdDAIObjectIds &contexts)
virtual OdResult onReadFileEnd() override