CFx SDK Documentation  2020SP3
FxSelectionSet.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 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 "FxPragmaPush.h"
20 
21 #include "DDKERNEL.h"
22 
23 #include <DbSSet.h>
24 #include <StaticRxObject.h>
25 #include <SharedPtr.h>
26 
27 #include <Ge/GePoint3d.h>
28 #include <Ge/GeVector3d.h>
29 
30 #include <vector>
31 
32 class CFxDatabase;
33 class CFxView;
34 class CFxDocument;
35 class CFxSelectionData;
36 class CFxUserIO;
38 class CFxEntityData;
39 
40 struct fdt_resbufW;
41 
48  protected OdStaticRxObject< OdDbSelectionSet >
49 {
50 public:
52 
53  /* {secret} */
54  virtual ~CFxSelectionSet();
55 
59  virtual size_t GetNumber() const = 0;
60 
63  virtual CFxDatabase* GetFxDatabase() = 0;
64 
67  virtual size_t GetLength() const = 0;
68 
72  virtual size_t GetTotalSubents() const = 0;
73 
76  virtual const OdDbObjectId& GetId( size_t index ) const = 0;
77 
80  virtual size_t SubentGetLength( size_t index ) const = 0;
81 
84  virtual const OdDbFullSubentPath& SubentGetId( size_t index, size_t subentIndex ) const = 0;
85 
88  virtual void Clear() = 0;
89 
92  virtual bool IsMember( const OdDbObjectId& id ) const = 0;
93 
96  virtual bool IsMember( const OdDbFullSubentPath & path ) const = 0;
97 
98  typedef std::vector<const OdRxClass*> CLASS_VECTOR;
99  typedef std::vector<size_t> SIZE_T_VECTOR;
100 
103  virtual void GetClassesFound( CLASS_VECTOR& classes, SIZE_T_VECTOR& objects ) const = 0;
104 
107  virtual const OdRxClass* GetCommonBaseClass() const = 0;
108 
112  virtual const OdRxClass* GetCommonBasePEClass() const = 0;
113 
116  virtual void GetObjectsByClass( const OdRxClass* pClass, OdDbObjectIdArray& objects ) const = 0;
117 
120  virtual int GetNTHX( int index, fdt_resbufW** data ) const = 0;
121 
124  virtual bool Add( const OdDbObjectId& objId ) = 0;
125 
128  virtual bool Remove( const OdDbObjectId& objId ) = 0;
129 
132  virtual bool SubentAdd( const OdDbFullSubentPath& path ) = 0;
133 
136  virtual bool SubentRemove( const OdDbFullSubentPath& path ) = 0;
137 
141  {
144  size_t m_Found;
147  size_t m_Duplicated;
150  size_t m_Removed;
153  size_t m_Groups;
157 
173 
175  /* {secret}*/
177  };
178 
181  enum
182  {
183  eRemoveNone = 0x0,
184  eRemoveOnLockedLayers = 0x1,
185  eRemoveOnOffLayers = 0x2,
186  eRemoveOnFrozenLayers = 0x4,
187  eRemoveNotInCurrentSpace = 0x8,
188  eRemoveNotRectViewports = 0x10,
189  eRemoveOverallViewports = 0x20,
190  eRemoveNotInWorkingSet = 0x40,
191  eRemoveCloud = 0x80, //flag added to not include Clouds in selection process.
192  // added to select entities inside block references in several dimension commands and interfere
193  eRemoveDefExceptNotInCurrentSpaceInvalid = eRemoveOnLockedLayers | eRemoveNotRectViewports | eRemoveOverallViewports,
194  eRemoveDefaultInvalid = eRemoveOnLockedLayers | eRemoveNotInCurrentSpace | eRemoveNotRectViewports | eRemoveOverallViewports | eRemoveNotInWorkingSet,
195  eRemoveDefaultInvalidButNonRectViewports = eRemoveOnLockedLayers | eRemoveNotInCurrentSpace | eRemoveOverallViewports | eRemoveNotInWorkingSet
196  };
197  typedef int RemoveFlags;
198 
202  {
206 
208  };
209 
212  virtual MergeResult Merge( const CFxSelectionSet* pSS, MergeOptions options ) = 0;
213 
216  virtual MergeResult Merge( const OdDbObjectIdArray& idsToMerge, MergeOptions options ) = 0;
217 
220  virtual void AddReactor( CFxSelectionSetReactor* pReactor ) = 0;
221 
224  virtual void RemoveReactor( CFxSelectionSetReactor* pReactor ) = 0;
225 
229  virtual bool IsHighlightEnabled() const = 0;
230 
234  virtual void SetHighlightEnabled( bool enable ) = 0;
235 
238  template <class TType, class TKey = TType>
240  {
241  public:
242  virtual ~CFxIterator() {};
243  virtual void start() = 0;
244  virtual void step() = 0;
245  virtual bool done() const = 0;
246  virtual const TType& object() const = 0;
247  virtual bool seek( const TKey& object ) = 0;
248  };
249 
253 
254  virtual bool IsEmpty() const = 0;
255 
256 public:
259  static CFxSelectionSet* SelectByPoint( const OdGePoint3d& pointWCS, double pickboxEYE, CFxView* pView );
260 
263  static CFxSelectionSet* SelectByBox( const OdGePoint3d& firstPointWCS, const OdGePoint3d& secondPointWCS, CFxView* pView );
264 
267  static CFxSelectionSet* SelectByWindow( const OdGePoint3d& firstPointWCS, const OdGePoint3d& secondPointWCS, CFxView* pView );
268 
271  static CFxSelectionSet* SelectByCrossingWindow( const OdGePoint3d& firstPointWCS, const OdGePoint3d& secondPointWCS, CFxView* pView );
272 
275  static CFxSelectionSet* SelectByPolygon( const OdGePoint3dArray& pointsWCS, CFxView* pView );
276 
280 
283  static CFxSelectionSet* SelectByFence( const OdGePoint3dArray& pointsWCS, CFxView* pView );
284 
288 
292 
296 
300 
301 public:
302  /* {secret} */
304 
305  /* {secret} */
306  static CFxSelectionSet* SelectForHatch( CFxView* pView, const OdGePoint3d& pickPoint, OdGeExtents3d* extents );
307 };
308 
310 
317 {
318 public:
319  /* {secret} */
320  virtual ~CFxSelectionData();
321 
324  typedef enum
325  {
326  eNonGraphical = 0,
327  ePickPointSelection = 1,
328  eWindowOrWPolygon = 2,
329  eCrossingOrCPolygon = 3,
330  eFence = 4,
331  eSubentity = 5
332  } SelectionMethod;
333 
336  virtual SelectionMethod GetMethod() const = 0;
337 
340  virtual fdt_resbufW* GetData() const = 0;
341 
344  virtual int GetWindowId() const = 0;
345 
349  {
350  typedef enum
351  {
352  eInfiniteLine = 0,
353  eRay = 1,
354  eLineSegment = 2
355  } PointDescription;
356 
360  };
361 
364  virtual size_t GetPointsCount() const = 0;
365 
368  virtual CFxVertexData* GetPoints() const = 0;
369 
372  virtual size_t GetNumEntities() const = 0;
373 
376  virtual bool IsNestedSelection() const = 0;
377 
380  virtual const OdDbObjectId& GetSpaceId() const = 0;
381 
385 };
386 
388 
395 {
396 public:
397  /* {secret} */
398  virtual ~CFxEntityData();
399 
402  virtual const OdDbObjectId& GetId() const = 0;
403 
406  virtual const OdDbObjectId& GetLayerId() const = 0;
407 
410  virtual size_t GetDrawOrder() const = 0;
411 
414  virtual const OdRxClass* GetClass() const = 0;
415 
418  typedef enum
419  {
420  eUnset = 0x0,
421  eNonAssociative = 0x1,
422  eGroup = 0x2,
423  eHatch = 0x4,
424  eViewport = 0x8
425  } Flags;
426 
429  virtual Flags GetFlags() const = 0;
430 
433  virtual int GetIndex() const = 0;
434 
437  virtual bool IsWholeEntitySelected() const = 0;
438 
441  virtual size_t SubentGetLength() const = 0;
442 
445  virtual bool ContainsSubent( const OdDbFullSubentPath & path ) const = 0;
446 
449  virtual bool SubentAdd( const OdDbFullSubentPath& subentPath ) = 0;
450 
453  virtual bool SubentRemove( const OdDbFullSubentPath& subentPath ) = 0;
454 
457  virtual CFxEntityDataIterator* CreateIterator() const = 0;
458 };
459 
460 #include "FxPragmaPop.h"
FxPragmaPop.h
CFxSelectionSet::SelectAll
static CFxSelectionSet * SelectAll(CFxDocument *pDoc)
CFxSelectionData::CFxVertexData::PointDescription
PointDescription
Definition: FxSelectionSet.h:351
CFxSelectionData::~CFxSelectionData
virtual ~CFxSelectionData()
OdGeVector3d
Definition: GeVector3d.h:54
CFxEntityData::GetLayerId
virtual const OdDbObjectId & GetLayerId() const =0
CFxSelectionSet::CFxIterator::seek
virtual bool seek(const TKey &object)=0
CFxSelectionSet::MergeResult::m_Groups
size_t m_Groups
Definition: FxSelectionSet.h:153
CFxEntityData::GetFlags
virtual Flags GetFlags() const =0
CFxDatabase
Definition: FxDatabase.h:48
CFxEntityData
Definition: FxSelectionSet.h:395
CFxSelectionSet::MergeOptions::MergeOptions
MergeOptions()
CFxSelectionSet::CFxIterator::~CFxIterator
virtual ~CFxIterator()
Definition: FxSelectionSet.h:242
CFxSelectionSetReactor
Definition: FxSelectionSetReactor.h:30
CFxEntityData::SubentAdd
virtual bool SubentAdd(const OdDbFullSubentPath &subentPath)=0
CFxUserIO
Definition: FxUserIO.h:138
CFxSelectionSet
Definition: FxSelectionSet.h:49
OdDbObjectId
Definition: DbObjectId.h:99
CFxSelectionSet::MergeOptions::m_Classes
OdArray< OdRxClass * > m_Classes
Definition: FxSelectionSet.h:205
CFxSelectionSet::MergeResult
Definition: FxSelectionSet.h:141
CFxSelectionSet::CFxIterator
Definition: FxSelectionSet.h:240
CFxSelectionSet::SelectGroup
static CFxSelectionSet * SelectGroup(OdDbObjectId idGroup)
CFxSelectionSet::SetHighlightEnabled
virtual void SetHighlightEnabled(bool enable)=0
OdDbFullSubentPath
Definition: DbSubentId.h:49
DDKERNEL.h
OdArray< OdDbObjectId, OdMemoryAllocator< OdDbObjectId > >
CFxSelectionSet::Merge
virtual MergeResult Merge(const CFxSelectionSet *pSS, MergeOptions options)=0
CFxSelectionData::GetMethod
virtual SelectionMethod GetMethod() const =0
CFxEntityData::GetDrawOrder
virtual size_t GetDrawOrder() const =0
CFxSelectionSet::SelectByPoint
static CFxSelectionSet * SelectByPoint(const OdGePoint3d &pointWCS, double pickboxEYE, CFxView *pView)
CFxSelectionSet::CLASS_VECTOR
std::vector< const OdRxClass * > CLASS_VECTOR
Definition: FxSelectionSet.h:98
CFxSelectionSet::MergeResult::MergeResult
MergeResult()
CFxSelectionDataIterator
CFxSelectionSet::CFxIterator< CFxEntityData, OdDbObjectId > CFxSelectionDataIterator
Definition: FxSelectionSet.h:309
data
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
index
GLuint index
Definition: gles2_ext.h:265
fdt_resbufW
Definition: FxFdtType.h:154
CFxSelectionSet::SelectByCrossingWindow
static CFxSelectionSet * SelectByCrossingWindow(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
CFxSelectionSet::CFxIterator::step
virtual void step()=0
CFxEntityData::~CFxEntityData
virtual ~CFxEntityData()
CFxSelectionSet::IsEmpty
virtual bool IsEmpty() const =0
CFxSelectionSet::MergeResult::m_RemovedNotInWorkingSet
size_t m_RemovedNotInWorkingSet
Definition: FxSelectionSet.h:172
CFxSelectionSet::RemoveReactor
virtual void RemoveReactor(CFxSelectionSetReactor *pReactor)=0
CFxSelectionSet::MergeResult::m_RemovedNotInCurrentSpace
size_t m_RemovedNotInCurrentSpace
Definition: FxSelectionSet.h:169
CFxSelectionData::CFxVertexData::m_Point
OdGePoint3d m_Point
Definition: FxSelectionSet.h:358
OdRxClass
Definition: RxObject.h:865
CFxSelectionSet::RemoveFlags
int RemoveFlags
Definition: FxSelectionSet.h:197
CFxSelectionData::GetPointsCount
virtual size_t GetPointsCount() const =0
CFxSelectionData::SelectionMethod
SelectionMethod
Definition: FxSelectionSet.h:325
CFxSelectionSet::SelectByWindow
static CFxSelectionSet * SelectByWindow(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
OdGePoint3d
Definition: GePoint3d.h:55
CFxSelectionData
Definition: FxSelectionSet.h:317
CFxSelectionData::IsNestedSelection
virtual bool IsNestedSelection() const =0
CFxSelectionSet::MergeResult::m_RemovedOnLockedLayers
size_t m_RemovedOnLockedLayers
Definition: FxSelectionSet.h:160
CFxSelectionSet::MergeOptions::m_pFilter
fdt_resbufW * m_pFilter
Definition: FxSelectionSet.h:204
GePoint3d.h
CFxEntityData::CreateIterator
virtual CFxEntityDataIterator * CreateIterator() const =0
CFxEntityData::GetClass
virtual const OdRxClass * GetClass() const =0
CFxSelectionSet::MergeResult::m_Removed
size_t m_Removed
Definition: FxSelectionSet.h:150
CFxSelectionSet::SIZE_T_VECTOR
std::vector< size_t > SIZE_T_VECTOR
Definition: FxSelectionSet.h:99
CFxSelectionSet::MergeOptions::m_RemoveOptions
RemoveFlags m_RemoveOptions
Definition: FxSelectionSet.h:203
CFxSelectionSet::IsHighlightEnabled
virtual bool IsHighlightEnabled() const =0
CFxSelectionSet::MergeOptions
Definition: FxSelectionSet.h:202
CFxSelectionData::CFxVertexData::m_Description
PointDescription m_Description
Definition: FxSelectionSet.h:357
CFxEntityData::SubentRemove
virtual bool SubentRemove(const OdDbFullSubentPath &subentPath)=0
CFxSelectionSet::CFxIterator::done
virtual bool done() const =0
CFxDocument
Definition: FxDocument.h:47
SharedPtr.h
CFxSelectionData::GetSpaceId
virtual const OdDbObjectId & GetSpaceId() const =0
CFxSelectionSet::MergeResult::m_FoundNotInCurrentSpace
size_t m_FoundNotInCurrentSpace
Definition: FxSelectionSet.h:156
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxSelectionSet::AddReactor
virtual void AddReactor(CFxSelectionSetReactor *pReactor)=0
DbSSet.h
CFxSelectionSet::SelectByPolygon
static CFxSelectionSet * SelectByPolygon(const OdGePoint3dArray &pointsWCS, CFxView *pView)
CFxView
Definition: FxView.h:265
ODRX_HEAP_OPERATORS
#define ODRX_HEAP_OPERATORS()
Definition: OdHeap.h:74
CFxSelectionSet::SelectLast
static CFxSelectionSet * SelectLast(CFxDocument *pDoc)
StaticRxObject.h
GeVector3d.h
CFxSelectionSet::CreateIterator
virtual CFxIterator< CFxSelectionData > * CreateIterator() const =0
CFxSelectionSet::SelectByView
static CFxSelectionSet * SelectByView(CFxView *pView)
CFxSelectionSet::MergeResult::m_RemovedCloud
size_t m_RemovedCloud
Definition: FxSelectionSet.h:174
CFxSelectionSet::SelectByBox
static CFxSelectionSet * SelectByBox(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
CFxSelectionData::GetData
virtual fdt_resbufW * GetData() const =0
CFxSelectionSet::SelectByFence
static CFxSelectionSet * SelectByFence(const OdGePoint3dArray &pointsWCS, CFxView *pView)
CFxSelectionData::GetPoints
virtual CFxVertexData * GetPoints() const =0
CFxSelectionSet::MergeResult::m_RemovedOnOffLayers
size_t m_RemovedOnOffLayers
Definition: FxSelectionSet.h:163
OdStaticRxObject
Definition: StaticRxObject.h:57
CFxSelectionSet::MergeResult::m_Found
size_t m_Found
Definition: FxSelectionSet.h:144
OdGeExtents3d
Definition: GeExtents3d.h:45
CFxEntityData::ContainsSubent
virtual bool ContainsSubent(const OdDbFullSubentPath &path) const =0
CFxEntityData::GetId
virtual const OdDbObjectId & GetId() const =0
CFxSelectionSet::MergeResult::m_RemovedOnFrozenLayers
size_t m_RemovedOnFrozenLayers
Definition: FxSelectionSet.h:166
CFxSelectionData::CFxVertexData::m_Direction
OdGeVector3d m_Direction
Definition: FxSelectionSet.h:359
FxPragmaPush.h
CFxSelectionSet::Merge
virtual MergeResult Merge(const OdDbObjectIdArray &idsToMerge, MergeOptions options)=0
CFxEntityData::GetIndex
virtual int GetIndex() const =0
CFxEntityDataIterator
CFxSelectionSet::CFxIterator< OdDbFullSubentPath > CFxEntityDataIterator
Definition: FxSelectionSet.h:387
CFxSelectionData::GetWindowId
virtual int GetWindowId() const =0
CFxSelectionSet::CFxIterator::start
virtual void start()=0
CFxEntityData::SubentGetLength
virtual size_t SubentGetLength() const =0
CFxEntityData::Flags
Flags
Definition: FxSelectionSet.h:419
CFxSelectionData::CFxVertexData
Definition: FxSelectionSet.h:349
CFxSelectionSet::CFxIterator::object
virtual const TType & object() const =0
CFxSelectionSet::SelectForHatch
static CFxSelectionSet * SelectForHatch(CFxView *pView, const OdGePoint3d &pickPoint, OdGeExtents3d *extents)
CFxSelectionData::CreateIterator
virtual CFxSelectionDataIterator * CreateIterator() const =0
CFxSelectionSet::SelectPrevious
static CFxSelectionSet * SelectPrevious(CFxDocument *pDoc)
CFxSelectionSet::MergeResult::m_Duplicated
size_t m_Duplicated
Definition: FxSelectionSet.h:147
CFxSelectionSet::SelectByCrossingPolygon
static CFxSelectionSet * SelectByCrossingPolygon(const OdGePoint3dArray &pointsWCS, CFxView *pView)
CFxEntityData::IsWholeEntitySelected
virtual bool IsWholeEntitySelected() const =0
CFxSelectionData::GetNumEntities
virtual size_t GetNumEntities() const =0