CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiFill.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 _OD_GIFILL_H_
25#define _OD_GIFILL_H_
26
27#include "RxObject.h"
28#include "HatchPattern.h"
29#include "UInt8Array.h"
30#include "CmColorBase.h"
31#include "UInt32Array.h"
32#include "Ge/GeExtents3d.h"
33#include "IntArray.h"
34#include "Ge/GePoint2dArray.h"
35
36#include "TD_PackPush.h"
37
44{
45 protected:
47 public:
52 OdGiFill();
53
57 double deviation() const;
58
64 void setDeviation(double dDeviation);
65
66 virtual void copyFrom(const OdRxObject* pSource);
67
68 virtual bool operator ==(const OdGiFill& fill) const;
69 virtual bool operator !=(const OdGiFill& fill) const;
70
71 virtual void saveBytes(OdUInt8Array &bytes) const;
72 virtual void loadBytes(const OdUInt8 *pBytes);
73
74 static OdSmartPtr<OdGiFill> loadFill(const OdUInt8 *pBytes);
75 protected:
76 void pushDbl(OdUInt8Array &bytes, double dDbl) const;
77 void pushInt(OdUInt8Array &bytes, OdUInt32 nInt) const;
78 void popDbl(const OdUInt8 *&pBytes, double &dDbl) const;
79 void popInt(const OdUInt8 *&pBytes, OdUInt32 &nInt) const;
80};
81
86
87inline
89 : m_dDeviation(0.0)
90{ }
91
92inline
93double OdGiFill::deviation() const
94{
95 return m_dDeviation;
96}
97
98inline
99void OdGiFill::setDeviation(double dDeviation)
100{
101 m_dDeviation = dDeviation;
102}
103
110{
111 protected:
118
119 enum Flags { kDraft = (1 << 0), kExternal = (1 << 1), kAlignedToCenter = (1 << 2), kEmpty = (1 << 3) };
121 public:
128
135 const OdHatchPattern &patternLines() const;
136
143 OdHatchPattern &patternLines();
144
150 void setPatternLines(const OdHatchPattern &aHatchPattern);
151
152 virtual void copyFrom(const OdRxObject* pSource);
153
154 virtual bool operator ==(const OdGiFill& fill) const;
155 virtual bool operator !=(const OdGiFill& fill) const;
156
157 virtual void saveBytes(OdUInt8Array &bytes) const;
158 virtual void loadBytes(const OdUInt8 *pBytes);
159
160 bool isDraft() const;
161 void setDraft(bool draft);
162
169 double patternScale() const;
170
176 void setPatternScale( double scale );
177
178 bool isExternal() const;
179 void setExternal(bool isExt);
180
181 OdCmEntityColor getPatternColor() const;
182 void setPatternColor(const OdCmEntityColor& color);
183
184 OdDb::LineWeight getPatternLineWeight() const;
185 void setPatternLineWeight(OdDb::LineWeight lineweight);
186
191 OdCmTransparency getPatternTransparency() const;
192
197 void setPatternTransparency(const OdCmTransparency& transparency);
198
203 OdSmartPtr< OdGiHatchPattern > getNext() const;
204
209 void setNext(const OdSmartPtr< OdGiHatchPattern >& pNext);
210
215 bool isAlignedToCenter() const;
216
222 void setAlignedToCenter(bool aligned);
223
228 bool isEmpty() const;
229
235 void setEmpty(bool empty);
236};
237
242
243inline
245 OdGiFill(),
246 m_nFlags(0),
247 m_dPatternScale(1.0),
248 m_patternLineWeight(OdDb::LineWeight(-1)),
249 m_patternColor(OdCmEntityColor::kNone),
250 m_patternTransparency((OdUInt8)255)
251{ }
252
253inline
255{
256 return m_aHatchPattern;
257}
258
259inline
261{
262 return m_aHatchPattern;
263}
264
265inline
267{
268 m_aHatchPattern = aHatchPattern;
269}
270
271inline
273{
274 return GETBIT(m_nFlags, kDraft);
275}
276
277inline
279{
280 SETBIT(m_nFlags, kDraft, draft);
281}
282
283inline
285{
286 return m_dPatternScale;
287}
288
289inline
291{
293}
294
295inline
297{
298 return GETBIT(m_nFlags, kExternal);
299}
300
301inline
303{
304 SETBIT(m_nFlags, kExternal, isExt);
305}
306
307inline
309{
310 return m_patternColor;
311}
312
313inline
315{
316 m_patternColor = color;
317}
318
319inline
321{
322 return m_patternLineWeight;
323}
324
325inline
327{
328 m_patternLineWeight = lineWeight;
329}
330
331inline
333{
335}
336
337inline
339{
340 m_patternTransparency = transparency;
341}
342
343inline
345{
346 return m_pNext;
347}
348
349inline
351{
352 m_pNext = pNext;
353}
354
355inline
357{
359}
360
361inline
363{
365}
366
367inline
369{
370 return GETBIT(m_nFlags, kEmpty);
371}
372
373inline
375{
376 SETBIT(m_nFlags, kEmpty, empty);
377}
378
379
380inline
382{
383 OdGiFillPtr pObj;
384 switch (*pBytes)
385 {
386 case 0: pObj = OdGiFill::createObject(); break;
387 case 1:
388 case 2:
389 case 3:
390 case 4: pObj = OdGiHatchPattern::createObject(); break;
391 }
392 if (!pObj.isNull())
393 pObj->loadBytes(pBytes);
394 return pObj;
395}
396
397
398
405{
406public:
407
409
412
413 virtual void copyFrom(const OdRxObject* pSource) ODRX_OVERRIDE;
414
415 virtual bool operator ==(const OdGiFill& fill) const ODRX_OVERRIDE;
416 virtual bool operator !=(const OdGiFill& fill) const ODRX_OVERRIDE;
417
418 //virtual void saveBytes(OdUInt8Array& bytes) const;
419 //virtual void loadBytes(const OdUInt8* pBytes);
420
422 {
423 kNotEvaluated = 0,
424 kEvaluated = 1,
425 kEvaluatedEmpty = 2
426 }m_eData;
427
428 //getters
429
430 double deviation() const;
431 double viewRotation() const;
432 double elevation() const;
437 bool isSolidFill() const;
438 bool isHatchTooDense() const;
439 bool isGradientFill() const;
440 bool isDrawCache() const;
441 bool isMPolygon() const;
442 bool isDBRO() const;
443 bool hasCache() const;
444
451 void getPoints(OdGePoint2dArray& startPoints, OdGePoint2dArray& endPoints) const;
453
454 //setters
455 void set(const double dDeviation,
456 const double dViewRotation,
457 const double dElevation,
458 const OdUInt32 maxHatchDensity,
459 const OdUInt32 pointLimit,
460 const OdUInt32 maxPointsToDraw,
461 const OdInt16 nSmoothHatch,
462 const bool bHatchTooDense,
463 const bool bSolidFill,
464 const bool bGradientFill,
465 const bool bMPolygon,
466 const bool bDBRO,
467 const OdUInt32Array& loopsFlags,
468 const OdUInt32Array& loopsMarker,
469 const OdGeIslandStyle style,
470 const OdHatchPattern& pattern);
471
472
473 void setHatchTooDense(const bool bHatchTooDense);
474 void setResult(const OdResult res);
475 void setLoopsFlags(const OdUInt32Array& loopsFlags);
476 void setLoopsMarker(const OdUInt32Array& loopsMarker);
477 void setExtents(const OdGeExtents3d& ext3d);
478 void setDrawCache(const bool bDrawCache);
480 void setPoints(const OdGePoint2dArray& startPoints, const OdGePoint2dArray& endPoints);
481
482protected:
494
508};
509
511
512
513inline OdGiFillHatch::OdGiFillHatch() : OdGiHatchPattern(), m_dDeviation(.0),
514m_dViewRotation(.0),
515m_dElevation(.0),
516m_maxHatchDensity(0),
517m_pointLimit(0),
518m_nSmoothHatch(0),
519m_bHatchTooDense(false),
520m_bSolidFill(false),
521m_bGradientFill(false),
522m_bDrawCache(false),
523m_bMPolygon(false),
525m_maxPointsToDraw(0),
526m_result(eInvalidInput),
527m_eData(kNotEvaluated)
528{
529
530}
531
533{
534}
535
536
537
538
539#include "TD_PackPop.h"
540
541#endif //_OD_GIFILL_H_
tol
Definition: DimVarDefs.h:2287
scale
Definition: DimVarDefs.h:1684
false
Definition: DimVarDefs.h:165
OdSmartPtr< OdGiFill > OdGiFillPtr
Definition: GiFill.h:85
OdSmartPtr< OdGiFillHatch > OdGiFillHatchPtr
Definition: GiFill.h:510
OdSmartPtr< OdGiHatchPattern > OdGiHatchPatternPtr
Definition: GiFill.h:241
bool operator!=(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:403
bool operator==(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:397
OdGeIslandStyle
Definition: HatchPattern.h:40
@ OdGeIslandStyle_Normal
Definition: HatchPattern.h:42
unsigned int OdUInt32
short OdInt16
unsigned char OdUInt8
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
bool isNull() const
Definition: BaseObjectPtr.h:86
Definition: GeTol.h:49
void setLoopsFlags(const OdUInt32Array &loopsFlags)
bool m_bHatchTooDense
Definition: GiFill.h:502
void set(const double dDeviation, const double dViewRotation, const double dElevation, const OdUInt32 maxHatchDensity, const OdUInt32 pointLimit, const OdUInt32 maxPointsToDraw, const OdInt16 nSmoothHatch, const bool bHatchTooDense, const bool bSolidFill, const bool bGradientFill, const bool bMPolygon, const bool bDBRO, const OdUInt32Array &loopsFlags, const OdUInt32Array &loopsMarker, const OdGeIslandStyle style, const OdHatchPattern &pattern)
bool m_bSolidFill
Definition: GiFill.h:503
OdGeIslandStyle m_style
Definition: GiFill.h:492
bool m_bDrawCache
Definition: GiFill.h:505
double m_dElevation
Definition: GiFill.h:497
OdGeTol m_tol
Definition: GiFill.h:491
OdGiFillHatch()
Definition: GiFill.h:513
const OdUInt32Array getLoopsFlags() const
bool m_bDBRO
Definition: GiFill.h:507
OdUInt32 hatchDensity() const
OdGePoint2dArray m_endPoints
Definition: GiFill.h:486
OdHatchPattern m_aHatchPattern
Definition: GiFill.h:489
bool isSolidFill() const
bool hasCache() const
OdUInt32 pointLimit() const
double elevation() const
OdResult m_result
Definition: GiFill.h:493
bool isDrawCache() const
double m_dDeviation
Definition: GiFill.h:495
OdUInt32Array m_loopsFlags
Definition: GiFill.h:483
void setTolerance(const OdGeTol tol)
bool isHatchTooDense() const
bool isGradientFill() const
OdUInt32 m_pointLimit
Definition: GiFill.h:499
void setPoints(const OdGePoint2dArray &startPoints, const OdGePoint2dArray &endPoints)
~OdGiFillHatch()
Definition: GiFill.h:532
double deviation() const
bool m_bGradientFill
Definition: GiFill.h:504
OdUInt32 m_maxPointsToDraw
Definition: GiFill.h:500
const OdUInt32Array getLoopsMarker() const
double viewRotation() const
OdGeTol getTolerance() const
virtual void copyFrom(const OdRxObject *pSource) ODRX_OVERRIDE
void setDrawCache(const bool bDrawCache)
OdUInt32Array m_loopsMarker
Definition: GiFill.h:484
OdGeExtents3d getExtents() const
bool isMPolygon() const
bool m_bMPolygon
Definition: GiFill.h:506
void setHatchTooDense(const bool bHatchTooDense)
OdResult getResult() const
OdIntArray m_loopTypes
Definition: GiFill.h:488
bool isDBRO() const
ODRX_DECLARE_MEMBERS(OdGiFillHatch)
OdGeExtents3d m_extents3d
Definition: GiFill.h:490
OdIntArray m_loopArray
Definition: GiFill.h:487
OdUInt32 m_maxHatchDensity
Definition: GiFill.h:498
OdGeIslandStyle getStyle() const
OdHatchPattern & patternLines()
void setResult(const OdResult res)
OdInt16 smoothHatch() const
void setLoopsMarker(const OdUInt32Array &loopsMarker)
double m_dViewRotation
Definition: GiFill.h:496
OdUInt32 maxDrawPoints() const
void setExtents(const OdGeExtents3d &ext3d)
OdGePoint2dArray m_startPoints
Definition: GiFill.h:485
OdInt16 m_nSmoothHatch
Definition: GiFill.h:501
void getPoints(OdGePoint2dArray &startPoints, OdGePoint2dArray &endPoints) const
void pushDbl(OdUInt8Array &bytes, double dDbl) const
void popInt(const OdUInt8 *&pBytes, OdUInt32 &nInt) const
static OdSmartPtr< OdGiFill > loadFill(const OdUInt8 *pBytes)
Definition: GiFill.h:381
ODRX_DECLARE_MEMBERS(OdGiFill)
virtual void copyFrom(const OdRxObject *pSource)
double m_dDeviation
Definition: GiFill.h:46
double deviation() const
Definition: GiFill.h:93
void pushInt(OdUInt8Array &bytes, OdUInt32 nInt) const
virtual void saveBytes(OdUInt8Array &bytes) const
OdGiFill()
Definition: GiFill.h:88
void setDeviation(double dDeviation)
Definition: GiFill.h:99
void popDbl(const OdUInt8 *&pBytes, double &dDbl) const
virtual void loadBytes(const OdUInt8 *pBytes)
virtual void copyFrom(const OdRxObject *pSource)
double m_dPatternScale
Definition: GiFill.h:113
OdCmEntityColor getPatternColor() const
Definition: GiFill.h:308
bool isEmpty() const
Definition: GiFill.h:368
OdCmEntityColor m_patternColor
Definition: GiFill.h:115
OdCmTransparency getPatternTransparency() const
Definition: GiFill.h:332
OdHatchPattern m_aHatchPattern
Definition: GiFill.h:112
OdCmTransparency m_patternTransparency
Definition: GiFill.h:116
OdDb::LineWeight getPatternLineWeight() const
Definition: GiFill.h:320
double patternScale() const
Definition: GiFill.h:284
void setAlignedToCenter(bool aligned)
Definition: GiFill.h:362
OdSmartPtr< OdGiHatchPattern > m_pNext
Definition: GiFill.h:117
ODRX_DECLARE_MEMBERS(OdGiHatchPattern)
OdDb::LineWeight m_patternLineWeight
Definition: GiFill.h:114
void setDraft(bool draft)
Definition: GiFill.h:278
bool isDraft() const
Definition: GiFill.h:272
virtual void loadBytes(const OdUInt8 *pBytes)
bool isExternal() const
Definition: GiFill.h:296
void setExternal(bool isExt)
Definition: GiFill.h:302
virtual void saveBytes(OdUInt8Array &bytes) const
void setPatternTransparency(const OdCmTransparency &transparency)
Definition: GiFill.h:338
void setPatternLines(const OdHatchPattern &aHatchPattern)
Definition: GiFill.h:266
void setEmpty(bool empty)
Definition: GiFill.h:374
void setPatternScale(double scale)
Definition: GiFill.h:290
const OdHatchPattern & patternLines() const
Definition: GiFill.h:254
OdSmartPtr< OdGiHatchPattern > getNext() const
Definition: GiFill.h:344
void setPatternLineWeight(OdDb::LineWeight lineweight)
Definition: GiFill.h:326
bool isAlignedToCenter() const
Definition: GiFill.h:356
void setPatternColor(const OdCmEntityColor &color)
Definition: GiFill.h:314
void setNext(const OdSmartPtr< OdGiHatchPattern > &pNext)
Definition: GiFill.h:350
OdUInt32 m_nFlags
Definition: GiFill.h:120
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
LineWeight
Definition: OdaDefs.h:386