CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GiLayerTraitsData.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 _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
111 OdUInt32 flags() const { return m_flags; }
112
119
125 OdDbStub* linetype() const { return m_linetypeId; }
126
131
135 OdDbStub* plotStyleNameId() const { return m_plotStyleNameId; }
136
142 const OdCmEntityColor& trueColor() const { return m_color; }
143
149 OdDbStub* materialId() const { return m_materialId; }
150
159
166 void setTrueColor(const OdCmEntityColor& cl) { m_color = cl; }
167
175
182 void setLinetype(OdDbStub* id) { m_linetypeId = id; }
183
190 void setMaterial(OdDbStub* id) { m_materialId = id; }
191
201
207 bool isOff() const { return GETBIT(m_flags, OdGiLayerTraits::kOff); }
208
213 void setOff(bool bVal) { SETBIT(m_flags, OdGiLayerTraits::kOff, bVal); }
214
221
227
234
240
247
254
261
265 OdDbStub* m_linetypeId;
268
270 OdDbStub* m_materialId;
273};
274
286 , public OdGiDummyWorldDraw< OdGiDummyWorldGeometry< OdGiWorldDraw_ > >
287 , public OdGiDummyViewportDraw< OdGiWrapperViewportGeometry< OdGiViewportDraw_ > >
288 , public OdGiSubEntityTraits_
289 , public OdGiLayerTraitsData
290{
291protected:
293private:
294 const OdGiBaseVectorizer* m_pUnderlayingView;
295 OdGiContext* m_pGiContext;
296 OdGiAuxiliaryDataPtr m_pAuxData;
297
298public:
303
309 OdGiLayerTraitsTaker(const OdGiBaseVectorizer* pRefView, OdGiContext* pContext = NULL);
310
314 void addRef();
319
320 void setRefView(const OdGiBaseVectorizer* pRefView);
321
326 { static_cast<OdGiLayerTraitsData&>(*this) = ltData; }
327
334
340 OdDbStub* linetype() const;
341
346
350 OdDbStub* plotStyleNameId() const;
351
357 OdDbStub* materialId() const;
358
366
374
381 void setLinetype(OdDbStub* pLinetypeId);
382
388 void setPlotStyleName(OdDb::PlotStyleNameType plotStyleNameType, OdDbStub* pPlotStyleNameId= 0);
389
395 bool isOff() const { return GETBIT(m_flags, kOff); }
396
401 void setOff(bool bVal) { SETBIT(m_flags, kOff, bVal); }
402
408 bool isPlottable() const { return GETBIT(m_flags, kPlottable); }
409
414 void setPlottable(bool bVal) { SETBIT(m_flags, kPlottable, bVal); }
415
421 bool isLocked() const { return GETBIT(m_flags, kLocked); }
422
427 void setLocked(bool bVal) { SETBIT(m_flags, kLocked, bVal); }
428
429
436
442 OdDbStub* layer() const;
443
449 OdDbStub* lineType() const;
450
455
462
468 double lineTypeScale() const;
469
473 double thickness() const;
474
480 OdDbStub* material() const;
481
487 const OdGiMapper* mapper() const;
488
494 OdDbStub* visualStyle() const;
495
504
509
517 bool selectionGeom() const;
518
527
535 bool sectionable() const;
536
543
551
559
566 void setLineType(OdDbStub* lineTypeId);
567
575
582 void setMaterial(OdDbStub* pMaterialId);
583
593
594
599
604
608 const OdGiFill* fill() const;
609
610
615
621 bool regenAbort() const;
622
627
632
639 bool isDragging() const;
640
667 double deviation(const OdGiDeviationType deviationType,
668 const OdGePoint3d& pointOnCurve) const;
669
679
684
690 void setContext( OdGiContext* pContext);
691
696
702
710 bool isValidId(const OdUInt32 viewportId) const;
711
715 OdDbStub* viewportObjectId() const;
716
721
726
730 virtual OdGiAuxiliaryDataPtr auxData() const { return m_pAuxData; }
731
737 virtual void setAuxData(const OdGiAuxiliaryDataPtr& pAuxData) { m_pAuxData = pAuxData; }
738};
739
740inline void
742{
743 m_pUnderlayingView = pRefView;
744}
745
746inline void
748{
749 m_pGiContext = pContext;
750}
751
752inline
754 : m_pUnderlayingView(0),
755 m_pGiContext( 0 )
756{
757}
758
759inline
761 : m_pUnderlayingView(pRefView),
762 m_pGiContext( pContext )
763{
764}
765
766#include "TD_PackPop.h"
767
768#endif // #ifndef _ODGILAYERTRAITSDATA_INCLUDED_
OdGiFillType
Definition Gi.h:45
OdSmartPtr< OdGiAuxiliaryData > OdGiAuxiliaryDataPtr
Definition GiAuxData.h:95
OdGiRegenType
OdGiDeviationType
#define ODGI_EXPORT
Definition GiExport.h:35
unsigned int OdUInt32
unsigned short OdUInt16
unsigned char OdUInt8
#define ODRX_NOEXCEPT
#define SETBIT(flags, bit, value)
Definition OdaDefs.h:516
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
OdCmEntityColor color() const
OdGiGeometry & rawGeometry() const
OdGiFillType fillType() const
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 release() ODRX_NOEXCEPT
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
OdGiLayerTraitsData & operator=(const OdGiLayerTraitsData &other)=default
void setLineweight(OdDb::LineWeight lw)
void setMaterial(OdDbStub *id)
OdDbStub * linetype() const
void setLinetype(OdDbStub *id)
OdCmEntityColor m_color
OdDbStub * plotStyleNameId() const
OdCmTransparency m_cmTransparency
OdDb::PlotStyleNameType m_plotStyleNameType
OdUInt32 flags() const
OdCmTransparency transparency() const