CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxBIMEntityGeometry.h
Go to the documentation of this file.
1//
2// (C) Copyright 2020-2025 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 <DbObjectId.h>
22#include <DbCurve.h>
23#include <RxObject.h>
24#include <Ge/GeExtents3d.h>
25#include <Ge/GePoint3dArray.h>
26#include <Gi/GiWorldDraw.h>
27#include <Modeler/FMMdlBody.h>
28
29class CFxBIMEntity;
30class CFxBIMEntityImpl;
31class CFxBIMEntityGeometryImpl;
32
34typedef std::shared_ptr< CFxBIMEntityGeometry > CFxBIMEntityGeometryPtr;
35
36class CFxBIMEntity;
38
41
42namespace FxBIM
43{
44 class RevitFamilyImpl;
45}
46
47namespace FxBIM
48{
49 namespace Geo
50 {
52 {
53 public:
55 OdDbObjectId _idMaterial; //CFxBIMMaterial
56 enum Flags
57 {
58 eNone = 0x0,
59 eEdgeData = 0x1,
60 eFaceData = 0x2,
62 };
64 std::vector< OdGePoint3d > _vertices;
65 std::vector< OdInt32 > _faces;
69 public:
70 explicit ShellData(
71 const OdCmColor& color, OdDbObjectId idMaterial,
72 OdInt32 numVertices, const OdGePoint3d* vertexList,
73 OdInt32 faceListSize, const OdInt32* faceList,
74 const OdGiEdgeData* pEdgeData, const OdGiFaceData* pFaceData, const OdGiVertexData* pVertexData );
75 ShellData() = default;
76 ShellData( ShellData&& other ) noexcept;
77 ShellData& operator=( ShellData&& other ) noexcept;
78 ShellData( const ShellData& other ) = delete;
79 ShellData& operator=( const ShellData& other ) = delete;
81 };
82
84 {
85 public:
86 std::vector< ShellData > _shells;
87 OdDbObjectId _idMaterial; //CFxBIMMaterial or CFxMaterialLayerSet
88
89 public:
90 explicit BodyData( std::vector< ShellData >&& shells, OdDbObjectId idMaterial );
92 BodyData( BodyData&& other ) noexcept;
93 BodyData& operator=( BodyData&& other ) noexcept;
94 BodyData( const BodyData& other ) = delete;
95 BodyData& operator=( const BodyData& other ) = delete;
97
98 Error AddShell( const OdCmColor& color, OdDbObjectId idMaterial,
99 OdInt32 numVertices, const OdGePoint3d* vertexList,
100 OdInt32 faceListSize, const OdInt32* faceList,
101 const OdGiEdgeData* pEdgeData, const OdGiFaceData* pFaceData, const OdGiVertexData* pVertexData );
102
103 [[nodiscard]] const OdGeExtents3d& Extents( const OdGeMatrix3d& mTr = OdGeMatrix3d::kIdentity ) const;
104
105 protected:
106 class Impl;
107 mutable std::unique_ptr< Impl > m_pImpl;
108 };
109 }
110}
111
113{
114 friend class CFxBIMEntityImpl;
116 friend class FxBIM::RevitFamilyImpl;
117public:
118 const CFxBIMEntityPtr Entity() const;
120
121 enum EType
122 {
123 e3D = 0,
124 e2D = 1,
125 };
126
135
137 OdString MaterialNameEx( OdDbObjectId& idMaterial, bool& bHasMultiBimMaterial, bool& bIsMultiComponent ) const;
138
139 std::set< OdDbObjectId > GetMaterial() const;
140 void SetMaterial( const OdString& material );
141 void SetMaterial( OdDbObjectId idMaterial );
142
144 Error Explode( OdRxObjectPtrArray& entitySet ) const;
145 Error Extents( OdGeExtents3d& extents, EGeoType type = EGeoType::k3D ) const; //Non-transformed extents
147
149 OdGsMarker gsSelectionMark,
150 const OdGePoint3d& pickPoint,
151 const OdGePoint3d& lastPoint,
152 const OdGeMatrix3d& xWorldToEye,
153 OdGePoint3dArray& snapPointsECS ) const;
154
155 void RemoveFromGS() const;
156
157 const std::vector< FxBIM::Geo::BodyData >& Bodies() const;
158
166
167 const std::vector< FxBody >& FxBodies() const;
168 const std::vector< FxBody >& FxBodiesSplit() const;
170
172 void Generate();
173
175 {
176 eDefault = 0x1, //Imported from .ifc or .rvt
177 eUser = 0x2, //
178 };
179
180 struct SBlock
181 {
183 OdGeMatrix3d _mTransform; //AV: BlockReference transform in ECS of EntityReference
184 std::vector< OdGeVector3d > _directions{ OdGeVector3d::kZAxis };
188 };
189
190 std::vector< SBlock > GetUserBlocks() const;
191 OdDbObjectId GetUserBlock( const OdString& blockName ) const;
192 Error AddUserBlock( OdDbObjectId idBlock, const OdGeMatrix3d& mT, const OdString& name, const OdString& layer, const std::vector< OdGeVector3d >& directions );
194
197
198protected:
199 explicit CFxBIMEntityGeometry( CFxBIMEntityImpl* pEntityImpl, bool dbro2D );
200
201protected:
202 std::shared_ptr< CFxBIMEntityGeometryImpl > m_pImpl;
204
205};
206
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
OdSmartPtr< OdDbCurve > OdDbCurvePtr
Definition DbCurve.h:44
Error
Definition FxBIM.h:40
#define FXBIM_COMMON_CODE_API
Definition FxBIMDefs.h:5
OdSmartPtr< CFxBIMEntity > CFxBIMEntityPtr
Definition FxBIMEntity.h:35
OdSmartPtr< CFxMaterialLayerSet > CFxMaterialLayerSetPtr
std::shared_ptr< CFxBIMEntityGeometry > CFxBIMEntityGeometryPtr
ptrdiff_t OdGsMarker
int OdInt32
OdArray< OdRxObjectPtr > OdRxObjectPtrArray
Definition RxObject.h:1196
Error Explode(OdRxObjectPtrArray &entitySet) const
Error Extents(OdGeExtents3d &extents, EGeoType type=EGeoType::k3D) const
OdString MaterialName() const
CFxBIMEntityPtr Entity()
CFxBIMEntityGeometry(CFxBIMEntityImpl *pEntityImpl, bool dbro2D)
void SetMaterial(OdDbObjectId idMaterial)
void SetMaterial(const OdString &material)
const std::vector< FxBIM::Geo::BodyData > & Bodies() const
Error Extents(OdGeExtents3d &extents, const OdGeMatrix3d &mTr, EGeoType type=EGeoType::k3D) const
OdString MaterialNameEx(OdDbObjectId &idMaterial, bool &bHasMultiBimMaterial, bool &bIsMultiComponent) const
friend class CFxBIMEntityGeometryImpl
void RemoveFromGS() const
Error Draw(OdGiWorldDraw *wd, EGeoType type=EGeoType::k3D) const
CFxBIMEntityImpl * m_pEntityImpl
OdDbObjectId GetUserBlock(const OdString &blockName) const
Error AddUserBlock(OdDbObjectId idBlock, const OdGeMatrix3d &mT, const OdString &name, const OdString &layer, const std::vector< OdGeVector3d > &directions)
const CFxMaterialLayerSetPtr MaterialLayerSet() const
void SnapPoints(OdDb::OsnapMode osnapMode, OdGsMarker gsSelectionMark, const OdGePoint3d &pickPoint, const OdGePoint3d &lastPoint, const OdGeMatrix3d &xWorldToEye, OdGePoint3dArray &snapPointsECS) const
bool IsEmpty(EGeoType type=EGeoType::k3D) const
OdDbCurvePtr Curve()
std::set< OdDbObjectId > GetMaterial() const
std::shared_ptr< CFxBIMEntityGeometryImpl > m_pImpl
const CFxBIMEntityPtr Entity() const
Error RemoveUserBlock(OdDbObjectId idBlock)
const std::vector< FxBody > & FxBodies() const
std::vector< SBlock > GetUserBlocks() const
const std::vector< FxBody > & FxBodiesSplit() const
std::unique_ptr< Impl > m_pImpl
BodyData & operator=(const BodyData &other)=delete
BodyData & operator=(BodyData &&other) noexcept
BodyData(std::vector< ShellData > &&shells, OdDbObjectId idMaterial)
const OdGeExtents3d & Extents(const OdGeMatrix3d &mTr=OdGeMatrix3d::kIdentity) const
std::vector< ShellData > _shells
BodyData(BodyData &&other) noexcept
BodyData(const BodyData &other)=delete
Error AddShell(const OdCmColor &color, OdDbObjectId idMaterial, OdInt32 numVertices, const OdGePoint3d *vertexList, OdInt32 faceListSize, const OdInt32 *faceList, const OdGiEdgeData *pEdgeData, const OdGiFaceData *pFaceData, const OdGiVertexData *pVertexData)
ShellData(const ShellData &other)=delete
std::vector< OdGePoint3d > _vertices
ShellData(ShellData &&other) noexcept
ShellData & operator=(ShellData &&other) noexcept
std::vector< OdInt32 > _faces
ShellData(const OdCmColor &color, OdDbObjectId idMaterial, OdInt32 numVertices, const OdGePoint3d *vertexList, OdInt32 faceListSize, const OdInt32 *faceList, const OdGiEdgeData *pEdgeData, const OdGiFaceData *pFaceData, const OdGiVertexData *pVertexData)
ShellData & operator=(const ShellData &other)=delete
static GE_STATIC_EXPORT const OdGeMatrix3d kIdentity
Definition GeMatrix3d.h:97
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition GeVector3d.h:103
GLuint const GLchar * name
Definition gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition gles2_ext.h:274
Definition FxBIM.h:72
OsnapMode
Definition OdaDefs.h:489
std::vector< OdGeVector3d > _directions