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 _OSGOSBGEOMETRYHELPER_H_
40 #define _OSGOSBGEOMETRYHELPER_H_
45 #include "OSGConfig.h"
46 #include "OSGFileIODef.h"
48 #include "OSGOSBElementBase.h"
49 #include "OSGGeometry.h"
51 #include "OSGNFIOBitPacker.h"
52 #include "OSGNFIOQuantizer.h"
53 #include "OSGOSBGeometryElement.h"
59 /*! \ingroup GrpFileIOOSB
63 class OSG_FILEIO_DLLMAPPING OSBGeometryHelper
65 /*========================== PUBLIC =================================*/
67 /*---------------------------------------------------------------------*/
71 typedef OSBElementBase::BinaryReadHandler BinaryReadHandler
;
72 typedef OSBElementBase::BinaryWriteHandler BinaryWriteHandler
;
75 /*---------------------------------------------------------------------*/
76 /*! \name Reading Helper Functions */
79 void readPackedIntegralPropertyHeader(BinaryReadHandler
*rh
,
84 template <class GeoPropPtrTypeT
>
85 void readPackedIntegralProperty ( BinaryReadHandler
*rh
,
86 const GeoPropPtrTypeT prop
,
87 const UInt32 maxValue
,
88 const UInt32 propSize
,
89 const UInt32 byteSize
);
91 void readQuantizedVectorPropertyHeader(BinaryReadHandler
*rh
,
97 template <class GeoPropPtrTypeT
>
98 void readQuantizedVectorProperty( BinaryReadHandler
*rh
,
99 const GeoPropPtrTypeT prop
,
100 const UInt32 fieldSize
,
101 const UInt8 resolution
,
102 const Real32 minValue
,
103 const Real32 maxValue
,
104 const UInt32 propSize
);
107 /*---------------------------------------------------------------------*/
108 /*! \name Conversion Helper Functions */
111 template <class OutIndexPtrTypeT
, class InIndexPtrTypeT
>
112 void splitMultiIndex(const std::vector
<UInt16
> &indexMapping
,
113 const InIndexPtrTypeT inIndex
,
114 Geometry
* const geo
);
117 /*---------------------------------------------------------------------*/
122 #include "OSGOSBGeometryHelper.inl"
124 #endif /* _OSGOSBGEOMETRYHELPER_H_ */