25#ifndef ODTRVECRESOURCESHARINGPROVIDER
26#define ODTRVECRESOURCESHARINGPROVIDER
31#include "../TrVisRendition.h"
32#include "ExDrawOrderBase.h"
38class OdTrVecVisualStyleContainer;
39class OdTrVecLayerContainer;
40class OdTrVisMetafilesPool;
41class OdTrVisMtContext;
47 ,
public OdDrawOrderBaseDeviceMCCallback
57 static bool isAttached(
const OdDrawOrderMetafileBase &bitSet,
const OdTrVecDevice *pDevice);
59 static void attach(OdDrawOrderMetafileBase &bitSet,
const OdTrVecDevice *pDevice);
61 static void detach(OdDrawOrderMetafileBase &bitSet,
const OdTrVecDevice *pDevice);
63 static void eliminate(OdDrawOrderMetafileBase &bitSet,
const OdTrVecDevice *pDevice);
66 static void clear(OdDrawOrderMetafileBase &bitSet);
141 OdTrVecDevice *
findUsage(
const OdDrawOrderMetafileBase &bitSet, OdTrVecDevice *pStartFrom = NULL)
const;
144 virtual bool shareMetafile(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet,
148 virtual bool shareGroup(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet,
149 OdTrVisGroupId groupId,
void *pInternalDataPtr,
void *pOriginatorPtr);
152 virtual bool shareTexture(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet,
156 virtual bool shareMaterial(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet,
160 virtual bool shareMetafile(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom,
163 virtual bool shareGroup(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom,
164 OdTrVisGroupId groupId,
void *pInternalDataPtr,
void *pOriginatorPtr);
166 virtual bool shareTexture(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom,
169 virtual bool shareMaterial(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom,
219#define OdTrVecResourceDependency_queryX(TypeOf, BaseClass) \
220 OdRxObject *queryX(const OdRxClass* pClass) const \
222 if (pClass == OdTrVecResourceSharingProvider::ResourceDependency::desc()) \
223 return reinterpret_cast<OdRxObject*>((OdTrVecResourceSharingProvider::ResourceDependency*)this); \
224 return BaseClass::queryX(pClass); \
226 TypeOfResource resourceType() const { return TypeOf; }
OdSmartPtr< OdTrVecResourceSharingProvider > OdTrVecResourceSharingProviderPtr
virtual OdTrVisId resourceId() const =0
virtual OdDrawOrderMetafileBase & resourceBitSet()=0
virtual TypeOfResource resourceType() const =0
static OdRxClass * desc()
OdGsDevice * gsDevice(OdTrVecDevice *pRequestFor) const
OdTrVecTtfFontsCache * m_pTtfCache
OdTrVisRenderClient * renderClient(OdTrVecDevice *pRequestFor) const
OdTrVisMetafilesPool * m_pMetafilesPool
virtual void closeResourceSharing(OdTrVecDevice *pDevice, bool bTemporaryDisconnect=false)
void mtLockMetafilesPool(OdTrVecDevice *pDevice)
OdTrVecLayerContainer * m_pLayerCache
OdRxObjectPtr m_pSrvMetafilesPool
OdRxObject * serverMetafilesPool(OdTrVecDevice *pDevice)
OdUInt32 m_nSharedDevices
OdTrVecLayerContainer * layersCache(OdTrVecDevice *pDevice)
void broadcastFunction(const OdDrawOrderMetafileBase &bitSet, broadcastProc pProc, void *pArg) const
OdTrVecVisualStyleContainer * m_pVSCache
OdTrVecDevice * findUsage(const OdDrawOrderMetafileBase &bitSet, OdTrVecDevice *pStartFrom=NULL) const
ODRX_USING_HEAP_OPERATORS(OdTrVisSharingProviderClient)
virtual bool shareMetafile(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisMetafileId metafileId, void *pInternalDataPtr, void *pOriginatorPtr)
virtual bool shareTexture(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet, OdTrVisTextureId textureId, void *pInternalDataPtr, void *pOriginatorPtr)
void shareIdRegistration(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisId id, OdInt32 type)
virtual void openResourceSharing(OdTrVecDevice *pDevice)
virtual bool shareMaterial(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet, OdTrVisMaterialId materialId, void *pInternalDataPtr, void *pOriginatorPtr)
void broadcastFunctionForAll(broadcastProc pProc, void *pArg, const OdTrVecDevice *pExclusion=NULL) const
virtual bool shareMetafile(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet, OdTrVisMetafileId metafileId, void *pInternalDataPtr, void *pOriginatorPtr)
virtual void onDeleteRequest(onDeleteRequestProc pReqProc, void *pData)
virtual bool shareMaterial(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisMaterialId materialId, void *pInternalDataPtr, void *pOriginatorPtr)
virtual bool shareTexture(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisTextureId textureId, void *pInternalDataPtr, void *pOriginatorPtr)
OdTrVisRendition * rendition(OdTrVecDevice *pRequestFor) const
OdTrVisMtContext * m_pMfPoolMtCtx
OdTrVecTtfFontsCache * ttfFontsCache(OdTrVecDevice *pDevice)
virtual bool shareGroup(OdTrVecDevice *pRequestedFor, OdDrawOrderMetafileBase &bitSet, OdTrVisGroupId groupId, void *pInternalDataPtr, void *pOriginatorPtr)
OdTrVecResourceSharingProvider()
OdRefCounter m_nMfPoolEntrances
OdTrVecVisualStyleContainer * visualStylesCache(OdTrVecDevice *pDevice)
virtual bool shareGroup(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisGroupId groupId, void *pInternalDataPtr, void *pOriginatorPtr)
bool materialTexturesProc(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisMaterialId materialId, void *pInternalDataPtr, void *pOriginatorPtr)
bool internalTextureProc(OdTrVecDevice *pRequestedFor, OdTrVecDevice *pRequestedFrom, OdTrVisTextureId textureId, void *pInternalDataPtr, void *pOriginatorPtr, OdTrVisTextureDef &resTexture, bool &bCreated)
~OdTrVecResourceSharingProvider()
void mtUnlockMetafilesPool(OdTrVecDevice *pDevice)
void(* broadcastProc)(OdDrawOrderBaseDevice *pDevice, void *pData)
const OdTrVisRendition::ClientSettings & clientSettings(const OdTrVecDevice *pRequestFor) const
OdTrVisMetafilesPool * metafilesPool(OdTrVecDevice *pDevice)
bool isResourceSharingOpened(OdTrVecDevice *pDevice) const
static OdSmartPtr< OdTrVecResourceSharingProvider > createObject()
OdArray< DeviceEntry > m_rmDevices
bool hasSharedResources() const
void setServerMetafilesPool(OdTrVecDevice *pDevice, OdRxObject *pMfPool)
typedef void(APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture)
GLuint GLsizei GLsizei GLint GLenum * type
static const OdUInt32 g_nMaxBit
static void attach(OdDrawOrderMetafileBase &bitSet, const OdTrVecDevice *pDevice)
static void clear(OdDrawOrderMetafileBase &bitSet)
static void compress(OdDrawOrderMetafileBase &bitSet, OdUInt32 nBit)
static bool isAttached(const OdDrawOrderMetafileBase &bitSet, const OdTrVecDevice *pDevice)
static void detach(OdDrawOrderMetafileBase &bitSet, const OdTrVecDevice *pDevice)
static const OdUInt32 g_nBitSys
static void eliminate(OdDrawOrderMetafileBase &bitSet, const OdTrVecDevice *pDevice)
DeviceEntry(OdTrVecDevice *pDevice)
OdTrVecDevice * m_pDevice