CFx SDK Documentation  2023 SP0
FxBIMEntity.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 <RxVariant.h>
22 #include <DbObject.h>
23 #include <DbIdMapping.h>
24 #include <Ge/GeVector3d.h>
25 #include <Modeler/FMMdlBody.h>
26 #include <sdk/FxBIMProperty.h>
27 
28 #include <map>
29 
30 class CFxBIMEntity;
32 
33 class CFxBIMDatabase;
35 
36 class CFxBIMDiscipline;
37 typedef std::shared_ptr< CFxBIMDiscipline > CFxBIMDisciplinePtr;
38 
39 class CFxBIMZone;
40 typedef std::shared_ptr< CFxBIMZone > CFxBIMZonePtr;
41 
42 class CFxBIMSpace;
43 typedef std::shared_ptr< CFxBIMSpace > CFxBIMSpacePtr;
44 
45 class CFxBIMFloor;
46 typedef std::shared_ptr< CFxBIMFloor > CFxBIMFloorPtr;
47 
48 class CFxBIMCategory;
49 typedef std::shared_ptr< CFxBIMCategory > CFxBIMCategoryPtr;
50 
51 class CFxBIMType;
52 typedef std::shared_ptr< CFxBIMType > CFxBIMTypePtr;
53 
54 class CFxBIMMaterial;
56 
57 class OdDbDwgFiler;
58 
60 {
61 public:
63 
64  virtual ~CFxBIMEntity();
65 
66  virtual bool IsEqual( CFxBIMEntityPtr p ) const;
67 
70  virtual const std::vector< CFxBIMZonePtr >& Zones() const;
71  virtual void Zones( const std::vector< CFxBIMZonePtr >& zones );
72  virtual CFxBIMSpacePtr Space() const;
73  virtual void SetSpace( CFxBIMSpacePtr p );
74  virtual CFxBIMFloorPtr Floor() const;
75  virtual void SetFloor( CFxBIMFloorPtr p );
76  virtual CFxBIMCategoryPtr Category() const;
77  virtual void SetCategory( CFxBIMCategoryPtr p );
78  virtual CFxBIMTypePtr Type() const;
79  virtual void SetType( CFxBIMTypePtr p );
81 
82  virtual const OdGeMatrix3d& OriginalTransform() const;
83 
86 
87  virtual OdString UniqueId() const;
88 
90  {
92  {
94  ePlan
95  };
97  {
107  eUnset
108  };
109 
110  static TargetView s2e( const OdString &s );
111  static OdString e2s( const TargetView &e );
112  static std::vector<TargetView> fromDirection( const OdGeVector3d &direction );
113 
114  static GeometryView Plan( const OdString &name = OdString() );
115  static GeometryView Ceiling( const OdString &name = OdString() );
116  static GeometryView Section( const OdString &name = OdString() );
118  static GeometryView Unset();
119 
121  Representation representation = eModel,
122  TargetView targetView = eMODEL_VIEW,
123  const OdString &name = OdString());
124 
125  void setTargetView( const OdString &s );
126  bool operator<( const GeometryView &r ) const;
127  bool isModel() const;
128  bool isUnset() const;
129  void reset();
130 
134  };
135 
137  {
138  using name_to_block_map = std::map< OdString, OdDbObjectId >;
139  std::map< GeometryView, name_to_block_map > data;
140 
141  OdInt64 size() const;
142  bool hasPlanView() const;
143 
144  std::map<OdString, GeometryView> views(const GeometryView::TargetView &view) const;
145  std::map<OdString, GeometryView> views(const OdGeVector3d &direction) const;
146 
149  OdDbObjectIdArray get( const OdGeVector3d &direction ) const;
150 
151  void add( const GeometryView &view, const OdDbObjectId &block );
152 
153  Error merge( const GeometryContainer& other, OdDbIdMappingPtr pIdMapping );
154  };
155 
157  {
165  ePlumbingFixtures
166  };
167 
168  virtual OdDbObjectId Generate2dGeometry( const OdGeVector3d &direction );
170 
171  virtual std::map<OdString, GeometryView> Views(const OdGeVector3d &direction) const;
172 
173  // Get all blocks from all views that match *direction*
174  virtual OdDbObjectIdArray Geometry( const OdGeVector3d &direction ) const;
175 
176  // Get a block corresponding to *view*. If *view* is not specified, the
177  // block corresponding to the model will be returned.
178  virtual OdDbObjectId Geometry( const GeometryView &view = GeometryView() ) const; //OdDbBlockTableRecord
179 
180  struct FxBody
181  {
184  };
185  virtual Error Geometry( std::vector< FxBody >& bodies, const GeometryView& view = GeometryView() ) const;
186 
187  virtual ElementType GetElementType() const;
188 
189  virtual OdDbHandle OriginalHandle() const;
190 
191 public:
192  virtual OdResult dwgInFields( OdDbDwgFiler* pFiler ) override;
193  virtual void dwgOutFields( OdDbDwgFiler* pFiler ) const override;
194 
195  virtual OdResult dxfInFields( OdDbDxfFiler* pFiler ) override;
196  virtual void dxfOutFields( OdDbDxfFiler* pFiler ) const override;
197 
198 protected:
200 };
Error
Definition: FxBIM.h:50
#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:48
std::shared_ptr< CFxBIMZone > CFxBIMZonePtr
Definition: FxBIMEntity.h:39
OdSmartPtr< CFxBIMEntity > CFxBIMEntityPtr
Definition: FxBIMEntity.h:30
std::shared_ptr< CFxBIMSpace > CFxBIMSpacePtr
Definition: FxBIMEntity.h:42
OdSmartPtr< CFxBIMDatabase > CFxBIMDatabasePtr
Definition: FxBIMEntity.h:33
std::shared_ptr< CFxBIMType > CFxBIMTypePtr
Definition: FxBIMEntity.h:51
std::shared_ptr< CFxBIMFloor > CFxBIMFloorPtr
Definition: FxBIMEntity.h:45
OdSmartPtr< CFxBIMMaterial > CFxBIMMaterialPtr
Definition: FxBIMEntity.h:54
std::shared_ptr< CFxBIMDiscipline > CFxBIMDisciplinePtr
Definition: FxBIMEntity.h:36
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 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
OdVariant MaterialName(CFxBIMEntityPtr) const
virtual CFxBIMPropertiesContainter * Properties()
virtual std::map< OdString, GeometryView > Views(const OdGeVector3d &direction) const
virtual const std::vector< CFxBIMZonePtr > & Zones() const
virtual ElementType GetElementType() const
virtual OdDbObjectId Geometry(const GeometryView &view=GeometryView()) const
virtual Error Geometry(std::vector< FxBody > &bodies, 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 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)
virtual CFxBIMSpacePtr Space() const
virtual void SetDiscipline(CFxBIMDisciplinePtr p)
virtual CFxBIMPropertiesContainter * Properties() const
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
FacetModeler::Body _body
Definition: FxBIMEntity.h:182
OdDbObjectId _idMaterial
Definition: FxBIMEntity.h:183
std::map< GeometryView, name_to_block_map > data
Definition: FxBIMEntity.h:139
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:138
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:131
static std::vector< TargetView > fromDirection(const OdGeVector3d &direction)
static GeometryView Plan(const OdString &name=OdString())