CFx SDK Documentation  2023 SP0
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
#define IFCCORE_EXPORT
InitialSchema
Definition: IfcCore.h:42
OdResult
Definition: OdResult.h:29
ModelProvider(const ModelPtr &model)
Definition: daiApiUtils.h:47
Definition: Gs.h:133
void setActiveView(OdGsView *pActiveView)
OdIfcModelContext getContext() const
OdDAIObjectId getProjectId()
virtual OdIfcModelPtr getModel() const
virtual OdIfcModelPtr getModelRW()
static OdSmartPtr< OdIfcFile > createObject(OdIfcHostAppServices *svcs, OdDAI::RepositoryPtr repository)
ODRX_DECLARE_MEMBERS(OdIfcFile)
virtual OdResult readFile(const OdString &fileName)
OdIfcHostAppServices * getAppServices() const
void setFileName(const OdString &name)
void setContext(const OdIfcModelContext &context)
void setAppServices(OdIfcHostAppServices *svcs)
OdGsView * getActiveView() const
OdString getFileName() const
virtual OdResult readFile(OdStreamBufPtr pStream)
OdHeaderSectionPtr getHeaderSection()
virtual OdGsCache * gsNode() const
Definition: IfcFile.h:180
virtual void setGsNode(OdGsCache *pGsNode)
Definition: IfcFile.h:171
OdResult initialize(InitialSchema modelScheme)
OdDAI::RepositoryPtr getRepository() const
virtual OdResult writeFile(const OdString &filename, bool saveLogFile=false)
FileModelProviderRO(const OdIfcFile *pFile)
Definition: IfcFile.h:216
FileModelProviderRO(const OdIfcFilePtr &pFile)
Definition: IfcFile.h:212
FileModelProviderRW(OdIfcFile *pFile)
Definition: IfcFile.h:237
FileModelProviderRW(OdIfcFilePtr &pFile)
Definition: IfcFile.h:233
GLuint const GLchar * name
Definition: gles2_ext.h:265
OdSmartPtr< Model > ModelPtr
Definition: daiModel.h:56
OdSmartPtr< OdIfcFile > OdIfcFilePtr
Definition: FxBIMDatabase.h:42