...
 
Commits (7)
include (ACGCommon)
set(OVM_ENABLE_DEPRECATED_APIS ON CACHE BOOL "Support deprecated OpenVolumeMesh APIs")
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/Config/DeprecationConfig.hh.in"
"${CMAKE_CURRENT_BINARY_DIR}/Config/DeprecationConfig.hh"
)
include_directories (
..
${CMAKE_CURRENT_SOURCE_DIR}
......@@ -10,6 +17,7 @@ set (directories
.
OpenVolumeMesh/Attribs
OpenVolumeMesh/Core
OpenVolumeMesh/Config
OpenVolumeMesh/FileManager
OpenVolumeMesh/Geometry
OpenVolumeMesh/Mesh
......@@ -32,6 +40,11 @@ else ()
set_target_properties (OpenVolumeMesh PROPERTIES VERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR}
SOVERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR} )
endif ()
foreach(TARGET_NAME OpenVolumeMesh OpenVolumeMeshStatic)
if (TARGET ${TARGET_NAME})
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Config/")
endif()
endforeach(TARGET_NAME)
# Only install if the project name matches OpenVolumeMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
......@@ -50,6 +63,10 @@ install(DIRECTORY .
PATTERN "Debian*" EXCLUDE)
endif ()
# install config files
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Config/DeprecationConfig.hh
DESTINATION include/OpenVolumeMesh/Config )
# Only build unittests and file converter
# if not built as external library
if(${PROJECT_NAME} MATCHES "OpenVolumeMesh")
......
#pragma once
#cmakedefine01 OVM_ENABLE_DEPRECATED_APIS
......@@ -169,10 +169,18 @@ public:
TopologyKernelT::clear(_clearProps);
}
typename PointT::value_type length(const HalfEdgeHandle& _heh) const {
return vector(_heh).length();
}
typename PointT::value_type length(const EdgeHandle& _eh) const {
return vector(_eh).length();
}
const typename TopologyKernelT::Edge& e = TopologyKernelT::edge(_eh);
return (vertex(e.to_vertex()) - vertex(e.from_vertex())).length();
PointT vector(const HalfEdgeHandle& _heh) const {
const typename TopologyKernelT::Edge& e = TopologyKernelT::halfedge(_heh);
return (vertex(e.to_vertex()) - vertex(e.from_vertex()));
}
PointT vector(const EdgeHandle& _eh) const {
......
......@@ -1510,7 +1510,7 @@ CellHalfFaceIterImpl& CellHalfFaceIterImpl::operator--() {
const std::vector<HalfFaceHandle>& halffaces =
BaseIter::mesh()->cell(ref_handle_).halffaces();
if (hf_iter_ == halffaces.begin()) {
hf_iter_ == halffaces.end();
hf_iter_ = halffaces.end();
--lap_;
if (lap_ < 0)
BaseIter::valid(false);
......@@ -1555,7 +1555,7 @@ CellFaceIterImpl& CellFaceIterImpl::operator--() {
const std::vector<HalfFaceHandle>& halffaces =
BaseIter::mesh()->cell(ref_handle_).halffaces();
if (hf_iter_ == halffaces.begin()) {
hf_iter_ == halffaces.end();
hf_iter_ = halffaces.end();
--lap_;
if (lap_ < 0)
BaseIter::valid(false);
......
......@@ -81,8 +81,10 @@ public:
void idx(const int& _idx) { idx_ = _idx; }
#if OVM_ENABLE_DEPRECATED_APIS
OVM_DEPRECATED("use explicit .idx() instead")
inline operator int() const { return idx_; }
#endif
void reset() { idx_ = -1; }
......
......@@ -96,10 +96,12 @@ public:
const_iterator end() const { return ptr::shared_ptr<PropT>::get()->end(); }
iterator end() { return ptr::shared_ptr<PropT>::get()->end(); }
#if OVM_ENABLE_DEPRECATED_APIS
OVM_DEPRECATED("use handles to index properties")
reference operator[](size_t _idx) { return (*ptr::shared_ptr<PropT>::get())[_idx]; }
OVM_DEPRECATED("use handles to index properties")
const_reference operator[](size_t _idx) const { return (*ptr::shared_ptr<PropT>::get())[_idx]; }
#endif
reference operator[](const EntityHandleT& _h) { return (*ptr::shared_ptr<PropT>::get())[_h.idx()]; }
const_reference operator[](const EntityHandleT& _h) const { return (*ptr::shared_ptr<PropT>::get())[_h.uidx()]; }
......
#pragma once
#include "DeprecationConfig.hh"
#if defined(__cplusplus) && (__cplusplus >= 201402L)
# define OVM_DEPRECATED(msg) [[deprecated(msg)]]
#elif defined(__GNUC__) || defined(__clang__)
......