CFx SDK Documentation  2022 SP0
TrVisIdMap.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 Id mapping
24 
25 #ifndef ODTRVISREGENTRY
26 #define ODTRVISREGENTRY
27 
28 #include "TD_PackPush.h"
29 
30 #include "TrVisRendition.h"
31 
32 class OdGsFiler;
33 
37 class OdTrVisIdMap : public OdRxObject
38 {
39  public:
40  static const OdChar* getClassName();
41  static void attachToFiler(OdGsFiler *pFiler);
43  static void detachFromFiler(OdGsFiler *pFiler);
44 
45  // Id Maps accessors
46 
47  virtual void add(OdTrVisRendition::DataType type, OdTrVisId nPrev, OdTrVisId nNew) = 0;
48  virtual void kill(OdTrVisRendition::DataType type, OdTrVisId nPrev) = 0;
49 
51  virtual void clear() = 0;
52 
53  virtual OdTrVisId get(OdTrVisRendition::DataType type, OdTrVisId nPrev, bool *bRes = NULL) const = 0;
54  virtual bool get(OdTrVisRendition::DataType type, OdTrVisId nPrev, OdTrVisId &nNew) const = 0;
55 
56  virtual OdTrVisId longSearch(OdTrVisRendition::DataType type, OdTrVisId nNew, bool *bRes = NULL) const = 0;
57  virtual bool longSearch(OdTrVisRendition::DataType type, OdTrVisId nNew, OdTrVisId &nPrev) const = 0;
58 
60  virtual const void *getEntry(OdTrVisRendition::DataType type, const void *pIndex, OdTrVisId &nPrev, OdTrVisId &nNew) const = 0;
61 
62  // Resource data accessors
63 
65  {
66  public:
67  virtual bool getResourceData(OdTrVisId resourceId, void *pDataStorage) = 0;
68  };
69 
72 
74  virtual void clearDataAccessors() = 0;
75 
77  virtual void clearAll() = 0;
78 
80  virtual bool dataAccess(OdTrVisRendition::DataType type, OdTrVisId resourceId, void *pDataStorage) const = 0;
81 
82  // Texture data accessor
83 
85  {
86  public:
88  {
89  return getResourceData(textureId, &pDef);
90  }
91  };
92 
94  {
95  return static_cast<TextureDataAccessor*>(getDataAccessor(OdTrVisRendition::kTextureData, textureId));
96  }
98  {
99  return dataAccess(OdTrVisRendition::kTextureData, textureId, &pDef);
100  }
101 };
102 
103 // OdGsFiler helpers
104 // for OdTrVisRendition::ClientSettings
107 // for OdTrVisSurfaceDef
111 // for OdTrVisViewParamsDef
115 // for OdTrVisViewportDef
119 // for OdTrVisLightDef
120 bool odTrVisSaveLightDef(OdGsFiler *pFiler, const OdTrVisLightDef &pDef);
123 // for OdTrVisFlatMetafileContainer
125 bool odTrVisLoadRawMetafileData(OdGsFiler *pFiler, OdTrVisFlatMetafileContainerPtr &pMf, OdTrVisIdMap *pIdMap = NULL, bool bDisplayId = false);
127 // for OdTrVisMetafileContainer
129 bool odTrVisLoadMetafileData(OdGsFiler *pFiler, OdTrVisMetafileContainerPtr &pMf, OdTrVisIdMap *pIdMap = NULL, bool bDisplayId = false);
130 void odTrVisLoadPostprocessMetafileData(OdTrVisMetafileContainer *pMf, OdTrVisIdMap *pIdMap, bool bDisplayId = false);
131 // for OdTrVisMetafileDef
133 bool odTrVisLoadMetafileDef(OdGsFiler *pFiler, OdTrVisMetafileDef &pDef, OdTrVisIdMap *pIdMap = NULL, bool bDisplayId = false);
134 void odTrVisLoadPostprocessMetafileDef(OdTrVisMetafileDef &pDef, OdTrVisIdMap *pIdMap, bool bDisplayId = false);
135 // for OdTrVisHlBranchDef
139 // for OdTrVisTextureDef
143 bool odTrVisSaveTexturePtr( OdGsFiler *pFiler, const OdTrVisTexture* tex );
145 // for OdTrVisMaterialDef
149 // for OdTrVisVisualStyle
152 // for OdTrVisLayerProps
155 // for OdTrVisLayerDef
156 bool odTrVisSaveLayerDef(OdGsFiler *pFiler, const OdTrVisLayerDef &pDef);
159 // for OdTrVisExtentsDef
162 
163 #include "TD_PackPop.h"
164 
165 #endif // ODTRVISREGENTRY
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
wchar_t OdChar
bool odTrVisLoadMetafileDef(OdGsFiler *pFiler, OdTrVisMetafileDef &pDef, OdTrVisIdMap *pIdMap=NULL, bool bDisplayId=false)
bool odTrVisSaveRawMetafileData(OdGsFiler *pFiler, const OdTrVisFlatMetafileContainer *pMf)
bool odTrVisSaveViewportDef(OdGsFiler *pFiler, const OdTrVisViewportDef &pDef)
bool odTrVisSaveMaterialDef(OdGsFiler *pFiler, const OdTrVisMaterialDef &pDef)
void odTrVisLoadPostprocessRawMetafileData(OdTrVisFlatMetafileContainer *pMf, OdTrVisIdMap *pIdMap, bool bDisplayId=false)
bool odTrVisLoadTextureDef(OdGsFiler *pFiler, OdTrVisTextureDef &pDef, OdTrVisIdMap *pIdMap=NULL)
bool odTrVisSaveTexturePtr(OdGsFiler *pFiler, const OdTrVisTexture *tex)
bool odTrVisLoadLayerDefProps(OdGsFiler *pFiler, OdTrVisLayerProps &pProps)
void odTrVisLoadPostprocessLightDef(OdTrVisLightDef &pDef, OdTrVisIdMap *pIdMap)
void odTrVisLoadPostprocessMetafileData(OdTrVisMetafileContainer *pMf, OdTrVisIdMap *pIdMap, bool bDisplayId=false)
void odTrVisLoadPostprocessSurfaceDef(OdTrVisSurfaceDef &pDef, OdTrVisIdMap *pIdMap)
bool odTrVisLoadHlBranchDef(OdGsFiler *pFiler, OdTrVisHlBranchDef &pDef, OdTrVisIdMap *pIdMap=NULL)
void odTrVisLoadPostprocessViewportDef(OdTrVisViewportDef &pDef, OdTrVisIdMap *pIdMap)
bool odTrVisSaveLayerDef(OdGsFiler *pFiler, const OdTrVisLayerDef &pDef)
bool odTrVisSaveMetafileDef(OdGsFiler *pFiler, const OdTrVisMetafileDef &pDef)
bool odTrVisLoadLightDef(OdGsFiler *pFiler, OdTrVisLightDef &pDef, OdTrVisIdMap *pIdMap=NULL)
void odTrVisLoadPostprocessMaterialDef(OdTrVisMaterialDef &pDef, OdTrVisIdMap *pIdMap)
bool odTrVisLoadSurfaceDef(OdGsFiler *pFiler, OdTrVisSurfaceDef &pDef, OdTrVisIdMap *pIdMap=NULL)
bool odTrVisSaveLightDef(OdGsFiler *pFiler, const OdTrVisLightDef &pDef)
bool odTrVisLoadViewportDef(OdGsFiler *pFiler, OdTrVisViewportDef &pDef, OdTrVisIdMap *pIdMap=NULL)
void odTrVisLoadPostprocessViewParamsDef(OdTrVisViewParamsDef &pDef, OdTrVisIdMap *pIdMap)
void odTrVisSaveLayerDefProps(OdGsFiler *pFiler, const OdTrVisLayerProps &pProps)
bool odTrVisLoadLayerDef(OdGsFiler *pFiler, OdTrVisLayerDef &pDef, OdTrVisIdMap *pIdMap=NULL)
void odTrVisLoadPostprocessLayerDef(OdTrVisLayerDef &pDef, OdTrVisIdMap *pIdMap)
bool odTrVisLoadExtentsDef(OdGsFiler *pFiler, OdTrVisExtentsDef &pDef)
bool odTrVisSaveHlBranchDef(OdGsFiler *pFiler, const OdTrVisHlBranchDef &pDef)
OdTrVisTexturePtr odTrVisLoadTexturePtr(OdGsFiler *pFiler)
bool odTrVisLoadMaterialDef(OdGsFiler *pFiler, OdTrVisMaterialDef &pDef, OdTrVisIdMap *pIdMap=NULL)
bool odTrVisLoadRawMetafileData(OdGsFiler *pFiler, OdTrVisFlatMetafileContainerPtr &pMf, OdTrVisIdMap *pIdMap=NULL, bool bDisplayId=false)
void odTrVisLoadPostprocessMetafileDef(OdTrVisMetafileDef &pDef, OdTrVisIdMap *pIdMap, bool bDisplayId=false)
bool odTrVisSaveMetafileData(OdGsFiler *pFiler, const OdTrVisMetafileContainer *pMf)
bool odTrVisSaveViewParamsDef(OdGsFiler *pFiler, const OdTrVisViewParamsDef &pDef)
bool odTrVisSaveClientSettings(OdGsFiler *pFiler, const OdTrVisRendition::ClientSettings &cliSets)
bool odTrVisLoadVisualStyle(OdGsFiler *pFiler, OdTrVisVisualStyle &pVS)
bool odTrVisSaveTextureDef(OdGsFiler *pFiler, const OdTrVisTextureDef &pDef)
bool odTrVisLoadViewParamsDef(OdGsFiler *pFiler, OdTrVisViewParamsDef &pDef, OdTrVisIdMap *pIdMap=NULL)
void odTrVisLoadPostprocessTextureDef(OdTrVisTextureDef &pDef, OdTrVisIdMap *pIdMap)
bool odTrVisLoadMetafileData(OdGsFiler *pFiler, OdTrVisMetafileContainerPtr &pMf, OdTrVisIdMap *pIdMap=NULL, bool bDisplayId=false)
bool odTrVisSaveSurfaceDef(OdGsFiler *pFiler, const OdTrVisSurfaceDef &pDef)
void odTrVisLoadPostprocessHlBranchDef(OdTrVisHlBranchDef &pDef, OdTrVisIdMap *pIdMap)
bool odTrVisSaveExtentsDef(OdGsFiler *pFiler, const OdTrVisExtentsDef &pDef)
bool odTrVisLoadClientSettings(OdGsFiler *pFiler, OdTrVisRendition::ClientSettings &cliSets)
bool odTrVisSaveVisualStyle(OdGsFiler *pFiler, const OdTrVisVisualStyle &pVS)
virtual bool getResourceData(OdTrVisId resourceId, void *pDataStorage)=0
bool getTextureData(OdTrVisTextureId textureId, OdTrVisTextureDef &pDef)
Definition: TrVisIdMap.h:87
virtual OdTrVisId get(OdTrVisRendition::DataType type, OdTrVisId nPrev, bool *bRes=NULL) const =0
virtual ResourceDataAccessor * getDataAccessor(OdTrVisRendition::DataType type, OdTrVisId resourceId) const =0
virtual bool dataAccess(OdTrVisRendition::DataType type, OdTrVisId resourceId, void *pDataStorage) const =0
static OdTrVisIdMap * getFromFiler(OdGsFiler *pFiler)
static void detachFromFiler(OdGsFiler *pFiler)
virtual void clearDataAccessors()=0
virtual void clearDataAccessors(OdTrVisRendition::DataType type)=0
virtual void add(OdTrVisRendition::DataType type, OdTrVisId nPrev, OdTrVisId nNew)=0
virtual OdTrVisId longSearch(OdTrVisRendition::DataType type, OdTrVisId nNew, bool *bRes=NULL) const =0
virtual bool longSearch(OdTrVisRendition::DataType type, OdTrVisId nNew, OdTrVisId &nPrev) const =0
virtual void kill(OdTrVisRendition::DataType type, OdTrVisId nPrev)=0
virtual void addDataAccessor(OdTrVisRendition::DataType type, OdTrVisId resourceId, ResourceDataAccessor *pAccessor)=0
static const OdChar * getClassName()
virtual void killDataAccessor(OdTrVisRendition::DataType type, OdTrVisId resourceId)=0
virtual void clearAll(OdTrVisRendition::DataType type)=0
virtual const void * getEntry(OdTrVisRendition::DataType type, const void *pIndex, OdTrVisId &nPrev, OdTrVisId &nNew) const =0
static void attachToFiler(OdGsFiler *pFiler)
virtual void clear(OdTrVisRendition::DataType type)=0
bool textureDataAccess(OdTrVisTextureId textureId, OdTrVisTextureDef &pDef)
Definition: TrVisIdMap.h:97
TextureDataAccessor * getTextureDataAccessor(OdTrVisTextureId textureId) const
Definition: TrVisIdMap.h:93
virtual OdUInt32 numEntries(OdTrVisRendition::DataType type) const =0
virtual void clear()=0
virtual bool get(OdTrVisRendition::DataType type, OdTrVisId nPrev, OdTrVisId &nNew) const =0
virtual void clearAll()=0
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274