fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / OSB / OSGOSBGeometryHelper.h
blob47478d0a60121305ee226bfbcd2da096578e694a
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 _OSGOSBGEOMETRYHELPER_H_
40 #define _OSGOSBGEOMETRYHELPER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
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"
55 #include <vector>
57 OSG_BEGIN_NAMESPACE
59 /*! \ingroup GrpFileIOOSB
60 \nohierarchy
63 class OSG_FILEIO_DLLMAPPING OSBGeometryHelper
65 /*========================== PUBLIC =================================*/
66 public:
67 /*---------------------------------------------------------------------*/
68 /*! \name Types */
69 /*! \{ */
71 typedef OSBElementBase::BinaryReadHandler BinaryReadHandler;
72 typedef OSBElementBase::BinaryWriteHandler BinaryWriteHandler;
74 /*! \} */
75 /*---------------------------------------------------------------------*/
76 /*! \name Reading Helper Functions */
77 /*! \{ */
79 void readPackedIntegralPropertyHeader(BinaryReadHandler *rh,
80 UInt32 &maxValue,
81 UInt32 &propSize,
82 UInt32 &byteSize );
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,
92 UInt8 &resolution,
93 Real32 &minValue,
94 Real32 &maxValue,
95 UInt32 &propSize );
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 );
106 /*! \} */
107 /*---------------------------------------------------------------------*/
108 /*! \name Conversion Helper Functions */
109 /*! \{ */
111 template <class OutIndexPtrTypeT, class InIndexPtrTypeT>
112 void splitMultiIndex(const std::vector<UInt16> &indexMapping,
113 const InIndexPtrTypeT inIndex,
114 Geometry * const geo );
116 /*! \} */
117 /*---------------------------------------------------------------------*/
120 OSG_END_NAMESPACE
122 #include "OSGOSBGeometryHelper.inl"
124 #endif /* _OSGOSBGEOMETRYHELPER_H_ */