45 #include "TetrahedralMeshIterators.hh"
46 #include "TetrahedralMeshTopologyKernel.hh"
47 #include "../Core/Iterators.hh"
56 TetVertexIter::TetVertexIter(
const CellHandle& _ref_h,
57 const TetrahedralMeshTopologyKernel* _mesh,
int _max_laps) :
58 BaseIter(_mesh, _ref_h, _max_laps) {
60 assert(_ref_h.is_valid());
61 assert(_mesh->cell(_ref_h).halffaces().size() == 4);
64 HalfFaceHandle curHF = *_mesh->cell(_ref_h).halffaces().begin();
65 assert(curHF.is_valid());
68 assert(_mesh->halfface(curHF).halfedges().size() == 3);
69 HalfEdgeHandle curHE = *_mesh->halfface(curHF).halfedges().begin();
70 assert(curHE.is_valid());
72 vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
74 curHE = _mesh->next_halfedge_in_halfface(curHE, curHF);
76 vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
78 curHE = _mesh->next_halfedge_in_halfface(curHE, curHF);
80 vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
82 curHF = _mesh->adjacent_halfface_in_cell(curHF, curHE);
83 curHE = _mesh->opposite_halfedge_handle(curHE);
84 curHE = _mesh->next_halfedge_in_halfface(curHE, curHF);
86 vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
89 BaseIter::valid(vertices_.size() > 0);
90 if(BaseIter::valid()) {
91 BaseIter::cur_handle(vertices_[cur_index_]);
96 TetVertexIter& TetVertexIter::operator--() {
98 if (cur_index_ == 0) {
99 cur_index_ = vertices_.size() - 1;
102 BaseIter::valid(
false);
107 BaseIter::cur_handle(vertices_[cur_index_]);
113 TetVertexIter& TetVertexIter::operator++() {
116 if(cur_index_ == vertices_.size()) {
119 if (lap_ >= max_laps_)
120 BaseIter::valid(
false);
123 BaseIter::cur_handle(vertices_[cur_index_]);