CFx SDK Documentation  2022 SP0
FxBIMEntity.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2020-2021 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 <RxVariant.h>
22 #include <DbObject.h>
23 #include <DbIdMapping.h>
24 #include <Ge/GeVector3d.h>
25 
26 #include <map>
27 
28 class CFxBIMEntity;
30 
31 class CFxBIMDatabase;
33 
34 class CFxBIMDiscipline;
35 typedef std::shared_ptr< CFxBIMDiscipline > CFxBIMDisciplinePtr;
36 
37 class CFxBIMZone;
38 typedef std::shared_ptr< CFxBIMZone > CFxBIMZonePtr;
39 
40 class CFxBIMSpace;
41 typedef std::shared_ptr< CFxBIMSpace > CFxBIMSpacePtr;
42 
43 class CFxBIMFloor;
44 typedef std::shared_ptr< CFxBIMFloor > CFxBIMFloorPtr;
45 
46 class CFxBIMCategory;
47 typedef std::shared_ptr< CFxBIMCategory > CFxBIMCategoryPtr;
48 
49 class CFxBIMType;
50 typedef std::shared_ptr< CFxBIMType > CFxBIMTypePtr;
51 
52 class CFxBIMProperty;
53 typedef std::shared_ptr< CFxBIMProperty > CFxBIMPropertyPtr;
54 
55 class CFxBIMMaterial;
57 
58 class OdDbDwgFiler;
59 
61 {
62 public:
64 
65  virtual ~CFxBIMEntity();
66 
67  virtual bool IsEqual( CFxBIMEntityPtr p ) const;
68 
71  virtual const std::vector< CFxBIMZonePtr >& Zones() const;
72  virtual void Zones( const std::vector< CFxBIMZonePtr >& zones );
73  virtual CFxBIMSpacePtr Space() const;
74  virtual void SetSpace( CFxBIMSpacePtr p );
75  virtual CFxBIMFloorPtr Floor() const;
76  virtual void SetFloor( CFxBIMFloorPtr p );
77  virtual CFxBIMCategoryPtr Category() const;
78  virtual void SetCategory( CFxBIMCategoryPtr p );
79  virtual CFxBIMTypePtr Type() const;
80  virtual void SetType( CFxBIMTypePtr p );
81 
82  virtual const OdGeMatrix3d& OriginalTransform() const;
83  virtual std::vector< CFxBIMPropertyPtr >& Properties();
84  virtual std::map< OdString, CFxBIMPropertyPtr >& DerivedProperties();
85  virtual OdVariant Property( const OdString &group, const OdString &label ) const;
86  virtual OdString UniqueId() const;
87 
89  {
91  {
93  ePlan
94  };
96  {
106  eUnset
107  };
108 
109  static TargetView s2e( const OdString &s );
110  static OdString e2s( const TargetView &e );
111  static std::vector<TargetView> fromDirection( const OdGeVector3d &direction );
112 
113  static GeometryView Plan( const OdString &name = OdString() );
114  static GeometryView Ceiling( const OdString &name = OdString() );
115  static GeometryView Section( const OdString &name = OdString() );
117  static GeometryView Unset();
118 
120  Representation representation = eModel,
121  TargetView targetView = eMODEL_VIEW,
122  const OdString &name = OdString());
123 
124  void setTargetView( const OdString &s );
125  bool operator<( const GeometryView &r ) const;
126  bool isModel() const;
127  bool isUnset() const;
128  void reset();
129 
133  };
134 
136  {
137  using name_to_block_map = std::map< OdString, OdDbObjectId >;
138  std::map< GeometryView, name_to_block_map > data;
139 
140  OdInt64 size() const;
141  bool hasPlanView() const;
142 
143  std::map<OdString, GeometryView> views(const GeometryView::TargetView &view) const;
144  std::map<OdString, GeometryView> views(const OdGeVector3d &direction) const;
145 
148  OdDbObjectIdArray get( const OdGeVector3d &direction ) const;
149 
150  void add( const GeometryView &view, const OdDbObjectId &block );
151 
152  Error merge( const GeometryContainer& other, OdDbIdMappingPtr pIdMapping );
153  };
154 
156  {
164  ePlumbingFixtures
165  };
166  static ElementType s2e( const OdString &s );
167  static OdString e2s( const ElementType &e );
168 
169  virtual OdDbObjectId Generate2dGeometry( const OdGeVector3d &direction );
171 
172  virtual std::map<OdString, GeometryView> Views(const OdGeVector3d &direction) const;
173 
174  // Get all blocks from all views that match *direction*
175  virtual OdDbObjectIdArray Geometry( const OdGeVector3d &direction ) const;
176 
177  // Get a block corresponding to *view*. If *view* is not specified, the
178  // block corresponding to the model will be returned.
179  virtual OdDbObjectId Geometry( const GeometryView &view = GeometryView() ) const; //OdDbBlockTableRecord
180 
181  virtual ElementType GetElementType() const;
182 
183  virtual OdDbHandle OriginalHandle() const;
184 
185 public:
186  virtual OdResult dwgInFields( OdDbDwgFiler* pFiler ) override;
187  virtual void dwgOutFields( OdDbDwgFiler* pFiler ) const override;
188 
189  virtual OdResult dxfInFields( OdDbDxfFiler* pFiler ) override;
190  virtual void dxfOutFields( OdDbDxfFiler* pFiler ) const override;
191 
192 protected:
194 };
Error
Definition: FxBIM.h:44
#define FXBIM_API
Definition: FxBIM.h:20
std::shared_ptr< CFxBIMCategory > CFxBIMCategoryPtr
Definition: FxBIMCategory.h:23
std::shared_ptr< CFxBIMType > CFxBIMTypePtr
Definition: FxBIMCategory.h:26
std::shared_ptr< CFxBIMDiscipline > CFxBIMDisciplinePtr
std::shared_ptr< CFxBIMCategory > CFxBIMCategoryPtr
Definition: FxBIMEntity.h:46
std::shared_ptr< CFxBIMZone > CFxBIMZonePtr
Definition: FxBIMEntity.h:37
std::shared_ptr< CFxBIMProperty > CFxBIMPropertyPtr
Definition: FxBIMEntity.h:52
OdSmartPtr< CFxBIMEntity > CFxBIMEntityPtr
Definition: FxBIMEntity.h:28
std::shared_ptr< CFxBIMSpace > CFxBIMSpacePtr
Definition: FxBIMEntity.h:40
OdSmartPtr< CFxBIMDatabase > CFxBIMDatabasePtr
Definition: FxBIMEntity.h:31
std::shared_ptr< CFxBIMType > CFxBIMTypePtr
Definition: FxBIMEntity.h:49
std::shared_ptr< CFxBIMFloor > CFxBIMFloorPtr
Definition: FxBIMEntity.h:43
OdSmartPtr< CFxBIMMaterial > CFxBIMMaterialPtr
Definition: FxBIMEntity.h:55
std::shared_ptr< CFxBIMDiscipline > CFxBIMDisciplinePtr
Definition: FxBIMEntity.h:34
OdResult
Definition: OdResult.h:29
OdString OdString
Definition: OdString.h:1224
virtual OdDbObjectId Generate2dGeometry(const GeometryView::TargetView &view)
virtual void Zones(const std::vector< CFxBIMZonePtr > &zones)
virtual OdVariant Property(const OdString &group, const OdString &label) const
virtual const OdGeMatrix3d & OriginalTransform() const
ODDB_DECLARE_MEMBERS(CFxBIMEntity)
virtual void SetFloor(CFxBIMFloorPtr p)
virtual OdDbHandle OriginalHandle() const
virtual CFxBIMCategoryPtr Category() const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler) override
virtual std::map< OdString, GeometryView > Views(const OdGeVector3d &direction) const
virtual const std::vector< CFxBIMZonePtr > & Zones() const
static ElementType s2e(const OdString &s)
virtual ElementType GetElementType() const
virtual OdDbObjectId Geometry(const GeometryView &view=GeometryView()) const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const override
virtual CFxBIMFloorPtr Floor() const
virtual OdString UniqueId() const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler) override
virtual std::vector< CFxBIMPropertyPtr > & Properties()
virtual void SetSpace(CFxBIMSpacePtr p)
virtual bool IsEqual(CFxBIMEntityPtr p) const
virtual void SetType(CFxBIMTypePtr p)
virtual CFxBIMTypePtr Type() const
virtual ~CFxBIMEntity()
virtual OdDbObjectId Generate2dGeometry(const OdGeVector3d &direction)
static OdString e2s(const ElementType &e)
virtual std::map< OdString, CFxBIMPropertyPtr > & DerivedProperties()
virtual CFxBIMSpacePtr Space() const
virtual void SetDiscipline(CFxBIMDisciplinePtr p)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const override
virtual OdDbObjectIdArray Geometry(const OdGeVector3d &direction) const
virtual CFxBIMDisciplinePtr Discipline() const
virtual void SetCategory(CFxBIMCategoryPtr p)
Definition: Int64.h:43
GLuint const GLchar * name
Definition: gles2_ext.h:265
std::map< GeometryView, name_to_block_map > data
Definition: FxBIMEntity.h:138
std::map< OdString, GeometryView > views(const GeometryView::TargetView &view) const
OdDbObjectIdArray get(const GeometryView::TargetView &view) const
std::map< OdString, OdDbObjectId > name_to_block_map
Definition: FxBIMEntity.h:137
void add(const GeometryView &view, const OdDbObjectId &block)
OdDbObjectIdArray get(const OdGeVector3d &direction) const
Error merge(const GeometryContainer &other, OdDbIdMappingPtr pIdMapping)
OdDbObjectId get(const GeometryView &view=CFxBIMEntity::GeometryView()) const
std::map< OdString, GeometryView > views(const OdGeVector3d &direction) const
static TargetView s2e(const OdString &s)
static GeometryView Elevation(const OdString &name=OdString())
static GeometryView Ceiling(const OdString &name=OdString())
static GeometryView Section(const OdString &name=OdString())
bool operator<(const GeometryView &r) const
static GeometryView Unset()
void setTargetView(const OdString &s)
static OdString e2s(const TargetView &e)
GeometryView(Representation representation=eModel, TargetView targetView=eMODEL_VIEW, const OdString &name=OdString())
Representation representation
Definition: FxBIMEntity.h:130
static std::vector< TargetView > fromDirection(const OdGeVector3d &direction)
static GeometryView Plan(const OdString &name=OdString())