52 #define OPENMESH_IO_OMFORMAT_CC 57 #include <OpenMesh/Core/IO/OMFormat.hh> 67 template<
typename T >
69 store( std::ostream& _os,
71 OMFormat::Chunk::Integer_Size _b,
75 assert( OMFormat::is_integer( _val ) );
79 case OMFormat::Chunk::Integer_8:
81 OMFormat::int8 v =
static_cast<OMFormat::int8
>(_val);
82 return store( _os, v, _swap );
84 case OMFormat::Chunk::Integer_16:
86 OMFormat::int16 v =
static_cast<OMFormat::int16
>(_val);
87 return store( _os, v, _swap );
89 case OMFormat::Chunk::Integer_32:
91 OMFormat::int32 v =
static_cast<OMFormat::int32
>(_val);
92 return store( _os, v, _swap );
94 case OMFormat::Chunk::Integer_64:
96 OMFormat::int64 v =
static_cast<OMFormat::int64
>(_val);
97 return store( _os, v, _swap );
105 template<
typename T >
107 store( std::ostream& _os,
109 OMFormat::Chunk::Integer_Size _b,
113 assert( OMFormat::is_integer( _val ) );
117 case OMFormat::Chunk::Integer_8:
119 OMFormat::uint8 v =
static_cast<OMFormat::uint8
>(_val);
120 return store( _os, v, _swap );
122 case OMFormat::Chunk::Integer_16:
124 OMFormat::uint16 v =
static_cast<OMFormat::uint16
>(_val);
125 return store( _os, v, _swap );
127 case OMFormat::Chunk::Integer_32:
129 OMFormat::uint32 v =
static_cast<OMFormat::uint32
>(_val);
130 return store( _os, v, _swap );
133 case OMFormat::Chunk::Integer_64:
135 OMFormat::uint64 v =
static_cast<OMFormat::uint64
>(_val);
136 return store( _os, v, _swap );
144 template<
typename T >
146 restore( std::istream& _is,
148 OMFormat::Chunk::Integer_Size _b,
152 assert( OMFormat::is_integer( _val ) );
157 case OMFormat::Chunk::Integer_8:
160 bytes = restore( _is, v, _swap );
161 _val =
static_cast<T
>(v);
164 case OMFormat::Chunk::Integer_16:
167 bytes = restore( _is, v, _swap );
168 _val =
static_cast<T
>(v);
171 case OMFormat::Chunk::Integer_32:
174 bytes = restore( _is, v, _swap );
175 _val =
static_cast<T
>(v);
178 case OMFormat::Chunk::Integer_64:
181 bytes = restore( _is, v, _swap );
182 _val =
static_cast<T
>(v);
191 template<
typename T >
193 restore( std::istream& _is,
195 OMFormat::Chunk::Integer_Size _b,
199 assert( OMFormat::is_integer( _val ) );
204 case OMFormat::Chunk::Integer_8:
207 bytes = restore( _is, v, _swap );
208 _val =
static_cast<T
>(v);
211 case OMFormat::Chunk::Integer_16:
214 bytes = restore( _is, v, _swap );
215 _val =
static_cast<T
>(v);
218 case OMFormat::Chunk::Integer_32:
221 bytes = restore( _is, v, _swap );
222 _val =
static_cast<T
>(v);
226 case OMFormat::Chunk::Integer_64:
229 bytes = restore( _is, v, _swap );
230 _val =
static_cast<T
>(v);
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59