CFx SDK Documentation  2022 SP0
DbDimData.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 ODDBDIMDATA_H
25 #define ODDBDIMDATA_H
26 
27 #include "TD_PackPush.h"
28 
29 #include "DbDimension.h"
30 
31 class OdDbDimData;
32 
36  OdDbEntity* pEnt,
37  double newValue,
38  const OdGeVector3d& offset);
39 
41  OdDbEntity* pEnt,
42  const OdString& sCustomString,
43  const OdGeVector3d& offset);
53 {
54 public:
56  {
57  kDimEditable = 0x0001,
58  kDimInvisible = 0x0002,
59  kDimFocal = 0x0004,
61  kDimEmptyData = 0x0010,
63  kDimDeltaLength = 0x0040,
65  kDimDeltaAngle = 0x0100,
66  kDimRadius = 0x0200,
67  kDimCustomValue = 0x0400,
68  kDimConstrained = 0x0800,
69  kDimCustomString = 0x1000
70  };
71 
72  OdDbDimData();
73 
75  DimDataSetValueFuncPtr setDimFunc = 0,
76  unsigned int bitFlags = 0,
77  void* appData = 0,
79 
80  // FELIX_CHANGE_BEGIN
81  // make this virtual for FRX
82  virtual ~OdDbDimData();
83  // FELIX_CHANGE_END
84 
85  OdDbDimData(const OdDbDimData&);
88  void setDimension(OdDbDimension* pDim);
89  OdDbObjectId ownerId() const;
90  void setOwnerId(const OdDbObjectId& objId);
91  unsigned int bitFlags() const;
92  void setBitFlags(unsigned int flags);
93  bool isDimFocal() const;
94  void setDimFocal(bool focal);
95  bool isDimEditable() const;
96  void setDimEditable(bool editable);
97  bool isDimInvisible() const;
98  void setDimInvisible(bool invisible);
99  bool isDimHideIfValueIsZero() const;
100  void setDimHideIfValueIsZero(bool hide);
101  void *appData() const;
102  void setAppData(void* appData);
107  bool isDimResultantLength() const;
108  void setDimResultantLength(bool bValue);
109  bool isDimDeltaLength() const;
110  void setDimDeltaLength(bool bValue);
111  bool isDimResultantAngle() const;
112  void setDimResultantAngle(bool bValue);
113  bool isDimDeltaAngle() const;
114  void setDimDeltaAngle(bool bValue);
115  bool isDimRadius() const;
116  void setDimRadius(bool bValue);
117  bool isCustomDimValue() const;
118  void setCustomDimValue(bool custom);
119  bool isConstrained() const;
120  void setConstrain(bool bValue);
121  bool isCustomString() const;
122  void setCustomString(bool bValue);
123 
124 private:
125  OdDbDimensionPtr m_pDim;
126  OdDbObjectId m_ownerId;
127  unsigned int m_bitFlags;
128  void* m_pAppData;
129  DimDataSetValueFuncPtr m_pSetDimValueFunc;
130  DimDataSetCustomStringFuncPtr m_pSetCustomStringFunc;
131 };
132 
134  : m_bitFlags(0)
135  , m_pAppData (0)
136  , m_pSetDimValueFunc(0)
137  , m_pSetCustomStringFunc(0)
138 {
139 }
140 
141 inline
143  DimDataSetValueFuncPtr setValueFunc,
144  unsigned int bitFlags,
145  void* appData,
146  DimDataSetCustomStringFuncPtr setCustomStringFunc)
147  : m_pDim(pDim)
148  , m_bitFlags(bitFlags)
149  , m_pAppData(appData)
150  , m_pSetDimValueFunc(setValueFunc)
151  , m_pSetCustomStringFunc(setCustomStringFunc)
152 {
153 }
154 
156 {
157 }
158 
159 inline OdDbDimensionPtr
161 {
162  return m_pDim;
163 }
164 
165 inline void
167 {
168  m_pDim = pDim;
169 }
170 
171 inline OdDbObjectId
173 {
174  return m_ownerId;
175 }
176 
177 inline void
179 {
180  m_ownerId = objId;
181 }
182 
183 inline unsigned int
185 {
186  return m_bitFlags;
187 }
188 
189 inline void
190 OdDbDimData::setBitFlags(unsigned int flags)
191 {
192  m_bitFlags = flags;
193 }
194 
195 inline bool
197 {
198  return 0 != (m_bitFlags & kDimFocal);
199 }
200 
201 inline void
203 {
204  if (focal)
205  m_bitFlags |= kDimFocal;
206  else
207  m_bitFlags &= ~kDimFocal;
208 }
209 
210 inline bool
212 {
213  return 0 != (m_bitFlags & kDimEditable);
214 }
215 
216 inline void
218 {
219  if (editable)
220  m_bitFlags |= kDimEditable;
221  else
222  m_bitFlags &= ~kDimEditable;
223 }
224 
225 inline bool
227 {
228  return 0 != (m_bitFlags & kDimInvisible);
229 }
230 
231 inline void
233 {
234  if (invisible)
235  m_bitFlags |= kDimInvisible;
236  else
237  m_bitFlags &= ~kDimInvisible;
238 }
239 
240 inline bool
242 {
243  return 0 != (m_bitFlags & kDimHideIfValueIsZero);
244 }
245 
246 inline void
248 {
249  if (hide)
250  m_bitFlags |= kDimHideIfValueIsZero;
251  else
252  m_bitFlags &= ~kDimHideIfValueIsZero;
253 }
254 
255 inline bool
257 {
258  return 0 != (m_bitFlags & kDimResultantLength);
259 }
260 
261 inline void
263 {
264  if (bValue)
265  m_bitFlags |= kDimResultantLength;
266  else
267  m_bitFlags &= ~kDimResultantLength;
268 }
269 
270 inline bool
272 {
273  return 0 != (m_bitFlags & kDimDeltaLength);
274 }
275 
276 inline void
278 {
279  if (bValue)
280  m_bitFlags |= kDimDeltaLength;
281  else
282  m_bitFlags &= ~kDimDeltaLength;
283 }
284 
285 inline bool
287 {
288  return 0 != (m_bitFlags & kDimResultantAngle);
289 }
290 
291 inline void
293 {
294  if (bValue)
295  m_bitFlags |= kDimResultantAngle;
296  else
297  m_bitFlags &= ~kDimResultantAngle;
298 }
299 
300 inline bool
302 {
303  return 0 != (m_bitFlags & kDimDeltaAngle);
304 }
305 
306 inline void
308 {
309  if (bValue)
310  m_bitFlags |= kDimDeltaAngle;
311  else
312  m_bitFlags &= ~kDimDeltaAngle;
313 }
314 
315 inline bool
317 {
318  return 0 != (m_bitFlags & kDimRadius);
319 }
320 
321 inline void
323 {
324  if (bValue)
325  m_bitFlags |= kDimRadius;
326  else
327  m_bitFlags &= ~kDimRadius;
328 }
329 
330 inline bool
332 {
333  return 0 != (m_bitFlags & kDimCustomValue);
334 }
335 
336 inline void
338 {
339  if (custom)
340  m_bitFlags |= kDimCustomValue;
341  else
342  m_bitFlags &= ~kDimCustomValue;
343 }
344 
345 inline bool
347 {
348  return 0 != (m_bitFlags & kDimConstrained);
349 }
350 
351 inline void
353 {
354  if (bValue)
355  m_bitFlags |= kDimConstrained;
356  else
357  m_bitFlags &= ~kDimConstrained;
358 }
359 
360 inline bool
362 {
363  return 0 != (m_bitFlags & kDimCustomString);
364 }
365 
366 inline void
368 {
369  if (bValue)
370  m_bitFlags |= kDimCustomString;
371  else
372  m_bitFlags &= ~kDimCustomString;
373 }
374 
375 inline void*
377 {
378  return m_pAppData;
379 }
380 
381 inline void
383 {
384  m_pAppData = appData;
385 }
386 
389 {
390  return m_pSetDimValueFunc;
391 }
392 
393 inline void
395 {
396  m_pSetDimValueFunc = funcPtr;
397 }
398 
401 {
402  return m_pSetCustomStringFunc;
403 }
404 
405 inline void
407 {
408  m_pSetCustomStringFunc = funcPtr;
409 }
410 
412 {
413  if (this == &src)
414  return *this;
415 
416  m_pDim = src.dimension()->clone();
417  m_ownerId = src.ownerId();
418  m_pSetDimValueFunc = src.dimValueFunc();
419  m_pSetCustomStringFunc = src.customStringFunc();
420  m_bitFlags = src.bitFlags();
421  m_pAppData = src.appData();
422  return *this;
423 }
424 
426 {
427  *this = src;
428 }
429 
430 #include "TD_PackPop.h"
431 
432 #endif // ODDBDIMDATA_H
OdArray< OdDbDimData > OdDbDimDataArray
Definition: DbDimData.h:31
OdGeVector3d(* DimDataSetValueFuncPtr)(OdDbDimData *pThis, OdDbEntity *pEnt, double newValue, const OdGeVector3d &offset)
Definition: DbDimData.h:35
OdArray< OdDbDimData *, OdMemoryAllocator< OdDbDimData * > > OdDbDimDataPtrArray
Definition: DbDimData.h:34
OdGeVector3d(* DimDataSetCustomStringFuncPtr)(OdDbDimData *pThis, OdDbEntity *pEnt, const OdString &sCustomString, const OdGeVector3d &offset)
Definition: DbDimData.h:40
void setCustomDimValue(bool custom)
Definition: DbDimData.h:337
unsigned int bitFlags() const
Definition: DbDimData.h:184
@ kDimCustomValue
Definition: DbDimData.h:67
@ kDimEmptyData
Definition: DbDimData.h:61
@ kDimCustomString
Definition: DbDimData.h:69
@ kDimInvisible
Definition: DbDimData.h:58
@ kDimConstrained
Definition: DbDimData.h:68
@ kDimResultantAngle
Definition: DbDimData.h:64
@ kDimDeltaLength
Definition: DbDimData.h:63
@ kDimHideIfValueIsZero
Definition: DbDimData.h:60
@ kDimDeltaAngle
Definition: DbDimData.h:65
@ kDimResultantLength
Definition: DbDimData.h:62
@ kDimEditable
Definition: DbDimData.h:57
void setDimResultantLength(bool bValue)
Definition: DbDimData.h:262
bool isCustomString() const
Definition: DbDimData.h:361
DimDataSetValueFuncPtr dimValueFunc() const
Definition: DbDimData.h:388
virtual ~OdDbDimData()
Definition: DbDimData.h:155
bool isDimFocal() const
Definition: DbDimData.h:196
void setCustomStringFunc(DimDataSetCustomStringFuncPtr funcPtr)
Definition: DbDimData.h:406
void setDimFocal(bool focal)
Definition: DbDimData.h:202
void setConstrain(bool bValue)
Definition: DbDimData.h:352
bool isDimResultantLength() const
Definition: DbDimData.h:256
void setBitFlags(unsigned int flags)
Definition: DbDimData.h:190
void setAppData(void *appData)
Definition: DbDimData.h:382
void setDimension(OdDbDimension *pDim)
Definition: DbDimData.h:166
void setDimResultantAngle(bool bValue)
Definition: DbDimData.h:292
OdDbDimensionPtr dimension() const
Definition: DbDimData.h:160
void setDimHideIfValueIsZero(bool hide)
Definition: DbDimData.h:247
void setDimDeltaLength(bool bValue)
Definition: DbDimData.h:277
void setDimDeltaAngle(bool bValue)
Definition: DbDimData.h:307
void setDimValueFunc(DimDataSetValueFuncPtr funcPtr)
Definition: DbDimData.h:394
void setOwnerId(const OdDbObjectId &objId)
Definition: DbDimData.h:178
bool isDimResultantAngle() const
Definition: DbDimData.h:286
bool isDimInvisible() const
Definition: DbDimData.h:226
bool isDimRadius() const
Definition: DbDimData.h:316
void setDimInvisible(bool invisible)
Definition: DbDimData.h:232
bool isConstrained() const
Definition: DbDimData.h:346
void setCustomString(bool bValue)
Definition: DbDimData.h:367
DimDataSetCustomStringFuncPtr customStringFunc() const
Definition: DbDimData.h:400
void setDimRadius(bool bValue)
Definition: DbDimData.h:322
OdDbObjectId ownerId() const
Definition: DbDimData.h:172
void setDimEditable(bool editable)
Definition: DbDimData.h:217
bool isDimDeltaLength() const
Definition: DbDimData.h:271
bool isDimDeltaAngle() const
Definition: DbDimData.h:301
bool isDimEditable() const
Definition: DbDimData.h:211
void * appData() const
Definition: DbDimData.h:376
bool isDimHideIfValueIsZero() const
Definition: DbDimData.h:241
OdDbDimData & operator=(const OdDbDimData &)
Definition: DbDimData.h:411
bool isCustomDimValue() const
Definition: DbDimData.h:331
virtual OdRxObjectPtr clone() const
GLintptr offset
Definition: gles2_ext.h:183