Commit c373d3ef authored by Jan Möbius's avatar Jan Möbius

Merge branch 'adjust-compiler-warnings' into 'master'

cmake compiler flag cleanup, enable many clang warnings and fix them

See merge request !63
parents bdd674be d37341fb
Pipeline #10598 passed with stage
in 3 minutes and 58 seconds
......@@ -4,10 +4,12 @@
if (UNIX)
set ( ADDITIONAL_CXX_FLAGS )
set ( ADDITIONAL_CXX_DEBUG_FLAGS )
set ( ADDITIONAL_CXX_RELEASE_FLAGS )
set ( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS )
set ( ADDITIONAL_C_FLAGS )
set ( ADDITIONAL_C_DEBUG_FLAGS )
set ( ADDITIONAL_C_RELEASE_FLAGS )
set ( ADDITIONAL_C_RELWITHDEBINFO_FLAGS )
......@@ -17,29 +19,15 @@ if (UNIX)
################################################################################
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_FLAGS "-DINCLUDE_TEMPLATES" )
# Increase the template depth as this might be exceeded from time to time
IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-ftemplate-depth-100" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-ftemplate-depth-100" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-ftemplate-depth-100" )
list(APPEND ADDITIONAL_CXX_FLAGS "-ftemplate-depth-100" )
ENDIF()
################################################################################
# OS Defines
################################################################################
if (APPLE)
add_definitions( -DARCH_DARWIN )
endif()
################################################################################
# Build/Release Defines
......@@ -59,21 +47,23 @@ if (UNIX)
################################################################################
IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_CXX_FLAGS "-W" "-Wall" "-Wno-unused" )
list(APPEND ADDITIONAL_C_FLAGS "-W" "-Wall" "-Wno-unused" )
ENDIF()
if (APPLE)
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-Wno-non-virtual-dtor" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-Wno-non-virtual-dtor" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-Wno-non-virtual-dtor" )
endif ()
if ("${CMAKE_CXX_COMPILER}" MATCHES ".*clang.*")
list(APPEND ADDITIONAL_CXX_FLAGS "-Weverything")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-padded")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-old-style-cast")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-documentation-unknown-command")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-unreachable-code-return")
# enable later:
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-sign-conversion")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-deprecated")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-weak-vtables")
endif()
################################################################################
# STL Vector checks
################################################################################
......@@ -101,43 +91,49 @@ if (UNIX)
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_DEBUG_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_DEBUG_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_RELEASE_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELEASE_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
# Add the debug flags
foreach( flag ${ADDITIONAL_C_DEBUG_FLAGS} )
if( NOT CMAKE_C_FLAGS_DEBUG MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_DEBUG_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_C_RELEASE_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELEASE MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELEASE_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
......
......@@ -58,9 +58,6 @@ public:
toVertex_(_toVertex) {
}
virtual ~OpenVolumeMeshEdge() {
}
const VertexHandle from_vertex() const {
return fromVertex_;
}
......@@ -94,9 +91,6 @@ public:
halfedges_(_halfedges) {
}
virtual ~OpenVolumeMeshFace() {
}
const std::vector<HalfEdgeHandle>& halfedges() const & {
return halfedges_;
}
......@@ -128,9 +122,6 @@ public:
halffaces_(_halffaces) {
}
virtual ~OpenVolumeMeshCell() {
}
const std::vector<HalfFaceHandle>& halffaces() const & {
return halffaces_;
}
......
......@@ -8,9 +8,6 @@ class BaseProperty;
template <class T>
class OpenVolumeMeshPropertyT;
template <class E, typename >
class PropHandleT;
template <class PropT, typename Entity>
class PropertyPtr;
......
......@@ -54,7 +54,7 @@ public:
GeometryKernel() = default;
/// Destructor
~GeometryKernel() = default;
~GeometryKernel() override = default;
template<class OtherTopoKernel>
void assign(const GeometryKernel<VecT, OtherTopoKernel> *other) {
......
......@@ -73,8 +73,8 @@ public:
valid_(true), mesh_(_mesh) {}
// STL compliance (needs to have default constructor)
BaseIterator() : valid_(false), mesh_(0) {}
virtual ~BaseIterator() {}
BaseIterator() : valid_(false), mesh_(nullptr) {}
virtual ~BaseIterator() = default;
bool operator== (const BaseIterator& _c) const {
return (this->cur_handle_ == _c.cur_handle() &&
this->valid_ == _c.valid() &&
......@@ -185,7 +185,7 @@ public:
max_laps_(1)
{}
virtual ~BaseCirculator() {}
virtual ~BaseCirculator() = default;
bool operator== (const BaseCirculator& _c) const {
return (BaseIter::operator==(_c) &&
......
......@@ -41,7 +41,7 @@
#include "OpenVolumeMeshHandle.hh"
//== CLASS DEFINITION =========================================================
namespace OpenVolumeMesh {
/** \class OpenVolumeMeshBaseProperty
......@@ -49,8 +49,6 @@
**/
namespace OpenVolumeMesh {
class OpenVolumeMeshBaseProperty {
public:
......
......@@ -44,7 +44,7 @@ bool operator==(const int& _lhs, const OpenVolumeMeshHandle& _rhs) {
bool operator==(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs) {
return _lhs == (unsigned int)_rhs.idx();
return _lhs == _rhs.uidx();
}
bool operator!=(const int& _lhs, const OpenVolumeMeshHandle& _rhs) {
......
......@@ -50,7 +50,7 @@ namespace OpenVolumeMesh {
class OpenVolumeMeshHandle {
public:
// Default constructor
explicit OpenVolumeMeshHandle(int _idx) : idx_(_idx) {}
explicit constexpr OpenVolumeMeshHandle(int _idx) : idx_(_idx) {}
OpenVolumeMeshHandle& operator=(int _idx) {
idx_ = _idx;
......@@ -90,14 +90,24 @@ private:
int idx_;
};
template<typename EntityTag,
typename = typename std::enable_if<is_entity<EntityTag>::value>::type>
class PropHandleTag {};
template <typename T> struct is_prop_handle_tag : std::false_type {};
template<typename T>
struct is_prop_handle_tag<PropHandleTag<T>> : std::true_type {};
template<typename T>
using is_handle_tag = std::enable_if<is_entity<T>::value || is_prop_handle_tag<T>::value>;
template<typename EntityTag, typename = typename is_handle_tag<EntityTag>::type>
class HandleT : public OpenVolumeMeshHandle
{
public:
using Entity = EntityTag;
explicit HandleT(int _idx = -1) : OpenVolumeMeshHandle(_idx) {}
explicit constexpr HandleT(int _idx = -1) : OpenVolumeMeshHandle(_idx) {}
static HandleT<EntityTag>
from_unsigned(size_t _idx)
......
......@@ -40,14 +40,8 @@
namespace OpenVolumeMesh {
template<typename EntityTag,
typename = typename std::enable_if<is_entity<EntityTag>::value>::type>
class PropHandleT : public OpenVolumeMeshHandle
{
public:
using Entity = EntityTag;
using OpenVolumeMeshHandle::OpenVolumeMeshHandle;
};
template<typename EntityTag>
using PropHandleT = HandleT<PropHandleTag<EntityTag>>;
using VertexPropHandle = PropHandleT<Entity::Vertex>;
using EdgePropHandle = PropHandleT<Entity::Edge>;
......
......@@ -100,7 +100,7 @@ protected:
{
PropIterator p_iter = _begin;
for (; p_iter != _end; ++p_iter)
(*p_iter)->swap_elements(_h1.idx(), _h2.idx());
(*p_iter)->swap_elements(_h1.uidx(), _h2.uidx());
}
......@@ -237,10 +237,10 @@ private:
{
if((*it)->name() == _name )
{
#if OVM_FORCE_STATIC_CAST
#if defined OVM_FORCE_STATIC_CAST && OVM_FORCE_STATIC_CAST
return true;
#else
if(dynamic_cast<FullPropT*>(*it) != NULL)
if(dynamic_cast<FullPropT*>(*it) != nullptr)
{
return true;
}
......
......@@ -32,14 +32,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#define RESOURCEMANAGERT_CC
#include "ResourceManager.hh"
......@@ -107,7 +99,7 @@ PropT ResourceManager::internal_request_property(StdVecT& _vec, const std::strin
}
}
HandleT handle((int)_vec.size());
auto handle = HandleT::from_unsigned(_vec.size());
PropT* prop = new PropT(_name, type_name, *this, handle, _def);
prop->resize(_size);
......@@ -200,7 +192,7 @@ void ResourceManager::entity_deleted(StdVecT& _vec, const OpenVolumeMeshHandle&
for(typename StdVecT::iterator it = _vec.begin();
it != _vec.end(); ++it) {
(*it)->delete_element(_h.idx());
(*it)->delete_element(_h.uidx());
}
}
......@@ -219,7 +211,7 @@ void ResourceManager::updatePropHandles(StdVecT &_vec)
{
size_t n = _vec.size();
for(size_t i = 0; i < n; ++i) {
_vec[i]->set_handle(OpenVolumeMeshHandle((int)i));
_vec[i]->set_handle(OpenVolumeMeshHandle(static_cast<int>(i)));
}
}
......
......@@ -57,7 +57,7 @@ std::ostream& serialize(std::ostream& _ostr, const std::string& _rhs)
std::istream& deserialize(std::istream& _istr, std::string& _rhs)
{
int len;
size_t len;
char delimiter;
_istr >> len; //deserialize size of string
_istr >> delimiter;
......
......@@ -65,7 +65,7 @@ private:
template<class U> static false_type test(...);
public:
enum { bool_value = sizeof(true_type) == sizeof(test<T>(0)) };
enum { bool_value = sizeof(true_type) == sizeof(test<T>(nullptr)) };
typedef bool_type<bool_value> type;
static type value;
};
......@@ -82,7 +82,7 @@ private:
template<class U> static false_type test(...);
public:
enum { bool_value = sizeof(true_type) == sizeof(test<T>(0)) };
enum { bool_value = sizeof(true_type) == sizeof(test<T>(nullptr)) };
typedef bool_type<bool_value> type;
static type value;
};
......
......@@ -252,14 +252,12 @@ FaceHandle TopologyKernel::add_face(const std::vector<VertexHandle>& _vertices)
// Swap halfedge if edge already existed and
// has been initially defined in reverse orientation
int swap = 0;
if(edge(e_idx).to_vertex() == *it) swap = 1;
char swap = edge(e_idx).to_vertex() == *it;
halfedges.push_back(halfedge_handle(e_idx, swap));
}
EdgeHandle e_idx = add_edge(*it, *_vertices.begin());
int swap = 0;
if(edge(e_idx).to_vertex() == *it) swap = 1;
char swap = edge(e_idx).to_vertex() == *it;
halfedges.push_back(halfedge_handle(e_idx, swap));
// Add face
......
......@@ -462,7 +462,7 @@ public:
/// Get valence of vertex (number of incident edges)
inline size_t valence(const VertexHandle& _vh) const {
assert(has_vertex_bottom_up_incidences());
assert(_vh.is_valid() && (size_t)_vh.idx() < outgoing_hes_per_vertex_.size());
assert(_vh.is_valid() && _vh.uidx() < outgoing_hes_per_vertex_.size());
return outgoing_hes_per_vertex_[_vh.idx()].size();
}
......@@ -470,22 +470,22 @@ public:
/// Get valence of edge (number of incident faces)
inline size_t valence(const EdgeHandle& _eh) const {
assert(has_edge_bottom_up_incidences());
assert(_eh.is_valid() && (size_t)_eh.idx() < edges_.size());
assert((size_t)halfedge_handle(_eh, 0).idx() < incident_hfs_per_he_.size());
assert(_eh.is_valid() && _eh.uidx() < edges_.size());
assert(halfedge_handle(_eh, 0).uidx() < incident_hfs_per_he_.size());
return incident_hfs_per_he_[halfedge_handle(_eh, 0).idx()].size();
}
/// Get valence of face (number of incident edges)
inline size_t valence(const FaceHandle& _fh) const {
assert(_fh.is_valid() && (size_t)_fh.idx() < faces_.size());
assert(_fh.is_valid() && _fh.uidx() < faces_.size());
return face(_fh).halfedges().size();
}
/// Get valence of cell (number of incident faces)
inline size_t valence(const CellHandle& _ch) const {
assert(_ch.is_valid() && (size_t)_ch.idx() < cells_.size());
assert(_ch.is_valid() && _ch.uidx() < cells_.size());
return cell(_ch).halffaces().size();
}
......@@ -581,7 +581,7 @@ protected:
he_end = hes.end(); he_it != he_end; ++he_it) {
EdgeHandle eh = edge_handle(*he_it);
unsigned char opp = (he_it->idx() - halfedge_handle(eh, 0).idx());
unsigned char opp = he_it->idx() == halfedge_handle(eh, 1).idx();
*he_it = halfedge_handle(EdgeHandle(newIndices_[eh.idx()]), opp);
}
_face.set_halfedges(hes);
......@@ -601,7 +601,7 @@ protected:
hf_end = hfs.end(); hf_it != hf_end; ++hf_it) {
FaceHandle fh = face_handle(*hf_it);
unsigned char opp = (hf_it->idx() - halfface_handle(fh, 0).idx());
unsigned char opp = hf_it->idx() == halfface_handle(fh, 1).idx();
*hf_it = halfface_handle(FaceHandle(newIndices_[fh.idx()]), opp);
}
_cell.set_halffaces(hfs);
......@@ -820,14 +820,14 @@ public:
bool is_boundary(const HalfFaceHandle& _halfFaceHandle) const {
assert(_halfFaceHandle.is_valid() && (size_t)_halfFaceHandle.idx() < faces_.size() * 2u);
assert(_halfFaceHandle.is_valid() && _halfFaceHandle.uidx() < faces_.size() * 2u);
assert(has_face_bottom_up_incidences());
assert((size_t)_halfFaceHandle.idx() < incident_cell_per_hf_.size());
assert(_halfFaceHandle.uidx() < incident_cell_per_hf_.size());
return incident_cell_per_hf_[_halfFaceHandle.idx()] == InvalidCellHandle;
}
bool is_boundary(const FaceHandle& _faceHandle) const {
assert(_faceHandle.is_valid() && (size_t)_faceHandle.idx() < faces_.size());
assert(_faceHandle.is_valid() && _faceHandle.uidx() < faces_.size());
assert(has_face_bottom_up_incidences());
return is_boundary(halfface_handle(_faceHandle, 0)) ||
is_boundary(halfface_handle(_faceHandle, 1));
......@@ -835,7 +835,7 @@ public:
bool is_boundary(const EdgeHandle& _edgeHandle) const {
assert(has_edge_bottom_up_incidences());
assert(_edgeHandle.is_valid() && (size_t)_edgeHandle.idx() < edges_.size());
assert(_edgeHandle.is_valid() && _edgeHandle.uidx() < edges_.size());
for(HalfEdgeHalfFaceIter hehf_it = hehf_iter(halfedge_handle(_edgeHandle, 0));
hehf_it.valid(); ++hehf_it) {
......@@ -848,7 +848,7 @@ public:
bool is_boundary(const HalfEdgeHandle& _halfedgeHandle) const {
assert(has_edge_bottom_up_incidences());
assert(_halfedgeHandle.is_valid() && (size_t)_halfedgeHandle.idx() < edges_.size() * 2u);
assert(_halfedgeHandle.is_valid() && _halfedgeHandle.uidx() < edges_.size() * 2u);
for(HalfEdgeHalfFaceIter hehf_it = hehf_iter(_halfedgeHandle);
hehf_it.valid(); ++hehf_it) {
......@@ -861,7 +861,7 @@ public:
bool is_boundary(const VertexHandle& _vertexHandle) const {
assert(has_vertex_bottom_up_incidences());
assert(_vertexHandle.is_valid() && (size_t)_vertexHandle.idx() < n_vertices());
assert(_vertexHandle.is_valid() && _vertexHandle.uidx() < n_vertices());
for(VertexOHalfEdgeIter voh_it = voh_iter(_vertexHandle); voh_it.valid(); ++voh_it) {
if(is_boundary(*voh_it)) return true;
......@@ -870,7 +870,7 @@ public:
}
size_t n_vertices_in_cell(const CellHandle& _ch) const {
assert(_ch.is_valid() && (size_t)_ch.idx() < cells_.size());
assert(_ch.is_valid() && _ch.uidx() < cells_.size());
std::set<VertexHandle> vhs;
std::vector<HalfFaceHandle> hfs = cell(_ch).halffaces();
......
......@@ -52,7 +52,7 @@
// macro expansion and preprocessor defines
// don't work properly.
#if (_MSC_VER >= 1900 || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENVOLUMEMESH_VECTOR_LEGACY)
#if ((defined _MSC_VER && _MSC_VER >= 1900) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENVOLUMEMESH_VECTOR_LEGACY)
#include "Vector11T.hh"
#else
#ifndef DOXYGEN
......
......@@ -45,20 +45,6 @@
namespace OpenVolumeMesh {
HexahedralMeshTopologyKernel::HexahedralMeshTopologyKernel() {
}
//========================================================================================
HexahedralMeshTopologyKernel::~HexahedralMeshTopologyKernel() {
}
//========================================================================================
FaceHandle HexahedralMeshTopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck) {
if(_halfedges.size() != 4) {
......
......@@ -32,14 +32,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef HEXAHEDRALMESHTOPOLOGYKERNEL_HH
#define HEXAHEDRALMESHTOPOLOGYKERNEL_HH
......@@ -100,10 +92,10 @@ public:
}
// Constructor
HexahedralMeshTopologyKernel();
HexahedralMeshTopologyKernel() = default;
// Destructor
~HexahedralMeshTopologyKernel();
~HexahedralMeshTopologyKernel() override = default;
// Overridden function
FaceHandle add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck = false) override;
......
......@@ -32,35 +32,12 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#include "TetrahedralMeshTopologyKernel.hh"
#include <iostream>
namespace OpenVolumeMesh {
TetrahedralMeshTopologyKernel::TetrahedralMeshTopologyKernel() {
}
//========================================================================================
TetrahedralMeshTopologyKernel::~TetrahedralMeshTopologyKernel() {
}
//========================================================================================
FaceHandle TetrahedralMeshTopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck) {
if(_halfedges.size() != 3) {
......@@ -458,7 +435,7 @@ void TetrahedralMeshTopologyKernel::split_face(FaceHandle _fh, VertexHandle _vh)
if (!deferred_deletion_tmp)
enable_deferred_deletion(true);
for (unsigned int i = 0; i < 2; ++i)
for (char i = 0; i < 2; ++i)
{
HalfFaceHandle hfh = halfface_handle(_fh, i);
CellHandle ch = incident_cell(hfh);
......
......@@ -63,11 +63,8 @@ namespace OpenVolumeMesh {
class TetrahedralMeshTopologyKernel : public TopologyKernel {
public:
// Constructor
TetrahedralMeshTopologyKernel();
// Destructor
~TetrahedralMeshTopologyKernel();
TetrahedralMeshTopologyKernel() = default;
~TetrahedralMeshTopologyKernel() override = default;
FaceHandle add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck = false) override;
......
#include <gtest/gtest.h>
#ifdef __clang__
# pragma GCC diagnostic ignored "-Weverything"
#endif
int main(int _argc, char** _argv) {
testing::InitGoogleTest(&_argc, _argv);
......
......@@ -635,7 +635,7 @@ TEST_F(PolyhedralMeshBase, PolyhedralMeshColorTest) {
generatePolyhedralMesh(mesh_);
typedef OpenVolumeMesh::Geometry::Vec4f Vec4f;
using OpenVolumeMesh::Geometry::Vec4f;
// Request colors
ColorAttrib<Vec4f> colors(mesh_);
......@@ -1806,11 +1806,9 @@ TEST_F(HexahedralMeshBase, HalfFaceFetchFunction2) {
VertexHandle v0(0);
VertexHandle v1(1);
VertexHandle v2(2);
VertexHandle v3(3);
VertexHandle v4(4);
VertexHandle v5(5);
VertexHandle v6(6);
VertexHandle v7(7);
std::vector<VertexHandle> vs;
vs.push_back(v0); vs.push_back(v1); vs.push_back(v2);
......@@ -2002,7 +2000,7 @@ TEST_F(PolyhedralMeshBase, SwapVertices) {
EXPECT_EQ(12u, mesh_.n_vertices());
}
void testDeferredDelete(PolyhedralMesh &mesh) {
static void testDeferredDelete(PolyhedralMesh &mesh) {
mesh.add_vertex(Vec3d(1,0,0));
mesh.add_vertex(Vec3d(0,1,0));
mesh.delete_vertex(VertexHandle(0));
......
......@@ -8,6 +8,12 @@
#include <OpenVolumeMesh/Mesh/TetrahedralMesh.hh>
#include <OpenVolumeMesh/Geometry/VectorT.hh>
#ifdef __clang__
# pragma GCC diagnostic ignored "-Wglobal-constructors"
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
# pragma GCC diagnostic ignored "-Wundef"
#endif
#define EXPECT_HANDLE_EQ(a, b) EXPECT_EQ((a).idx(), (b).idx())
#define EXPECT_HANDLE_NE(a, b) EXPECT_NE((a).idx(), (b).idx())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment