CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GiFill.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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
43class FIRSTDLL_EXPORT OdGiFill : public OdRxObject
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
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:
112 //DOM-IGNORE-BEGIN
119
120 enum Flags { kDraft = (1 << 0), kExternal = (1 << 1), kAlignedToCenter = (1 << 2), kEmpty = (1 << 3),
121 kSolid = (1 << 4), kDisabledBackgroundFill = (1 << 5), kDisabledTransparency = (1 << 6) };
123 //DOM-IGNORE-END
124 public:
131
138 const OdHatchPattern &patternLines() const;
139
147
153 void setPatternLines(const OdHatchPattern &aHatchPattern);
154
155 virtual void copyFrom(const OdRxObject* pSource);
156
157 virtual bool operator ==(const OdGiFill& fill) const;
158 virtual bool operator !=(const OdGiFill& fill) const;
159
160 virtual void saveBytes(OdUInt8Array &bytes) const;
161 virtual void loadBytes(const OdUInt8 *&pBytes);
162
163 bool isDraft() const;
164 void setDraft(bool draft);
165
172 double patternScale() const;
173
179 void setPatternScale( double scale );
180
181 bool isExternal() const;
182 void setExternal(bool isExt);
183
185 void setPatternColor(const OdCmEntityColor& color);
186
188 void setPatternLineWeight(OdDb::LineWeight lineweight);
189
195
200 void setPatternTransparency(const OdCmTransparency& transparency);
201
207
212 void setNext(const OdSmartPtr< OdGiHatchPattern >& pNext);
213
218 bool isAlignedToCenter() const;
219
225 void setAlignedToCenter(bool aligned);
226
231 bool isEmpty() const;
232
238 void setEmpty(bool empty);
239
244 bool isSolid() const;
245
251 void setSolid(bool solid);
252
257 bool isDisabledBackgroundFill() const;
258
264 void setDisabledBackgroundFill(bool disabled);
265
270 bool isDisabledTransparency() const;
271
276 void setDisabledTransparency(bool disabled);
277};
278
283
284inline
293
294inline
299
300inline
305
306inline
308{
309 m_aHatchPattern = aHatchPattern;
310}
311
312inline
314{
315 return GETBIT(m_nFlags, kDraft);
316}
317
318inline
320{
321 SETBIT(m_nFlags, kDraft, draft);
322}
323
324inline
326{
327 return m_dPatternScale;
328}
329
330inline
335
336inline
338{
339 return GETBIT(m_nFlags, kExternal);
340}
341
342inline
344{
345 SETBIT(m_nFlags, kExternal, isExt);
346}
347
348inline
353
354inline
356{
357 m_patternColor = color;
358}
359
360inline
365
366inline
371
372inline
377
378inline
380{
381 m_patternTransparency = transparency;
382}
383
384inline
389
390inline
392{
393 m_pNext = pNext;
394}
395
396inline
401
402inline
407
408inline
410{
411 return GETBIT(m_nFlags, kEmpty);
412}
413
414inline
416{
417 SETBIT(m_nFlags, kEmpty, empty);
418}
419
420inline
422{
423 return GETBIT(m_nFlags, kSolid);
424}
425
426inline
428{
429 SETBIT(m_nFlags, kSolid, solid);
430}
431
432inline
437
438inline
443
444inline
449
450inline
455
456inline
458{
459 OdGiFillPtr pObj;
460 switch (*pBytes)
461 {
462 case 0: pObj = OdGiFill::createObject(); break;
463 case 1:
464 case 2:
465 case 3:
466 case 4: pObj = OdGiHatchPattern::createObject(); break;
467 }
468 if (!pObj.isNull())
469 pObj->loadBytes(pBytes);
470 return pObj;
471}
472
473
474
481{
482public:
483
485
490
495
496 virtual void copyFrom(const OdRxObject* pSource) ODRX_OVERRIDE;
497
498 virtual bool operator ==(const OdGiFill& fill) const ODRX_OVERRIDE;
499 virtual bool operator !=(const OdGiFill& fill) const ODRX_OVERRIDE;
500
501 //virtual void saveBytes(OdUInt8Array& bytes) const;
502 //virtual void loadBytes(const OdUInt8* pBytes);
503
510
511 //getters
512
513 double deviation() const;
514 double viewRotation() const;
515 double elevation() const;
520 bool isSolidFill() const;
521 bool isHatchTooDense() const;
522 bool isGradientFill() const;
523 bool isDrawCache() const;
524 bool isMPolygon() const;
525 bool isDBRO() const;
526 bool hasCache() const;
527
535 void getPoints(OdGePoint2dArray& startPoints, OdGePoint2dArray& endPoints) const;
538
539 //setters
540 void set(const double dDeviation,
541 const double dViewRotation,
542 const double dElevation,
543 const OdUInt32 maxHatchDensity,
544 const OdUInt32 pointLimit,
545 const OdUInt32 maxPointsToDraw,
546 const OdInt16 nSmoothHatch,
547 const bool bHatchTooDense,
548 const bool bSolidFill,
549 const bool bGradientFill,
550 const bool bMPolygon,
551 const bool bDBRO,
552 const OdUInt32Array& loopsFlags,
553 const OdUInt32Array& loopsMarker,
554 const OdGeIslandStyle style,
555 const OdHatchPattern& pattern);
556
557
558 void setHatchTooDense(const bool bHatchTooDense);
559 void setResult(const OdResult res);
560 void setEvaluateData(const EvaluateEnum eData);
561 void setLoopsFlags(const OdUInt32Array& loopsFlags);
562 void setLoopsMarker(const OdUInt32Array& loopsMarker);
563 void setExtents(const OdGeExtents3d& ext3d);
564 void setDrawCache(const bool bDrawCache);
566 void setPoints(const OdGePoint2dArray& startPoints, const OdGePoint2dArray& endPoints);
568
569 //FELIX_CHANGE_BEGIN
570 // Issues: DESKTOP-215705, DESKTOP-238503, DESKTOP-271997
571 // Draw too dense hatch if only solid optimization can be applied.
573 void SetCanUseSolidOptimization(bool bCanUseSolidOptimization);
574 //FELIX_CHANGE_END
575
576protected:
590
604
605 //FELIX_CHANGE_BEGIN
606 // Issues: DESKTOP-215705, DESKTOP-238503, DESKTOP-271997
607 // Draw too dense hatch if only solid optimization can be applied.
609 //FELIX_CHANGE_END
610};
611
613
614
635
639
640#include "TD_PackPop.h"
641
642#endif //_OD_GIFILL_H_
tol
scale
false
Definition DimVarDefs.h:165
OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > > OdGePoint2dArray
Definition GeGbl.h:45
OdSmartPtr< OdGiFill > OdGiFillPtr
OdSmartPtr< OdGiFill > OdGiFillPtr
Definition GiFill.h:85
OdSmartPtr< OdGiFillHatch > OdGiFillHatchPtr
Definition GiFill.h:612
OdSmartPtr< OdGiHatchPattern > OdGiHatchPatternPtr
Definition GiFill.h:282
bool operator!=(T left, const OdGiVariant::EnumType right)
Definition GiVariant.h:405
bool operator==(T left, const OdGiVariant::EnumType right)
Definition GiVariant.h:399
OdGeIslandStyle
@ OdGeIslandStyle_Normal
OdArray< OdHatchPatternLine > OdHatchPattern
OdArray< int, OdMemoryAllocator< int > > OdIntArray
Definition IntArray.h:35
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
OdArray< OdUInt32, OdMemoryAllocator< OdUInt32 > > OdUInt32Array
Definition UInt32Array.h:35
OdArray< OdUInt8, OdMemoryAllocator< OdUInt8 > > OdUInt8Array
Definition UInt8Array.h:35
bool isNull() const
void setLoopsFlags(const OdUInt32Array &loopsFlags)
bool m_bHatchTooDense
Definition GiFill.h:598
void setEvaluateData(const EvaluateEnum eData)
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:599
OdGeIslandStyle m_style
Definition GiFill.h:587
bool m_bDrawCache
Definition GiFill.h:601
bool CanUseSolidOptimization() const
double m_dElevation
Definition GiFill.h:593
OdGeTol m_tol
Definition GiFill.h:586
OdSharedPtr< OdGeShellData > m_pShellData
Definition GiFill.h:577
const OdUInt32Array getLoopsFlags() const
bool m_bDBRO
Definition GiFill.h:603
OdUInt32 hatchDensity() const
OdGePoint2dArray m_endPoints
Definition GiFill.h:581
OdHatchPattern m_aHatchPattern
Definition GiFill.h:584
bool isSolidFill() const
void setShellData(const OdSharedPtr< OdGeShellData > &)
bool hasCache() const
OdUInt32 pointLimit() const
double elevation() const
OdResult m_result
Definition GiFill.h:588
bool isDrawCache() const
double m_dDeviation
Definition GiFill.h:591
OdUInt32Array m_loopsFlags
Definition GiFill.h:578
void setTolerance(const OdGeTol tol)
bool isHatchTooDense() const
bool isGradientFill() const
OdUInt32 m_pointLimit
Definition GiFill.h:595
EvaluateEnum getEvaluateData() const
void setPoints(const OdGePoint2dArray &startPoints, const OdGePoint2dArray &endPoints)
double deviation() const
bool m_bCanUseSolidOptimization
Definition GiFill.h:608
bool m_bGradientFill
Definition GiFill.h:600
OdUInt32 m_maxPointsToDraw
Definition GiFill.h:596
const OdUInt32Array getLoopsMarker() const
void SetCanUseSolidOptimization(bool bCanUseSolidOptimization)
OdSharedPtr< OdGeShellData > getShellData() const
@ kEvaluatedEmpty
Definition GiFill.h:508
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:579
OdGeExtents3d getExtents() const
bool isMPolygon() const
bool m_bMPolygon
Definition GiFill.h:602
void setHatchTooDense(const bool bHatchTooDense)
OdResult getResult() const
OdIntArray m_loopTypes
Definition GiFill.h:583
bool isDBRO() const
ODRX_DECLARE_MEMBERS(OdGiFillHatch)
OdGeExtents3d m_extents3d
Definition GiFill.h:585
OdIntArray m_loopArray
Definition GiFill.h:582
OdUInt32 m_maxHatchDensity
Definition GiFill.h:594
OdGeIslandStyle getStyle() const
OdHatchPattern & patternLines()
void setResult(const OdResult res)
OdInt16 smoothHatch() const
void setLoopsMarker(const OdUInt32Array &loopsMarker)
double m_dViewRotation
Definition GiFill.h:592
OdUInt32 maxDrawPoints() const
void setExtents(const OdGeExtents3d &ext3d)
OdGePoint2dArray m_startPoints
Definition GiFill.h:580
EvaluateEnum m_eData
Definition GiFill.h:589
OdInt16 m_nSmoothHatch
Definition GiFill.h:597
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:457
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 loadBytes(const OdUInt8 *&pBytes)
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 copyFrom(const OdRxObject *pSource)
double m_dPatternScale
Definition GiFill.h:114
virtual void loadBytes(const OdUInt8 *&pBytes)
OdCmEntityColor getPatternColor() const
Definition GiFill.h:349
bool isEmpty() const
Definition GiFill.h:409
OdCmEntityColor m_patternColor
Definition GiFill.h:116
OdCmTransparency getPatternTransparency() const
Definition GiFill.h:373
OdHatchPattern m_aHatchPattern
Definition GiFill.h:113
OdCmTransparency m_patternTransparency
Definition GiFill.h:117
bool isDisabledBackgroundFill() const
Definition GiFill.h:433
OdDb::LineWeight getPatternLineWeight() const
Definition GiFill.h:361
double patternScale() const
Definition GiFill.h:325
void setAlignedToCenter(bool aligned)
Definition GiFill.h:403
OdSmartPtr< OdGiHatchPattern > m_pNext
Definition GiFill.h:118
ODRX_DECLARE_MEMBERS(OdGiHatchPattern)
OdDb::LineWeight m_patternLineWeight
Definition GiFill.h:115
void setDisabledTransparency(bool disabled)
Definition GiFill.h:451
void setDraft(bool draft)
Definition GiFill.h:319
@ kDisabledBackgroundFill
Definition GiFill.h:121
@ kDisabledTransparency
Definition GiFill.h:121
bool isDraft() const
Definition GiFill.h:313
bool isExternal() const
Definition GiFill.h:337
void setExternal(bool isExt)
Definition GiFill.h:343
virtual void saveBytes(OdUInt8Array &bytes) const
void setPatternTransparency(const OdCmTransparency &transparency)
Definition GiFill.h:379
void setPatternLines(const OdHatchPattern &aHatchPattern)
Definition GiFill.h:307
void setEmpty(bool empty)
Definition GiFill.h:415
void setPatternScale(double scale)
Definition GiFill.h:331
const OdHatchPattern & patternLines() const
Definition GiFill.h:295
bool isSolid() const
Definition GiFill.h:421
OdSmartPtr< OdGiHatchPattern > getNext() const
Definition GiFill.h:385
void setPatternLineWeight(OdDb::LineWeight lineweight)
Definition GiFill.h:367
bool isAlignedToCenter() const
Definition GiFill.h:397
bool isDisabledTransparency() const
Definition GiFill.h:445
void setPatternColor(const OdCmEntityColor &color)
Definition GiFill.h:355
void setNext(const OdSmartPtr< OdGiHatchPattern > &pNext)
Definition GiFill.h:391
void setSolid(bool solid)
Definition GiFill.h:427
void setDisabledBackgroundFill(bool disabled)
Definition GiFill.h:439
OdUInt32 m_nFlags
Definition GiFill.h:122
GLsizei const GLfloat * value
Definition gles2_ext.h:302
LineWeight
Definition OdaDefs.h:386