CFx SDK Documentation  2023 SP0
FxBIMStorage.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2020-2022 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 #include "FxBIM.h"
20 
21 #include <DbObject.h>
22 
23 #include <map>
24 
25 class CFxBIMStorage;
27 
30 
31 class CFxBIMDrawing;
32 typedef std::shared_ptr< CFxBIMDrawing > CFxBIMDrawingPtr;
33 
34 class CFxBIMSection;
36 
38 {
39 public:
40  static CFxBIMStoragePtr GetStorage( OdDbDatabase* pDatabase, OdDb::OpenMode eMode = OdDb::kForRead, bool bCreateIfNotExist = false );
41 
42 public:
44 
45  virtual ~CFxBIMStorage();
46 
49 
50  virtual CFxBIMDbIteratorRAPtr DatabaseRefs() const; //CFxBIMDatabaseReference
51 
52  virtual Error AddSection( OdDbObjectId idSection );
53  virtual Error RemoveSection( OdDbObjectId idSection );
54  virtual OdDbObjectId FindSection( const OdString& name ) const;
55 
56  virtual CFxBIMDbIteratorRAPtr Sections() const; //CFxBIMSection
57 
58  virtual CFxBIMIteratorPtr Disciplines( OdDb::OpenMode openMode ) const;
59  virtual CFxBIMIteratorPtr Zones( OdDb::OpenMode openMode ) const;
60  virtual CFxBIMIteratorPtr Spaces( OdDb::OpenMode openMode ) const;
61  virtual CFxBIMIteratorPtr Floors( OdDb::OpenMode openMode ) const;
62  virtual CFxBIMIteratorPtr Categories( OdDb::OpenMode openMode ) const;
63  virtual CFxBIMIteratorPtr Types( OdDb::OpenMode openMode ) const;
64 
65  virtual CFxBIMDbIteratorPtr Entities( OdDb::OpenMode openMode ) const;
66  virtual CFxBIMDbIteratorPtr EntityRefs( OdDb::OpenMode openMode ) const;
67 
68  virtual Error AddReactor( CFxBIMObjectPtr p ) const; //CFxBIMDatabaseReferenceReactor, CFxBIMSectionReactor, CFxBIMMaterialReactor, etc.
69  virtual Error RemoveReactor( CFxBIMObjectPtr p ) const;
70 
71  virtual CFxBIMDbIteratorPtr Materials( OdDb::OpenMode openMode ) const;
72 
73  virtual const std::vector< CFxBIMDrawingPtr >& BimDrawings( CFxBIMSectionPtr pS ) const;
74  virtual std::vector< CFxBIMDrawingPtr >& BimDrawings( CFxBIMSectionPtr pS );
75 
76  using drawings_map = std::map< OdDbHandle, std::vector< CFxBIMDrawingPtr > >; //CFxBIMSection to bim drawings
77  virtual const drawings_map& BimDrawings() const;
79 
80  enum
81  {
82  eModifyUnlocked = 0x1,
83  eMainDatabase = 0x2,
84  eFlatshotDatabase = 0x4,
85  };
86  virtual int Flags() const;
87  virtual void SetFlags( int flags );
88 
89 public:
90  OdResult dwgInFields( OdDbDwgFiler* pFiler ) override;
91  void dwgOutFields( OdDbDwgFiler* pFiler ) const override;
92 
93  OdResult dxfInFields( OdDbDxfFiler* pFiler ) override;
94  void dxfOutFields( OdDbDxfFiler* pFiler ) const override;
95 
96  void subClose() override;
97 
98  void audit( OdDbAuditInfo* pAuditInfo ) override;
99 
100 protected:
102 };
std::shared_ptr< CFxBIMDbIterator > CFxBIMDbIteratorPtr
Definition: FxBIM.h:195
std::shared_ptr< CFxBIMDbIteratorRA > CFxBIMDbIteratorRAPtr
Definition: FxBIM.h:197
Error
Definition: FxBIM.h:50
#define FXBIM_API
Definition: FxBIM.h:20
std::shared_ptr< CFxBIMObject > CFxBIMObjectPtr
Definition: FxBIM.h:162
std::shared_ptr< CFxBIMIterator > CFxBIMIteratorPtr
Definition: FxBIM.h:191
OdSmartPtr< CFxBIMSection > CFxBIMSectionPtr
Definition: FxBIMStorage.h:34
OdSmartPtr< CFxBIMStorage > CFxBIMStoragePtr
Definition: FxBIMStorage.h:25
OdSmartPtr< CFxBIMDatabaseReference > CFxBIMDatabaseReferencePtr
Definition: FxBIMStorage.h:28
std::shared_ptr< CFxBIMDrawing > CFxBIMDrawingPtr
Definition: FxBIMStorage.h:31
OdResult
Definition: OdResult.h:29
virtual CFxBIMDbIteratorPtr Entities(OdDb::OpenMode openMode) const
virtual Error RemoveDatabaseRef(CFxBIMDatabaseReferencePtr pBimDbRef)
virtual ~CFxBIMStorage()
virtual Error RemoveSection(OdDbObjectId idSection)
OdResult dwgInFields(OdDbDwgFiler *pFiler) override
void dwgOutFields(OdDbDwgFiler *pFiler) const override
virtual CFxBIMDbIteratorPtr EntityRefs(OdDb::OpenMode openMode) const
void dxfOutFields(OdDbDxfFiler *pFiler) const override
void audit(OdDbAuditInfo *pAuditInfo) override
virtual CFxBIMIteratorPtr Floors(OdDb::OpenMode openMode) const
virtual std::vector< CFxBIMDrawingPtr > & BimDrawings(CFxBIMSectionPtr pS)
virtual CFxBIMDbIteratorPtr Materials(OdDb::OpenMode openMode) const
virtual Error AddSection(OdDbObjectId idSection)
OdResult dxfInFields(OdDbDxfFiler *pFiler) override
virtual OdDbObjectId FindSection(const OdString &name) const
virtual drawings_map & BimDrawings()
static CFxBIMStoragePtr GetStorage(OdDbDatabase *pDatabase, OdDb::OpenMode eMode=OdDb::kForRead, bool bCreateIfNotExist=false)
virtual Error AddDatabaseRef(CFxBIMDatabaseReferencePtr pBimDbRef)
virtual CFxBIMDbIteratorRAPtr Sections() const
virtual CFxBIMDbIteratorRAPtr DatabaseRefs() const
virtual Error RemoveReactor(CFxBIMObjectPtr p) const
void subClose() override
virtual const drawings_map & BimDrawings() const
virtual Error AddReactor(CFxBIMObjectPtr p) const
ODDB_DECLARE_MEMBERS(CFxBIMStorage)
virtual CFxBIMIteratorPtr Types(OdDb::OpenMode openMode) const
virtual CFxBIMIteratorPtr Zones(OdDb::OpenMode openMode) const
virtual CFxBIMIteratorPtr Spaces(OdDb::OpenMode openMode) const
virtual CFxBIMIteratorPtr Disciplines(OdDb::OpenMode openMode) const
virtual void SetFlags(int flags)
virtual CFxBIMIteratorPtr Categories(OdDb::OpenMode openMode) const
std::map< OdDbHandle, std::vector< CFxBIMDrawingPtr > > drawings_map
Definition: FxBIMStorage.h:76
virtual int Flags() const
virtual const std::vector< CFxBIMDrawingPtr > & BimDrawings(CFxBIMSectionPtr pS) const
GLuint const GLchar * name
Definition: gles2_ext.h:265
OpenMode
Definition: DbObjectId.h:54
@ kForRead
Definition: DbObjectId.h:56