1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2008 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGOFDATABASE_H_
40 #define _OSGOFDATABASE_H_
44 #include "OSGFileIODef.h"
45 #include "OSGContainerForwards.h"
47 #include "OSGOFRecords.h"
48 #include "OSGOFPalettes.h"
49 #include "OSGOFPrimaryRecords.h"
55 //---------------------------------------------------------------------------
57 //---------------------------------------------------------------------------
59 class OSG_FILEIO_DLLMAPPING OFDatabase
72 /*---------------------------------------------------------------------*/
77 /*---------------------------------------------------------------------*/
79 bool read (std::istream
&is
);
80 NodeTransitPtr
convert(void );
82 /*---------------------------------------------------------------------*/
87 /*---------------------------------------------------------------------*/
89 VertexUnits
getTargetUnits(void ) const;
90 void setTargetUnits(VertexUnits units
);
92 Real32
getUnitScale (void ) const;
93 void setUnitScale (Real32 scale
);
95 /*---------------------------------------------------------------------*/
97 const OFColorPaletteRecord
*getColorPalette (void );
98 const OFVertexPaletteRecord
*getVertexPalette(void );
100 const OFTexturePaletteRecord
*getTexRecord (UInt32 uiIdx
);
101 const OFMaterialPaletteRecord
*getMatRecord (UInt32 uiIdx
);
103 void addColorPaletteRecord (OFColorPaletteRecord
*colPal
);
104 void addVertexPaletteRecord (OFVertexPaletteRecord
*vertPal
);
105 void addTexturePaletteRecord (OFTexturePaletteRecord
*texPal
);
106 void addMaterialPaletteRecord(OFMaterialPaletteRecord
*matPal
);
108 /*---------------------------------------------------------------------*/
111 OFHeaderRecordRCPtr _pHeader
;
112 std::stack
<OFRecord
*> _sRecords
;
114 OFRecordRCPtr _pCurr
;
115 OFRecordRCPtr _pCurrPrimary
;
117 OFColorPaletteRCPtr _pColorPalette
;
118 OFVertexPaletteRCPtr _pVertexPalette
;
119 OFTexturePaletteRCPtr _pTexturePalette
;
120 OFMaterialPaletteRCPtr _pMaterialPalette
;
122 VertexUnits _targetUnits
;
125 // OpCode without object
127 static const UInt16 OFContinuationOC
= 23;
132 #endif // _OSGOFDATABASE_H