Commit cf2434fc authored by Mike Kremer's avatar Mike Kremer

Made OpenVolumeMesh Mavericks ready. Suspended template functions in status...

Made OpenVolumeMesh Mavericks ready. Suspended template functions in status attrib to separate template implementation file. Avoid use of lambda functions on OS 10.9.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@275 66977474-1d4b-4f09-8fe9-267525286df2
parent 60e92894
cmake_minimum_required (VERSION 2.6)
set(CMAKE_MACOSX_RPATH 1)
if("${PROJECT_NAME}" STREQUAL "")
message("Setting project name to OpenVolumeMesh")
project (OpenVolumeMesh)
......
This diff is collapsed.
......@@ -279,4 +279,8 @@ private:
} // Namespace OpenVolumeMesh
#if defined(INCLUDE_TEMPLATES) && !defined(STATUSATTRIBT_CC)
#include "StatusAttribT.cc"
#endif
#endif /* STATUSATTRIB_HH_ */
This diff is collapsed.
......@@ -118,7 +118,13 @@ class HEHandleCorrection {
public:
HEHandleCorrection(HalfEdgeHandle _thld) : thld_(_thld) {}
void correctVecValue(std::vector<HalfEdgeHandle>& _vec) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<HalfEdgeHandle>::iterator it = _vec.begin(), end = _vec.end(); it != end; ++it) {
correctValue(*it);
}
#else
std::for_each(_vec.begin(), _vec.end(), fun::bind(&HEHandleCorrection::correctValue, this, fun::placeholders::_1));
#endif
}
void correctValue(HalfEdgeHandle& _h) {
if(_h > thld_) _h.idx(_h.idx() - 2);
......@@ -130,7 +136,13 @@ class HFHandleCorrection {
public:
HFHandleCorrection(HalfFaceHandle _thld) : thld_(_thld) {}
void correctVecValue(std::vector<HalfFaceHandle>& _vec) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<HalfFaceHandle>::iterator it = _vec.begin(), end = _vec.end(); it != end; ++it) {
correctValue(*it);
}
#else
std::for_each(_vec.begin(), _vec.end(), fun::bind(&HFHandleCorrection::correctValue, this, fun::placeholders::_1));
#endif
}
void correctValue(HalfFaceHandle& _h) {
if(_h > thld_) _h.idx(_h.idx() - 2);
......
......@@ -979,8 +979,15 @@ EdgeIter TopologyKernel::delete_edge_core(const EdgeHandle& _h) {
hes.erase(std::remove(hes.begin(), hes.end(), halfedge_handle(_h, 0)), hes.end());
hes.erase(std::remove(hes.begin(), hes.end(), halfedge_handle(_h, 1)), hes.end());
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<HalfEdgeHandle>::iterator it = hes.begin(), end = hes.end();
it != end; ++it) {
cor.correctValue(*it);
}
#else
std::for_each(hes.begin(), hes.end(),
fun::bind(&HEHandleCorrection::correctValue, &cor, fun::placeholders::_1));
#endif
face(*f_it).set_halfedges(hes);
}
} else {
......@@ -998,8 +1005,15 @@ EdgeIter TopologyKernel::delete_edge_core(const EdgeHandle& _h) {
// Decrease all half-edge handles greater than _h in face
HEHandleCorrection cor(halfedge_handle(_h, 1));
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<HalfEdgeHandle>::iterator it = hes.begin(), end = hes.end();
it != end; ++it) {
cor.correctValue(*it);
}
#else
std::for_each(hes.begin(), hes.end(),
fun::bind(&HEHandleCorrection::correctValue, &cor, fun::placeholders::_1));
#endif
face(*f_it).set_halfedges(hes);
}
}
......@@ -1015,9 +1029,16 @@ EdgeIter TopologyKernel::delete_edge_core(const EdgeHandle& _h) {
// 4)
if(v_bottom_up_) {
HEHandleCorrection cor(halfedge_handle(_h, 1));
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<std::vector<HalfEdgeHandle> >::iterator it = outgoing_hes_per_vertex_.begin(),
end = outgoing_hes_per_vertex_.end(); it != end; ++it) {
cor.correctVecValue(*it);
}
#else
std::for_each(outgoing_hes_per_vertex_.begin(),
outgoing_hes_per_vertex_.end(),
fun::bind(&HEHandleCorrection::correctVecValue, &cor, fun::placeholders::_1));
#endif
}
// 5)
......@@ -1098,8 +1119,15 @@ FaceIter TopologyKernel::delete_face_core(const FaceHandle& _h) {
hfs.erase(std::remove(hfs.begin(), hfs.end(), halfface_handle(_h, 1)), hfs.end());
HFHandleCorrection cor(halfface_handle(_h, 1));
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<HalfFaceHandle>::iterator it = hfs.begin(),
end = hfs.end(); it != end; ++it) {
cor.correctValue(*it);
}
#else
std::for_each(hfs.begin(), hfs.end(),
fun::bind(&HFHandleCorrection::correctValue, &cor, fun::placeholders::_1));
#endif
cell(*c_it).set_halffaces(hfs);
}
......@@ -1115,8 +1143,15 @@ FaceIter TopologyKernel::delete_face_core(const FaceHandle& _h) {
hfs.erase(std::remove(hfs.begin(), hfs.end(), halfface_handle(_h, 1)), hfs.end());
HFHandleCorrection cor(halfface_handle(_h, 1));
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<HalfFaceHandle>::iterator it = hfs.begin(),
end = hfs.end(); it != end; ++it) {
cor.correctValue(*it);
}
#else
std::for_each(hfs.begin(), hfs.end(),
fun::bind(&HFHandleCorrection::correctValue, &cor, fun::placeholders::_1));
#endif
cell(*c_it).set_halffaces(hfs);
}
}
......@@ -1132,9 +1167,15 @@ FaceIter TopologyKernel::delete_face_core(const FaceHandle& _h) {
// 4)
if(e_bottom_up_) {
HFHandleCorrection cor(halfface_handle(_h, 1));
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<std::vector<HalfFaceHandle> >::iterator it = incident_hfs_per_he_.begin(), end = incident_hfs_per_he_.end(); it != end; ++it) {
cor.correctVecValue(*it);
}
#else
std::for_each(incident_hfs_per_he_.begin(),
incident_hfs_per_he_.end(),
fun::bind(&HFHandleCorrection::correctVecValue, &cor, fun::placeholders::_1));
#endif
}
// 5)
......@@ -1182,9 +1223,16 @@ CellIter TopologyKernel::delete_cell_core(const CellHandle& _h) {
// 2)
if(f_bottom_up_) {
CHandleCorrection cor(_h);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(std::vector<CellHandle>::iterator it = incident_cell_per_hf_.begin(),
end = incident_cell_per_hf_.end(); it != end; ++it) {
cor.correctValue(*it);
}
#else
std::for_each(incident_cell_per_hf_.begin(),
incident_cell_per_hf_.end(),
fun::bind(&CHandleCorrection::correctValue, &cor, fun::placeholders::_1));
#endif
}
// 3)
......
......@@ -631,8 +631,15 @@ public:
compute_edge_bottom_up_incidences();
if(f_bottom_up_) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(EdgeIter e_it = edges_begin(), e_end = edges_end();
e_it != e_end; ++e_it) {
reorder_incident_halffaces(*e_it);
}
#else
std::for_each(edges_begin(), edges_end(),
fun::bind(&TopologyKernel::reorder_incident_halffaces, this, fun::placeholders::_1));
#endif
}
}
......@@ -662,8 +669,15 @@ public:
if(updateOrder) {
if(e_bottom_up_) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
for(EdgeIter e_it = edges_begin(), e_end = edges_end();
e_it != e_end; ++e_it) {
reorder_incident_halffaces(*e_it);
}
#else
std::for_each(edges_begin(), edges_end(),
fun::bind(&TopologyKernel::reorder_incident_halffaces, this, fun::placeholders::_1));
#endif
}
}
}
......
......@@ -63,8 +63,14 @@
namespace fun = std::tr1;
#else
// hope for TR1 equivalents
#include <tr1/functional>
namespace fun = std::tr1;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
// Mavericks special treatment
#include <functional>
namespace fun = std;
#else
#include <tr1/functional>
namespace fun = std::tr1;
#endif
#endif
#endif
......
......@@ -73,10 +73,16 @@
#pragma warning "TR1 not available! Please install Visual Studio Service Pack 1!"
#endif
#else
// hope for TR1 equivalents
#include <tr1/memory>
namespace ptr = std::tr1;
#define ACG_UNIQUE_POINTER_SUPPORTED 0
// hope for TR1 equivalents
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
// Mavericks special treatment
#include <memory>
namespace ptr = std;
#else
#include <tr1/memory>
namespace ptr = std::tr1;
#endif
#define ACG_UNIQUE_POINTER_SUPPORTED 0
#endif
#endif
......
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