CFx SDK Documentation  2020SP3
IfcFile.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2019, 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-2019 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 #include "OdStreamBuf.h"
29 #include "daiRepository.h"
30 #include "IfcCore.h"
31 #include "IfcModel.h"
32 #include "daiApiUtils.h"
33 //#include "IfcModelContext.h"
34 
36 
40 namespace OdIfc {
41 
45  class IFCCORE_EXPORT OdIfcFile : public OdRxObject //OdGiDrawable
46  {
47  public:
48  //DOM-IGNORE-BEGIN
50  //DOM-IGNORE-END
51 
53 
58 
64 
68  void setFileName(const OdString &name);
69 
75 
81 
88 
94  virtual OdResult readFile(const OdString& fileName);
95 
101  virtual OdResult readFile(OdStreamBufPtr pStream);
102 
109  virtual OdResult writeFile(const OdString& filename, bool saveLogFile = false);
110 
116 
121  virtual OdIfcModelPtr getModel() const;
122 
128 
129 
137 
143 
148  void setContext(const OdIfcModelContext& context);
149 
150 
155  void setActiveView(OdGsView *pActiveView);
156 
162 
164 
165 //DOM-IGNORE-BEGIN
166 
171  virtual void setGsNode(OdGsCache* pGsNode)
172  {
173  m_gsNode = pGsNode;
174  };
175 
180  virtual OdGsCache* gsNode() const
181  {
182  return m_gsNode;
183  };
184 
185  private:
186  OdIfcHostAppServices *m_pHostAppServices;
187  OdGsCache *m_gsNode;
188  OdGsView *m_ActiveView;
189  OdDAI::RepositoryPtr m_pRepository;
190 //DOM-IGNORE-END
191  };
192 
197 
198  namespace Utils
199  {
200 
203  {
204  private:
205  static ModelPtr fileModelExtract(const OdIfcFile* pFile)
206  { // linux fix
207  if (pFile) { return pFile->getModel();}
208  return ModelPtr();
209  }
210 
211  public:
213  : ModelProvider(fileModelExtract(pFile.get()))
214  {}
215 
217  : ModelProvider(fileModelExtract(pFile))
218  {}
219 
220  };
221 
224  {
225  private:
226  static ModelPtr fileModelExtract(OdIfcFile* pFile)
227  { // linux fix
228  if (pFile) { return pFile->getModelRW(); }
229  return ModelPtr();
230  }
231 
232  public:
234  : ModelProvider(fileModelExtract(pFile.get()))
235  {}
236 
238  : ModelProvider(fileModelExtract(pFile))
239  {}
240  };
241  }
242 
243 } //namespace OdIfc
244 
245 #endif // _IFC_CORE_H
OdResult
OdResult
Definition: OdResult.h:29
OdIfc::Utils::FileModelProviderRW
Definition: IfcFile.h:224
OdString
Definition: OdString.h:95
OdIfc::OdIfcFile::readFile
virtual OdResult readFile(OdStreamBufPtr pStream)
IFCCORE_EXPORT
#define IFCCORE_EXPORT
Definition: IfcBuildOptions.h:28
OdIfc::Utils::FileModelProviderRO::FileModelProviderRO
FileModelProviderRO(const OdIfcFilePtr &pFile)
Definition: IfcFile.h:212
name
GLuint const GLchar * name
Definition: gles2_ext.h:265
OdGsView
Definition: Gs.h:133
OdDAIObjectId
Definition: daiObjectId.h:67
OdIfc::OdIfcFile::getProjectId
OdDAIObjectId getProjectId()
InitialSchema
InitialSchema
Definition: IfcCore.h:42
OdRxObject
Definition: RxObject.h:564
OdIfc::Utils::FileModelProviderRO
Definition: IfcFile.h:203
daiRepository.h
OdGsCache
Definition: GsModel.h:40
OdIfc::OdIfcFile::createObject
static OdSmartPtr< OdIfcFile > createObject(OdIfcHostAppServices *svcs, OdDAI::RepositoryPtr repository)
OdIfc::OdIfcFile::getContext
OdIfcModelContext getContext() const
OdIfc::OdIfcFile
Definition: IfcFile.h:46
OdIfc::Utils::FileModelProviderRW::FileModelProviderRW
FileModelProviderRW(OdIfcFilePtr &pFile)
Definition: IfcFile.h:233
OdIfc::OdIfcFile::readFile
virtual OdResult readFile(const OdString &fileName)
OdDAI::Utils::ModelProvider
Definition: daiApiUtils.h:45
OdStreamBuf.h
IfcCore.h
OdIfc::OdIfcFile::initialize
OdResult initialize(InitialSchema modelScheme)
OdSmartPtr
Definition: SmartPtr.h:58
OdIfc
Definition: FxBIMDatabase.h:24
OdIfc::OdIfcFile::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdIfcFile)
OdIfc::OdIfcFile::setAppServices
void setAppServices(OdIfcHostAppServices *svcs)
OdIfcHostAppServices
Definition: IfcHostAppServices.h:39
OdIfc::OdIfcFile::getHeaderSection
OdHeaderSectionPtr getHeaderSection()
OdIfc::Utils::FileModelProviderRW::FileModelProviderRW
FileModelProviderRW(OdIfcFile *pFile)
Definition: IfcFile.h:237
OdDAI::ModelPtr
OdSmartPtr< Model > ModelPtr
Definition: daiModel.h:56
OdIfc::OdIfcFile::getFileName
OdString getFileName() const
OdPlatformSettings.h
OdIfc::OdIfcFile::getRepository
OdDAI::RepositoryPtr getRepository() const
OdIfc::OdIfcFile::OdIfcFile
OdIfcFile()
OdIfc::OdIfcFile::gsNode
virtual OdGsCache * gsNode() const
Definition: IfcFile.h:180
OdDAI::Utils::ModelProvider::ModelProvider
ModelProvider(const ModelPtr &model)
Definition: daiApiUtils.h:47
OdIfc::OdIfcFile::getModelRW
virtual OdIfcModelPtr getModelRW()
OdIfc::OdIfcFile::setContext
void setContext(const OdIfcModelContext &context)
OdIfc::OdIfcFile::getModel
virtual OdIfcModelPtr getModel() const
OdIfc::OdIfcFilePtr
OdSmartPtr< OdIfcFile > OdIfcFilePtr
Definition: FxBIMDatabase.h:25
daiApiUtils.h
OdIfc::OdIfcFile::setGsNode
virtual void setGsNode(OdGsCache *pGsNode)
Definition: IfcFile.h:171
OdIfc::OdIfcFile::writeFile
virtual OdResult writeFile(const OdString &filename, bool saveLogFile=false)
OdIfc::OdIfcFile::getActiveView
OdGsView * getActiveView() const
OdIfc::OdIfcFile::setActiveView
void setActiveView(OdGsView *pActiveView)
OdIfc::OdIfcFile::setFileName
void setFileName(const OdString &name)
OdIfc::OdIfcFile::getAppServices
OdIfcHostAppServices * getAppServices() const
OdIfc::Utils::FileModelProviderRO::FileModelProviderRO
FileModelProviderRO(const OdIfcFile *pFile)
Definition: IfcFile.h:216
OdIfc::OdIfcModelContext
Definition: IfcModelContext.h:47
IfcModel.h