57 #ifndef OPENMESH_VECTORCAST_HH
58 #define OPENMESH_VECTORCAST_HH
64 #include <OpenMesh/Core/System/config.h>
65 #include <OpenMesh/Core/Utils/vector_traits.hh>
66 #include <OpenMesh/Core/Utils/GenProg.hh>
67 #include <OpenMesh/Core/Geometry/VectorT.hh>
85 template <
typename src_t,
typename dst_t,
int n>
86 inline void vector_cast(
const src_t &_src, dst_t &_dst, GenProg::Int2Type<n> )
93 template <
typename src_t,
typename dst_t>
94 inline void vector_cast(
const src_t & , dst_t & , GenProg::Int2Type<0> )
99 template <
typename src_t,
typename dst_t,
int n>
100 inline void vector_copy(
const src_t &_src, dst_t &_dst, GenProg::Int2Type<n> )
104 _dst[n-1] = _src[n-1];
107 template <
typename src_t,
typename dst_t>
108 inline void vector_copy(
const src_t & , dst_t & , GenProg::Int2Type<0> )
115 #ifndef DOXY_IGNORE_THIS
117 template <
typename dst_t,
typename src_t>
120 typedef dst_t return_type;
122 inline static return_type cast(
const src_t& _src)
125 vector_cast(_src, dst, GenProg::Int2Type<vector_traits<dst_t>::size_>());
130 #if !defined(OM_CC_MSVC)
131 template <
typename dst_t>
132 struct vector_caster<dst_t,dst_t>
134 typedef const dst_t& return_type;
136 inline static return_type cast(
const dst_t& _src)
148 template <
typename dst_t,
typename src_t>
150 typename vector_caster<dst_t, src_t>::return_type
153 return vector_caster<dst_t, src_t>::cast(_src);
163 #endif // OPENMESH_MESHREADER_HH defined
T::value_type value_type
Type of the scalar value.
Definition: vector_traits.hh:99
Helper class providing information about a vector type.
Definition: vector_traits.hh:93
void vector_cast(const src_t &_src, dst_t &_dst, GenProg::Int2Type< n >)
Cast vector type to another vector type by copying the vector elements.
Definition: vector_cast.hh:86
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
void vector_copy(const src_t &_src, dst_t &_dst, GenProg::Int2Type< n >)
Cast vector type to another vector type by copying the vector elements.
Definition: vector_cast.hh:100