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