CFx SDK Documentation  2022 SP0
FxBIMSection.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 "sdk/FxBIM.h"
20 
21 #include <StringArray.h>
22 #include <DbEntity.h>
23 #include <Ge/GePlane.h>
24 #include <Ge/GeExtents2d.h>
25 
26 class CFxBIMSection;
28 
30 {
31 public:
33 
34  virtual ~CFxBIMSection();
35 
36  virtual const OdString& Name() const;
37  virtual void SetName( const OdString& name );
38  virtual const OdGePlane& Plane() const;
39  virtual void SetPlane( const OdGePlane& plane );
40  virtual const std::vector< OdGePoint2d >& Points() const;
41  virtual void SetPoints( const std::vector< OdGePoint2d >& points );
42  virtual double Depth() const;
43  virtual void SetDepth( double depth );
44 
45  struct BimDrawing
46  {
49  std::vector< OdDbObjectId > m_SectionEntities; //CFxBIMSectionEntity
50  std::vector< OdDbObjectId > m_Views; //CFxBIMSectionView
51  OdInt32 m_Flags = 0;
52  };
53 
54  virtual size_t DrawingCount() const;
55  virtual BimDrawing& DrawingW( size_t index );
56  virtual const BimDrawing& DrawingR( size_t index ) const;
57 
59  virtual OdString sourceView() const;
60  virtual void setSourceView(const OdString &name);
61 
63  {
68  //InteriorElevation, //TODO:
69  };
70 
71  virtual SectionType Type() const;
73 
75  {
76  eCutGraphics = 0x1,
77  eForwardGraphics = 0x2,
78  eBackwardGraphics = 0x4,
79  };
80  virtual int ViewOptions() const;
81  virtual void SetViewOptions( int viewOptions, size_t drawing );
82 
83  virtual const OdString& Filter() const;
84  virtual void SetFilter( const OdString& filter );
85 
86  enum Flags
87  {
88  eInvalid = 0x1,
89  eDrawBox = 0x2,
90  eDrawSymbol = 0x4,
91  eDuplicateName = 0x8,
92  eUse3DOnly = 0x10
93  };
94 
95  virtual int Flags() const;
96  virtual void SetFlags( int flags );
97 
98  virtual Error Regenerate();
99 
100  virtual const std::vector< OdDbObjectId >& Layers() const;
101  virtual void SetLayers( const std::vector< OdDbObjectId >& layers );
102 
103  void HideDrawBox( const bool& bHide );
104 
108  virtual void AddLayer(const OdDbObjectId &layer);
109 
113  virtual void RemoveLayer(const OdDbObjectId &layer);
114 
115 public:
116  virtual OdResult dwgInFields( OdDbDwgFiler* pFiler ) override;
117  virtual void dwgOutFields( OdDbDwgFiler* pFiler ) const override;
118 
119  virtual OdResult dxfInFields( OdDbDxfFiler* pFiler ) override;
120  virtual void dxfOutFields( OdDbDxfFiler* pFiler ) const override;
121 
122  OdUInt32 subSetAttributes( OdGiDrawableTraits* traits ) const override;
123  bool subWorldDraw( OdGiWorldDraw* wd ) const override;
124  void subViewportDraw( OdGiViewportDraw* vd ) const override;
125 
126  OdResult subGetGeomExtents( OdGeExtents3d& extents ) const override;
127 
128  void subGripStatus( const OdDb::GripStat status ) override;
129 
131  OdDb::OsnapMode osnapMode,
132  OdGsMarker gsSelectionMark,
133  const OdGePoint3d& pickPoint,
134  const OdGePoint3d& lastPoint,
135  const OdGeMatrix3d& xWorldToEye,
136  OdGePoint3dArray& snapPoints ) const override;
137 
139  OdDb::OsnapMode osnapMode,
140  OdGsMarker gsSelectionMark,
141  const OdGePoint3d& pickPoint,
142  const OdGePoint3d& lastPoint,
143  const OdGeMatrix3d& xWorldToEye,
144  OdGePoint3dArray& snapPoints,
145  const OdGeMatrix3d& insertionMat ) const override;
146 
147  bool subIsContentSnappable() const override;
148 
149  OdResult subGetGripPoints( OdGePoint3dArray& gripPoints ) const override;
150  OdResult subMoveGripPointsAt( const OdIntArray& indices, const OdGeVector3d& offset ) override;
152  OdDbGripDataPtrArray& grips,
153  const double curViewUnitSize,
154  const int gripSize,
155  const OdGeVector3d& curViewDir,
156  const int bitFlags ) const override;
158  const OdDbVoidPtrArray& grips,
159  const OdGeVector3d& offset,
160  int bitFlags ) override;
161  OdResult subGetStretchPoints( OdGePoint3dArray& stretchPoints ) const override;
163  const OdIntArray& indices,
164  const OdGeVector3d& offset ) override;
165 
166  OdResult subErase( bool erasing ) override;
167  OdDbObjectPtr subWblockClone( OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary ) const override;
168  OdDbObjectPtr subDeepClone( OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary ) const override;
169 
170 protected:
172 };
173 
174 class CFxBIMSectionView;
175 
177 {
178 public:
179  virtual ~CFxBIMSectionReactor() {};
180 
181  virtual void Created( CFxBIMSection* p ) {};
182  virtual void Removed( CFxBIMSection* p, bool removed ) {};
183 
184  virtual void Renamed( CFxBIMSection* p, const OdString& oldName, bool undo ) {};
185 
186  virtual void ViewCreated( CFxBIMSectionView* pView ) {};
187  virtual void ViewRemoved( CFxBIMSectionView* pView, bool removed ) {};
188 
189  virtual void Regenerated( CFxBIMSection* p, const std::vector< OdDbObjectId >& oldSE ) {};
190 };
Error
Definition: FxBIM.h:44
#define FXBIM_API
Definition: FxBIM.h:20
OdSmartPtr< CFxBIMSection > CFxBIMSectionPtr
Definition: FxBIMSection.h:26
ptrdiff_t OdGsMarker
unsigned int OdUInt32
int OdInt32
OdResult
Definition: OdResult.h:29
virtual const std::vector< OdDbObjectId > & Layers() const
bool subIsContentSnappable() const override
OdResult subGetStretchPoints(OdGePoint3dArray &stretchPoints) const override
OdResult subGetGeomExtents(OdGeExtents3d &extents) const override
virtual void SetName(const OdString &name)
virtual SectionType Type() const
OdResult subMoveGripPointsAt(const OdDbVoidPtrArray &grips, const OdGeVector3d &offset, int bitFlags) override
virtual OdString sourceView() const
OdDbObjectPtr subWblockClone(OdDbIdMapping &ownerIdMap, OdDbObject *, bool bPrimary) const override
OdResult subGetOsnapPoints(OdDb::OsnapMode osnapMode, OdGsMarker gsSelectionMark, const OdGePoint3d &pickPoint, const OdGePoint3d &lastPoint, const OdGeMatrix3d &xWorldToEye, OdGePoint3dArray &snapPoints, const OdGeMatrix3d &insertionMat) const override
void subGripStatus(const OdDb::GripStat status) override
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const override
virtual void SetLayers(const std::vector< OdDbObjectId > &layers)
OdResult subMoveGripPointsAt(const OdIntArray &indices, const OdGeVector3d &offset) override
virtual int ViewOptions() const
virtual void SetFilter(const OdString &filter)
virtual void SetPlane(const OdGePlane &plane)
virtual void SetFlags(int flags)
OdResult subGetGripPoints(OdGePoint3dArray &gripPoints) const override
virtual const OdGePlane & Plane() const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler) override
virtual int Flags() const
virtual ~CFxBIMSection()
OdUInt32 subSetAttributes(OdGiDrawableTraits *traits) const override
virtual size_t DrawingCount() const
virtual OdStringArray availableSourceViews() const
virtual void AddLayer(const OdDbObjectId &layer)
Add layer, if it is not added yet.
virtual const std::vector< OdGePoint2d > & Points() const
OdResult subGetOsnapPoints(OdDb::OsnapMode osnapMode, OdGsMarker gsSelectionMark, const OdGePoint3d &pickPoint, const OdGePoint3d &lastPoint, const OdGeMatrix3d &xWorldToEye, OdGePoint3dArray &snapPoints) const override
void subViewportDraw(OdGiViewportDraw *vd) const override
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const override
virtual const OdString & Filter() const
OdResult subErase(bool erasing) override
virtual void SetPoints(const std::vector< OdGePoint2d > &points)
OdResult subGetGripPoints(OdDbGripDataPtrArray &grips, const double curViewUnitSize, const int gripSize, const OdGeVector3d &curViewDir, const int bitFlags) const override
virtual Error Regenerate()
void HideDrawBox(const bool &bHide)
OdResult subMoveStretchPointsAt(const OdIntArray &indices, const OdGeVector3d &offset) override
virtual void SetDepth(double depth)
virtual void setSourceView(const OdString &name)
bool subWorldDraw(OdGiWorldDraw *wd) const override
virtual const BimDrawing & DrawingR(size_t index) const
virtual BimDrawing & DrawingW(size_t index)
virtual void RemoveLayer(const OdDbObjectId &layer)
Remove layer, if it was added.
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler) override
ODDB_DECLARE_MEMBERS(CFxBIMSection)
virtual void SetType(CFxBIMSection::SectionType type)
OdDbObjectPtr subDeepClone(OdDbIdMapping &ownerIdMap, OdDbObject *, bool bPrimary) const override
virtual double Depth() const
virtual void SetViewOptions(int viewOptions, size_t drawing)
virtual const OdString & Name() const
virtual void Renamed(CFxBIMSection *p, const OdString &oldName, bool undo)
Definition: FxBIMSection.h:184
virtual void ViewRemoved(CFxBIMSectionView *pView, bool removed)
Definition: FxBIMSection.h:187
virtual void Created(CFxBIMSection *p)
Definition: FxBIMSection.h:181
virtual ~CFxBIMSectionReactor()
Definition: FxBIMSection.h:179
virtual void Regenerated(CFxBIMSection *p, const std::vector< OdDbObjectId > &oldSE)
Definition: FxBIMSection.h:189
virtual void ViewCreated(CFxBIMSectionView *pView)
Definition: FxBIMSection.h:186
virtual void Removed(CFxBIMSection *p, bool removed)
Definition: FxBIMSection.h:182
GLuint index
Definition: gles2_ext.h:265
GLuint const GLchar * name
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLintptr offset
Definition: gles2_ext.h:183
GripStat
Definition: DbGrip.h:80
OsnapMode
Definition: OdaDefs.h:478
std::vector< OdDbObjectId > m_Views
Definition: FxBIMSection.h:50
std::vector< OdDbObjectId > m_SectionEntities
Definition: FxBIMSection.h:49