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>
85template <
typename src_t,
typename dst_t,
int n>
86inline void vector_cast(
const src_t &_src, dst_t &_dst, GenProg::Int2Type<n> )
93template <
typename src_t,
typename dst_t>
94inline void vector_cast(
const src_t & , dst_t & , GenProg::Int2Type<0> )
99template <
typename src_t,
typename dst_t,
int n>
100inline void vector_copy(
const src_t &_src, dst_t &_dst, GenProg::Int2Type<n> )
104 _dst[n-1] = _src[n-1];
107template <
typename src_t,
typename dst_t>
108inline void vector_copy(
const src_t & , dst_t & , GenProg::Int2Type<0> )
115#ifndef DOXY_IGNORE_THIS
117template <
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)
131template <
typename dst_t>
132struct vector_caster<dst_t,dst_t>
134 typedef const dst_t& return_type;
136 inline static return_type cast(
const dst_t& _src)
148template <
typename dst_t,
typename src_t>
150typename vector_caster<dst_t, src_t>::return_type
153 return vector_caster<dst_t, src_t>::cast(_src);
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
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
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
T::value_type value_type
Type of the scalar value.
Definition vector_traits.hh:99
static const size_t size_
size/dimension of the vector
Definition vector_traits.hh:102