24 #ifndef __OD_GS_BASE_MATERIAL_VIEW__
25 #define __OD_GS_BASE_MATERIAL_VIEW__
66 kProcessMaterials = (1 << 1),
68 kProcessMappersAndMaterials = 3,
70 kMappersForRender = (1 << 2),
71 kMaterialsForRender = (1 << 3),
73 kMappersAndMaterialsForRender = 12,
75 kProcessForRender = 15,
78 kEnableDelayCache = (1 << 4)
105 friend class OdDefDelayCacheEntryMap;
106 friend class OdManageMViewPerDrawableData;
108 bool m_bMaterialCommited;
109 struct ExtentsContainer
113 bool m_bExtentsValid;
118 const OdGiMapper *m_pCurMapper, *m_pCopyMapper;
119 const OdDbStub *m_pCurMaterial, *m_pCopyMaterial;
120 DelayCacheEntry m_Cache;
121 DelayCacheEntry *m_pTail;
123 DelayCache() : m_pCurMapper(
NULL), m_pCopyMapper(
NULL)
124 , m_pCurMaterial(
NULL), m_pCopyMaterial(
NULL)
131 struct MViewPerDrawableData
133 bool m_bMapperNeedExtents;
135 ExtentsContainer m_CurrentDrawableExtents;
136 DelayCache m_DelayCache;
137 MViewPerDrawableData()
138 : m_bMapperNeedExtents(
false)
139 , m_bBaseLevel(
false)
141 m_CurrentDrawableExtents.m_bExtentsValid = m_CurrentDrawableExtents.m_bAwaiting =
false;
142 m_CurrentDrawableExtents.m_pCurrentDrawable =
NULL;
144 ~MViewPerDrawableData()
149 m_CurrentDrawableExtents.m_bExtentsValid = m_CurrentDrawableExtents.m_bAwaiting =
false;
150 m_bMapperNeedExtents =
false;
151 m_CurrentDrawableExtents.m_pCurrentDrawable =
NULL;
153 } *m_pCurMvDrawableData, m_mvBaseDrawableData, m_mvGlobalDrawableDataInitializer;
318 void computeDrawableExtents();
352 resetConstructorFlags(uMaterialViewFlags);
368 resetConstructorFlags(uMaterialViewFlags);
373 return (&
view() !=
this);
OdSmartPtr< OdGiMaterialTextureData > OdGiMaterialTextureDataPtr
#define GS_TOOLKIT_EXPORT
OdGsViewImpl & view() const
virtual void playDelayCacheEntry(const DelayCacheEntry *pEntry)
void resetCurrentMaterial(OdGiMaterialItemPtr pMaterial)
virtual void beginViewVectorization()
bool saveMaterialItem(const OdGiMaterialItem *pMatItem, OdGsFiler *pFiler)
void resetCurrentMaterial()
virtual void onTraitsModified()
virtual bool getDeviceMapperMatrix(OdGeMatrix3d &dm) const
virtual void beginMetafile(OdRxObject *pMetafile)
virtual void delayCacheProcessed(const OdGiDrawable *pDrawable)
OdGiMaterialItemPtr m_pNullMaterialItem
OdGiMaterialTraitsData m_nullMaterialTraitsData
OdGsBaseMaterialVectorizer(OdUInt32 uMaterialViewFlags=kProcessMappersAndMaterials)
OdUInt32 m_uMaterialViewFlags
OdGiMaterialItemPtr currentMaterial() const
static OdGiMaterialTexturePtr loadMaterialTexture(OdGsFiler *pFiler)
~OdGsBaseMaterialVectorizer()
virtual bool saveClientMaterialCache(const OdRxObject *pMtl, OdGsFiler *pFiler)
bool isMapperEnabled() const
void appendDelayCacheEntry(DelayCacheEntry *pEntry)
virtual bool computeDelayedExtents(const OdGiDrawable *pDrawable, OdGeExtents3d &extents)
virtual void nullMaterialStub()
virtual bool loadMaterialCache(OdGsMaterialNode *pNode, OdGsFiler *pFiler)
bool isMappingDelayed() const
virtual OdRxObjectPtr loadClientMaterialCache(OdGsFiler *pFiler, OdGiMaterialItem *pMatItem)
virtual void endViewVectorization()
virtual bool saveMaterialCache(const OdGsMaterialNode *pNode, OdGsFiler *pFiler)
static bool saveMaterialTexture(const OdGiMaterialTexture *pTexture, OdGsFiler *pFiler)
bool isMapperAvailable() const
bool isMaterialEnabled() const
virtual void mapperChangedForDelayCache()
OdGiMaterialItemPtr m_pCurrentMaterialItem
OdGiMaterialItemPtr loadMaterialItem(OdGsFiler *pFiler)
void resetCurrentMapper(OdGiMapperItemPtr pMapper)
bool isMaterialAvailable() const
virtual void renderMaterialCache(OdGiMaterialItemPtr pCache, OdDbStub *materialId)
static bool saveMaterialTextureManager(const OdGiMaterialTextureManager *pManager, OdGsFiler *pFiler, OdGsMaterialTextureDataFiler *pSaver)
virtual void processMaterialNode(OdDbStub *materialId, OdGsMaterialNode *node)
virtual OdGiMaterialItemPtr fillMaterialCache(OdGiMaterialItemPtr prevCache, OdDbStub *materialId, const OdGiMaterialTraitsData &materialData)
virtual bool computeDrawableExtents(const OdGiDrawable *pDrawable, OdGeExtents3d &extents)
virtual bool doDraw(OdUInt32 drawableFlags, const OdGiDrawable *pDrawable)
OdGiMapperItemPtr m_pCurrentMapperItem
OdGiMapperItemPtr _itlCreateMapperItem() const
virtual void endMetafile(OdRxObject *pMetafile)
static bool loadMaterialTextureManager(OdGiMaterialTextureManager *pManager, OdGsFiler *pFiler, OdGsMaterialTextureDataFiler *pSaver)
OdGiMapperItemPtr currentMapper(bool bForCoords=true) const
virtual bool skipMaterialProcess(OdDbStub *materialId) const
OdGiMaterialItemPtr _itlCreateMaterialItem() const
OdGsBaseMaterialView(OdUInt32 uMaterialViewFlags=kProcessMappersAndMaterials)
OdGsBaseMaterialViewMT(OdUInt32 uMaterialViewFlags=kProcessMappersAndMaterials)
void resetConstructorFlags(OdUInt32 uMaterialViewFlags)
DelayCacheEntry * nextEntry()
virtual ~DelayCacheEntry()
virtual void play(OdGsBaseMaterialVectorizer &mView) const
virtual DelayCacheEntryType internalType() const
void setNextEntry(DelayCacheEntry *pNext)
DelayCacheEntry * m_pNext
virtual OdGiMaterialTextureDataPtr loadClientMaterialTextureData(OdGsFiler *)
virtual bool saveClientMaterialTextureData(const OdGiMaterialTextureData *, OdGsFiler *)