CFx SDK Documentation  2022 SP0
GsSelectionReactor.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef __ODGSSELECTIONREACTOR_H_INCLUDED_
25 #define __ODGSSELECTIONREACTOR_H_INCLUDED_
26 
27 #include "TD_PackPush.h"
28 
29 class OdDbStub;
30 class OdGiViewport;
31 class OdGiDrawable;
32 class OdGiPathNode;
33 
43 {
45  : pParent(0)
46  , persistId(0)
48  , nDrawableFlags(0)
50  {}
51 
52  OdGiDrawableDesc* pParent; // Pointer to the parent of the Drawable object.
53 
54  OdDbStub* persistId; // Persistent ID of the *database* object associated with the Drawable object.
55 
56  const OdGiDrawable* pTransientDrawable; // Pointer to the Drawable object.
57 
58  OdUInt32 nDrawableFlags; // Drawable flags for the Drawable object (come from subSetAttributes).
59 
61  {
63 
65  kMarkedBySelection = kFirstFlag << 1, // selected for crossing/fence; not selected for window
66  kMarkedBySubSelection = kFirstFlag << 2, // selected for crossing/fence; not selected for window
67  kMarkedByGeometry = kFirstFlag << 3, // geometry output for entire drawable
68  kMarkedBySubGeometry = kFirstFlag << 4, // geometry output for current marker
69  kMarkedToBreak = kFirstFlag << 5, // break selection process entirely
72  };
73 
74  OdUInt32 nDrawableDescFlags; // additional desc flags
75 
83  void markToSkip(bool skip) const;
84 
88  bool isMarkedToSkip() const;
89 
90  void markBySelection(bool val) const;
91 
92  bool isMarkedBySelection() const;
93 
94  void markBySubSelection(bool val) const;
95 
96  bool isMarkedBySubSelection() const;
97 
98  void markByGeometry(bool val) const;
99 
100  bool isMarkedByGeometry() const;
101 
102  void markBySubGeometry(bool val) const;
103 
104  bool isMarkedBySubGeometry() const;
105 
106  void markToBreak(bool val) const;
107 
108  bool isMarkedToBreak() const;
109 
110  void markForForcedSelection(bool val) const;
111 
112  bool isMarkedForForcedSelection() const;
113 };
114 
128 {
129 public:
140  virtual bool selected(const OdGiDrawableDesc& pDrawableDesc) = 0;
141 
142  enum
143  {
144  kNotImplemented = 0x80000000,
146  kBreak = 1,
147  kSkipDrawable = 2
148  };
151  virtual OdUInt32 selected(const OdGiPathNode& /*pathNode*/, const OdGiViewport& /*viewInfo*/)
152  {
153  return OdUInt32(kNotImplemented);
154  }
155 };
156 
157 inline void OdGiDrawableDesc::markToSkip(bool val) const
158 {
159  SETBIT(const_cast<OdGiDrawableDesc*>(this)->nDrawableDescFlags, kMarkedToSkip, val);
160 }
161 
163 {
165 }
166 
167 inline void OdGiDrawableDesc::markBySelection(bool val) const
168 {
170 }
171 
173 {
175 }
176 
177 inline void OdGiDrawableDesc::markBySubSelection(bool val) const
178 {
180 }
181 
183 {
185 }
186 
187 inline void OdGiDrawableDesc::markByGeometry(bool val) const
188 {
189  SETBIT(const_cast<OdGiDrawableDesc*>(this)->nDrawableDescFlags, kMarkedByGeometry, val);
190 }
191 
193 {
195 }
196 
197 inline void OdGiDrawableDesc::markBySubGeometry(bool val) const
198 {
200 }
201 
203 {
205 }
206 
207 inline void OdGiDrawableDesc::markToBreak(bool val) const
208 {
209  SETBIT(const_cast<OdGiDrawableDesc*>(this)->nDrawableDescFlags, kMarkedToBreak, val);
210 }
211 
213 {
215 }
216 
217 inline void OdGiDrawableDesc::markForForcedSelection(bool val) const
218 {
220 }
221 
223 {
225 }
226 
227 #include "TD_PackPop.h"
228 
229 #endif // __ODGSSELECTIONREACTOR_H_INCLUDED_
unsigned int OdUInt32
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
virtual OdUInt32 selected(const OdGiPathNode &, const OdGiViewport &)
virtual bool selected(const OdGiDrawableDesc &pDrawableDesc)=0
OdGiDrawableDesc * pParent
void markBySelection(bool val) const
bool isMarkedToBreak() const
void markForForcedSelection(bool val) const
bool isMarkedForForcedSelection() const
void markBySubSelection(bool val) const
const OdGiDrawable * pTransientDrawable
bool isMarkedBySelection() const
bool isMarkedBySubSelection() const
bool isMarkedBySubGeometry() const
void markBySubGeometry(bool val) const
void markToSkip(bool skip) const
bool isMarkedByGeometry() const
bool isMarkedToSkip() const
void markByGeometry(bool val) const
void markToBreak(bool val) const