CFx SDK Documentation  2020SP3
TrVisMetafileDef.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 // GLES2 device metafile definition
24 
25 #ifndef ODTRVISMETAFILEDEF
26 #define ODTRVISMETAFILEDEF
27 
28 #include "TD_PackPush.h"
29 
30 #include "UInt8Array.h"
31 #include "Ge/GeExtents3d.h"
32 #include "SharedPtr.h"
33 #include "TPtr.h"
34 
35 #include "TrVisDefs.h"
36 #include "TrVisMetafileStream.h"
37 
38 // Forward declaration
39 class OdTrRndSgExpand;
40 
45 
50 {
52  {
53  kMfVisible = (1 << 0), // Visibility flag (false for invisible metafiles).
54  kMfHighlighted = (1 << 1), // Highlighting flag (always false for nested metafiles).
55  kMfTemporary = (1 << 2), // True for transient drawables, false for persistent drawables.
56  kMfNested = (1 << 3), // Marks nested drawables (true for drawables inside blocks, false for top-level always).
57  kMfBlockRef = (1 << 4), // Marks block reference container metafile.
58  kMfUtilitary = (1 << 5), // Marks utilitary metafiles (TTF characters cache for example).
59  kMfSectionable = (1 << 6), // Marks sectionable metafiles.
60  kMfComposite = (1 << 7), // Marks composite metafiles (containing data for multipass rendering).
61  kMfXRef = (1 << 8), // Marks external reference metafiles.
62  kMfRefEditFade = (1 << 9) // Fade metafile flag (true if metafile faded onto vectorizer side).
63  };
64 
65  OdUInt16 m_mfFlags; // Metafile bit flags
66  OdUInt16 m_nRefs; // Reference counter
67  OdTrRndSgExpand *m_pSgData; // Runtime scene graph rendering data
68  OdDbStub *m_pOwnerId; // Metafile owner database Id
69  OdTrVisHlBranchId m_pHlBranch; // Highlight branch associated with metafile
70  OdTrVisLayerId m_pLayer; // Layer Id associated with metafile
71 
73 
74  // Reset metafile flags
75  void resetMetafileFlags(OdUInt16 mfFlags = 0) { m_mfFlags = mfFlags; }
76 
77  // Visiblity flag
78  bool isMetafileVisible() const { return GETBIT(m_mfFlags, kMfVisible); }
79  void setMetafileVisible(bool bSet) { SETBIT(m_mfFlags, kMfVisible, bSet); }
80 
81  // Highlighting flag
84 
85  // Temporary drawable flag
86  bool isTemporaryMetafile() const { return GETBIT(m_mfFlags, kMfTemporary); }
87  void setTemporaryMetafile(bool bSet) { SETBIT(m_mfFlags, kMfTemporary, bSet); }
88 
89  // Nested metafile flag
90  bool isNestedMetafile() const { return GETBIT(m_mfFlags, kMfNested); }
91  void setNestedMetafile(bool bSet) { SETBIT(m_mfFlags, kMfNested, bSet); }
92 
93  // Block reference flag
94  bool isBlockRefMetafile() const { return GETBIT(m_mfFlags, kMfBlockRef); }
95  void setBlockRefMetafile(bool bSet) { SETBIT(m_mfFlags, kMfBlockRef, bSet); }
96 
97  // Utilitary metafile flag
98  bool isUtilitaryMetafile() const { return GETBIT(m_mfFlags, kMfUtilitary); }
99  void setUtilitaryMetafile(bool bSet) { SETBIT(m_mfFlags, kMfUtilitary, bSet); }
100 
101  // Sectionable metafile flag
104 
105  // Composite metafile flag
107  void setCompositeMetafile(bool bSet) { SETBIT(m_mfFlags, kMfComposite, bSet); }
108 
109  // XRef metafile flag
110  bool isXRefMetafile() const { return GETBIT(m_mfFlags, kMfXRef); }
111  void setXRefMetafile(bool bSet) { SETBIT(m_mfFlags, kMfXRef, bSet); }
112 
113  // RefEditFade metafile flag
114  bool isMetafileFaded() const { return GETBIT(m_mfFlags, kMfRefEditFade); }
115  void setMetafileFaded(bool bSet) { SETBIT(m_mfFlags, kMfRefEditFade, bSet); }
116 
117  // Scene-Graph connection
118  bool hasSceneGraphExpand() const { return !!m_pSgData; }
119  void setSceneGraphExpand(OdTrRndSgExpand *pExpand) { m_pSgData = pExpand; }
121  OdTrRndSgExpand *sceneGraphExpand() const { return m_pSgData; }
122 
123  void setDefault()
124  {
126  m_pOwnerId = NULL;
127  m_pHlBranch = 0;
128  m_pLayer = 0;
129  }
130 };
131 
136 {
137  public:
138  static void addRef(OdTrVisMetafileContainer* pObj) { if (pObj) { pObj->m_nRefs++; } }
139  static void release(OdTrVisMetafileContainer* pObj) { if (pObj) { pObj->m_nRefs--; if (!pObj->m_nRefs) delete pObj; } }
140 };
141 
146 
151 {
152  // Metafile stream and related flags
154  // Metafile extents
156  // Generator viewport Id
158 
159  void setDefault()
160  {
161  m_pMetafile = NULL;
164  }
165 };
166 
167 #include "TD_PackPop.h"
168 
169 #endif // ODTRVISMETAFILEDEF
GETBIT
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
OdTrVisMetafileContainer::isTemporaryMetafile
bool isTemporaryMetafile() const
Definition: TrVisMetafileDef.h:86
OdTrVisMetafileContainer::setMetafileVisible
void setMetafileVisible(bool bSet)
Definition: TrVisMetafileDef.h:79
OdTrVisMetafileContainer::hasSceneGraphExpand
bool hasSceneGraphExpand() const
Definition: TrVisMetafileDef.h:118
OdTrVisMetafileContainer::kMfTemporary
@ kMfTemporary
Definition: TrVisMetafileDef.h:55
NULL
#define NULL
Definition: GsProperties.h:177
OdTrVisMetafileContainer::sceneGraphExpand
OdTrRndSgExpand * sceneGraphExpand() const
Definition: TrVisMetafileDef.h:121
OdTrVisMetafileContainer::kMfRefEditFade
@ kMfRefEditFade
Definition: TrVisMetafileDef.h:62
OdTrVisMetafileContainer::kMfUtilitary
@ kMfUtilitary
Definition: TrVisMetafileDef.h:58
OdTrVisMetafileContainer
Definition: TrVisMetafileDef.h:50
OdTrVisMetafileContainer::setMetafileFaded
void setMetafileFaded(bool bSet)
Definition: TrVisMetafileDef.h:115
OdTrVisMetafileContainer::setCompositeMetafile
void setCompositeMetafile(bool bSet)
Definition: TrVisMetafileDef.h:107
OdSharedPtr
Definition: SharedPtr.h:49
GeExtents3d.h
SETBIT
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
OdTrVisMetafileContainer::resetMetafileFlags
void resetMetafileFlags(OdUInt16 mfFlags=0)
Definition: TrVisMetafileDef.h:75
OdTrVisMetafileContainer::setBlockRefMetafile
void setBlockRefMetafile(bool bSet)
Definition: TrVisMetafileDef.h:95
OdTrVisMetafileContainer::m_pLayer
OdTrVisLayerId m_pLayer
Definition: TrVisMetafileDef.h:70
OdTrVisMetafileContainer::isMetafileVisible
bool isMetafileVisible() const
Definition: TrVisMetafileDef.h:78
TD_PackPop.h
OdTrVisMetafileContainer::OdTrVisMetafileContainer
OdTrVisMetafileContainer()
Definition: TrVisMetafileDef.h:72
OdTrVisMetafileContainer::setXRefMetafile
void setXRefMetafile(bool bSet)
Definition: TrVisMetafileDef.h:111
OdTrVisMetafileContainer::m_mfFlags
OdUInt16 m_mfFlags
Definition: TrVisMetafileDef.h:65
OdUInt16
unsigned short OdUInt16
Definition: OdPlatformSettings.h:760
OdTrVisMetafileContainer::isUtilitaryMetafile
bool isUtilitaryMetafile() const
Definition: TrVisMetafileDef.h:98
OdTrVisMetafileContainer::isBlockRefMetafile
bool isBlockRefMetafile() const
Definition: TrVisMetafileDef.h:94
OdTrVisFlatMetafileContainerPtr
OdSharedPtr< OdTrVisFlatMetafileContainer > OdTrVisFlatMetafileContainerPtr
Definition: TrVisMetafileDef.h:39
OdTrVisMfContainerRelease
Definition: TrVisMetafileDef.h:136
OdTrVisFlatMetafileContainer
Definition: TrVisMetafileStream.h:405
OdTrVisMetafileDef::m_generatorId
OdTrVisViewportId m_generatorId
Definition: TrVisMetafileDef.h:157
OdTrVisMetafileContainer::MetafileDefFlags
MetafileDefFlags
Definition: TrVisMetafileDef.h:52
OdTrVisMetafileContainer::isMetafileHighlighted
bool isMetafileHighlighted() const
Definition: TrVisMetafileDef.h:82
OdTrVisMetafileContainer::m_nRefs
OdUInt16 m_nRefs
Definition: TrVisMetafileDef.h:66
OdTrVisMetafileContainer::setSceneGraphExpand
void setSceneGraphExpand(OdTrRndSgExpand *pExpand)
Definition: TrVisMetafileDef.h:119
OdTrVisMetafileContainer::isCompositeMetafile
bool isCompositeMetafile() const
Definition: TrVisMetafileDef.h:106
OdTrVisMetafileContainer::kMfHighlighted
@ kMfHighlighted
Definition: TrVisMetafileDef.h:54
TrVisDefs.h
OdTrVisMetafileDef
Definition: TrVisMetafileDef.h:151
OdTrVisMetafileContainer::m_pOwnerId
OdDbStub * m_pOwnerId
Definition: TrVisMetafileDef.h:68
SharedPtr.h
OdTrVisMetafileContainer::isXRefMetafile
bool isXRefMetafile() const
Definition: TrVisMetafileDef.h:110
OdTrVisMetafileDef::m_pMetafile
OdTrVisMetafileContainerPtr m_pMetafile
Definition: TrVisMetafileDef.h:153
TD_PackPush.h
OdTrVisMetafileContainer::isNestedMetafile
bool isNestedMetafile() const
Definition: TrVisMetafileDef.h:90
OdTrVisMetafileDef::m_extents
OdGeExtents3d m_extents
Definition: TrVisMetafileDef.h:155
OdTrVisMetafileDef::setDefault
void setDefault()
Definition: TrVisMetafileDef.h:159
TrVisMetafileStream.h
OdTrVisMetafileContainerPtr
TPtr< OdTrVisMetafileContainer, OdTrVisMfContainerRelease > OdTrVisMetafileContainerPtr
Definition: TrVisMetafileDef.h:145
TPtr< OdTrVisMetafileContainer, OdTrVisMfContainerRelease >
OdTrVisMfContainerRelease::addRef
static void addRef(OdTrVisMetafileContainer *pObj)
Definition: TrVisMetafileDef.h:138
OdTrVisMetafileContainer::isSectionableMetafile
bool isSectionableMetafile() const
Definition: TrVisMetafileDef.h:102
OdTrVisMetafileContainer::m_pHlBranch
OdTrVisHlBranchId m_pHlBranch
Definition: TrVisMetafileDef.h:69
UInt8Array.h
OdGeExtents3d
Definition: GeExtents3d.h:45
OdTrVisMetafileContainer::setTemporaryMetafile
void setTemporaryMetafile(bool bSet)
Definition: TrVisMetafileDef.h:87
OdTrVisMfContainerRelease::release
static void release(OdTrVisMetafileContainer *pObj)
Definition: TrVisMetafileDef.h:139
OdTrVisMetafileContainer::kMfXRef
@ kMfXRef
Definition: TrVisMetafileDef.h:61
OdTrVisMetafileContainer::setUtilitaryMetafile
void setUtilitaryMetafile(bool bSet)
Definition: TrVisMetafileDef.h:99
OdTrVisMetafileContainer::kMfNested
@ kMfNested
Definition: TrVisMetafileDef.h:56
TPtr.h
OdTrVisMetafileContainer::setNestedMetafile
void setNestedMetafile(bool bSet)
Definition: TrVisMetafileDef.h:91
OdTrVisMetafileContainer::m_pSgData
OdTrRndSgExpand * m_pSgData
Definition: TrVisMetafileDef.h:67
OdTrVisMetafileContainer::resetSceneGraphExpand
void resetSceneGraphExpand()
Definition: TrVisMetafileDef.h:120
OdTrVisViewportId
OdTrVisId OdTrVisViewportId
Definition: TrVisDefs.h:87
OdTrVisMetafileContainer::isMetafileFaded
bool isMetafileFaded() const
Definition: TrVisMetafileDef.h:114
OdTrVisMetafileContainer::kMfComposite
@ kMfComposite
Definition: TrVisMetafileDef.h:60
OdTrVisMetafileContainer::kMfSectionable
@ kMfSectionable
Definition: TrVisMetafileDef.h:59
OdTrVisMetafileContainer::setDefault
void setDefault()
Definition: TrVisMetafileDef.h:123
OdTrVisMetafileContainer::setSectionableMetafile
void setSectionableMetafile(bool bSet)
Definition: TrVisMetafileDef.h:103
OdTrVisMetafileContainer::setMetafileHighlighted
void setMetafileHighlighted(bool bSet)
Definition: TrVisMetafileDef.h:83
OdTrVisMetafileContainer::kMfVisible
@ kMfVisible
Definition: TrVisMetafileDef.h:53
OdUInt64
Definition: Int64.h:137
OdTrVisMetafileContainer::kMfBlockRef
@ kMfBlockRef
Definition: TrVisMetafileDef.h:57