Commit 960634bc authored by Mike Kremer's avatar Mike Kremer

Finished restructuring folders

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@16 66977474-1d4b-4f09-8fe9-267525286df2
parent 815b4c25
......@@ -7,7 +7,8 @@ include_directories (
# source code directories
set (directories
.
.
Core
OpenVolumeMesh
OpenVolumeMesh/Utils
OpenHexMesh
......
......@@ -62,7 +62,7 @@ class OpenVolumeMeshBaseProperty {
public:
/// Indicates an error when a size is returned by a member.
static const size_t UnknownSize = std::numeric_limits<size_t>::max();
static const size_t UnknownSize;
public:
......@@ -149,6 +149,9 @@ private:
bool persistent_;
};
// Initialize constant
const size_t OpenVolumeMeshBaseProperty::UnknownSize = std::numeric_limits<size_t>::max();
} // Namespace OpenVolumeMesh
#endif //OPENVOLUMEMESHBASEPROPERTY_HH
......
/*
* OpenHexMeshT.cc
*
* Created on: Jun 10, 2011
* Author: kremer
*/
/*===========================================================================*\
* *
* 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: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#define OPENHEXMESHT_CC
#include "OpenHexMesh.hh"
#include "HexahedralMesh.hh"
namespace OpenVolumeMesh {
template <typename VecT>
OpenHexMesh<VecT>::OpenHexMesh() {
HexahedralMesh<VecT>::HexahedralMesh() {
}
//========================================================================================
template <typename VecT>
OpenHexMesh<VecT>::~OpenHexMesh() {
HexahedralMesh<VecT>::~HexahedralMesh() {
}
//========================================================================================
template <typename VecT>
typename OpenHexMesh<VecT>::FaceHandle
OpenHexMesh<VecT>::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck) {
typename HexahedralMesh<VecT>::FaceHandle
HexahedralMesh<VecT>::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck) {
if(_halfedges.size() != 4) {
std::cerr << "Face valence is not four! Aborting." << std::endl;
......@@ -38,8 +75,8 @@ OpenHexMesh<VecT>::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool
//========================================================================================
template <typename VecT>
typename OpenHexMesh<VecT>::FaceHandle
OpenHexMesh<VecT>::add_face(const std::vector<VertexHandle>& _vertices) {
typename HexahedralMesh<VecT>::FaceHandle
HexahedralMesh<VecT>::add_face(const std::vector<VertexHandle>& _vertices) {
if(_vertices.size() != 4) {
std::cerr << "Face valence is not four! Aborting." << std::endl;
......@@ -52,8 +89,8 @@ OpenHexMesh<VecT>::add_face(const std::vector<VertexHandle>& _vertices) {
//========================================================================================
template <typename VecT>
typename OpenHexMesh<VecT>::CellHandle
OpenHexMesh<VecT>::add_cell(const std::vector<HalfFaceHandle>& _halffaces, bool _topologyCheck, bool _reorderFaces) {
typename HexahedralMesh<VecT>::CellHandle
HexahedralMesh<VecT>::add_cell(const std::vector<HalfFaceHandle>& _halffaces, bool _topologyCheck, bool _reorderFaces) {
if(_halffaces.size() != 6) {
std::cerr << "Cell valence is not six! Aborting." << std::endl;
......@@ -206,8 +243,8 @@ OpenHexMesh<VecT>::add_cell(const std::vector<HalfFaceHandle>& _halffaces, bool
//========================================================================================
template <typename VecT>
const typename OpenHexMesh<VecT>::HalfFaceHandle&
OpenHexMesh<VecT>::get_adjacent_halfface(const HalfFaceHandle& _hfh, const HalfEdgeHandle& _heh,
const typename HexahedralMesh<VecT>::HalfFaceHandle&
HexahedralMesh<VecT>::get_adjacent_halfface(const HalfFaceHandle& _hfh, const HalfEdgeHandle& _heh,
const std::vector<HalfFaceHandle>& _halffaces) const {
// Search for halfface that is incident to the opposite
......@@ -226,3 +263,5 @@ OpenHexMesh<VecT>::get_adjacent_halfface(const HalfFaceHandle& _hfh, const HalfE
return OpenVolumeMesh<VecT>::InvalidHalfFaceHandle;
}
} // Namespace OpenVolumeMesh
/*
* OpenHexMeshIterators.hh
*
* Created on: 27.06.2011
* Author: mike
*/
/*===========================================================================*\
* *
* 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/>. *
* *
\*===========================================================================*/
#ifndef OPENHEXMESHITERATORS_HH_
#define OPENHEXMESHITERATORS_HH_
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef HEXAHEDRALMESHITERATORS_HH
#define HEXAHEDRALMESHITERATORS_HH
namespace OpenVolumeMesh {
//#include "../OpenHexMesh.hh"
template <class VecT>
class OpenHexMesh;
class HexahedralMesh;
#include "../../OpenVolumeMesh/Utils/Iterators.hh"
#include "../../PolyhedralMesh/Utils/Iterators.hh"
template <class VecT>
class CellSheetCellIter : public BaseIterator<VecT,
......@@ -26,7 +62,7 @@ private:
typedef typename OpenVolumeMesh<VecT>::HalfFaceHandle HalfFaceHandle;
public:
CellSheetCellIter(const CellHandle& _ref_h, const unsigned char _orthDir,
const OpenHexMesh<VecT>* _mesh);
const HexahedralMesh<VecT>* _mesh);
CellSheetCellIter& operator=(const CellSheetCellIter& _c) {
BaseIter::operator=(_c);
......@@ -94,7 +130,7 @@ private:
typedef typename OpenVolumeMesh<VecT>::EdgeHandle EdgeHandle;
public:
HalfFaceSheetHalfFaceIter(const HalfFaceHandle& _ref_h,
const OpenHexMesh<VecT>* _mesh);
const HexahedralMesh<VecT>* _mesh);
HalfFaceSheetHalfFaceIter& operator=(const HalfFaceSheetHalfFaceIter& _c) {
BaseIter::operator=(_c);
adjacent_halffaces_ = _c.adjacent_halffaces_;
......@@ -165,7 +201,7 @@ private:
typedef typename OpenVolumeMesh<VecT>::EdgeHandle EdgeHandle;
public:
OutsideNeighborHalfFaceIter(const HalfFaceHandle& _ref_h,
const OpenHexMesh<VecT>* _mesh);
const HexahedralMesh<VecT>* _mesh);
OutsideNeighborHalfFaceIter& operator=(const OutsideNeighborHalfFaceIter& _c) {
BaseIter::operator=(_c);
neighbor_halffaces_ = _c.adjacent_halffaces_;
......@@ -223,8 +259,10 @@ private:
typename std::vector<EdgeHandle>::const_iterator edge_it_;
};
#if defined(INCLUDE_TEMPLATES) && !defined(OPENHEXMESHITERATORST_CC)
#include "OpenHexMeshIteratorsT.cc"
#if defined(INCLUDE_TEMPLATES) && !defined(HEXAHEDRALMESHITERATORST_CC)
#include "IteratorsT.cc"
#endif
#endif /* OPENHEXMESHITERATORS_HH_ */
} // Namespace OpenVolumeMesh
#endif /* HEXAHEDRALMESHITERATORS_HH */
/*
* OpenHexMeshIteratorsT.cc
*
* Created on: Jun 20, 2011
* Author: kremer
*/
#define OPENHEXMESHITERATORST_CC
/*===========================================================================*\
* *
* 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: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#define HEXAHEDRALMESHITERATORST_CC
#include <set>
#include "OpenHexMeshIterators.hh"
#include "Iterators.hh"
namespace OpenVolumeMesh {
//================================================================================================
// CellSheetCellIter
......@@ -17,7 +54,7 @@
template <class VecT>
CellSheetCellIter<VecT>::CellSheetCellIter(const CellHandle& _ref_h,
const unsigned char _orthDir, const OpenHexMesh<VecT>* _mesh) :
const unsigned char _orthDir, const HexahedralMesh<VecT>* _mesh) :
BaseIter(_mesh, _ref_h) {
if(!_mesh->has_bottom_up_adjacencies()) {
......@@ -32,7 +69,7 @@ BaseIter(_mesh, _ref_h) {
hf_it != halffaces.end(); ++hf_it) {
// Add those, that are perpendicular to the specified _orthDir
if(_mesh->orientation(*hf_it, _ref_h) != _orthDir &&
_mesh->orientation(*hf_it, _ref_h) != OpenHexMesh<VecT>::opposite_orientation(_orthDir)) {
_mesh->orientation(*hf_it, _ref_h) != HexahedralMesh<VecT>::opposite_orientation(_orthDir)) {
CellHandle ch = _mesh->incident_cell_per_hf_[_mesh->opposite_halfface_handle(*hf_it)];
if(ch != OpenVolumeMesh<VecT>::InvalidCellHandle) {
neighb_sheet_cell_hs_.insert(ch);
......@@ -77,7 +114,7 @@ CellSheetCellIter<VecT>& CellSheetCellIter<VecT>::operator++() {
template <class VecT>
HalfFaceSheetHalfFaceIter<VecT>::HalfFaceSheetHalfFaceIter(const HalfFaceHandle& _ref_h,
const OpenHexMesh<VecT>* _mesh) :
const HexahedralMesh<VecT>* _mesh) :
BaseIter(_mesh, _ref_h) {
if(!_mesh->has_bottom_up_adjacencies()) {
......@@ -103,13 +140,13 @@ BaseIter(_mesh, _ref_h) {
return;
}
typename OpenHexMesh<VecT>::CellHandle ch = _mesh->incident_cell(_ref_h);
typename HexahedralMesh<VecT>::CellHandle ch = _mesh->incident_cell(_ref_h);
unsigned char orientation = _mesh->orientation(_ref_h, ch);
std::vector<HalfEdgeHandle> hes_v = _mesh->halfface(_ref_h).opposite().halfedges();
std::set<HalfEdgeHandle> hes;
hes.insert(hes_v.begin(), hes_v.end());
for(typename OpenHexMesh<VecT>::CellSheetCellIter csc_it = _mesh->csc_iter(ch, orientation);
for(typename HexahedralMesh<VecT>::CellSheetCellIter csc_it = _mesh->csc_iter(ch, orientation);
csc_it.valid(); ++csc_it) {
std::vector<HalfFaceHandle> hfs = _mesh->cell(*csc_it).halffaces();
......@@ -170,7 +207,7 @@ HalfFaceSheetHalfFaceIter<VecT>& HalfFaceSheetHalfFaceIter<VecT>::operator++() {
template <class VecT>
OutsideNeighborHalfFaceIter<VecT>::OutsideNeighborHalfFaceIter(const HalfFaceHandle& _ref_h,
const OpenHexMesh<VecT>* _mesh) :
const HexahedralMesh<VecT>* _mesh) :
BaseIter(_mesh, _ref_h) {
if(!_mesh->has_bottom_up_adjacencies()) {
......@@ -228,3 +265,5 @@ OutsideNeighborHalfFaceIter<VecT>& OutsideNeighborHalfFaceIter<VecT>::operator++
}
return *this;
}
} // Namespace OpenVolumeMesh
//=============================================================================
//
// CLASS OpenVolumeMesh Data Structure
//
//=============================================================================
#ifndef OPENVOLUMEMESH_HH
#define OPENVOLUMEMESH_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: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef POLYHEDRALMESH_HH
#define POLYHEDRALMESH_HH
//== INCLUDES =================================================================
#include <vector>
#include <set>
#include "Utils/OpenVolumeMeshHandle.hh"
#include "Utils/OpenVolumeMeshBaseKernel.hh"
#include "Utils/OpenVolumeMeshStatus.hh"
#include "../Core/OpenVolumeMeshHandle.hh"
#include "../Core/OpenVolumeMeshBaseKernel.hh"
#include "../Core/OpenVolumeMeshStatus.hh"
#include "Utils/Iterators.hh"
//== FORWARDDECLARATIONS ======================================================
namespace OpenVolumeMesh {
//== FORWARD DECLARATIONS ======================================================
template <typename VecT>
class OpenVolumeMeshVertex;
......@@ -29,12 +66,9 @@ class OpenVolumeMeshFace;
template <typename VecT>
class OpenVolumeMeshCell;
//== FORWARD DECLARATIONS =====================================================
//== CLASS DEFINITION =========================================================
/** \class OpenVolumeMesh OpenVolumeMesh.hh
/** \class PolyhedralMesh PolyhedralMesh.hh
This is a general index based data structure for easy storage and processing
of volume meshes. Meshes are built defining entities of higher dimensions
......@@ -98,7 +132,7 @@ class OpenVolumeMeshCell;
//***************************************************************************
template <typename VecT>
class OpenVolumeMesh: public OpenVolumeMeshBaseKernel {
class PolyhedralMesh: public OpenVolumeMeshBaseKernel {
public:
//=====================================================================
// Defines
......@@ -132,8 +166,8 @@ public:
// Constructors/Destructor
//=====================================================================
OpenVolumeMesh();
virtual ~OpenVolumeMesh() {};
PolyhedralMesh();
virtual ~PolyhedralMesh() {};
//=====================================================================
// Iterators
......@@ -155,17 +189,17 @@ public:
typedef class VertexOHalfedgeIter<VecT> VertexOHalfedgeIter;
typedef class HalfEdgeHalfFaceIter<VecT> HalfEdgeHalfFaceIter;
typedef class VertexCellIter<VecT> VertexCellIter;
typedef class HalfedgeCellIter<VecT> HalfedgeCellIter;
typedef class CellVertexIter<VecT> CellVertexIter;
typedef class CellCellIter<VecT> CellCellIter;
typedef class BoundaryFaceIter<VecT> BoundaryFaceIter;
typedef class VertexIter<VecT> VertexIter;
typedef class EdgeIter<VecT> EdgeIter;
typedef class HalfEdgeIter<VecT> HalfEdgeIter;
typedef class FaceIter<VecT> FaceIter;
typedef class HalfFaceIter<VecT> HalfFaceIter;
typedef class CellIter<VecT> CellIter;
typedef class VertexCellIter<VecT> VertexCellIter;
typedef class HalfedgeCellIter<VecT> HalfedgeCellIter;
typedef class CellVertexIter<VecT> CellVertexIter;
typedef class CellCellIter<VecT> CellCellIter;
typedef class BoundaryFaceIter<VecT> BoundaryFaceIter;
typedef class VertexIter<VecT> VertexIter;
typedef class EdgeIter<VecT> EdgeIter;
typedef class HalfEdgeIter<VecT> HalfEdgeIter;
typedef class FaceIter<VecT> FaceIter;
typedef class HalfFaceIter<VecT> HalfFaceIter;
typedef class CellIter<VecT> CellIter;
VertexOHalfedgeIter voh_iter(const VertexHandle& _idx) const {
return VertexOHalfedgeIter(_idx, this);
......@@ -749,17 +783,17 @@ protected:
// Initialize constants
template <typename VecT>
const typename OpenVolumeMesh<VecT>::VertexHandle OpenVolumeMesh<VecT>::InvalidVertexHandle(-1);
const typename PolyhedralMesh<VecT>::VertexHandle PolyhedralMesh<VecT>::InvalidVertexHandle(-1);
template <typename VecT>
const typename OpenVolumeMesh<VecT>::EdgeHandle OpenVolumeMesh<VecT>::InvalidEdgeHandle(-1);
const typename PolyhedralMesh<VecT>::EdgeHandle PolyhedralMesh<VecT>::InvalidEdgeHandle(-1);
template <typename VecT>
const typename OpenVolumeMesh<VecT>::FaceHandle OpenVolumeMesh<VecT>::InvalidFaceHandle(-1);
const typename PolyhedralMesh<VecT>::FaceHandle PolyhedralMesh<VecT>::InvalidFaceHandle(-1);
template <typename VecT>
const typename OpenVolumeMesh<VecT>::CellHandle OpenVolumeMesh<VecT>::InvalidCellHandle(-1);
const typename PolyhedralMesh<VecT>::CellHandle PolyhedralMesh<VecT>::InvalidCellHandle(-1);
template <typename VecT>
const typename OpenVolumeMesh<VecT>::HalfEdgeHandle OpenVolumeMesh<VecT>::InvalidHalfEdgeHandle(-1);
const typename PolyhedralMesh<VecT>::HalfEdgeHandle PolyhedralMesh<VecT>::InvalidHalfEdgeHandle(-1);
template <typename VecT>
const typename OpenVolumeMesh<VecT>::HalfFaceHandle OpenVolumeMesh<VecT>::InvalidHalfFaceHandle(-1);
const typename PolyhedralMesh<VecT>::HalfFaceHandle PolyhedralMesh<VecT>::InvalidHalfFaceHandle(-1);
//***************************************************************************
......@@ -902,12 +936,12 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshCell<VecT>& _cel
return _os;
}
} // Namespace OpenVolumeMesh
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(OPENVOLUMEMESHT_CC)
#include "OpenVolumeMeshT.cc"
#if defined(INCLUDE_TEMPLATES) && !defined(POLYHEDRALMESHT_CC)
#include "PolyhedralMeshT.cc"
#endif
//=============================================================================
//***************************************************************************
#endif // OPENVOLUMEMESH_HH
#endif // POLYHEDRALMESH_HH
This diff is collapsed.
This diff is collapsed.
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