1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2007 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 _OSGOSBGEOMETRYELEMENT_H_
40 #define _OSGOSBGEOMETRYELEMENT_H_
45 #include "OSGConfig.h"
46 #include "OSGFileIODef.h"
47 #include "OSGGeoIntegralProperty.h"
49 #include "OSGOSBCommonElement.h"
50 #include "OSGOSBElementFactoryHelper.h"
56 /*! \ingroup GrpFileIOOSB
60 class OSG_FILEIO_DLLMAPPING OSBGeometryElement
: public OSBCommonElement
62 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
68 typedef OSBCommonElement Inherited
;
69 typedef OSBGeometryElement Self
;
72 /*---------------------------------------------------------------------*/
73 /*! \name Constants */
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
;
91 /*---------------------------------------------------------------------*/
92 /*! \name Constructor */
95 OSBGeometryElement(OSBRootElement
*root
);
98 /*---------------------------------------------------------------------*/
99 /*! \name Destructor */
102 virtual ~OSBGeometryElement(void);
105 /*---------------------------------------------------------------------*/
109 virtual void read (const std::string
&typeName
);
110 virtual void postRead( void );
111 virtual void postMap ( void );
114 /*---------------------------------------------------------------------*/
118 virtual void preWrite(FieldContainer
* const fc
);
119 virtual void write (void );
122 /*========================== 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 */
133 void readV100 (void);
134 void postReadV100(void);
135 void postMapV200 (void);
138 /*---------------------------------------------------------------------*/
140 static OSBElementRegistrationHelper
<OSBGeometryElement
> _regHelper
;
142 std::vector
<UInt16
> _indexMapping
;
144 GeoIntegralPropertyUnrecPtr _indices
;
153 #endif /* _OSGOSBGEOMETRYELEMENT_H_ */