CFx SDK Documentation  2020SP3
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_
GETBIT
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
OdGiDrawableDesc::markByGeometry
void markByGeometry(bool val) const
Definition: GsSelectionReactor.h:187
OdGiDrawableDesc::isMarkedForForcedSelection
bool isMarkedForForcedSelection() const
Definition: GsSelectionReactor.h:222
OdGsSelectionReactor::kNotImplemented
@ kNotImplemented
Definition: GsSelectionReactor.h:144
OdGiDrawableDesc::isMarkedBySubGeometry
bool isMarkedBySubGeometry() const
Definition: GsSelectionReactor.h:202
OdGiDrawableDesc::markBySubSelection
void markBySubSelection(bool val) const
Definition: GsSelectionReactor.h:177
OdGiDrawableDesc::kMarkedForForcedSelection
@ kMarkedForForcedSelection
Definition: GsSelectionReactor.h:70
OdGiDrawableDesc::kMarkedToBreak
@ kMarkedToBreak
Definition: GsSelectionReactor.h:69
OdGiViewport
Definition: GiViewport.h:51
OdGiDrawableDesc
Definition: GsSelectionReactor.h:43
SETBIT
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
OdGiDrawableDesc::nDrawableFlags
OdUInt32 nDrawableFlags
Definition: GsSelectionReactor.h:58
TD_PackPop.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGsSelectionReactor::kBreak
@ kBreak
Definition: GsSelectionReactor.h:146
OdGiDrawableDesc::kMarkedByGeometry
@ kMarkedByGeometry
Definition: GsSelectionReactor.h:67
OdGiDrawableDesc::kMarkedBySelection
@ kMarkedBySelection
Definition: GsSelectionReactor.h:65
OdGiDrawableDesc::kMarkedBySubSelection
@ kMarkedBySubSelection
Definition: GsSelectionReactor.h:66
OdGsSelectionReactor::selected
virtual OdUInt32 selected(const OdGiPathNode &, const OdGiViewport &)
Definition: GsSelectionReactor.h:151
OdGiPathNode
Definition: GiPathNode.h:36
OdGiDrawableDesc::isMarkedBySelection
bool isMarkedBySelection() const
Definition: GsSelectionReactor.h:172
OdGiDrawable
Definition: GiDrawable.h:49
OdGiDrawableDesc::OdGiDrawableDesc
OdGiDrawableDesc()
Definition: GsSelectionReactor.h:44
OdGiDrawableDesc::markToSkip
void markToSkip(bool skip) const
Definition: GsSelectionReactor.h:157
OdGiDrawableDesc::nDrawableDescFlags
OdUInt32 nDrawableDescFlags
Definition: GsSelectionReactor.h:74
TD_PackPush.h
OdGiDrawableDesc::kLastFlag
@ kLastFlag
Definition: GsSelectionReactor.h:71
OdGsSelectionReactor::kSkipDrawable
@ kSkipDrawable
Definition: GsSelectionReactor.h:147
OdGiDrawableDesc::pParent
OdGiDrawableDesc * pParent
Definition: GsSelectionReactor.h:52
OdGsSelectionReactor::kContinue
@ kContinue
Definition: GsSelectionReactor.h:145
OdGiDrawableDesc::kMarkedToSkip
@ kMarkedToSkip
Definition: GsSelectionReactor.h:64
OdGsSelectionReactor::selected
virtual bool selected(const OdGiDrawableDesc &pDrawableDesc)=0
OdGiDrawableDesc::markForForcedSelection
void markForForcedSelection(bool val) const
Definition: GsSelectionReactor.h:217
OdGiDrawableDesc::isMarkedBySubSelection
bool isMarkedBySubSelection() const
Definition: GsSelectionReactor.h:182
OdGiDrawableDesc::markToBreak
void markToBreak(bool val) const
Definition: GsSelectionReactor.h:207
OdGiDrawableDesc::DrawableDescFlags
DrawableDescFlags
Definition: GsSelectionReactor.h:61
OdGiDrawableDesc::isMarkedToBreak
bool isMarkedToBreak() const
Definition: GsSelectionReactor.h:212
OdGiDrawableDesc::persistId
OdDbStub * persistId
Definition: GsSelectionReactor.h:54
OdGiDrawableDesc::markBySelection
void markBySelection(bool val) const
Definition: GsSelectionReactor.h:167
OdGiDrawableDesc::markBySubGeometry
void markBySubGeometry(bool val) const
Definition: GsSelectionReactor.h:197
OdGiDrawableDesc::kMarkedBySubGeometry
@ kMarkedBySubGeometry
Definition: GsSelectionReactor.h:68
OdGiDrawableDesc::isMarkedToSkip
bool isMarkedToSkip() const
Definition: GsSelectionReactor.h:162
OdGiDrawableDesc::kFirstFlag
@ kFirstFlag
Definition: GsSelectionReactor.h:62
OdGiDrawableDesc::isMarkedByGeometry
bool isMarkedByGeometry() const
Definition: GsSelectionReactor.h:192
OdGsSelectionReactor
Definition: GsSelectionReactor.h:128
OdGiDrawableDesc::pTransientDrawable
const OdGiDrawable * pTransientDrawable
Definition: GsSelectionReactor.h:56