...
 
Commits (11)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 11)
if("${PROJECT_NAME}" STREQUAL "")
message("Setting project name to OpenVolumeMesh")
......
OpenVolumeMesh is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version with the
following exceptions:
OpenVolumeMesh is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU LesserGeneral Public
License along with OpenVolumeMesh. If not,
see http://www.gnu.org/licenses/.
\ No newline at end of file
===========================================================================
-----
OpenVolumeMesh
Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen
www.openvolumemesh.org
---------------------------------------------------------------------------
Copyright (C) 2011-2018 by Computer Graphics Group, RWTH Aachen
www.openvolumemesh.org
-----
OpenVolumeMesh is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
......@@ -21,18 +19,17 @@
License along with OpenVolumeMesh. If not,
see <http://www.gnu.org/licenses/>.
===========================================================================
Overview:
# Overview:
0. Introduction
1. System Requirements
2. Building OpenVolumeMesh
3. License Information
===========================================================================
0. Introduction
# 0. Introduction
Thank you for downloading and using the OpenVolumeMesh library. OpenVolumeMesh
is a generic data structure for the comfortable handling of arbitrary
......@@ -65,24 +62,23 @@ a well-working, reliable, and useful library. Please feel free to commit
suggestions, bug reports, or patches to the OpenVolumeMesh project management
system (redmine), which you find at
<http://www.openvolumemesh.org/redmine/projects/openvolumemesh>,
<https://www.graphics.rwth-aachen.de:9000/OpenVolumeMesh/OpenVolumeMesh>,
or you can send them directly to my e-mail address which is
or you can send them directly to the following e-mail address which is
<mkremer@cs.rwth-aachen.de>.
<moebius@cs.rwth-aachen.de>.
===========================================================================
1. System Requirements
# 1. System Requirements
OpenVolumeMesh is shipped as source project and can be built on all common
architectures and operating systems including:
- Windows XP/2000/Vista/7 with Visual Studio 2008 SP1 or Visual Studio 2010.
- Windows 7/8/10 with Visual Studio 2013 or higher
- MacOSX 10.6. with XCode 4.3
- MacOSX with latest XCode
- Linux with GCC 4.5 and higher
- Linux with GCC 6 and higher
Note that OpenVolumeMesh uses CMake as build system, so make sure that
the latest version of CMake is installed on your computer. Download
......@@ -92,12 +88,11 @@ Note also that, in order to build the documentation, you will need to
have Doxygen installed on your computer. Download Doxygen under
<http://www.doxygen.org>. The use of Doxygen is not mandatory though.
===========================================================================
2. Building OpenVolumeMesh
# 2. Building OpenVolumeMesh
OpenVolumeMesh is equipped with a CMake build system <http://www.cmake.org>.
Make sure that at least version 2.6 of CMake is installed on your computer.
Make sure that at least version 3.7 of CMake is installed on your computer.
Once CMake is installed, perform the following steps (on Linux, Mac OSX):
- Create a build directory somewhere outside the source directory
......@@ -115,15 +110,14 @@ Once CMake is installed, perform the following steps (on Linux, Mac OSX):
by "sudo make install" in order to build and install the library.
On Windows, start the CMake gui tool and set the path to OpenVolumeMesh's
sources. Then select the target project type (Visual Studio 2008, 2010)
sources. Then select the target project type (Visual Studio 20xx)
and click on "Configure". Once everything is configured to your satisfaction,
click on "Generate". You will now find a Visual Studio project file
in the specified build folder (which is "Build" per default). Open this
file in Visual Studio and select "Build all".
===========================================================================
3. License Information
# 3. License Information
OpenVolumeMesh is free software licensed under the terms of the
GNU Lesser General Public License Version 3 as published by the Free Software
......
......@@ -64,8 +64,7 @@ TopologyKernel::TopologyKernel() :
e_bottom_up_(true),
f_bottom_up_(true),
deferred_deletion(true),
fast_deletion(true),
needs_garbage_collection_(false)
fast_deletion(true)
{
}
......@@ -720,42 +719,44 @@ CellIter TopologyKernel::delete_cell(const CellHandle& _h) {
*/
void TopologyKernel::collect_garbage()
{
if (!deferred_deletion_enabled() || !needs_garbage_collection_)
if (!deferred_deletion_enabled() || !needs_garbage_collection())
return; // nothing todo
deferred_deletion = false;
for (int i = (int)n_cells(); i > 0; --i)
if (is_deleted(CellHandle(i-1)))
{
cell_deleted_[i-1] = false;
delete_cell_core(CellHandle(i-1));
for (int i = (int)n_cells(); i > 0; --i) {
if (is_deleted(CellHandle(i - 1))) {
cell_deleted_[i - 1] = false;
delete_cell_core(CellHandle(i - 1));
}
}
n_deleted_cells_ = 0;
for (int i = (int)n_faces(); i > 0; --i)
if (is_deleted(FaceHandle(i-1)))
{
face_deleted_[i-1] = false;
delete_face_core(FaceHandle(i-1));
for (int i = (int)n_faces(); i > 0; --i) {
if (is_deleted(FaceHandle(i - 1))) {
face_deleted_[i - 1] = false;
delete_face_core(FaceHandle(i - 1));
}
}
n_deleted_faces_ = 0;
for (int i = (int)n_edges(); i > 0; --i)
if (is_deleted(EdgeHandle(i-1)))
{
edge_deleted_[i-1] = false;
delete_edge_core(EdgeHandle(i-1));
for (int i = (int)n_edges(); i > 0; --i) {
if (is_deleted(EdgeHandle(i - 1))) {
edge_deleted_[i - 1] = false;
delete_edge_core(EdgeHandle(i - 1));
}
}
n_deleted_edges_ = 0;
for (int i = (int)n_vertices(); i > 0; --i)
if (is_deleted(VertexHandle(i-1)))
{
vertex_deleted_[i-1] = false;
delete_vertex_core(VertexHandle(i-1));
for (int i = (int)n_vertices(); i > 0; --i) {
if (is_deleted(VertexHandle(i - 1))) {
vertex_deleted_[i - 1] = false;
delete_vertex_core(VertexHandle(i - 1));
}
}
n_deleted_vertices_ = 0;
deferred_deletion = true;
needs_garbage_collection_ = false;
}
......@@ -922,7 +923,7 @@ VertexIter TopologyKernel::delete_vertex_core(const VertexHandle& _h) {
if (deferred_deletion_enabled())
{
needs_garbage_collection_ = true;
++n_deleted_vertices_;
vertex_deleted_[h.idx()] = true;
// deleted_vertices_.push_back(h);
......@@ -1050,7 +1051,7 @@ EdgeIter TopologyKernel::delete_edge_core(const EdgeHandle& _h) {
if (deferred_deletion_enabled())
{
needs_garbage_collection_ = true;
++n_deleted_edges_;
edge_deleted_[h.idx()] = true;
// deleted_edges_.push_back(h);
......@@ -1235,7 +1236,7 @@ FaceIter TopologyKernel::delete_face_core(const FaceHandle& _h) {
if (deferred_deletion_enabled())
{
needs_garbage_collection_ = true;
++n_deleted_faces_;
face_deleted_[h.idx()] = true;
// deleted_faces_.push_back(h);
......@@ -1394,7 +1395,7 @@ CellIter TopologyKernel::delete_cell_core(const CellHandle& _h) {
if (deferred_deletion_enabled())
{
needs_garbage_collection_ = true;
++n_deleted_cells_;
cell_deleted_[h.idx()] = true;
// deleted_cells_.push_back(h);
// deleted_cells_set.insert(h);
......
......@@ -331,6 +331,19 @@ public:
/// Get number of cells in mesh
virtual size_t n_cells() const { return cells_.size(); }
/// Get number of undeleted vertices in mesh
size_t n_logical_vertices() const { return n_vertices_ - n_deleted_vertices_; }
/// Get number of undeleted edges in mesh
size_t n_logical_edges() const { return edges_.size() - n_deleted_edges_; }
/// Get number of undeleted halfedges in mesh
size_t n_logical_halfedges() const { return n_logical_edges() * 2u; }
/// Get number of undeleted faces in mesh
size_t n_logical_faces() const { return faces_.size() - n_deleted_faces_; }
/// Get number of undeleted halffaces in mesh
size_t n_logical_halffaces() const { return n_faces() * 2u; }
/// Get number of undeleted cells in mesh
size_t n_logical_cells() const { return cells_.size() - n_deleted_cells_; }
int genus() const {
int g = (1 - (int)(n_vertices() -
......@@ -623,6 +636,10 @@ public:
edge_deleted_.clear();
face_deleted_.clear();
cell_deleted_.clear();
n_deleted_vertices_ = 0;
n_deleted_edges_ = 0;
n_deleted_faces_ = 0;
n_deleted_cells_ = 0;
outgoing_hes_per_vertex_.clear();
incident_hfs_per_he_.clear();
incident_cell_per_hf_.clear();
......@@ -952,7 +969,7 @@ public:
}
bool inline needs_garbage_collection() const {
return needs_garbage_collection_;
return n_deleted_vertices_ > 0 || n_deleted_edges_ > 0 || n_deleted_faces_ > 0 || n_deleted_cells_ > 0;
}
protected:
......@@ -970,7 +987,12 @@ protected:
std::vector<bool> edge_deleted_;
std::vector<bool> face_deleted_;
std::vector<bool> cell_deleted_;
bool needs_garbage_collection_;
// number of elements deleted, but not yet garbage collected
size_t n_deleted_vertices_ = 0;
size_t n_deleted_edges_ = 0;
size_t n_deleted_faces_ = 0;
size_t n_deleted_cells_ = 0;
};
......