CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GsMaterialNode.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_GS_MATERIAL_NODE__
25#define __OD_GS_MATERIAL_NODE__
26
27#include "TD_PackPush.h"
28
29#include "Gs/GsNode.h"
30#include "Gi/GiMaterial.h"
32#include "ThreadsCounter.h"
33#define STL_USING_MAP
34#include "OdaSTL.h"
35
36// Materials cached in GsModel, but in separate cache, instead all geometry.
37
38// GsModel caches hierarchy:
39// OdGsBaseModel
40// OdGsContainerNode <-- OdGsNode - geometry cache
41// OdGsEntityNode <-- OdGsNode
42// OdGsLightNode - has separate array, but stored into geometry cache too
43// OdGsLayerNode <-- OdGsNode - layers cache
44// OdGsBaseMode::OdGsMaterialCache
45// OdGsMaterialNode <-- OdGsNode - materials cache
46
50{
51protected:
52 //DOM-IGNORE-BEGIN
53
57 void update(OdGsUpdateContext& ctx, OdGsContainerNode* pParent,
58 OdSiSpatialIndex* pParentIndex);
59
64
68 bool extents(OdGeExtents3d& ) const;
69
74
79
84
89
110
113 typedef std::map<const void *, DataEntry> CacheMap;
114
119
124
129
134
135 //DOM-IGNORE-END
136public:
138
146 OdGsMaterialNode(OdGsBaseModel* pModel, const OdGiDrawable* pUnderlyingDrawable, bool bSetGsNode = true);
147
152
153 void destroy() {}
154
159
164
171 virtual void onModified(OdGsBaseVectorizer& view);
172
177
183 void invalidateModule(const void *pModule);
184
190 virtual void update(OdGsBaseVectorizer& view);
191
196
201
210
219
226 bool isDataModified() const;
227
235
242
248 const OdRxObject *cachedData(OdGsBaseVectorizer& view) const;
249
256 void setCachedData(OdGsBaseVectorizer& view, OdRxObject *newCachedData);
257
262
269 virtual ENodeType nodeType() const { return kMaterialNode; }
270
279 bool saveNodeState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer = NULL) const;
280
289 bool loadNodeState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer = NULL);
290};
291
292// Cache for material nodes
293#include "GsMaterialCache.h"
294
295#include "TD_PackPop.h"
296
297#endif // __OD_GS_MATERIAL_NODE__
true
ENodeType
Definition GsBaseModel.h:69
@ kMaterialNode
Definition GsBaseModel.h:77
#define GS_TOOLKIT_EXPORT
Definition GsExport.h:37
unsigned int OdUInt32
void setCachedData(OdGsBaseVectorizer &view, OdRxObject *newCachedData)
OdGiMaterialTraitsData m_materialTraits
void invalidate(OdGsContainerNode *pParent, OdGsViewImpl *pView, OdUInt32 mask)
bool saveNodeState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL) const
OdGsMaterialNode * m_pMatNext
OdGsMaterialNode * setNextNode(OdGsMaterialNode *newNode)
OdGsMaterialNode(OdGsBaseModel *pModel, const OdGiDrawable *pUnderlyingDrawable, bool bSetGsNode=true)
const OdGiMaterialTraitsData & materialTraits() const
void invalidateModule(const void *pModule)
virtual void onModified(OdGsBaseVectorizer &view)
OdGiMaterialTraitsData & materialTraits()
void update(OdGsUpdateContext &ctx, OdGsContainerNode *pParent, OdSiSpatialIndex *pParentIndex)
bool extents(OdGeExtents3d &) const
bool loadNodeState(OdGsFiler *pFiler, OdGsBaseVectorizer *pVectorizer=NULL)
bool isDataModified() const
OdGsMaterialNode * setPrevNode(OdGsMaterialNode *newNode)
void setCachedDataUpdated(OdGsBaseVectorizer &view)
const OdRxObject * cachedData(OdGsBaseVectorizer &view) const
virtual void update(OdGsBaseVectorizer &view)
OdGsMaterialNode * prevNode() const
OdGsMaterialNode * nextNode() const
void display(OdGsDisplayContext &ctx)
OdGsMaterialNode * m_pMatPrev
virtual ENodeType nodeType() const
ODRX_DECLARE_MEMBERS(OdGsMaterialNode)
bool isCachedDataModified(OdGsBaseVectorizer &view) const
OdMutexPtr m_pCacheMutex
virtual void propagateLayerChanges(OdGsViewImpl &view)
std::map< const void *, DataEntry > CacheMap
OdMutexPtr & cacheMutex()
friend class OdGsViewImpl
Definition GsNode.h:62
friend class OdGsBaseModel
Definition GsNode.h:61
OdGsNode(OdGsBaseModel *pModel, const OdGiDrawable *pUnderlyingDrawable)
GLenum GLint GLuint mask
Definition gles2_ext.h:262
DataEntry()
bool m_cachedDataModified
OdRxObjectPtr m_pCachedData