Commit fc8cdda0 authored by Mike Kremer's avatar Mike Kremer

Changed inheritance structure of core components and topology specializations...

Changed inheritance structure of core components and topology specializations as described in the documentation.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@98 66977474-1d4b-4f09-8fe9-267525286df2
parent b467ccf3
......@@ -51,15 +51,11 @@
namespace OpenVolumeMesh {
// Forward declaration
template<class VecT>
class GeometryKernel;
template <class VecT>
template <class GeomKernelT>
class NormalAttrib {
public:
NormalAttrib(GeometryKernel<VecT>& _kernel);
NormalAttrib(GeomKernelT& _kernel);
virtual ~NormalAttrib();
/** \brief A simple heuristic to estimate the vertex normals
......@@ -79,22 +75,22 @@ public:
*/
void update_face_normals();
const VecT& operator[](const VertexHandle& _h) const {
const typename GeomKernelT::PointT& operator[](const VertexHandle& _h) const {
assert((unsigned int)_h.idx < v_normals_.size());
return v_normals_[_h.idx()];
}
const VecT& operator[](const FaceHandle& _h) const {
const typename GeomKernelT::PointT& operator[](const FaceHandle& _h) const {
assert((unsigned int)_h.idx < f_normals_.size());
return f_normals_[_h.idx()];
}
VecT& operator[](const VertexHandle& _h) {
typename GeomKernelT::PointT& operator[](const VertexHandle& _h) {
assert((unsigned int)_h.idx < kernel_.n_vertices());
return v_normals_[_h.idx()];
}
VecT& operator[](const FaceHandle& _h) {
typename GeomKernelT::PointT& operator[](const FaceHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_faces());
return f_normals_[_h.idx()];
}
......@@ -105,10 +101,10 @@ private:
void compute_face_normal(const FaceHandle& _fh);
GeometryKernel<VecT>& kernel_;
GeomKernelT& kernel_;
VertexPropertyT<VecT> v_normals_;
FacePropertyT<VecT> f_normals_;
VertexPropertyT<typename GeomKernelT::PointT> v_normals_;
FacePropertyT<typename GeomKernelT::PointT> f_normals_;
};
} // Namespace OpenVolumeMesh
......
......@@ -50,21 +50,21 @@
namespace OpenVolumeMesh {
template <class VecT>
NormalAttrib<VecT>::NormalAttrib(GeometryKernel<VecT>& _kernel) :
template <class GeomKernelT>
NormalAttrib<GeomKernelT>::NormalAttrib(GeomKernelT& _kernel) :
kernel_(_kernel),
v_normals_(_kernel.template request_vertex_property<VecT>("vertex_normals")),
f_normals_(_kernel.template request_face_property<VecT>("face_normals")) {
v_normals_(_kernel.template request_vertex_property<typename GeomKernelT::PointT>("vertex_normals")),
f_normals_(_kernel.template request_face_property<typename GeomKernelT::PointT>("face_normals")) {
}
template <class VecT>
NormalAttrib<VecT>::~NormalAttrib() {
template <class GeomKernelT>
NormalAttrib<GeomKernelT>::~NormalAttrib() {
}
template <class VecT>
void NormalAttrib<VecT>::update_vertex_normals() {
template <class GeomKernelT>
void NormalAttrib<GeomKernelT>::update_vertex_normals() {
if(!kernel_.has_bottom_up_adjacencies()) {
std::cerr << "Error: update_vertex_normals() needs bottom-up adjacencies!" << std::endl;
......@@ -79,8 +79,8 @@ void NormalAttrib<VecT>::update_vertex_normals() {
}
}
template <class VecT>
void NormalAttrib<VecT>::update_face_normals() {
template <class GeomKernelT>
void NormalAttrib<GeomKernelT>::update_face_normals() {
for(FaceIter f_it = kernel_.f_iter(); f_it.valid(); ++f_it) {
// Assume the face is planar, so just take the
......@@ -89,8 +89,8 @@ void NormalAttrib<VecT>::update_face_normals() {
}
}
template <typename VecT>
void NormalAttrib<VecT>::compute_vertex_normal(const VertexHandle& _vh) {
template <class GeomKernelT>
void NormalAttrib<GeomKernelT>::compute_vertex_normal(const VertexHandle& _vh) {
std::set<FaceHandle> faces;
for(VertexOHalfEdgeIter voh_it = kernel_.voh_iter(_vh);
......@@ -103,7 +103,7 @@ void NormalAttrib<VecT>::compute_vertex_normal(const VertexHandle& _vh) {
}
}
}
VecT normal;
typename GeomKernelT::PointT normal;
for(std::set<FaceHandle>::const_iterator f_it = faces.begin();
f_it != faces.end(); ++f_it) {
normal += f_normals_[f_it->idx()];
......@@ -114,8 +114,8 @@ void NormalAttrib<VecT>::compute_vertex_normal(const VertexHandle& _vh) {
v_normals_[_vh.idx()] = normal;
}
template <typename VecT>
void NormalAttrib<VecT>::compute_face_normal(const FaceHandle& _fh) {
template <class GeomKernelT>
void NormalAttrib<GeomKernelT>::compute_face_normal(const FaceHandle& _fh) {
if(kernel_.face(_fh).halfedges().size() < 3) {
std::cerr << "Warning: Degenerate face detected!" << std::endl;
......@@ -129,12 +129,12 @@ void NormalAttrib<VecT>::compute_face_normal(const FaceHandle& _fh) {
std::vector<HalfEdgeHandle> halfedges = kernel_.halfface(hfh).halfedges();
std::vector<HalfEdgeHandle>::const_iterator he_it = halfedges.begin();
VecT p1 = kernel_.vertex(kernel_.halfedge(*he_it).from_vertex());
VecT p2 = kernel_.vertex(kernel_.halfedge(*he_it).to_vertex());
typename GeomKernelT::PointT p1 = kernel_.vertex(kernel_.halfedge(*he_it).from_vertex());
typename GeomKernelT::PointT p2 = kernel_.vertex(kernel_.halfedge(*he_it).to_vertex());
++he_it;
VecT p3 = kernel_.vertex(kernel_.halfedge(*he_it).to_vertex());
typename GeomKernelT::PointT p3 = kernel_.vertex(kernel_.halfedge(*he_it).to_vertex());
VecT n = (p3 - p2) % (p1 - p2);
typename GeomKernelT::PointT n = (p3 - p2) % (p1 - p2);
n.normalize();
f_normals_[_fh.idx()] = n;
......
......@@ -50,11 +50,12 @@
namespace OpenVolumeMesh {
template <class VecT>
class GeometryKernel : public TopologyKernel {
template <class VecT, class TopologyKernelT = TopologyKernel>
class GeometryKernel : public TopologyKernelT {
public:
typedef VecT PointT;
typedef TopologyKernelT KernelT;
/// Constructor
GeometryKernel() {}
......@@ -99,7 +100,7 @@ public:
virtual VertexIter delete_vertex(const VertexHandle& _h) {
assert(_h.idx() < (int)n_vertices());
VertexIter nV = TopologyKernel::delete_vertex(_h);
VertexIter nV = TopologyKernelT::delete_vertex(_h);
vertices_.erase(vertices_.begin() + _h.idx());
......@@ -109,7 +110,7 @@ public:
virtual void clear() {
vertices_.clear();
TopologyKernel::clear();
TopologyKernelT::clear();
}
private:
......
......@@ -50,9 +50,9 @@ namespace OpenVolumeMesh {
/*
* Predefines for most common mesh types
*/
typedef HexahedralMeshTopologyKernel<GeometryKernel<Geometry::Vec3d> > GeometricHexahedralMeshV3d;
typedef GeometryKernel<Geometry::Vec3d, HexahedralMeshTopologyKernel> GeometricHexahedralMeshV3d;
typedef HexahedralMeshTopologyKernel<TopologyKernel> TopologicHexahedralMesh;
typedef HexahedralMeshTopologyKernel TopologicHexahedralMesh;
} // Namespace OpenVolumeMesh
......
......@@ -40,8 +40,6 @@
* *
\*===========================================================================*/
#define HEXAHEDRALMESHITERATORST_CC
#include <set>
#include "HexahedralMeshIterators.hh"
......@@ -54,9 +52,9 @@ namespace OpenVolumeMesh {
// CellSheetCellIter
//================================================================================================
template<class KernelT>
CellSheetCellIter<KernelT>::CellSheetCellIter(const CellHandle& _ref_h,
const unsigned char _orthDir, const HexahedralMeshTopologyKernel<KernelT>* _mesh) :
CellSheetCellIter::CellSheetCellIter(const CellHandle& _ref_h,
const unsigned char _orthDir, const HexahedralMeshTopologyKernel* _mesh) :
BaseIter(_mesh, _ref_h) {
if(!_mesh->has_bottom_up_adjacencies()) {
......@@ -73,7 +71,7 @@ BaseIter(_mesh, _ref_h) {
if(_mesh->orientation(*hf_it, _ref_h) != _orthDir &&
_mesh->orientation(*hf_it, _ref_h) != _mesh->opposite_orientation(_orthDir)) {
CellHandle ch = _mesh->incident_cell(_mesh->opposite_halfface_handle(*hf_it));
if(ch != KernelT::InvalidCellHandle) {
if(ch != TopologyKernel::InvalidCellHandle) {
neighb_sheet_cell_hs_.insert(ch);
}
}
......@@ -86,8 +84,8 @@ BaseIter(_mesh, _ref_h) {
}
}
template<class KernelT>
CellSheetCellIter<KernelT>& CellSheetCellIter<KernelT>::operator--() {
CellSheetCellIter& CellSheetCellIter::operator--() {
if(cur_it_ == neighb_sheet_cell_hs_.begin()) {
BaseIter::valid(false);
......@@ -98,8 +96,8 @@ CellSheetCellIter<KernelT>& CellSheetCellIter<KernelT>::operator--() {
return *this;
}
template<class KernelT>
CellSheetCellIter<KernelT>& CellSheetCellIter<KernelT>::operator++() {
CellSheetCellIter& CellSheetCellIter::operator++() {
++cur_it_;
if(cur_it_ != neighb_sheet_cell_hs_.end()) {
......@@ -114,9 +112,9 @@ CellSheetCellIter<KernelT>& CellSheetCellIter<KernelT>::operator++() {
// HalfFaceSheetHalfFaceIter
//================================================================================================
template<class KernelT>
HalfFaceSheetHalfFaceIter<KernelT>::HalfFaceSheetHalfFaceIter(const HalfFaceHandle& _ref_h,
const HexahedralMeshTopologyKernel<KernelT>* _mesh) :
HalfFaceSheetHalfFaceIter::HalfFaceSheetHalfFaceIter(const HalfFaceHandle& _ref_h,
const HexahedralMeshTopologyKernel* _mesh) :
BaseIter(_mesh, _ref_h) {
if(!_mesh->has_bottom_up_adjacencies()) {
......@@ -148,7 +146,7 @@ BaseIter(_mesh, _ref_h) {
std::set<HalfEdgeHandle> hes;
hes.insert(hes_v.begin(), hes_v.end());
for(CellSheetCellIter<KernelT> csc_it = _mesh->csc_iter(ch, orientation);
for(CellSheetCellIter csc_it = _mesh->csc_iter(ch, orientation);
csc_it.valid(); ++csc_it) {
std::vector<HalfFaceHandle> hfs = _mesh->cell(*csc_it).halffaces();
......@@ -177,8 +175,8 @@ BaseIter(_mesh, _ref_h) {
}
}
template<class KernelT>
HalfFaceSheetHalfFaceIter<KernelT>& HalfFaceSheetHalfFaceIter<KernelT>::operator--() {
HalfFaceSheetHalfFaceIter& HalfFaceSheetHalfFaceIter::operator--() {
--cur_it_;
--edge_it_;
......@@ -190,8 +188,8 @@ HalfFaceSheetHalfFaceIter<KernelT>& HalfFaceSheetHalfFaceIter<KernelT>::operator
return *this;
}
template<class KernelT>
HalfFaceSheetHalfFaceIter<KernelT>& HalfFaceSheetHalfFaceIter<KernelT>::operator++() {
HalfFaceSheetHalfFaceIter& HalfFaceSheetHalfFaceIter::operator++() {
++cur_it_;
++edge_it_;
......@@ -207,9 +205,9 @@ HalfFaceSheetHalfFaceIter<KernelT>& HalfFaceSheetHalfFaceIter<KernelT>::operator
// OutsideNeighborHalfFaceIter
//================================================================================================
template<class KernelT>
OutsideNeighborHalfFaceIter<KernelT>::OutsideNeighborHalfFaceIter(const HalfFaceHandle& _ref_h,
const HexahedralMeshTopologyKernel<KernelT>* _mesh) :
OutsideNeighborHalfFaceIter::OutsideNeighborHalfFaceIter(const HalfFaceHandle& _ref_h,
const HexahedralMeshTopologyKernel* _mesh) :
BaseIter(_mesh, _ref_h) {
if(!_mesh->has_bottom_up_adjacencies()) {
......@@ -224,7 +222,7 @@ BaseIter(_mesh, _ref_h) {
he_it != halfedges.end(); ++he_it) {
// Get outside halffaces
typename KernelT::HalfEdgeHalfFaceIter hehf_it = _mesh->hehf_iter(_mesh->opposite_halfedge_handle(*he_it));
OpenVolumeMesh::HalfEdgeHalfFaceIter hehf_it = _mesh->hehf_iter(_mesh->opposite_halfedge_handle(*he_it));
for(; hehf_it.valid(); ++hehf_it) {
if(_mesh->is_boundary(*hehf_it)) {
......@@ -242,8 +240,8 @@ BaseIter(_mesh, _ref_h) {
}
}
template<class KernelT>
OutsideNeighborHalfFaceIter<KernelT>& OutsideNeighborHalfFaceIter<KernelT>::operator--() {
OutsideNeighborHalfFaceIter& OutsideNeighborHalfFaceIter::operator--() {
--cur_it_;
--edge_it_;
......@@ -255,8 +253,8 @@ OutsideNeighborHalfFaceIter<KernelT>& OutsideNeighborHalfFaceIter<KernelT>::oper
return *this;
}
template<class KernelT>
OutsideNeighborHalfFaceIter<KernelT>& OutsideNeighborHalfFaceIter<KernelT>::operator++() {
OutsideNeighborHalfFaceIter& OutsideNeighborHalfFaceIter::operator++() {
++cur_it_;
++edge_it_;
......
......@@ -47,10 +47,9 @@
namespace OpenVolumeMesh {
template<class KernelT>
class HexahedralMeshTopologyKernel;
template<class KernelT>
class CellSheetCellIter : public BaseIterator<CellHandle,
CellHandle> {
private:
......@@ -58,7 +57,7 @@ private:
CellHandle> BaseIter;
public:
CellSheetCellIter(const CellHandle& _ref_h, const unsigned char _orthDir,
const HexahedralMeshTopologyKernel<KernelT>* _mesh);
const HexahedralMeshTopologyKernel* _mesh);
CellSheetCellIter& operator=(const CellSheetCellIter& _c) {
BaseIter::operator=(_c);
......@@ -113,7 +112,7 @@ private:
std::set<CellHandle>::const_iterator cur_it_;
};
template<class KernelT>
class HalfFaceSheetHalfFaceIter : public BaseIterator<HalfFaceHandle,
HalfFaceHandle> {
private:
......@@ -121,7 +120,7 @@ private:
HalfFaceHandle> BaseIter;
public:
HalfFaceSheetHalfFaceIter(const HalfFaceHandle& _ref_h,
const HexahedralMeshTopologyKernel<KernelT>* _mesh);
const HexahedralMeshTopologyKernel* _mesh);
HalfFaceSheetHalfFaceIter& operator=(const HalfFaceSheetHalfFaceIter& _c) {
BaseIter::operator=(_c);
adjacent_halffaces_ = _c.adjacent_halffaces_;
......@@ -179,7 +178,7 @@ private:
std::vector<EdgeHandle>::const_iterator edge_it_;
};
template<class KernelT>
class OutsideNeighborHalfFaceIter : public BaseIterator<HalfFaceHandle,
HalfFaceHandle> {
private:
......@@ -187,7 +186,7 @@ private:
HalfFaceHandle> BaseIter;
public:
OutsideNeighborHalfFaceIter(const HalfFaceHandle& _ref_h,
const HexahedralMeshTopologyKernel<KernelT>* _mesh);
const HexahedralMeshTopologyKernel* _mesh);
OutsideNeighborHalfFaceIter& operator=(const OutsideNeighborHalfFaceIter& _c) {
BaseIter::operator=(_c);
neighbor_halffaces_ = _c.neighbor_halffaces_;
......@@ -247,8 +246,4 @@ private:
} // Namespace OpenVolumeMesh
#if defined(INCLUDE_TEMPLATES) && !defined(HEXAHEDRALMESHITERATORST_CC)
#include "HexahedralMeshIteratorsT.cc"
#endif
#endif /* HEXAHEDRALMESHITERATORS_HH */
......@@ -40,66 +40,64 @@
* *
\*===========================================================================*/
#define HEXAHEDRALMESHTOPOLOGYKERNELT_CC
#include "HexahedralMeshTopologyKernel.hh"
namespace OpenVolumeMesh {
template <typename KernelT>
HexahedralMeshTopologyKernel<KernelT>::HexahedralMeshTopologyKernel() {
HexahedralMeshTopologyKernel::HexahedralMeshTopologyKernel() {
}
//========================================================================================
template <typename KernelT>
HexahedralMeshTopologyKernel<KernelT>::~HexahedralMeshTopologyKernel() {
HexahedralMeshTopologyKernel::~HexahedralMeshTopologyKernel() {
}
//========================================================================================
template <typename KernelT>
FaceHandle HexahedralMeshTopologyKernel<KernelT>::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck) {
FaceHandle HexahedralMeshTopologyKernel::add_face(const std::vector<HalfEdgeHandle>& _halfedges, bool _topologyCheck) {
if(_halfedges.size() != 4) {
std::cerr << "Face valence is not four! Aborting." << std::endl;
return KernelT::InvalidFaceHandle;
return TopologyKernel::InvalidFaceHandle;
}
return KernelT::add_face(_halfedges, _topologyCheck);
return TopologyKernel::add_face(_halfedges, _topologyCheck);
}
//========================================================================================
template <typename KernelT>
FaceHandle
HexahedralMeshTopologyKernel<KernelT>::add_face(const std::vector<VertexHandle>& _vertices) {
HexahedralMeshTopologyKernel::add_face(const std::vector<VertexHandle>& _vertices) {
if(_vertices.size() != 4) {
std::cerr << "Face valence is not four! Aborting." << std::endl;
return KernelT::InvalidFaceHandle;
return TopologyKernel::InvalidFaceHandle;
}
return KernelT::add_face(_vertices);
return TopologyKernel::add_face(_vertices);
}
//========================================================================================
template <typename KernelT>
CellHandle
HexahedralMeshTopologyKernel<KernelT>::add_cell(const std::vector<HalfFaceHandle>& _halffaces, bool _topologyCheck, bool _reorderFaces) {
HexahedralMeshTopologyKernel::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;
return KernelT::InvalidCellHandle;
return TopologyKernel::InvalidCellHandle;
}
for(typename std::vector<HalfFaceHandle>::const_iterator it = _halffaces.begin();
it != _halffaces.end(); ++it) {
if(KernelT::halfface(*it).halfedges().size() != 4) {
if(TopologyKernel::halfface(*it).halfedges().size() != 4) {
std::cerr << "Incident face does not have valence four! Aborting." << std::endl;
return KernelT::InvalidCellHandle;
return TopologyKernel::InvalidCellHandle;
}
}
......@@ -113,19 +111,19 @@ HexahedralMeshTopologyKernel<KernelT>::add_cell(const std::vector<HalfFaceHandle
// The user wants the faces to be reordered
if(_reorderFaces) {
ordered_halffaces.resize(6, KernelT::InvalidHalfFaceHandle);
ordered_halffaces.resize(6, TopologyKernel::InvalidHalfFaceHandle);
// Create top side
ordered_halffaces[0] = _halffaces[0];
// Go over all incident halfedges
std::vector<HalfEdgeHandle> hes = KernelT::halfface(ordered_halffaces[0]).halfedges();
std::vector<HalfEdgeHandle> hes = TopologyKernel::halfface(ordered_halffaces[0]).halfedges();
unsigned int idx = 0;
for(typename std::vector<HalfEdgeHandle>::const_iterator he_it = hes.begin();
he_it != hes.end(); ++he_it) {
HalfFaceHandle ahfh = get_adjacent_halfface(ordered_halffaces[0], *he_it, _halffaces);
if(ahfh == KernelT::InvalidHalfFaceHandle) {
if(ahfh == TopologyKernel::InvalidHalfFaceHandle) {
std::cerr << "The current halfface is invalid!" << std::endl;
continue;
}
......@@ -135,14 +133,14 @@ HexahedralMeshTopologyKernel<KernelT>::add_cell(const std::vector<HalfFaceHandle
// Now set bottom-halfface
HalfFaceHandle cur_hf = ordered_halffaces[0];
HalfEdgeHandle cur_he = *(KernelT::halfface(cur_hf).halfedges().begin());
HalfEdgeHandle cur_he = *(TopologyKernel::halfface(cur_hf).halfedges().begin());
cur_hf = get_adjacent_halfface(cur_hf, cur_he, _halffaces);
cur_he = KernelT::opposite_halfedge_handle(cur_he);
cur_he = KernelT::next_halfedge_in_halfface(cur_he, cur_hf);
cur_he = KernelT::next_halfedge_in_halfface(cur_he, cur_hf);
cur_he = TopologyKernel::opposite_halfedge_handle(cur_he);
cur_he = TopologyKernel::next_halfedge_in_halfface(cur_he, cur_hf);
cur_he = TopologyKernel::next_halfedge_in_halfface(cur_he, cur_hf);
cur_hf = get_adjacent_halfface(cur_hf, cur_he, _halffaces);
if(cur_hf != KernelT::InvalidHalfFaceHandle) {
if(cur_hf != TopologyKernel::InvalidHalfFaceHandle) {
ordered_halffaces[1] = cur_hf;
} else {
std::cerr << "The current halfface is invalid!" << std::endl;
......@@ -180,8 +178,8 @@ HexahedralMeshTopologyKernel<KernelT>::add_cell(const std::vector<HalfFaceHandle
HalfFaceHandle hfhTop = ordered_halffaces[0];
HalfFaceHandle hfhBot = ordered_halffaces[1];
std::vector<HalfEdgeHandle> halfedgesTop = KernelT::halfface(ordered_halffaces[0]).halfedges();
std::vector<HalfEdgeHandle> halfedgesBot = KernelT::halfface(ordered_halffaces[1]).halfedges();
std::vector<HalfEdgeHandle> halfedgesTop = TopologyKernel::halfface(ordered_halffaces[0]).halfedges();
std::vector<HalfEdgeHandle> halfedgesBot = TopologyKernel::halfface(ordered_halffaces[1]).halfedges();
int offsetTop = -1;
int offsetBot = -1;
......@@ -201,14 +199,14 @@ HexahedralMeshTopologyKernel<KernelT>::add_cell(const std::vector<HalfFaceHandle
offsetTop = (offsetTop + 1) % 4;
if(ahfh != ordered_halffaces[orderTop[offsetTop]]) {
std::cerr << "Faces not in right order!" << std::endl;
return KernelT::InvalidCellHandle;
return TopologyKernel::InvalidCellHandle;
}
}
}
if(offsetTop == -1) {
std::cerr << "Faces not in right order!" << std::endl;
return KernelT::InvalidCellHandle;
return TopologyKernel::InvalidCellHandle;
}
// Traverse halfedges bottom
......@@ -226,41 +224,41 @@ HexahedralMeshTopologyKernel<KernelT>::add_cell(const std::vector<HalfFaceHandle
offsetBot = (offsetBot + 1) % 4;
if(ahfh != ordered_halffaces[orderBot[offsetBot]]) {
std::cerr << "Faces not in right order!" << std::endl;
return KernelT::InvalidCellHandle;
return TopologyKernel::InvalidCellHandle;
}
}
}
if(offsetBot == -1) {
std::cerr << "Faces not in right order!" << std::endl;
return KernelT::InvalidCellHandle;
return TopologyKernel::InvalidCellHandle;
}
return KernelT::add_cell(ordered_halffaces, _topologyCheck);
return TopologyKernel::add_cell(ordered_halffaces, _topologyCheck);
}
//========================================================================================
template <typename KernelT>
const HalfFaceHandle&
HexahedralMeshTopologyKernel<KernelT>::get_adjacent_halfface(const HalfFaceHandle& _hfh, const HalfEdgeHandle& _heh,
HexahedralMeshTopologyKernel::get_adjacent_halfface(const HalfFaceHandle& _hfh, const HalfEdgeHandle& _heh,
const std::vector<HalfFaceHandle>& _halffaces) const {
// Search for halfface that is incident to the opposite
// halfedge of _heh
HalfEdgeHandle o_he = KernelT::opposite_halfedge_handle(_heh);
HalfEdgeHandle o_he = TopologyKernel::opposite_halfedge_handle(_heh);
for(typename std::vector<HalfFaceHandle>::const_iterator it = _halffaces.begin();
it != _halffaces.end(); ++it) {
if(*it == _hfh) continue;
std::vector<HalfEdgeHandle> halfedges = KernelT::halfface(*it).halfedges();
std::vector<HalfEdgeHandle> halfedges = TopologyKernel::halfface(*it).halfedges();
for(typename std::vector<HalfEdgeHandle>::const_iterator h_it = halfedges.begin();
h_it != halfedges.end(); ++h_it) {
if(*h_it == o_he) return *it;
}
}
return KernelT::InvalidHalfFaceHandle;
return TopologyKernel::InvalidHalfFaceHandle;
}
} // Namespace OpenVolumeMesh
......@@ -45,7 +45,7 @@
#include <set>
#include "../Core/GeometryKernel.hh"
#include "../Core/TopologyKernel.hh"
#include "HexahedralMeshIterators.hh"
namespace OpenVolumeMesh {
......@@ -78,8 +78,7 @@ namespace OpenVolumeMesh {
* \li \c 6. ZB
*/
template <class KernelT>
class HexahedralMeshTopologyKernel : public KernelT {
class HexahedralMeshTopologyKernel : public TopologyKernel {
public:
// Orientation constants
......@@ -113,13 +112,13 @@ public:
// ======================= Specialized Iterators =============================
friend class CellSheetCellIter<KernelT>;