Commit b626334d authored by Mike Kremer's avatar Mike Kremer

Deleted source folder

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@92 66977474-1d4b-4f09-8fe9-267525286df2
parent 9d6145b7
include (ACGCommon)
include_directories (
..
${CMAKE_CURRENT_SOURCE_DIR}
)
# source code directories
set (directories
.
OpenVolumeMesh/Core
OpenVolumeMesh/FileManager
OpenVolumeMesh/Geometry
OpenVolumeMesh/PolyhedralMesh
OpenVolumeMesh/PolyhedralMesh/Utils
OpenVolumeMesh/HexahedralMesh
OpenVolumeMesh/HexahedralMesh/Utils
)
# collect all header and source files
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})
# Disable Library installation when not building OpenVolumeMesh on its own but as part of another project!
if ( NOT ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
set(ACG_NO_LIBRARY_INSTALL true)
endif()
if (WIN32)
# OpenVolumeMesh has no dll exports so we have to build a static library on windows
acg_add_library (OpenVolumeMesh STATIC ${sources} ${headers})
else ()
acg_add_library (OpenVolumeMesh SHAREDANDSTATIC ${sources} ${headers})
set_target_properties (OpenVolumeMesh PROPERTIES VERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR}
SOVERSION ${OPENVOLUMEMESH_VERSION_MAJOR}.${OPENVOLUMEMESH_VERSION_MINOR} )
endif ()
# Only install if the project name matches OpenVolumeMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
# Install Header Files)
install(DIRECTORY .
DESTINATION include
FILES_MATCHING
PATTERN "*.hh"
PATTERN "Unittests" EXCLUDE
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "tmp" EXCLUDE
PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE)
#install Template cc files (required by headers)
install(DIRECTORY .
DESTINATION include
FILES_MATCHING
PATTERN "*T.cc"
PATTERN "Unittests" EXCLUDE
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "tmp" EXCLUDE
PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE)
endif ()
# Only build unittests if not built as external library
if(${PROJECT_NAME} MATCHES "OpenVolumeMesh")
# Add unittests target
add_subdirectory(Unittests)
endif()
This diff is collapsed.
This diff is collapsed.
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openvolumemesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of 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: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* 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/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 22 $ *
* $Date: 2012-01-10 10:10:39 +0100 (Tue, 10 Jan 2012) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#include "OpenVolumeMeshBaseProperty.hh"
namespace OpenVolumeMesh {
// Initialize constant
const size_t OpenVolumeMeshBaseProperty::UnknownSize = std::numeric_limits<size_t>::max();
} // Namespace OpenVolumeMesh
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openvolumemesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of 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: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* 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/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHBASEPROPERTY_HH
#define OPENVOLUMEMESHBASEPROPERTY_HH
#include <limits>
#include <string>
#include <iostream>
//== CLASS DEFINITION =========================================================
/** \class OpenVolumeMeshBaseProperty
Abstract class defining the basic interface of a dynamic property.
**/
namespace OpenVolumeMesh {
class OpenVolumeMeshBaseProperty {
public:
/// Indicates an error when a size is returned by a member.
static const size_t UnknownSize;
public:
OpenVolumeMeshBaseProperty(const std::string& _name = "<unknown>") :
name_(_name), persistent_(false) {
}
OpenVolumeMeshBaseProperty(const OpenVolumeMeshBaseProperty& _rhs) :
name_(_rhs.name_), persistent_(_rhs.persistent_) {
}
virtual ~OpenVolumeMeshBaseProperty() {}
public:
/// Reserve memory for n elements.
virtual void reserve(size_t _n) = 0;
/// Resize storage to hold n elements.
virtual void resize(size_t _n) = 0;
/// Clear all elements and free memory.
virtual void clear() = 0;
/// Extend the number of elements by one.
virtual void push_back() = 0;
/// Let two elements swap their storage place.
virtual void swap(size_t _i0, size_t _i1) = 0;
/// Erase an element of the vector
virtual void delete_element(size_t _idx) = 0;
/// Return a deep copy of self.
virtual OpenVolumeMeshBaseProperty* clone() const = 0;
public:
/// Return the name of the property
const std::string& name() const {
return name_;
}
virtual void stats(std::ostream& _ostr) const {
_ostr << name() << (persistent() ? ", persistent " : "") << "\n";
}
public:
// I/O support
/// Returns true if the persistent flag is enabled else false.
bool persistent() const {
return persistent_;
}
/// Enable or disable persistency. Self must be a named property to enable
/// persistency.
void set_persistent(bool _yn) {
persistent_ = _yn;
}
/// Number of elements in property
virtual size_t n_elements() const = 0;
/// Size of one element in bytes or UnknownSize if not known.
virtual size_t element_size() const = 0;
/// Return size of property in bytes
virtual size_t size_of() const {
return size_of(n_elements());
}
/// Estimated size of property if it has _n_elem elements.
/// The member returns UnknownSize if the size cannot be estimated.
virtual size_t size_of(size_t _n_elem) const {
return (element_size() != UnknownSize) ? (_n_elem * element_size())
: UnknownSize;
}
private:
std::string name_;
bool persistent_;
};
} // Namespace OpenVolumeMesh
#endif //OPENVOLUMEMESHBASEPROPERTY_HH
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openvolumemesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of 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: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* 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/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHHANDLE_HH_
#define OPENVOLUMEMESHHANDLE_HH_
namespace OpenVolumeMesh {
// Define handle types in order to distinguish different entities by their indices
class OpenVolumeMeshHandle {
public:
// Default constructor
explicit OpenVolumeMeshHandle(int _idx) : idx_(_idx) {};
OpenVolumeMeshHandle& operator=(int _idx) {
idx_ = _idx;
return *this;
}
OpenVolumeMeshHandle& operator=(const OpenVolumeMeshHandle& _idx) {
idx_ = _idx.idx_;
return *this;
}
inline bool is_valid() const { return idx_ != -1; }
inline bool operator<(const OpenVolumeMeshHandle& _idx) const { return (this->idx_ < _idx.idx_); }
inline bool operator<(int _idx) const { return idx_ < _idx; }
inline int idx() const { return idx_; }
void idx(const int& _idx) { idx_ = _idx; }
void reset() { idx_ = -1; }
operator int() const { return idx_; }
private:
int idx_;
};
// Default entity handles
class VertexHandle : public OpenVolumeMeshHandle { public: VertexHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class EdgeHandle : public OpenVolumeMeshHandle { public: EdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class FaceHandle : public OpenVolumeMeshHandle { public: FaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class CellHandle : public OpenVolumeMeshHandle { public: CellHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfEdgeHandle : public OpenVolumeMeshHandle { public: HalfEdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFaceHandle : public OpenVolumeMeshHandle { public: HalfFaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
} // Namespace OpenVolumeMesh
#endif /* OPENVOLUMEMESHHANDLE_HH_ */
This diff is collapsed.
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openvolumemesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of 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: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* 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/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHPROPERTYCONTAINER_HH
#define OPENVOLUMEMESHPROPERTYCONTAINER_HH
#include <algorithm>
#include <cassert>
#include "OpenVolumeMeshProperty.hh"
namespace OpenVolumeMesh {
//== FORWARDDECLARATIONS ======================================================
class BaseKernel;
//== CLASS DEFINITION =========================================================
/// A a container for properties.
class OpenVolumeMeshPropertyContainer {
public:
//-------------------------------------------------- constructor / destructor
OpenVolumeMeshPropertyContainer() {
}
virtual ~OpenVolumeMeshPropertyContainer() {
std::for_each(properties_.begin(), properties_.end(), Delete());
}
//------------------------------------------------------------- info / access
typedef std::vector<OpenVolumeMeshBaseProperty*> Properties;
const Properties& properties() const {
return properties_;
}
size_t size() const {
return properties_.size();
}
//--------------------------------------------------------- copy / assignment
OpenVolumeMeshPropertyContainer(const OpenVolumeMeshPropertyContainer& _rhs) {
operator=(_rhs);
}
OpenVolumeMeshPropertyContainer& operator=(const OpenVolumeMeshPropertyContainer& _rhs) {
// The assignment below relies on all previous OpenVolumeMeshBaseProperty* elements having been deleted
std::for_each(properties_.begin(), properties_.end(), Delete());
properties_ = _rhs.properties_;
Properties::iterator p_it = properties_.begin(), p_end =
properties_.end();
for (; p_it != p_end; ++p_it)
if (*p_it)
*p_it = (*p_it)->clone();
return *this;
}
//--------------------------------------------------------- manage properties
template<class T>
OpenVolumeMeshBasePropHandleT<T> add(const T&, const std::string& _name = "<unknown>") {
Properties::iterator p_it = properties_.begin(), p_end =
properties_.end();
int idx = 0;
for (; p_it != p_end && *p_it != NULL; ++p_it, ++idx) {
}
if (p_it == p_end)
properties_.push_back(NULL);
properties_[idx] = new OpenVolumeMeshPropertyT<T> (_name);
return OpenVolumeMeshBasePropHandleT<T> (idx);
}
template<class T>
OpenVolumeMeshBasePropHandleT<T> handle(const T&, const std::string& _name) const {
Properties::const_iterator p_it = properties_.begin();
for (int idx = 0; p_it != properties_.end(); ++p_it, ++idx) {
if (*p_it != NULL && (*p_it)->name() == _name) {
return OpenVolumeMeshBasePropHandleT<T> (idx);
}
}
return OpenVolumeMeshBasePropHandleT<T> ();
}
OpenVolumeMeshBaseProperty* property(const std::string& _name) const {
Properties::const_iterator p_it = properties_.begin();
for (int idx = 0; p_it != properties_.end(); ++p_it, ++idx) {
if (*p_it != NULL && (*p_it)->name() == _name) //skip deleted properties
{
return *p_it;
}
}
return NULL;
}
template<class T> OpenVolumeMeshPropertyT<T>& property(OpenVolumeMeshBasePropHandleT<T> _h) {
assert(_h.idx() >= 0 && _h.idx() < (int) properties_.size());
assert(properties_[_h.idx()] != NULL);
OpenVolumeMeshPropertyT<T>* p = dynamic_cast<OpenVolumeMeshPropertyT<T>*> (properties_[_h.idx()]);
assert(p != NULL);
return *p;
}
template<class T> const OpenVolumeMeshPropertyT<T>& property(OpenVolumeMeshBasePropHandleT<T> _h) const {
assert(_h.idx() >= 0 && _h.idx() < (int) properties_.size());
assert(properties_[_h.idx()] != NULL);
OpenVolumeMeshPropertyT<T>* p = dynamic_cast<OpenVolumeMeshPropertyT<T>*> (properties_[_h.idx()]);
assert(p != NULL);
return *p;
}
template<class T> void remove(OpenVolumeMeshBasePropHandleT<T> _h) {
assert(_h.idx() >= 0 && _h.idx() < (int) properties_.size());
delete properties_[_h.idx()];
properties_[_h.idx()] = NULL;
}
void clear() {
// Clear properties vector:
// Replaced the old version with new one
// which performs a swap to clear values and
// deallocate memory.
// Old version (changed 22.07.09) {
// std::for_each(properties_.begin(), properties_.end(), Delete());
// }
std::for_each(properties_.begin(), properties_.end(), ClearAll());
properties_.clear();
}
//---------------------------------------------------- synchronize properties
void reserve(size_t _n) const {
std::for_each(properties_.begin(), properties_.end(), Reserve(_n));
}
void resize(size_t _n) const {
std::for_each(properties_.begin(), properties_.end(), Resize(_n));
}
void swap(size_t _i0, size_t _i1) const {
std::for_each(properties_.begin(), properties_.end(), Swap(_i0, _i1));
}
protected:
// generic add/get
size_t _add(OpenVolumeMeshBaseProperty* _bp) {
Properties::iterator p_it = properties_.begin(), p_end =
properties_.end();
size_t idx = 0;
for (; p_it != p_end && *p_it != NULL; ++p_it, ++idx) {
};
if (p_it == p_end)
properties_.push_back(NULL);
properties_[idx] = _bp;
return idx;
}
OpenVolumeMeshBaseProperty& _property(size_t _idx) {
assert(_idx < properties_.size());
assert(properties_[_idx] != NULL);
OpenVolumeMeshBaseProperty *p = properties_[_idx];
assert(p != NULL);
return *p;
}
const OpenVolumeMeshBaseProperty& _property(size_t _idx) const {
assert(_idx < properties_.size());
assert(properties_[_idx] != NULL);
OpenVolumeMeshBaseProperty *p = properties_[_idx];
assert(p != NULL);
return *p;
}
typedef Properties::iterator iterator;
typedef Properties::const_iterator const_iterator;
iterator begin() {
return properties_.begin();
}
iterator end() {
return properties_.end();
}
const_iterator begin() const {
return properties_.begin();
}
const_iterator end() const {
return properties_.end();
}
friend class OpenVolumeMeshBaseKernel;
private:
//-------------------------------------------------- synchronization functors