Now builds on VS 2013
This commit is contained in:
@@ -74,8 +74,7 @@ if ( OPENMESH_BUILD_UNIT_TESTS )
|
||||
else()
|
||||
# Set compiler flags
|
||||
set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" )
|
||||
set_target_properties(unittests_customvec PROPERTIES COMPILE_FLAGS "-g -pedantic -Wno-long-long")
|
||||
|
||||
set_target_properties(unittests_customvec PROPERTIES COMPILE_FLAGS "" )
|
||||
endif()
|
||||
|
||||
if ( OPENMESH_BUILD_SHARED )
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define UNITTESTS_COMMON_DUMMYTRAITS
|
||||
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
|
||||
#include <OpenMesh/Core/Utils/color_cast.hh>
|
||||
#include <array>
|
||||
|
||||
namespace Custom {
|
||||
|
||||
@@ -10,20 +11,13 @@ namespace Custom {
|
||||
template <int DIM> class Vec {
|
||||
public:
|
||||
// Constructor with DIM components
|
||||
template <typename T, typename... Ts,
|
||||
typename = typename std::enable_if<sizeof...(Ts)+1 == DIM>::type,
|
||||
typename = typename std::enable_if<
|
||||
are_convertible_to<float, T, Ts...>::value>::type>
|
||||
constexpr Vec(T v, Ts... vs)
|
||||
: data{{static_cast<float>(v), static_cast<float>(vs)...}} {
|
||||
static_assert(sizeof...(Ts)+1 == DIM,
|
||||
"Invalid number of components specified in constructor.");
|
||||
static_assert(are_convertible_to<float, T, Ts...>::value,
|
||||
"Not all components are convertible to Scalar.");
|
||||
}
|
||||
|
||||
constexpr Vec() = default;
|
||||
constexpr Vec(Vec<DIM> const &) = default;
|
||||
Vec(float x) : data({ x }) {}
|
||||
Vec(float x, float y) : data({ x, y }) {}
|
||||
Vec(float x, float y, float z) : data({ x, y, z }) {}
|
||||
Vec(float x, float y, float z, float w) : data({ x, y, z, w }) {}
|
||||
|
||||
Vec() = default;
|
||||
Vec(Vec<DIM> const &) = default;
|
||||
|
||||
float &operator[](int i) { return data[i]; }
|
||||
float operator[](int i) const { return data[i]; }
|
||||
|
||||
@@ -165,7 +165,7 @@ TEST_F(OpenMeshOthers, CalcDihedralAngre ) {
|
||||
|
||||
// Modify point
|
||||
Mesh::Point tmp = ( Mesh::Point(0.0, 0.0, -1.0) + Mesh::Point(1.0, 1.0, -1.0) )
|
||||
* static_cast<typename OpenMesh::vector_traits<typename Mesh::Point>::value_type>(0.5);
|
||||
* static_cast<OpenMesh::vector_traits<Mesh::Point>::value_type>(0.5);
|
||||
mesh_.point(vhandle[2]) = tmp;
|
||||
|
||||
double difference = fabs( 1.36944 - mesh_.calc_dihedral_angle(eh) );
|
||||
|
||||
Reference in New Issue
Block a user