CFx SDK Documentation  2023 SP0
FxSelectionSet.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-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 "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"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxSelectionSet::CFxIterator< OdDbFullSubentPath > CFxEntityDataIterator
CFxSelectionSet::CFxIterator< CFxEntityData, OdDbObjectId > CFxSelectionDataIterator
#define ODRX_HEAP_OPERATORS()
Definition: OdHeap.h:74
virtual int GetIndex() const =0
virtual const OdDbObjectId & GetLayerId() const =0
virtual const OdRxClass * GetClass() const =0
virtual size_t SubentGetLength() const =0
virtual size_t GetDrawOrder() const =0
virtual Flags GetFlags() const =0
virtual bool SubentRemove(const OdDbFullSubentPath &subentPath)=0
virtual CFxEntityDataIterator * CreateIterator() const =0
virtual const OdDbObjectId & GetId() const =0
virtual bool IsWholeEntitySelected() const =0
virtual bool ContainsSubent(const OdDbFullSubentPath &path) const =0
virtual ~CFxEntityData()
virtual bool SubentAdd(const OdDbFullSubentPath &subentPath)=0
virtual size_t GetPointsCount() const =0
virtual size_t GetNumEntities() const =0
virtual SelectionMethod GetMethod() const =0
virtual bool IsNestedSelection() const =0
virtual CFxSelectionDataIterator * CreateIterator() const =0
virtual fdt_resbufW * GetData() const =0
virtual CFxVertexData * GetPoints() const =0
virtual const OdDbObjectId & GetSpaceId() const =0
virtual int GetWindowId() const =0
virtual ~CFxSelectionData()
virtual const TType & object() const =0
virtual bool seek(const TKey &object)=0
virtual bool done() const =0
static CFxSelectionSet * SelectPrevious(CFxDocument *pDoc)
virtual void SetHighlightEnabled(bool enable)=0
static CFxSelectionSet * SelectGroup(OdDbObjectId idGroup)
static CFxSelectionSet * SelectByPoint(const OdGePoint3d &pointWCS, double pickboxEYE, CFxView *pView)
virtual void AddReactor(CFxSelectionSetReactor *pReactor)=0
static CFxSelectionSet * SelectForHatch(CFxView *pView, const OdGePoint3d &pickPoint, OdGeExtents3d *extents)
virtual bool IsEmpty() const =0
static CFxSelectionSet * SelectByPolygon(const OdGePoint3dArray &pointsWCS, CFxView *pView)
static CFxSelectionSet * SelectByView(CFxView *pView)
virtual CFxIterator< CFxSelectionData > * CreateIterator() const =0
static CFxSelectionSet * SelectByCrossingWindow(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
std::vector< size_t > SIZE_T_VECTOR
virtual MergeResult Merge(const OdDbObjectIdArray &idsToMerge, MergeOptions options)=0
static CFxSelectionSet * SelectByCrossingPolygon(const OdGePoint3dArray &pointsWCS, CFxView *pView)
std::vector< const OdRxClass * > CLASS_VECTOR
static CFxSelectionSet * SelectAll(CFxDocument *pDoc)
static CFxSelectionSet * SelectByFence(const OdGePoint3dArray &pointsWCS, CFxView *pView)
virtual bool IsHighlightEnabled() const =0
static CFxSelectionSet * SelectByWindow(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
static CFxSelectionSet * SelectByBox(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
static CFxSelectionSet * SelectLast(CFxDocument *pDoc)
virtual MergeResult Merge(const CFxSelectionSet *pSS, MergeOptions options)=0
virtual void RemoveReactor(CFxSelectionSetReactor *pReactor)=0
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
GLuint index
Definition: gles2_ext.h:265
OdArray< OdRxClass * > m_Classes