54 #include "OpenVolumeMeshHandle.hh" 55 #include "OpenVolumeMesh/Config/Export.hh" 67 typedef std::bidirectional_iterator_tag iterator_category;
68 typedef int difference_type;
69 typedef const OH value_type;
70 typedef const OH* pointer;
71 typedef const OH& reference;
75 valid_(
true), cur_handle_(_ch), mesh_(_mesh) {}
78 valid_(
true), mesh_(_mesh) {}
88 return (this->cur_handle_ == _c.cur_handle() &&
89 this->valid_ == _c.valid() &&
90 this->mesh_ == _c.mesh());
93 return !this->operator==(_c);
96 pointer operator->()
const {
100 reference operator*()
const {
105 return cur_handle_.idx() < _c.cur_handle_.idx();
108 operator bool()
const {
112 void valid(
bool _valid) {
118 void cur_handle(
const OH& _h) {
121 reference cur_handle()
const {
136 #if __cplusplus >= 201103L || _MSC_VER >= 1800 // an older MSVC version might be sufficient, didn't test 138 #include <type_traits> 141 using is_ovm_iterator = std::is_base_of<BaseIterator<typename std::remove_const<typename I::value_type>::type>, I>;
146 typename std::enable_if<is_ovm_iterator<I>::value, I>::type
147 begin(
const std::pair<I, I>& iterpair)
149 return iterpair.first;
153 typename std::enable_if<is_ovm_iterator<I>::value, I>::type
154 end(
const std::pair<I, I>& iterpair)
156 return iterpair.second;
170 BaseIter(_mesh, _oh),
172 max_laps_(_max_laps),
177 BaseIter(_mesh, OH()),
179 max_laps_(_max_laps),
194 return (BaseIter::operator==(_c) &&
195 this->lap() == _c.lap() &&
196 this->ref_handle() == _c.ref_handle());
199 return !this->operator==(_c);
204 return BaseIter::operator<(_c);
206 return lap_ < _c.lap_;
211 const IH& ref_handle()
const {
222 void max_laps(
int _max_laps) {
223 max_laps_ = _max_laps;
225 int max_laps()
const {
264 for(
int i = 0; i < _n; ++i) {
271 for(
int i = 0; i < _n; ++i) {
277 for(
int i = 0; i < _n; ++i) {
283 for(
int i = 0; i < _n; ++i) {
327 for(
int i = 0; i < _n; ++i) {
334 for(
int i = 0; i < _n; ++i) {
340 for(
int i = 0; i < _n; ++i) {
346 for(
int i = 0; i < _n; ++i) {
386 for(
int i = 0; i < _n; ++i) {
393 for(
int i = 0; i < _n; ++i) {
399 for(
int i = 0; i < _n; ++i) {
405 for(
int i = 0; i < _n; ++i) {
443 for(
int i = 0; i < _n; ++i) {
450 for(
int i = 0; i < _n; ++i) {
456 for(
int i = 0; i < _n; ++i) {
462 for(
int i = 0; i < _n; ++i) {
472 std::vector<FaceHandle> faces_;
501 for(
int i = 0; i < _n; ++i) {
508 for(
int i = 0; i < _n; ++i) {
514 for(
int i = 0; i < _n; ++i) {
520 for(
int i = 0; i < _n; ++i) {
530 std::vector<CellHandle> cells_;
558 for(
int i = 0; i < _n; ++i) {
565 for(
int i = 0; i < _n; ++i) {
571 for(
int i = 0; i < _n; ++i) {
577 for(
int i = 0; i < _n; ++i) {
587 CellHandle getCellHandle(
int _cur_index)
const;
590 std::vector<CellHandle> cells_;
619 for(
int i = 0; i < _n; ++i) {
626 for(
int i = 0; i < _n; ++i) {
632 for(
int i = 0; i < _n; ++i) {
638 for(
int i = 0; i < _n; ++i) {
648 std::vector<VertexHandle> incident_vertices_;
677 for(
int i = 0; i < _n; ++i) {
684 for(
int i = 0; i < _n; ++i) {
690 for(
int i = 0; i < _n; ++i) {
696 for(
int i = 0; i < _n; ++i) {
706 std::vector<CellHandle> adjacent_cells_;
735 for(
int i = 0; i < _n; ++i) {
742 for(
int i = 0; i < _n; ++i) {
748 for(
int i = 0; i < _n; ++i) {
754 for(
int i = 0; i < _n; ++i) {
764 std::vector<VertexHandle> vertices_;
792 for(
int i = 0; i < _n; ++i) {
799 for(
int i = 0; i < _n; ++i) {
805 for(
int i = 0; i < _n; ++i) {
811 for(
int i = 0; i < _n; ++i) {
817 const EdgeHandle& common_edge()
const {
return common_edges_[cur_index_]; }
823 std::vector<HalfFaceHandle> neighbor_halffaces_;
824 std::vector<EdgeHandle> common_edges_;
850 for(
int i = 0; i < _n; ++i) {
857 for(
int i = 0; i < _n; ++i) {
863 for(
int i = 0; i < _n; ++i) {
869 for(
int i = 0; i < _n; ++i) {
904 for(
int i = 0; i < _n; ++i) {
911 for(
int i = 0; i < _n; ++i) {
917 for(
int i = 0; i < _n; ++i) {
923 for(
int i = 0; i < _n; ++i) {
958 for(
int i = 0; i < _n; ++i) {
965 for(
int i = 0; i < _n; ++i) {
971 for(
int i = 0; i < _n; ++i) {
977 for(
int i = 0; i < _n; ++i) {
1012 for(
int i = 0; i < _n; ++i) {
1019 for(
int i = 0; i < _n; ++i) {
1025 for(
int i = 0; i < _n; ++i) {
1031 for(
int i = 0; i < _n; ++i) {
1066 for(
int i = 0; i < _n; ++i) {
1073 for(
int i = 0; i < _n; ++i) {
1079 for(
int i = 0; i < _n; ++i) {
1085 for(
int i = 0; i < _n; ++i) {
1120 for(
int i = 0; i < _n; ++i) {
1127 for(
int i = 0; i < _n; ++i) {
1133 for(
int i = 0; i < _n; ++i) {
1139 for(
int i = 0; i < _n; ++i) {
1154 namespace Internal {
1204 std::vector<HalfFaceHandle> halffaces_;
1222 std::vector<FaceHandle> faces_;
1240 std::vector<HalfFaceHandle> halffaces_;
1342 std::vector<HalfEdgeHandle> halfedges_;
1360 std::vector<EdgeHandle> edges_;
1378 std::vector<HalfFaceHandle>::const_iterator hf_iter_;
1395 std::vector<HalfFaceHandle>::const_iterator hf_iter_;
1404 template <
class CirculatorImpl>
1409 CirculatorImpl(_ref_h, _mesh, _max_laps) {}
1412 CirculatorImpl::operator++();
1417 CirculatorImpl::operator--();
1434 for(
int i = 0; i < _n; ++i) {
1441 for(
int i = 0; i < _n; ++i) {
1447 for(
int i = 0; i < _n; ++i) {
1453 for(
int i = 0; i < _n; ++i) {
1491 typedef GenericCirculator<Internal::VertexEdgeIterImpl>
VertexEdgeIter;
1494 typedef GenericCirculator<Internal::HalfEdgeFaceIterImpl>
HalfEdgeFaceIter;
1496 typedef GenericCirculator<Internal::EdgeHalfFaceIterImpl>
EdgeHalfFaceIter;
1497 typedef GenericCirculator<Internal::EdgeFaceIterImpl>
EdgeFaceIter;
1498 typedef GenericCirculator<Internal::EdgeCellIterImpl>
EdgeCellIter;
1501 typedef GenericCirculator<Internal::HalfFaceEdgeIterImpl>
HalfFaceEdgeIter;
1503 typedef GenericCirculator<Internal::FaceVertexIterImpl>
FaceVertexIter;
1504 typedef GenericCirculator<Internal::FaceHalfEdgeIterImpl>
FaceHalfEdgeIter;
1505 typedef GenericCirculator<Internal::FaceEdgeIterImpl>
FaceEdgeIter;
1507 typedef GenericCirculator<Internal::CellHalfEdgeIterImpl>
CellHalfEdgeIter;
1508 typedef GenericCirculator<Internal::CellEdgeIterImpl>
CellEdgeIter;
1509 typedef GenericCirculator<Internal::CellHalfFaceIterImpl>
CellHalfFaceIter;
1510 typedef GenericCirculator<Internal::CellFaceIterImpl>
CellFaceIter;
1514 template <
class Iter,
class Handle>
1522 it_(_mesh, Handle(0)),
1523 it_begin_(_mesh, Handle(0)),
1524 it_end_(_mesh, Handle((
int)n_items())) {
1526 if(!has_incidences()) {
1528 std::cerr <<
"This iterator needs bottom-up incidences!" << std::endl;
1530 BaseIter::valid(
false);
1534 while(it_ != it_end_ && !BaseIter::mesh()->is_boundary(*it_)){
1537 BaseIter::valid(it_ != it_end_);
1538 if(BaseIter::valid()) {
1539 BaseIter::cur_handle(*it_);
1556 for(
int i = 0; i < _n; ++i) {
1563 for(
int i = 0; i < _n; ++i) {
1569 for(
int i = 0; i < _n; ++i) {
1575 for(
int i = 0; i < _n; ++i) {
1583 while(it_ >= it_begin_ && !BaseIter::mesh()->is_boundary(*it_)){
1586 if(it_ >= it_begin_) {
1587 BaseIter::cur_handle(*it_);
1589 BaseIter::valid(
false);
1596 while(it_ != it_end_ && !BaseIter::mesh()->is_boundary(*it_)){
1599 if(it_ != it_end_) {
1600 BaseIter::cur_handle(*it_);
1602 BaseIter::valid(
false);
1608 size_t n_items()
const;
1609 bool has_incidences()
const;
1613 const Iter it_begin_;