54 #include "OpenVolumeMeshHandle.hh" 66 typedef std::bidirectional_iterator_tag iterator_category;
67 typedef int difference_type;
68 typedef const OH value_type;
69 typedef const OH* pointer;
70 typedef const OH& reference;
74 valid_(
true), cur_handle_(_ch), mesh_(_mesh) {}
77 valid_(
true), mesh_(_mesh) {}
83 return (this->cur_handle_ == _c.cur_handle() &&
84 this->valid_ == _c.valid() &&
85 this->mesh_ == _c.mesh());
88 return !this->operator==(_c);
91 pointer operator->()
const {
95 reference operator*()
const {
100 return cur_handle_.idx() < _c.cur_handle_.idx();
104 this->valid_ = _c.valid();
105 this->cur_handle_ = _c.cur_handle();
106 this->mesh_ = _c.mesh();
110 operator bool()
const {
114 void valid(
bool _valid) {
120 void cur_handle(
const OH& _h) {
123 reference cur_handle()
const {
138 #if __cplusplus >= 201103L || _MSC_VER >= 1800 // an older MSVC version might be sufficient, didn't test 140 #include <type_traits> 143 using is_ovm_iterator = std::is_base_of<BaseIterator<typename std::remove_const<typename I::value_type>::type>, I>;
148 typename std::enable_if<is_ovm_iterator<I>::value, I>::type
149 begin(
const std::pair<I, I>& iterpair)
151 return iterpair.first;
155 typename std::enable_if<is_ovm_iterator<I>::value, I>::type
156 end(
const std::pair<I, I>& iterpair)
158 return iterpair.second;
172 BaseIter(_mesh, _oh),
174 max_laps_(_max_laps),
179 BaseIter(_mesh, OH()),
181 max_laps_(_max_laps),
195 return (BaseIter::operator==(_c) &&
196 this->lap() == _c.lap() &&
197 this->ref_handle() == _c.ref_handle());
200 return !this->operator==(_c);
205 return BaseIter::operator<(_c);
207 return lap_ < _c.lap_;
211 BaseIter::operator=(_c);
212 this->ref_handle_ = _c.ref_handle();
213 this->lap_ = _c.lap_;
214 this->max_laps_ = _c.max_laps_;
218 const IH& ref_handle()
const {
229 void max_laps(
int _max_laps) {
230 max_laps_ = _max_laps;
232 int max_laps()
const {
271 for(
int i = 0; i < _n; ++i) {
278 for(
int i = 0; i < _n; ++i) {
284 for(
int i = 0; i < _n; ++i) {
290 for(
int i = 0; i < _n; ++i) {
334 for(
int i = 0; i < _n; ++i) {
341 for(
int i = 0; i < _n; ++i) {
347 for(
int i = 0; i < _n; ++i) {
353 for(
int i = 0; i < _n; ++i) {
393 for(
int i = 0; i < _n; ++i) {
400 for(
int i = 0; i < _n; ++i) {
406 for(
int i = 0; i < _n; ++i) {
412 for(
int i = 0; i < _n; ++i) {
450 for(
int i = 0; i < _n; ++i) {
457 for(
int i = 0; i < _n; ++i) {
463 for(
int i = 0; i < _n; ++i) {
469 for(
int i = 0; i < _n; ++i) {
479 std::vector<FaceHandle> faces_;
508 for(
int i = 0; i < _n; ++i) {
515 for(
int i = 0; i < _n; ++i) {
521 for(
int i = 0; i < _n; ++i) {
527 for(
int i = 0; i < _n; ++i) {
537 std::vector<CellHandle> cells_;
565 for(
int i = 0; i < _n; ++i) {
572 for(
int i = 0; i < _n; ++i) {
578 for(
int i = 0; i < _n; ++i) {
584 for(
int i = 0; i < _n; ++i) {
594 CellHandle getCellHandle(
int _cur_index)
const;
597 std::vector<CellHandle> cells_;
626 for(
int i = 0; i < _n; ++i) {
633 for(
int i = 0; i < _n; ++i) {
639 for(
int i = 0; i < _n; ++i) {
645 for(
int i = 0; i < _n; ++i) {
655 std::vector<VertexHandle> incident_vertices_;
684 for(
int i = 0; i < _n; ++i) {
691 for(
int i = 0; i < _n; ++i) {
697 for(
int i = 0; i < _n; ++i) {
703 for(
int i = 0; i < _n; ++i) {
713 std::vector<CellHandle> adjacent_cells_;
742 for(
int i = 0; i < _n; ++i) {
749 for(
int i = 0; i < _n; ++i) {
755 for(
int i = 0; i < _n; ++i) {
761 for(
int i = 0; i < _n; ++i) {
771 std::vector<VertexHandle> vertices_;
799 for(
int i = 0; i < _n; ++i) {
806 for(
int i = 0; i < _n; ++i) {
812 for(
int i = 0; i < _n; ++i) {
818 for(
int i = 0; i < _n; ++i) {
824 const EdgeHandle& common_edge()
const {
return common_edges_[cur_index_]; }
830 std::vector<HalfFaceHandle> neighbor_halffaces_;
831 std::vector<EdgeHandle> common_edges_;
857 for(
int i = 0; i < _n; ++i) {
864 for(
int i = 0; i < _n; ++i) {
870 for(
int i = 0; i < _n; ++i) {
876 for(
int i = 0; i < _n; ++i) {
911 for(
int i = 0; i < _n; ++i) {
918 for(
int i = 0; i < _n; ++i) {
924 for(
int i = 0; i < _n; ++i) {
930 for(
int i = 0; i < _n; ++i) {
965 for(
int i = 0; i < _n; ++i) {
972 for(
int i = 0; i < _n; ++i) {
978 for(
int i = 0; i < _n; ++i) {
984 for(
int i = 0; i < _n; ++i) {
1019 for(
int i = 0; i < _n; ++i) {
1026 for(
int i = 0; i < _n; ++i) {
1032 for(
int i = 0; i < _n; ++i) {
1038 for(
int i = 0; i < _n; ++i) {
1073 for(
int i = 0; i < _n; ++i) {
1080 for(
int i = 0; i < _n; ++i) {
1086 for(
int i = 0; i < _n; ++i) {
1092 for(
int i = 0; i < _n; ++i) {
1127 for(
int i = 0; i < _n; ++i) {
1134 for(
int i = 0; i < _n; ++i) {
1140 for(
int i = 0; i < _n; ++i) {
1146 for(
int i = 0; i < _n; ++i) {
1161 namespace Internal {
1211 std::vector<HalfFaceHandle> halffaces_;
1229 std::vector<FaceHandle> faces_;
1247 std::vector<HalfFaceHandle> halffaces_;
1349 std::vector<HalfEdgeHandle> halfedges_;
1367 std::vector<EdgeHandle> edges_;
1385 std::vector<HalfFaceHandle>::const_iterator hf_iter_;
1402 std::vector<HalfFaceHandle>::const_iterator hf_iter_;
1411 template <
class CirculatorImpl>
1416 CirculatorImpl(_ref_h, _mesh, _max_laps) {}
1419 CirculatorImpl::operator++();
1424 CirculatorImpl::operator--();
1441 for(
int i = 0; i < _n; ++i) {
1448 for(
int i = 0; i < _n; ++i) {
1454 for(
int i = 0; i < _n; ++i) {
1460 for(
int i = 0; i < _n; ++i) {
1494 template <
class Iter,
class Handle>
1502 it_(_mesh, Handle(0)),
1503 it_begin_(_mesh, Handle(0)),
1504 it_end_(_mesh, Handle((
int)n_items())) {
1506 if(!has_incidences()) {
1508 std::cerr <<
"This iterator needs bottom-up incidences!" << std::endl;
1510 BaseIter::valid(
false);
1514 while(it_ != it_end_ && !BaseIter::mesh()->is_boundary(*it_)){
1517 BaseIter::valid(it_ != it_end_);
1518 if(BaseIter::valid()) {
1519 BaseIter::cur_handle(*it_);
1536 for(
int i = 0; i < _n; ++i) {
1543 for(
int i = 0; i < _n; ++i) {
1549 for(
int i = 0; i < _n; ++i) {
1555 for(
int i = 0; i < _n; ++i) {
1563 while(it_ >= it_begin_ && !BaseIter::mesh()->is_boundary(*it_)){
1566 if(it_ >= it_begin_) {
1567 BaseIter::cur_handle(*it_);
1569 BaseIter::valid(
false);
1576 while(it_ != it_end_ && !BaseIter::mesh()->is_boundary(*it_)){
1579 if(it_ != it_end_) {
1580 BaseIter::cur_handle(*it_);
1582 BaseIter::valid(
false);
1588 size_t n_items()
const;
1589 bool has_incidences()
const;
1593 const Iter it_begin_;