CFx SDK Documentation  2023 SP0
GsDrawableHolder.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 #ifndef ODGSDRAWABLEHOLDER_INC
24 #define ODGSDRAWABLEHOLDER_INC
25 
26 #include "TD_PackPush.h"
27 #include "Ge/GeExtents3d.h"
28 #include "IntArray.h"
29 #include "Gi/GiDrawable.h"
30 #include "Gs/GsExport.h"
31 
32 class OdGsNode;
33 class OdGsBaseModel;
34 class OdDbStub;
35 
37 {
38  protected:
41  public:
43  public:
45  : m_lineweight(OdDb::kLnWt000)
46  {
47  }
49  : m_extents(extents)
50  , m_lineweight(lw)
51  {
52  }
53 
54  const OdGeExtents3d &getExtents() const
55  {
56  return m_extents;
57  }
59  {
60  return m_extents;
61  }
62  void setExtents(const OdGeExtents3d &extents)
63  {
64  m_extents = extents;
65  }
66  void resetExtents()
67  {
68  m_extents = OdGeExtents3d::kInvalid;
69  }
70  void addExtents(const OdGeExtents3d &extents)
71  {
72  if (extents.isValidExtents())
73  m_extents.addExt(extents);
74  }
75 
76  bool hasLineweight() const
77  {
78  return (m_lineweight > OdDb::kLnWt000);
79  }
81  {
82  return m_lineweight;
83  }
85  {
86  return m_lineweight;
87  }
89  {
90  m_lineweight = lw;
91  }
93  {
94  m_lineweight = OdDb::kLnWt000;
95  }
97  {
98  if (m_lineweight < lw)
99  m_lineweight = lw;
100  }
101 
102  void get(OdGeExtents3d &extents, OdDb::LineWeight &lw) const
103  {
104  extents = m_extents;
105  lw = m_lineweight;
106  }
107  void set(const OdGeExtents3d &extents, OdDb::LineWeight lw)
108  {
109  m_extents = extents;
110  m_lineweight = lw;
111  }
112  void reset()
113  {
114  resetExtents();
115  resetLineweight();
116  }
117  void add(const OdGeExtents3d &extents, OdDb::LineWeight lw)
118  {
119  addExtents(extents);
120  addLineweight(lw);
121  }
122  void add(const OdGsUpdateExtents &extents)
123  {
124  add(extents.getExtents(), extents.getLineweight());
125  }
126 
127  bool isValid() const
128  {
129  return m_extents.isValidExtents();
130  }
131 };
132 
139 {
141  {
142  }
143  OdDbStub* m_drawableId;
149 };
151 
152 #include "TD_PackPop.h"
153 
154 #endif // ODGSDRAWABLEHOLDER_INC
OdArray< DrawableHolder > DrawableHolderArray
#define GS_TOOLKIT_EXPORT
Definition: GsExport.h:37
#define GS_STATIC_EXPORT
Definition: GsExport.h:38
static GE_STATIC_EXPORT const OdGeExtents3d kInvalid
Definition: GeExtents3d.h:60
void addExt(const OdGeExtents3d &extents)
Definition: GeExtents3d.h:323
bool isValidExtents() const
Definition: GeExtents3d.h:120
OdDb::LineWeight & accessLineweight()
OdGeExtents3d m_extents
OdGeExtents3d & accessExtents()
bool isValid() const
const OdGeExtents3d & getExtents() const
void add(const OdGsUpdateExtents &extents)
void get(OdGeExtents3d &extents, OdDb::LineWeight &lw) const
void setExtents(const OdGeExtents3d &extents)
void addExtents(const OdGeExtents3d &extents)
OdDb::LineWeight m_lineweight
OdGsUpdateExtents(const OdGeExtents3d &extents, OdDb::LineWeight lw=OdDb::kLnWt000)
void add(const OdGeExtents3d &extents, OdDb::LineWeight lw)
void set(const OdGeExtents3d &extents, OdDb::LineWeight lw)
OdDb::LineWeight getLineweight() const
void setLineweight(OdDb::LineWeight lw)
void addLineweight(OdDb::LineWeight lw)
static GS_STATIC_EXPORT const OdGsUpdateExtents kInvalid
bool hasLineweight() const
LineWeight
Definition: OdaDefs.h:384
@ kLnWt000
Definition: OdaDefs.h:385
OdGsUpdateExtents m_lastExt
OdSmartPtr< OdGsBaseModel > m_pGsModel
OdRxObjectPtr m_pMetafile
OdDbStub * m_drawableId
OdGsNode * m_pGsRoot
OdGiDrawablePtr m_pDrawable