fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / OpenFlight / OSGOFPalettes.h
blob929d9c18860b7a6d6c2b750572a2293a897e7a94
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2011 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
30 #ifndef _OSGOFPALETTES_H_
31 #define _OSGOFPALETTES_H_
33 #include "OSGFileIODef.h"
34 #include "OSGMemoryObject.h"
35 #include "OSGRefCountPtr.h"
36 #include "OSGOFAncillaryRecords.h"
38 #include <map>
40 OSG_BEGIN_NAMESPACE
42 //---------------------------------------------------------------------------
43 // Class
44 //---------------------------------------------------------------------------
46 /*! \ingroup GrpFileIOOpenFlight
47 \nohierarchy
50 class OSG_FILEIO_DLLMAPPING OFColorPalette : public MemoryObject
52 protected:
54 typedef MemoryObject Inherited;
56 /*---------------------------------------------------------------------*/
58 OFColorPaletteRecordRCPtr _pColorPalette;
60 /*---------------------------------------------------------------------*/
62 virtual ~OFColorPalette(void);
64 public:
66 OFColorPalette(void);
68 /*---------------------------------------------------------------------*/
70 void addRecord(OFColorPaletteRecord *pColorPal);
71 const OFColorPaletteRecord *getRecord(void );
73 /*---------------------------------------------------------------------*/
75 void dump(UInt32 uiIndent) const;
78 /*! \ingroup GrpFileIOOpenFlight
80 typedef RefCountPtr<OFColorPalette,
81 MemObjRefCountPolicy> OFColorPaletteRCPtr;
83 //---------------------------------------------------------------------------
84 // Class
85 //---------------------------------------------------------------------------
87 /*! \ingroup GrpFileIOOpenFlight
88 \nohierarchy
91 class OSG_FILEIO_DLLMAPPING OFVertexPalette : public MemoryObject
93 protected:
95 typedef MemoryObject Inherited;
97 /*---------------------------------------------------------------------*/
99 OFVertexPaletteRecordRCPtr _pVertexPalette;
101 /*---------------------------------------------------------------------*/
103 virtual ~OFVertexPalette(void);
105 public:
107 OFVertexPalette(void);
109 /*---------------------------------------------------------------------*/
111 void addRecord(OFVertexPaletteRecord *pVertexPal);
112 const OFVertexPaletteRecord *getRecord(void );
114 /*---------------------------------------------------------------------*/
116 void dump(UInt32 uiIndent) const;
119 /*! \ingroup GrpFileIOOpenFlight
121 typedef RefCountPtr<OFVertexPalette,
122 MemObjRefCountPolicy> OFVertexPaletteRCPtr;
124 //---------------------------------------------------------------------------
125 // Class
126 //---------------------------------------------------------------------------
128 /*! \ingroup GrpFileIOOpenFlight
129 \nohierarchy
132 class OSG_FILEIO_DLLMAPPING OFTexturePalette : public MemoryObject
134 protected:
136 typedef MemoryObject Inherited;
138 /*---------------------------------------------------------------------*/
140 typedef std::map<Int32,
141 OFTexturePaletteRecordRCPtr> TextureStore;
142 typedef TextureStore::iterator TextureStoreIt;
143 typedef TextureStore::const_iterator TextureStoreConstIt;
146 /*---------------------------------------------------------------------*/
148 TextureStore _mTextures;
150 /*---------------------------------------------------------------------*/
152 virtual ~OFTexturePalette(void);
154 public:
156 OFTexturePalette(void);
158 /*---------------------------------------------------------------------*/
160 void addRecord(OFTexturePaletteRecord *pTex);
161 const OFTexturePaletteRecord *getRecord(Int32 uiId);
163 /*---------------------------------------------------------------------*/
165 void dump(UInt32 uiIndent) const;
168 /*! \ingroup GrpFileIOOpenFlight
170 typedef RefCountPtr<OFTexturePalette,
171 MemObjRefCountPolicy> OFTexturePaletteRCPtr;
173 //---------------------------------------------------------------------------
174 // Class
175 //---------------------------------------------------------------------------
177 /*! \ingroup GrpFileIOOpenFlight
178 \nohierarchy
181 class OSG_FILEIO_DLLMAPPING OFMaterialPalette : public MemoryObject
183 protected:
184 typedef MemoryObject Inherited;
186 /*---------------------------------------------------------------------*/
188 typedef std::map<Int32,
189 OFMaterialPaletteRecordRCPtr> MaterialStore;
190 typedef MaterialStore::iterator MaterialStoreIt;
191 typedef MaterialStore::const_iterator MaterialStoreConstIt;
193 /*---------------------------------------------------------------------*/
195 MaterialStore _mMaterials;
197 /*---------------------------------------------------------------------*/
199 virtual ~OFMaterialPalette(void);
201 public:
203 typedef RefCountPtr<OFMaterialPalette,
204 MemObjRefCountPolicy> ObjRCPtr;
205 typedef TransitPtr <OFMaterialPalette > ObjTransitPtr;
207 OFMaterialPalette(void);
209 /*---------------------------------------------------------------------*/
211 void addRecord(OFMaterialPaletteRecord *pMat);
212 const OFMaterialPaletteRecord *getRecord(Int32 uiId);
214 /*---------------------------------------------------------------------*/
216 void dump(UInt32 uiIndent) const;
219 /*! \ingroup GrpFileIOOpenFlight
221 typedef OFMaterialPalette::ObjRCPtr OFMaterialPaletteRCPtr;
222 /*! \ingroup GrpFileIOOpenFlight
224 typedef OFMaterialPalette::ObjTransitPtr OFMaterialPaletteTransitPtr;
226 OSG_END_NAMESPACE
228 #endif /* _OSGOFPALETTES_H_ */