changed: gcc8 base update
[opensg.git] / Source / System / FileIO / OSB / OSGOSBGeometryElement.h
bloba413212d8305133702b809ac90bff5c57fa75ebc
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2007 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 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGOSBGEOMETRYELEMENT_H_
40 #define _OSGOSBGEOMETRYELEMENT_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGFileIODef.h"
47 #include "OSGGeoIntegralProperty.h"
49 #include "OSGOSBCommonElement.h"
50 #include "OSGOSBElementFactoryHelper.h"
52 #include <vector>
54 OSG_BEGIN_NAMESPACE
56 /*! \ingroup GrpFileIOOSB
57 \nohierarchy
60 class OSG_FILEIO_DLLMAPPING OSBGeometryElement : public OSBCommonElement
62 /*========================== PUBLIC =================================*/
63 public:
64 /*---------------------------------------------------------------------*/
65 /*! \name Types */
66 /*! \{ */
68 typedef OSBCommonElement Inherited;
69 typedef OSBGeometryElement Self;
71 /*! \} */
72 /*---------------------------------------------------------------------*/
73 /*! \name Constants */
74 /*! \{ */
76 static const UInt16 MapPosition;
77 static const UInt16 MapNormal;
78 static const UInt16 MapColor;
79 static const UInt16 MapSecondaryColor;
80 static const UInt16 MapTexCoords;
81 static const UInt16 MapTexCoords1;
82 static const UInt16 MapTexCoords2;
83 static const UInt16 MapTexCoords3;
84 static const UInt16 MapTexCoords4;
85 static const UInt16 MapTexCoords5;
86 static const UInt16 MapTexCoords6;
87 static const UInt16 MapTexCoords7;
88 static const UInt16 MapEmpty;
90 /*! \} */
91 /*---------------------------------------------------------------------*/
92 /*! \name Constructor */
93 /*! \{ */
95 OSBGeometryElement(OSBRootElement *root);
97 /*! \} */
98 /*---------------------------------------------------------------------*/
99 /*! \name Destructor */
100 /*! \{ */
102 virtual ~OSBGeometryElement(void);
104 /*! \} */
105 /*---------------------------------------------------------------------*/
106 /*! \name Reading */
107 /*! \{ */
109 virtual void read (const std::string &typeName);
110 virtual void postRead( void );
111 virtual void postMap ( void );
113 /*! \} */
114 /*---------------------------------------------------------------------*/
115 /*! \name Writing */
116 /*! \{ */
118 virtual void preWrite(FieldContainer * const fc);
119 virtual void write (void );
121 /*! \} */
122 /*========================== PRIVATE ================================*/
123 private:
124 /*!\brief prohibit default function (move to 'public' if needed) */
125 OSBGeometryElement(const OSBGeometryElement &source);
126 /*!\brief prohibit default function (move to 'public' if needed) */
127 void operator =(const OSBGeometryElement &source);
129 /*---------------------------------------------------------------------*/
130 /*! \name Reading Helper Functions */
131 /*! \{ */
133 void readV100 (void);
134 void postReadV100(void);
135 void postMapV200 (void);
137 /*! \} */
138 /*---------------------------------------------------------------------*/
140 static OSBElementRegistrationHelper<OSBGeometryElement> _regHelper;
142 std::vector<UInt16> _indexMapping;
143 UInt32 _indicesId;
144 GeoIntegralPropertyUnrecPtr _indices;
145 bool _indices16Bit;
146 bool _indicesPacked;
148 UInt16 _version;
151 OSG_END_NAMESPACE
153 #endif /* _OSGOSBGEOMETRYELEMENT_H_ */