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
/*===========================================================================*\
* *
* 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 OPENVOLUMEMESHBASEKERNEL_HH
#define OPENVOLUMEMESHBASEKERNEL_HH
//== INCLUDES =================================================================
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
// --------------------
#include "OpenVolumeMeshProperty.hh"
#include "OpenVolumeMeshPropertyContainer.hh"
#include "OpenVolumeMeshHandle.hh"
namespace OpenVolumeMesh {
//== CLASS DEFINITION =========================================================
/// This class provides the basic property management like adding/removing
/// properties and access to properties.
/// All operations provided by %OpenVolumeMeshBaseKernel need at least a property handle
/// (VPropHandleT, HEPropHandleT, EPropHandleT, HFPropHandleT, FPropHandleT, CPropHandleT, MPropHandleT).
/// which keeps the data type of the property, too.
class OpenVolumeMeshBaseKernel {
public:
//-------------------------------------------- constructor / destructor
OpenVolumeMeshBaseKernel() {
}
virtual ~OpenVolumeMeshBaseKernel() {
vprops_.clear();
eprops_.clear();
heprops_.clear();
fprops_.clear();
hfprops_.clear();
cprops_.clear();
mprops_.clear();
}
public:
//-------------------------------------------------- add new properties
template<class T>
void add_property(VPropHandleT<T>& _ph,
const std::string& _name = "<vprop>") {
_ph = VPropHandleT<T> (vprops_.add(T(), _name));
vprops_.resize(n_vertices());
}
template<class T>
void add_property(HEPropHandleT<T>& _ph,
const std::string& _name = "<heprop>") {
_ph = HEPropHandleT<T> (heprops_.add(T(), _name));
heprops_.resize(n_halfedges());
}
template<class T>
void add_property(EPropHandleT<T>& _ph,
const std::string& _name = "<eprop>") {
_ph = EPropHandleT<T> (eprops_.add(T(), _name));
eprops_.resize(n_edges());
}
template<class T>
void add_property(FPropHandleT<T>& _ph,
const std::string& _name = "<fprop>") {
_ph = FPropHandleT<T> (fprops_.add(T(), _name));
fprops_.resize(n_faces());
}
template<class T>
void add_property(HFPropHandleT<T>& _ph,
const std::string& _name = "<hfprop>") {
_ph = HFPropHandleT<T> (hfprops_.add(T(), _name));
hfprops_.resize(n_halffaces());
}
template<class T>
void add_property(CPropHandleT<T>& _ph,
const std::string& _name = "<cprop>") {
_ph = CPropHandleT<T> (cprops_.add(T(), _name));
cprops_.resize(n_cells());
}
template<class T>
void add_property(MPropHandleT<T>& _ph,
const std::string& _name = "<mprop>") {
_ph = MPropHandleT<T> (mprops_.add(T(), _name));
mprops_.resize(1);
}
public:
//--------------------------------------------------- remove properties
template<typename T>
void remove_property(VPropHandleT<T>& _ph) {
if (_ph.is_valid())
vprops_.remove(_ph);
_ph.reset();
}
template<typename T>
void remove_property(HEPropHandleT<T>& _ph) {
if (_ph.is_valid())
heprops_.remove(_ph);
_ph.reset();
}
template<typename T>
void remove_property(EPropHandleT<T>& _ph) {
if (_ph.is_valid())
eprops_.remove(_ph);
_ph.reset();
}
template<typename T>
void remove_property(FPropHandleT<T>& _ph) {
if (_ph.is_valid())
fprops_.remove(_ph);
_ph.reset();
}
template<typename T>
void remove_property(HFPropHandleT<T>& _ph) {
if (_ph.is_valid())
hfprops_.remove(_ph);
_ph.reset();
}
template<typename T>
void remove_property(CPropHandleT<T>& _ph) {
if (_ph.is_valid())
cprops_.remove(_ph);
_ph.reset();
}
template<typename T>
void remove_property(MPropHandleT<T>& _ph) {
if (_ph.is_valid())
mprops_.remove(_ph);
_ph.reset();
}
//--------------------------------------------------- remove single elements
void remove_vprop_element(size_t _idx) {
for(prop_iterator p_it = vprops_.begin(); p_it != vprops_.end(); ++p_it) {
(*p_it)->delete_element(_idx);
}
}
void remove_eprop_element(size_t _idx) {
for(prop_iterator p_it = eprops_.begin(); p_it != eprops_.end(); ++p_it) {
(*p_it)->delete_element(_idx);
}
}
void remove_heprop_element(size_t _idx) {
for(prop_iterator p_it = heprops_.begin(); p_it != heprops_.end(); ++p_it) {
(*p_it)->delete_element(_idx);
}
}
void remove_fprop_element(size_t _idx) {
for(prop_iterator p_it = fprops_.begin(); p_it != fprops_.end(); ++p_it) {
(*p_it)->delete_element(_idx);
}
}
void remove_hfprop_element(size_t _idx) {
for(prop_iterator p_it = hfprops_.begin(); p_it != hfprops_.end(); ++p_it) {
(*p_it)->delete_element(_idx);
}
}
void remove_cprop_element(size_t _idx) {
for(prop_iterator p_it = cprops_.begin(); p_it != cprops_.end(); ++p_it) {
(*p_it)->delete_element(_idx);
}
}
public:
//------------------------------------------------ get handle from name
template<class T>
bool get_property_handle(VPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = VPropHandleT<T> (vprops_.handle(T(), _name))).is_valid();
}
template<class T>
bool get_property_handle(HEPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = HEPropHandleT<T> (heprops_.handle(T(), _name))).is_valid();
}
template<class T>
bool get_property_handle(EPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = EPropHandleT<T> (eprops_.handle(T(), _name))).is_valid();
}
template<class T>
bool get_property_handle(FPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = FPropHandleT<T> (fprops_.handle(T(), _name))).is_valid();
}
template<class T>
bool get_property_handle(HFPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = HFPropHandleT<T> (hfprops_.handle(T(), _name))).is_valid();
}
template<class T>
bool get_property_handle(CPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = CPropHandleT<T> (cprops_.handle(T(), _name))).is_valid();
}
template<class T>
bool get_property_handle(MPropHandleT<T>& _ph, const std::string& _name) const {
return (_ph = MPropHandleT<T> (mprops_.handle(T(), _name))).is_valid();
}
public:
//--------------------------------------------------- access properties
template<class T>
OpenVolumeMeshPropertyT<T>& property(VPropHandleT<T> _ph) {
return vprops_.property(_ph);
}
template<class T>
const OpenVolumeMeshPropertyT<T>& property(VPropHandleT<T> _ph) const {
return vprops_.property(_ph);
}
template<class T>
OpenVolumeMeshPropertyT<T>& property(HEPropHandleT<T> _ph) {
return heprops_.property(_ph);
}
template<class T>
const OpenVolumeMeshPropertyT<T>& property(HEPropHandleT<T> _ph) const {
return heprops_.property(_ph);
}
template<class T>
OpenVolumeMeshPropertyT<T>& property(EPropHandleT<T> _ph) {
return eprops_.property(_ph);
}
template<class T>
const OpenVolumeMeshPropertyT<T>& property(EPropHandleT<T> _ph) const {
return eprops_.property(_ph);
}
template<class T>
OpenVolumeMeshPropertyT<T>& property(FPropHandleT<T> _ph) {
return fprops_.property(_ph);
}
template<class T>
const OpenVolumeMeshPropertyT<T>& property(FPropHandleT<T> _ph) const {
return fprops_.property(_ph);
}
template<class T>
OpenVolumeMeshPropertyT<T>& property(HFPropHandleT<T> _ph) {
return hfprops_.property(_ph);
}
template<class T>
const OpenVolumeMeshPropertyT<T>& property(HFPropHandleT<T> _ph) const {
return hfprops_.property(_ph);
}
template<class T>
OpenVolumeMeshPropertyT<T>& property(CPropHandleT<T> _ph) {
return cprops_.property(_ph);
}
template<class T>
const OpenVolumeMeshPropertyT<T>& property(CPropHandleT<T> _ph) const {
return cprops_.property(_ph);