CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiLayerTraitsData.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 _ODGILAYERTRAITSDATA_INCLUDED_
25#define _ODGILAYERTRAITSDATA_INCLUDED_
26
28#include "CmColorBase.h"
29#include "GiDrawImpl.h"
30#include "GiDummyGeometry.h"
32
33class OdDbStub;
34
35#include "TD_PackPush.h"
36
46{
47 virtual OdCmEntityColor trueColor() const = 0;
48protected:
49 OdCmEntityColor color() const { return trueColor(); }
50};
51
60class OdGiSubEntityTraits_ : public OdGiDummySubEntityTraits< OdGiSubEntityTraits >
61{
62 virtual OdCmEntityColor trueColor() const = 0;
63protected:
64 OdUInt16 color() const { return trueColor().colorIndex(); }
65};
66
74{
90 : m_flags(OdGiLayerTraits::kPlottable)
91 , m_lineweight(OdDb::kLnWtByLwDefault)
92 , m_plotStyleNameType(OdDb::kPlotStyleNameById)
93 , m_color(OdCmEntityColor::kForeground)
94 , m_linetypeId(0)
96 , m_materialId(0)
98 {
99 }
100
107 {
108 m_flags = other.m_flags;
111 m_color = other.m_color;
116 }
117
118
122 OdUInt32 flags() const { return m_flags; }
123
130
136 OdDbStub* linetype() const { return m_linetypeId; }
137
142
146 OdDbStub* plotStyleNameId() const { return m_plotStyleNameId; }
147
153 const OdCmEntityColor& trueColor() const { return m_color; }
154
160 OdDbStub* materialId() const { return m_materialId; }
161
170
177 void setTrueColor(const OdCmEntityColor& cl) { m_color = cl; }
178
186
193 void setLinetype(OdDbStub* id) { m_linetypeId = id; }
194
201 void setMaterial(OdDbStub* id) { m_materialId = id; }
202
212
218 bool isOff() const { return GETBIT(m_flags, OdGiLayerTraits::kOff); }
219
224 void setOff(bool bVal) { SETBIT(m_flags, OdGiLayerTraits::kOff, bVal); }
225
232
238
245
251
258
265
272
276 OdDbStub* m_linetypeId;
279
281 OdDbStub* m_materialId;
284};
285
297 , public OdGiDummyWorldDraw< OdGiDummyWorldGeometry< OdGiWorldDraw_ > >
298 , public OdGiDummyViewportDraw< OdGiWrapperViewportGeometry< OdGiViewportDraw_ > >
299 , public OdGiSubEntityTraits_
300 , public OdGiLayerTraitsData
301{
302protected:
304private:
305 const OdGiBaseVectorizer* m_pUnderlayingView;
306 OdGiContext* m_pGiContext;
307 OdGiAuxiliaryDataPtr m_pAuxData;
308
309public:
314
320 OdGiLayerTraitsTaker(const OdGiBaseVectorizer* pRefView, OdGiContext* pContext = NULL);
321
325 void addRef();
329 void release();
330
331 void setRefView(const OdGiBaseVectorizer* pRefView);
332
337 { static_cast<OdGiLayerTraitsData&>(*this) = ltData; }
338
345
351 OdDbStub* linetype() const;
352
357
361 OdDbStub* plotStyleNameId() const;
362
368 OdDbStub* materialId() const;
369
376 void setColor(const OdCmEntityColor& color);
377
385
392 void setLinetype(OdDbStub* pLinetypeId);
393
399 void setPlotStyleName(OdDb::PlotStyleNameType plotStyleNameType, OdDbStub* pPlotStyleNameId= 0);
400
406 bool isOff() const { return GETBIT(m_flags, kOff); }
407
412 void setOff(bool bVal) { SETBIT(m_flags, kOff, bVal); }
413
419 bool isPlottable() const { return GETBIT(m_flags, kPlottable); }
420
425 void setPlottable(bool bVal) { SETBIT(m_flags, kPlottable, bVal); }
426
432 bool isLocked() const { return GETBIT(m_flags, kLocked); }
433
438 void setLocked(bool bVal) { SETBIT(m_flags, kLocked, bVal); }
439
440
447
453 OdDbStub* layer() const;
454
460 OdDbStub* lineType() const;
461
466
473
479 double lineTypeScale() const;
480
484 double thickness() const;
485
491 OdDbStub* material() const;
492
498 const OdGiMapper* mapper() const;
499
505 OdDbStub* visualStyle() const;
506
515
520
528 bool selectionGeom() const;
529
538
546 bool sectionable() const;
547
554
561 void setTrueColor(const OdCmEntityColor& color);
562
569 void setColor(OdUInt16 color);
570
577 void setLineType(OdDbStub* lineTypeId);
578
586
593 void setMaterial(OdDbStub* pMaterialId);
594
603 void setTransparency(const OdCmTransparency &transparency);
604
605
610
615
619 const OdGiFill* fill() const;
620
621
626
632 bool regenAbort() const;
633
638
643
650 bool isDragging() const;
651
678 double deviation(const OdGiDeviationType deviationType,
679 const OdGePoint3d& pointOnCurve) const;
680
690
695
701 void setContext( OdGiContext* pContext);
702
707
713
721 bool isValidId(const OdUInt32 viewportId) const;
722
726 OdDbStub* viewportObjectId() const;
727
732
737
741 virtual OdGiAuxiliaryDataPtr auxData() const { return m_pAuxData; }
742
748 virtual void setAuxData(const OdGiAuxiliaryDataPtr& pAuxData) { m_pAuxData = pAuxData; }
749};
750
751inline void
753{
754 m_pUnderlayingView = pRefView;
755}
756
757inline void
759{
760 m_pGiContext = pContext;
761}
762
763inline
765 : m_pUnderlayingView(0),
766 m_pGiContext( 0 )
767{
768}
769
770inline
772 : m_pUnderlayingView(pRefView),
773 m_pGiContext( pContext )
774{
775}
776
777#include "TD_PackPop.h"
778
779#endif // #ifndef _ODGILAYERTRAITSDATA_INCLUDED_
OdGiFillType
Definition: Gi.h:42
OdGiRegenType
Definition: GiCommonDraw.h:51
OdGiDeviationType
Definition: GiCommonDraw.h:65
#define ODGI_EXPORT
Definition: GiExport.h:35
unsigned int OdUInt32
unsigned short OdUInt16
unsigned char OdUInt8
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
OdInt16 colorIndex() const
Definition: CmColorBase.h:406
OdCmEntityColor color() const
OdGiGeometry & rawGeometry() const
OdGiFillType fillType() const
void setOff(bool bVal)
OdDbStub * materialId() const
OdDbStub * material() const
void setPlottable(bool bVal)
void setLineWeight(OdDb::LineWeight lineWeight)
OdCmTransparency transparency() const
virtual OdGiAuxiliaryDataPtr auxData() const
bool isValidId(const OdUInt32 viewportId) const
OdGiRegenType regenType() const
OdDb::PlotStyleNameType plotStyleNameType() const
OdGeMatrix3d getWorldToModelTransform() const
OdDbStub * viewportObjectId() const
void setColor(const OdCmEntityColor &color)
bool selectionGeom() const
void setLinetype(OdDbStub *pLinetypeId)
void setColor(OdUInt16 color)
void setLineweight(OdDb::LineWeight lineweight)
OdDb::LineWeight lineWeight() const
void setTransparency(const OdCmTransparency &transparency)
OdGeMatrix3d getModelToWorldTransform() const
void setMaterial(OdDbStub *pMaterialId)
OdGiSubEntityTraits & subEntityTraits() const
OdDbStub * layer() const
virtual void setAuxData(const OdGiAuxiliaryDataPtr &pAuxData)
bool regenAbort() const
OdUInt32 numberOfIsolines() const
void setPlotStyleName(OdDb::PlotStyleNameType plotStyleNameType, OdDbStub *pPlotStyleNameId=0)
bool isDragging() const
ShadowFlags shadowFlags() const
SelectionFlags selectionFlags() const
OdDbStub * lineType() const
OdCmEntityColor secondaryTrueColor() const
OdDbStub * linetype() const
OdDbStub * visualStyle() const
OdUInt32 sequenceNumber() const
void reset(const OdGiLayerTraitsData &ltData=OdGiLayerTraitsData())
void setRefView(const OdGiBaseVectorizer *pRefView)
const OdGiDgLinetypeModifiers * lineStyleModifiers() const
OdGiContext * context() const
void setContext(OdGiContext *pContext)
double thickness() const
bool sectionable() const
OdUInt32 drawFlags() const
void setTrueColor(const OdCmEntityColor &color)
double lineTypeScale() const
void setLocked(bool bVal)
OdGiViewport & viewport() const
const OdGiMapper * mapper() const
const OdGiFill * fill() const
OdDbStub * plotStyleNameId() const
OdDb::LineWeight lineweight() const
double deviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const
ODRX_USING_HEAP_OPERATORS(OdGiDummyWorldDraw< OdGiDummyWorldGeometry< OdGiWorldDraw_ > >)
OdCmEntityColor trueColor() const
void setLineType(OdDbStub *lineTypeId)
OdUInt16 color() const
PlotStyleNameType
Definition: OdaDefs.h:417
LineWeight
Definition: OdaDefs.h:386
void setPlottable(bool bVal)
void setTransparency(const OdCmTransparency &transparency)
void setLocked(bool bVal)
OdDbStub * materialId() const
const OdCmEntityColor & trueColor() const
void setTrueColor(const OdCmEntityColor &cl)
OdDb::LineWeight m_lineweight
OdDb::PlotStyleNameType plotStyleNameType() const
OdDb::LineWeight lineweight() const
void setLineweight(OdDb::LineWeight lw)
void setMaterial(OdDbStub *id)
void operator=(const OdGiLayerTraitsData &other)
OdDbStub * linetype() const
void setLinetype(OdDbStub *id)
OdCmEntityColor m_color
OdDbStub * plotStyleNameId() const
OdCmTransparency m_cmTransparency
void setOff(bool bVal)
OdDb::PlotStyleNameType m_plotStyleNameType
OdUInt32 flags() const
OdCmTransparency transparency() const