Commit 618c870f authored by Mike Kremer's avatar Mike Kremer

Changed directory structure once more

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@22 66977474-1d4b-4f09-8fe9-267525286df2
parent df73103b
......@@ -8,12 +8,12 @@ include_directories (
# source code directories
set (directories
.
Core
Geometry
OpenVolumeMesh
OpenVolumeMesh/Utils
OpenHexMesh
OpenHexMesh/Utils
OpenVolumeMesh/Core
OpenVolumeMesh/Geometry
OpenVolumeMesh/PolyhedralMesh
OpenVolumeMesh/PolyhedralMesh/Utils
OpenVolumeMesh/HexahedralMesh
OpenVolumeMesh/HexahedralMesh/Utils
Unittests
)
......@@ -34,31 +34,8 @@ 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 ()
if ( ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
# Add core as dependency before fixbundle
if ( WIN32 OR APPLE)
# let bundle generation depend on targets
add_dependencies (fixbundle OpenVolumeMesh)
endif ()
endif()
# Install Header Files (Apple)
if ( NOT ACG_PROJECT_MACOS_BUNDLE AND APPLE )
FILE(GLOB files_install_OVM "${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh/*T.cc" )
FILE(GLOB files_install_OVM_Utils "${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh/Utils/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/OpenVolumeMesh/Utils/*T.cc" )
FILE(GLOB files_install_OHM "${CMAKE_CURRENT_SOURCE_DIR}/OpenHexMesh/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/OpenHexMesh/*T.cc" )
FILE(GLOB files_install_OHM_Utils "${CMAKE_CURRENT_SOURCE_DIR}/OpenHexMesh/Utils/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/OpenHexMesh/Utils/*T.cc" )
INSTALL(FILES ${files_install_OVM} DESTINATION include/OpenVolumeMesh/OpenVolumeMesh )
INSTALL(FILES ${files_install_OVM_Utils} DESTINATION include/OpenVolumeMesh/OpenVolumeMesh/Utils )
INSTALL(FILES ${files_install_OHM} DESTINATION include/OpenVolumeMesh/OpenHexMesh )
INSTALL(FILES ${files_install_OHM_Utils} DESTINATION include/OpenVolumeMesh/OpenHexMesh/Utils )
endif()
# Only install if the project name matches OpenVolumeMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenVolumeMesh")
......
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.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$ *
* *
\*===========================================================================*/
#include "OpenVolumeMeshBaseKernel.hh"
namespace OpenVolumeMesh {
void OpenVolumeMeshBaseKernel::property_stats(std::ostream& _ostr) const {
const OpenVolumeMeshPropertyContainer::Properties& vps =
vprops_.properties();
const OpenVolumeMeshPropertyContainer::Properties& hps =
heprops_.properties();
const OpenVolumeMeshPropertyContainer::Properties& eps =
eprops_.properties();
const OpenVolumeMeshPropertyContainer::Properties& fps =
fprops_.properties();
const OpenVolumeMeshPropertyContainer::Properties& hfps =
hfprops_.properties();
const OpenVolumeMeshPropertyContainer::Properties& cps =
cprops_.properties();
const OpenVolumeMeshPropertyContainer::Properties& mps =
mprops_.properties();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
_ostr << vprops_.size() << " vprops:\n";
for (it = vps.begin(); it != vps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
_ostr << heprops_.size() << " heprops:\n";
for (it = hps.begin(); it != hps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
_ostr << eprops_.size() << " eprops:\n";
for (it = eps.begin(); it != eps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
_ostr << fprops_.size() << " fprops:\n";
for (it = fps.begin(); it != fps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
_ostr << hfprops_.size() << " hfprops:\n";
for (it = hfps.begin(); it != hfps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
_ostr << cprops_.size() << " cprops:\n";
for (it = cps.begin(); it != cps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
_ostr << mprops_.size() << " mprops:\n";
for (it = mps.begin(); it != mps.end(); ++it) {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
}
void OpenVolumeMeshBaseKernel::vprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& vps =
vprops_.properties();
for (it = vps.begin(); it != vps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::heprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& hps =
heprops_.properties();
for (it = hps.begin(); it != hps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::eprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& eps =
eprops_.properties();
for (it = eps.begin(); it != eps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::fprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& fps =
fprops_.properties();
for (it = fps.begin(); it != fps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::hfprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& hfps =
hfprops_.properties();
for (it = hfps.begin(); it != hfps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::cprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& cps =
cprops_.properties();
for (it = cps.begin(); it != cps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::mprop_stats(std::string& _string) const {
_string.clear();
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& mps =
mprops_.properties();
for (it = mps.begin(); it != mps.end(); ++it)
if (*it == NULL)
_string += "[deleted] \n";
else {
_string += (*it)->name();
_string += "\n";
}
}
void OpenVolumeMeshBaseKernel::vprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& vps =
vprops_.properties();
for (it = vps.begin(); it != vps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
void OpenVolumeMeshBaseKernel::heprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& hps =
heprops_.properties();
for (it = hps.begin(); it != hps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
void OpenVolumeMeshBaseKernel::eprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& eps =
eprops_.properties();
for (it = eps.begin(); it != eps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
void OpenVolumeMeshBaseKernel::fprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& fps =
fprops_.properties();
for (it = fps.begin(); it != fps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
void OpenVolumeMeshBaseKernel::hfprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& hfps =
hfprops_.properties();
for (it = hfps.begin(); it != hfps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
void OpenVolumeMeshBaseKernel::cprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& cps =
cprops_.properties();
for (it = cps.begin(); it != cps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
void OpenVolumeMeshBaseKernel::mprop_stats(std::ostream& _ostr) const {
OpenVolumeMeshPropertyContainer::Properties::const_iterator it;
const OpenVolumeMeshPropertyContainer::Properties& mps =
mprops_.properties();
for (it = mps.begin(); it != mps.end(); ++it)
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr);
}
} // Namespace OpenVolumeMesh
This diff is collapsed.
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.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>
//== 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_;
};
// Initialize constant
const size_t OpenVolumeMeshBaseProperty::UnknownSize = std::numeric_limits<size_t>::max();
} // Namespace OpenVolumeMesh
#endif //OPENVOLUMEMESHBASEPROPERTY_HH
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.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_ */
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.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/>. *
* *
\*===========================================================================*/
/*================