Merge branch 'fix_warnings' into 'master'

Fix warnings

See merge request OpenMesh/OpenMesh!242
This commit is contained in:
Jan Möbius
2019-12-10 10:28:38 +01:00
9 changed files with 77 additions and 79 deletions

View File

@@ -206,7 +206,6 @@ _OBJWriter_::
write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const
{
unsigned int idx;
size_t nV, nF;
Vec3f v, n;
Vec2f t;
VertexHandle vh;

View File

@@ -40,11 +40,7 @@ bool _VTKWriter_::write(const std::string& _filename, BaseExporter& _be, Options
bool _VTKWriter_::write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const
{
Vec3f n;
Vec2f t;
VertexHandle vh;
OpenMesh::Vec3f c;
OpenMesh::Vec4f cA;
// check exporter features
if (!check(_be, _opt)) {

View File

@@ -43,7 +43,6 @@ TEST_F(OpenMeshMultipleChoiceDecimater, DecimateMesh) {
typedef OpenMesh::Decimater::McDecimaterT< Mesh > Decimater;
typedef OpenMesh::Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
typedef OpenMesh::Decimater::ModNormalFlippingT< Mesh >::Handle HModNormal;
Decimater decimaterDBG(mesh_);
HModQuadric hModQuadricDBG;
@@ -67,7 +66,6 @@ TEST_F(OpenMeshMultipleChoiceDecimater, DecimateMeshToFaceVerticesLimit) {
typedef OpenMesh::Decimater::McDecimaterT< Mesh > Decimater;
typedef OpenMesh::Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
typedef OpenMesh::Decimater::ModNormalFlippingT< Mesh >::Handle HModNormal;
Decimater decimaterDBG(mesh_);
HModQuadric hModQuadricDBG;
@@ -91,7 +89,6 @@ TEST_F(OpenMeshMultipleChoiceDecimater, DecimateMeshToFaceFaceLimit) {
typedef OpenMesh::Decimater::McDecimaterT< Mesh > Decimater;
typedef OpenMesh::Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
typedef OpenMesh::Decimater::ModNormalFlippingT< Mesh >::Handle HModNormal;
Decimater decimaterDBG(mesh_);
HModQuadric hModQuadricDBG;

View File

@@ -43,7 +43,6 @@ TEST_F(OpenMeshMixedDecimater, DecimateMesh80PercentMc) {
typedef OpenMesh::Decimater::MixedDecimaterT< Mesh > Decimater;
typedef OpenMesh::Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
typedef OpenMesh::Decimater::ModNormalFlippingT< Mesh >::Handle HModNormal;
Decimater decimaterDBG(mesh_);
HModQuadric hModQuadricDBG;
@@ -67,7 +66,6 @@ TEST_F(OpenMeshMixedDecimater, DecimateMeshToFaceVerticesLimit) {
typedef OpenMesh::Decimater::MixedDecimaterT< Mesh > Decimater;
typedef OpenMesh::Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
typedef OpenMesh::Decimater::ModNormalFlippingT< Mesh >::Handle HModNormal;
Decimater decimaterDBG(mesh_);
HModQuadric hModQuadricDBG;
@@ -91,7 +89,6 @@ TEST_F(OpenMeshMixedDecimater, DecimateMeshToFaceFaceLimit) {
typedef OpenMesh::Decimater::MixedDecimaterT< Mesh > Decimater;
typedef OpenMesh::Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
typedef OpenMesh::Decimater::ModNormalFlippingT< Mesh >::Handle HModNormal;
Decimater decimaterDBG(mesh_);
HModQuadric hModQuadricDBG;

View File

@@ -234,9 +234,9 @@ TEST_F(OpenMeshPropertyManager, property_move_construction) {
for (auto vh : mesh_.vertices())
prop1[vh] = vh.idx()*2-13;
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
auto prop2 = std::move(prop1);
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "move constructing property from temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_FALSE(prop1.isValid()) << "prop1 should have been invalidated";
@@ -250,9 +250,9 @@ TEST_F(OpenMeshPropertyManager, property_move_construction) {
for (auto vh : mesh_.vertices())
prop1[vh] = vh.idx()*2-13;
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
auto prop2 = std::move(prop1); // prop1 and prop2 should refere to the same property
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "move constructing from named took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named properties cannot be invalidated";
@@ -285,9 +285,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property temporary to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Temporary property got destroyed";
@@ -309,9 +309,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property temporary to named took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Temporary property got destroyed";
@@ -334,9 +334,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) {
for (auto vh : mesh_.vertices())
prop1[vh] = vh.idx()*2-13;
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property named to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
prop1.set_range(mesh_.vertices(), 0);
@@ -357,9 +357,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property named to named with different name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
prop1.set_range(mesh_.vertices(), 0);
@@ -378,9 +378,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_same_mesh) {
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1; // this should be a no op
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property named to named with same name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
@@ -423,9 +423,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // this should be cheap
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property temporary to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_FALSE(prop1.isValid()) << "prop1 not invalidated after moving";
@@ -445,9 +445,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1);
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property temporary to named took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_FALSE(prop1.isValid()) << "prop1 not invalidated after moving";
@@ -468,9 +468,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) {
for (auto vh : mesh_.vertices())
prop1[vh] = vh.idx()*2-13;
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // moving named properties will not invalidate the property and will copy the data
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property named to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named prop1 should not be invalidated by moving";
@@ -493,9 +493,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // moving named properties will not invalidate the property and will copy the data
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property named to named with different name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named prop1 should not be invalidated by moving";
@@ -516,9 +516,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_same_mesh) {
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // this should be a no op
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property named to named with same name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named prop1 should not be invalidated by moving";
@@ -559,9 +559,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property temporary to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Temporary property got destroyed";
@@ -584,9 +584,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property temporary to named took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Temporary property got destroyed";
@@ -609,9 +609,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) {
for (auto vh : mesh_.vertices())
prop1[vh] = vh.idx()*2-13;
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property named to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
prop1.set_range(mesh_.vertices(), 0);
@@ -632,9 +632,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1;
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property named to named with different name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
prop1.set_range(mesh_.vertices(), 0);
@@ -652,9 +652,9 @@ TEST_F(OpenMeshPropertyManager, property_copying_different_mesh) {
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = prop1; // this should be a no op
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "copying property named to named with same name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
@@ -693,9 +693,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_different_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // this should be cheap
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property temporary to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_FALSE(prop1.isValid()) << "prop1 not invalidated after moving";
@@ -716,9 +716,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_different_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1);
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property temporary to named took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_FALSE(prop1.isValid()) << "prop1 not invalidated after moving";
@@ -739,9 +739,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_different_mesh) {
for (auto vh : mesh_.vertices())
prop1[vh] = vh.idx()*2-13;
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // moving named properties will not invalidate the property and will copy the data
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property named to temporary took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named prop1 should not be invalidated by moving";
@@ -764,9 +764,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_different_mesh) {
EXPECT_EQ(prop2[OpenMesh::VertexHandle(0)], 0) << "Property not initialized correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // moving named properties will not invalidate the property and will copy the data
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property named to named with different name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named prop1 should not be invalidated by moving";
@@ -789,9 +789,9 @@ TEST_F(OpenMeshPropertyManager, property_moving_different_mesh) {
EXPECT_EQ(prop1[OpenMesh::VertexHandle(0)], -13) << "Property not copied correctly";
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
prop2 = std::move(prop1); // should copy
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "moving property named to named with same name took " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
EXPECT_TRUE(prop1.isValid()) << "named prop1 should not be invalidated by moving";
@@ -840,13 +840,13 @@ TEST_F(OpenMeshPropertyManager, temporary_property_on_const_mesh) {
OpenMesh::VProp<int> get_id_prop(const OpenMesh::PolyConnectivity& mesh)
{
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
auto id_prop = OpenMesh::VProp<int>(mesh);
for (auto vh : mesh.vertices())
id_prop(vh) = vh.idx();
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "Time spend in function: " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
return id_prop;
@@ -857,9 +857,9 @@ TEST_F(OpenMeshPropertyManager, return_property_from_function) {
for (int i = 0; i < N_VERTICES_TIMING; ++i)
mesh_.add_vertex(Mesh::Point());
auto t_start = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_start = std::chrono::high_resolution_clock::now();)
auto id_p = get_id_prop(mesh_);
auto t_end = std::chrono::high_resolution_clock::now();
TIMING_OUTPUT(auto t_end = std::chrono::high_resolution_clock::now();)
TIMING_OUTPUT(std::cout << "Time spend around function " << std::chrono::duration_cast<std::chrono::milliseconds>(t_end-t_start).count() << "ms" << std::endl;)
for (auto vh : mesh_.vertices())

View File

@@ -469,9 +469,9 @@ TEST_F(OpenMeshSmartHandles, MixOldAndNew)
for (OpenMesh::SmartHalfedgeHandle heh : mesh_.halfedges())
{
heh = mesh_.opposite_halfedge_handle(heh);
OpenMesh::SmartEdgeHandle eh = OpenMesh::PolyConnectivity::s_edge_handle(heh);
OpenMesh::SmartEdgeHandle eh2 = mesh_.edge_handle(heh);
OpenMesh::SmartFaceHandle fh = mesh_.face_handle(heh);
EXPECT_TRUE((std::is_same<OpenMesh::SmartEdgeHandle, decltype(OpenMesh::PolyConnectivity::s_edge_handle(heh))>::value));
EXPECT_TRUE((std::is_same<OpenMesh::SmartEdgeHandle, decltype(mesh_.edge_handle(heh))>::value));
EXPECT_TRUE((std::is_same<OpenMesh::SmartFaceHandle, decltype(mesh_.face_handle(heh))>::value));
}
}
@@ -552,10 +552,11 @@ TEST(OpenMeshSmartHandlesNoFixture, SplitTriMesh)
auto p = (MyMesh::Point());
OpenMesh::SmartVertexHandle vh = mesh.split(fh, p);
OpenMesh::SmartEdgeHandle eh = fh.halfedge().edge();
OpenMesh::SmartVertexHandle vh2 = mesh.split(eh, p);
EXPECT_NE(vh.idx(), vh2.idx()) << "This was only intended to fix an unused variable warning but cool that it caugth an actual error now";
}

View File

@@ -225,12 +225,12 @@ TEST_F(OpenMeshSmartRanges, ToVector)
auto tri_uvs = fh.halfedges().to_vector(uvs);
auto heh_handles = fh.halfedges().to_vector();
for (auto heh : heh_handles)
auto n = heh.next();
heh.next();
}
auto vertex_vec = mesh_.vertices().to_vector();
for (auto vh : vertex_vec)
auto heh = vh.out();
vh.out();
}
/* Test to array
@@ -244,8 +244,8 @@ TEST_F(OpenMeshSmartRanges, ToArray)
for (auto fh : mesh_.faces())
{
auto tri_uvs = fh.halfedges().to_array<3>(uvs);
auto heh_handles = fh.halfedges().to_array<3>();
fh.halfedges().to_array<3>(uvs);
fh.halfedges().to_array<3>();
}
}
@@ -263,7 +263,7 @@ TEST_F(OpenMeshSmartRanges, BoundingBox)
auto bb_min = mesh_.vertices().min(myPos);
auto bb_max = mesh_.vertices().max(myPos);
auto bb = mesh_.vertices().minmax(myPos);
mesh_.vertices().minmax(myPos);
EXPECT_LT(norm(bb_min - OpenMesh::Vec3f(-1,-1,-1)), 0.000001) << "Bounding box minimum seems off";
EXPECT_LT(norm(bb_max - OpenMesh::Vec3f( 1, 1, 1)), 0.000001) << "Bounding box maximum seems off";
@@ -275,8 +275,8 @@ TEST_F(OpenMeshSmartRanges, BoundingBox)
for (auto fh : mesh_.faces())
{
auto uv_bb_min = fh.halfedges().min(uvs);
auto uv_bb_max = fh.halfedges().max(uvs);
fh.halfedges().min(uvs);
fh.halfedges().max(uvs);
}
}

View File

@@ -127,7 +127,7 @@ TEST_F(OpenMeshSplitEdgeCopyPolyMesh, SplitEdgeCopyPolymesh) {
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[3]);
PolyMesh::FaceHandle fh = mesh_.add_face(face_vhandles);
mesh_.add_face(face_vhandles);
PolyMesh::EdgeHandle eh = *mesh_.edges_begin();
// Test setup:

View File

@@ -904,11 +904,13 @@ TEST_F(OpenMeshIterators, RangeIterators) {
int count_faces_range = 0;
for (auto fh : mesh_.faces())
if (fh.is_valid()) // not actually necessary but fixes unused variable warning
++count_faces_range;
EXPECT_EQ(1, count_faces_range) << "Wrong number of visited faces.";
int count_faces_range_all = 0;
for (auto fh : mesh_.all_faces())
if (fh.is_valid()) // not actually necessary but fixes unused variable warning
++count_faces_range_all;
EXPECT_EQ(2, count_faces_range_all) << "Wrong number of visited faces.";
@@ -927,11 +929,13 @@ TEST_F(OpenMeshIterators, RangeIterators) {
int count_edges_range = 0;
for (auto eh : mesh_.edges())
if (eh.is_valid()) // not actually necessary but fixes unused variable warning
++count_edges_range;
EXPECT_EQ(3, count_edges_range) << "Wrong number of visited edges.";
int count_edges_range_all = 0;
for (auto eh : mesh_.all_edges())
if (eh.is_valid()) // not actually necessary but fixes unused variable warning
++count_edges_range_all;
EXPECT_EQ(5, count_edges_range_all) << "Wrong number of visited edges.";
@@ -950,11 +954,13 @@ TEST_F(OpenMeshIterators, RangeIterators) {
int count_halfedges_range = 0;
for (auto heh : mesh_.halfedges())
if (heh.is_valid()) // not actually necessary but fixes unused variable warning
++count_halfedges_range;
EXPECT_EQ(6, count_halfedges_range) << "Wrong number of visited halfedges.";
int count_halfedges_range_all = 0;
for (auto heh : mesh_.all_halfedges())
if (heh.is_valid()) // not actually necessary but fixes unused variable warning
++count_halfedges_range_all;
EXPECT_EQ(10, count_halfedges_range_all) << "Wrong number of visited halfedges.";
@@ -973,11 +979,13 @@ TEST_F(OpenMeshIterators, RangeIterators) {
int count_vertices_range = 0;
for (auto vh : mesh_.vertices())
if (vh.is_valid()) // not actually necessary but fixes unused variable warning
++count_vertices_range;
EXPECT_EQ(3, count_vertices_range) << "Wrong number of visited vertices.";
int count_vertices_range_all = 0;
for (auto vh : mesh_.all_vertices())
if (vh.is_valid()) // not actually necessary but fixes unused variable warning
++count_vertices_range_all;
EXPECT_EQ(4, count_vertices_range_all) << "Wrong number of visited vertices.";