CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxSelectionSet.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2023 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
32class CFxDatabase;
33class CFxView;
34class CFxDocument;
36class CFxUserIO;
38class CFxEntityData;
40
41struct fdt_resbufW;
42
49 protected OdStaticRxObject< OdDbSelectionSet >
50{
51public:
53
54 /* {secret} */
55 virtual ~CFxSelectionSet();
56
60 virtual size_t GetNumber() const = 0;
61
64 virtual CFxDatabase* GetFxDatabase() = 0;
65
68 virtual size_t GetLength() const = 0;
69
73 virtual size_t GetTotalSubents() const = 0;
74
77 virtual const OdDbObjectId& GetId( size_t index ) const = 0;
78
81 virtual size_t SubentGetLength( size_t index ) const = 0;
82
85 virtual const OdDbFullSubentPath& SubentGetId( size_t index, size_t subentIndex ) const = 0;
86
89 virtual void Clear() = 0;
90
93 virtual bool IsMember( const OdDbObjectId& id ) const = 0;
94
97 virtual bool IsMember( const OdDbFullSubentPath & path ) const = 0;
98
99 typedef std::vector<const OdRxClass*> CLASS_VECTOR;
100 typedef std::vector<size_t> SIZE_T_VECTOR;
101
104 virtual void GetClassesFound( CLASS_VECTOR& classes, SIZE_T_VECTOR& objects ) const = 0;
105
108 virtual const OdRxClass* GetCommonBaseClass() const = 0;
109
113 virtual const OdRxClass* GetCommonBasePEClass() const = 0;
114
117 virtual void GetObjectsByClass( const OdRxClass* pClass, OdDbObjectIdArray& objects ) const = 0;
118
121 virtual int GetNTHX( int index, fdt_resbufW** data ) const = 0;
122
125 virtual bool Add( const OdDbObjectId& objId ) = 0;
126
129 virtual bool Remove( const OdDbObjectId& objId ) = 0;
130
133 virtual bool SubentAdd( const OdDbFullSubentPath& path ) = 0;
134
137 virtual bool SubentRemove( const OdDbFullSubentPath& path ) = 0;
138
141 virtual void SetCustomFilter( const CFxSelectionSetFilter* pFilter ) = 0;
142
145 virtual const CFxSelectionSetFilter* GetCustomFilter() = 0;
146
149 virtual void AddObjectFilter( const OdRxClass* pClass ) = 0;
150
153 virtual void ClearObjectFilters() = 0;
154
158 {
161 size_t m_Found;
167 size_t m_Removed;
170 size_t m_Groups;
174
190
192 /* {secret}*/
194 };
195
198 enum
199 {
200 eRemoveNone = 0x0,
201 eRemoveOnLockedLayers = 0x1,
202 eRemoveOnOffLayers = 0x2,
203 eRemoveOnFrozenLayers = 0x4,
204 eRemoveNotInCurrentSpace = 0x8,
205 eRemoveNotRectViewports = 0x10,
206 eRemoveOverallViewports = 0x20,
207 eRemoveNotInWorkingSet = 0x40,
208 eRemoveCloud = 0x80, //flag added to not include Clouds in selection process.
209 // added to select entities inside block references in several dimension commands and interfere
210 eRemoveDefExceptNotInCurrentSpaceInvalid = eRemoveOnLockedLayers | eRemoveOverallViewports,
211 eRemoveDefaultInvalid = eRemoveOnLockedLayers | eRemoveNotInCurrentSpace | eRemoveOverallViewports | eRemoveNotInWorkingSet,
212 eRemoveDefaultInvalidButNonRectViewports = eRemoveOnLockedLayers | eRemoveNotInCurrentSpace | eRemoveOverallViewports | eRemoveNotInWorkingSet
213 };
214 typedef int RemoveFlags;
215
219 {
223
225 };
226
229 virtual MergeResult Merge( const CFxSelectionSet* pSS, MergeOptions options ) = 0;
230
233 virtual MergeResult Merge( const OdDbObjectIdArray& idsToMerge, MergeOptions options ) = 0;
234
237 virtual void AddReactor( CFxSelectionSetReactor* pReactor ) = 0;
238
241 virtual void RemoveReactor( CFxSelectionSetReactor* pReactor ) = 0;
242
246 virtual bool IsHighlightEnabled() const = 0;
247
251 virtual void SetHighlightEnabled( bool enable ) = 0;
252
255 template <class TType, class TKey = TType>
257 {
258 public:
259 virtual ~CFxIterator() {};
260 virtual void start() = 0;
261 virtual void step() = 0;
262 virtual bool done() const = 0;
263 virtual const TType& object() const = 0;
264 virtual bool seek( const TKey& object ) = 0;
265 };
266
270
271 virtual bool IsEmpty() const = 0;
272
273public:
276 static CFxSelectionSet* SelectByPoint( const OdGePoint3d& pointWCS, double pickboxEYE, CFxView* pView );
277
280 static CFxSelectionSet* SelectByBox( const OdGePoint3d& firstPointWCS, const OdGePoint3d& secondPointWCS, CFxView* pView );
281
284 static CFxSelectionSet* SelectByWindow( const OdGePoint3d& firstPointWCS, const OdGePoint3d& secondPointWCS, CFxView* pView );
285
288 static CFxSelectionSet* SelectByCrossingWindow( const OdGePoint3d& firstPointWCS, const OdGePoint3d& secondPointWCS, CFxView* pView );
289
292 static CFxSelectionSet* SelectByPolygon( const OdGePoint3dArray& pointsWCS, CFxView* pView );
293
297
300 static CFxSelectionSet* SelectByFence( const OdGePoint3dArray& pointsWCS, CFxView* pView );
301
305
309
313
317
318public:
319 /* {secret} */
321
322 /* {secret} */
323 static CFxSelectionSet* SelectForHatch( CFxView* pView, const OdGePoint3d& pickPoint, OdGeExtents3d* extents );
324};
325
327
334{
335public:
336 /* {secret} */
338
341 typedef enum
342 {
343 eNonGraphical = 0,
344 ePickPointSelection = 1,
345 eWindowOrWPolygon = 2,
346 eCrossingOrCPolygon = 3,
347 eFence = 4,
348 eSubentity = 5
349 } SelectionMethod;
350
351 typedef enum
352 {
369 } SelectionMode;
370
373 virtual SelectionMethod GetMethod() const = 0;
374
377 virtual fdt_resbufW* GetData() const = 0;
378
381 virtual int GetWindowId() const = 0;
382
386 {
387 typedef enum
388 {
389 eInfiniteLine = 0,
390 eRay = 1,
391 eLineSegment = 2
392 } PointDescription;
393
397 };
398
401 virtual size_t GetPointsCount() const = 0;
402
405 virtual CFxVertexData* GetPoints() const = 0;
406
409 virtual size_t GetNumEntities() const = 0;
410
413 virtual bool IsNestedSelection() const = 0;
414
417 virtual const OdDbObjectId& GetSpaceId() const = 0;
418
422
423 virtual SelectionMode GetMode() const = 0;
424};
425
427
434{
435public:
436 /* {secret} */
437 virtual ~CFxEntityData();
438
441 virtual const OdDbObjectId& GetId() const = 0;
442
445 virtual const OdDbObjectId& GetLayerId() const = 0;
446
449 virtual size_t GetDrawOrder() const = 0;
450
453 virtual const OdRxClass* GetClass() const = 0;
454
457 typedef enum
458 {
459 eUnset = 0x0,
460 eNonAssociative = 0x1,
461 eGroup = 0x2,
462 eHatch = 0x4,
463 eViewport = 0x8
464 } Flags;
465
468 virtual Flags GetFlags() const = 0;
469
472 virtual int GetIndex() const = 0;
473
476 virtual bool IsWholeEntitySelected() const = 0;
477
480 virtual size_t SubentGetLength() const = 0;
481
484 virtual bool ContainsSubent( const OdDbFullSubentPath & path ) const = 0;
485
488 virtual bool SubentAdd( const OdDbFullSubentPath& subentPath ) = 0;
489
492 virtual bool SubentRemove( const OdDbFullSubentPath& subentPath ) = 0;
493
497};
498
499#include "FxPragmaPop.h"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
@ kUnknown
eUnset
CFxSelectionSet::CFxIterator< OdDbFullSubentPath > CFxEntityDataIterator
CFxSelectionSet::CFxIterator< CFxEntityData, OdDbObjectId > CFxSelectionDataIterator
#define ODRX_HEAP_OPERATORS()
Definition: OdHeap.h:76
virtual int GetIndex() const =0
virtual CFxEntityDataIterator * CreateIterator() const =0
virtual const OdRxClass * GetClass() const =0
virtual size_t SubentGetLength() const =0
virtual size_t GetDrawOrder() const =0
virtual const OdDbObjectId & GetLayerId() const =0
virtual Flags GetFlags() const =0
virtual bool SubentRemove(const OdDbFullSubentPath &subentPath)=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 CFxVertexData * GetPoints() const =0
virtual fdt_resbufW * GetData() const =0
virtual size_t GetNumEntities() const =0
virtual SelectionMethod GetMethod() const =0
virtual SelectionMode GetMode() const =0
virtual bool IsNestedSelection() const =0
virtual const OdDbObjectId & GetSpaceId() const =0
virtual CFxSelectionDataIterator * CreateIterator() const =0
virtual int GetWindowId() const =0
virtual ~CFxSelectionData()
virtual bool seek(const TKey &object)=0
virtual const TType & object() const =0
virtual bool done() const =0
static CFxSelectionSet * SelectGroup(OdDbObjectId idGroup)
virtual CFxIterator< CFxSelectionData > * CreateIterator() const =0
static CFxSelectionSet * SelectByView(CFxView *pView)
virtual void SetHighlightEnabled(bool enable)=0
static CFxSelectionSet * SelectByPolygon(const OdGePoint3dArray &pointsWCS, CFxView *pView)
virtual void AddReactor(CFxSelectionSetReactor *pReactor)=0
virtual bool IsEmpty() const =0
static CFxSelectionSet * SelectByCrossingPolygon(const OdGePoint3dArray &pointsWCS, CFxView *pView)
static CFxSelectionSet * SelectByFence(const OdGePoint3dArray &pointsWCS, CFxView *pView)
static CFxSelectionSet * SelectPrevious(CFxDocument *pDoc)
static CFxSelectionSet * SelectByWindow(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 * SelectByPoint(const OdGePoint3d &pointWCS, double pickboxEYE, CFxView *pView)
std::vector< const OdRxClass * > CLASS_VECTOR
static CFxSelectionSet * SelectForHatch(CFxView *pView, const OdGePoint3d &pickPoint, OdGeExtents3d *extents)
virtual bool IsHighlightEnabled() const =0
static CFxSelectionSet * SelectLast(CFxDocument *pDoc)
static CFxSelectionSet * SelectAll(CFxDocument *pDoc)
static CFxSelectionSet * SelectByBox(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
virtual MergeResult Merge(const CFxSelectionSet *pSS, MergeOptions options)=0
virtual void RemoveReactor(CFxSelectionSetReactor *pReactor)=0
static CFxSelectionSet * SelectByCrossingWindow(const OdGePoint3d &firstPointWCS, const OdGePoint3d &secondPointWCS, CFxView *pView)
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