51#ifndef OPENMESH_SR_RBO_HH
52#define OPENMESH_SR_RBO_HH
57#include <OpenMesh/Core/System/config.h>
59#if defined(OM_CC_MIPS)
68#include <OpenMesh/Core/IO/SR_types.hh>
69#include <OpenMesh/Core/Utils/GenProg.hh>
91template <
size_t N >
inline
101 _val[0] ^= _val[1]; _val[1] ^= _val[0]; _val[0] ^= _val[1];
108 _val[0] ^= _val[3]; _val[3] ^= _val[0]; _val[0] ^= _val[3];
109 _val[1] ^= _val[2]; _val[2] ^= _val[1]; _val[1] ^= _val[2];
116 _val[0] ^= _val[7]; _val[7] ^= _val[0]; _val[0] ^= _val[7];
117 _val[1] ^= _val[6]; _val[6] ^= _val[1]; _val[1] ^= _val[6];
118 _val[2] ^= _val[5]; _val[5] ^= _val[2]; _val[2] ^= _val[5];
119 _val[3] ^= _val[4]; _val[4] ^= _val[3]; _val[3] ^= _val[4];
126 _val[0] ^= _val[11]; _val[11] ^= _val[0]; _val[0] ^= _val[11];
127 _val[1] ^= _val[10]; _val[10] ^= _val[1]; _val[1] ^= _val[10];
128 _val[2] ^= _val[ 9]; _val[ 9] ^= _val[2]; _val[2] ^= _val[ 9];
129 _val[3] ^= _val[ 8]; _val[ 8] ^= _val[3]; _val[3] ^= _val[ 8];
130 _val[4] ^= _val[ 7]; _val[ 7] ^= _val[4]; _val[4] ^= _val[ 7];
131 _val[5] ^= _val[ 6]; _val[ 6] ^= _val[5]; _val[5] ^= _val[ 6];
166 omerr() <<
"Not defined for type " <<
typeid(T).name() << std::endl;
173#if defined(OM_CC_GCC)
179#define REVERSE_FUNDAMENTAL_TYPE( T ) \
180 template <> inline T& reverse_byte_order( T& _t ) {\
181 _reverse_byte_order_N<sizeof(T)>( reinterpret_cast<uint8_t*>(&_t) ); \
193REVERSE_FUNDAMENTAL_TYPE(
unsigned long)
198REVERSE_FUNDAMENTAL_TYPE(
float)
199REVERSE_FUNDAMENTAL_TYPE(
double)
200REVERSE_FUNDAMENTAL_TYPE(
long double)
202#undef REVERSE_FUNDAMENTAL_TYPE
206#define REVERSE_VECTORT_TYPE( T ) \
207 template <> inline T& reverse_byte_order(T& _v) {\
208 for (size_t i; i< T::size_; ++i) \
209 _reverse_byte_order_N< sizeof(T::value_type) >( reinterpret_cast<uint8_t*>(&_v[i])); \
213#define REVERSE_VECTORT_TYPES( N ) \
214 REVERSE_VECTORT_TYPE( Vec##N##c ) \
215 REVERSE_VECTORT_TYPE( Vec##N##uc ) \
216 REVERSE_VECTORT_TYPE( Vec##N##s ) \
217 REVERSE_VECTORT_TYPE( Vec##N##us ) \
218 REVERSE_VECTORT_TYPE( Vec##N##i ) \
219 REVERSE_VECTORT_TYPE( Vec##N##ui ) \
220 REVERSE_VECTORT_TYPE( Vec##N##f ) \
221 REVERSE_VECTORT_TYPE( Vec##N##d ) \
223REVERSE_VECTORT_TYPES(1)
224REVERSE_VECTORT_TYPES(2)
225REVERSE_VECTORT_TYPES(3)
226REVERSE_VECTORT_TYPES(4)
227REVERSE_VECTORT_TYPES(6)
229#undef REVERSE_VECTORT_TYPES
230#undef REVERSE_VECTORT_TYPE
234template <
typename T>
inline
237 compile_timer_error__const_means_const(a);
This file provides the streams omlog, omout, and omerr.
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
T * reverse_byte_order(T *t)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
short int16_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:81
void _reverse_byte_order_N< 16 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:136
void compile_time_error__no_fundamental_type()
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:156
void _reverse_byte_order_N< 1 >(uint8_t *)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:95
void _reverse_byte_order_N< 8 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:114
unsigned char uchar
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:76
void _reverse_byte_order_N< 12 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:124
unsigned long long uint64_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:89
unsigned int uint32_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:85
void _reverse_byte_order_N(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
void _reverse_byte_order_N< 4 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:106
long long int64_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:89
void _reverse_byte_order_N< 2 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:99
unsigned short uint16_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:81
int int32_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:85
unsigned char uint8_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:80