52 #ifndef CGAL_HALFEDGE_DATA_STRUCTURE_USING_VECTOR_H
53 #define CGAL_HALFEDGE_DATA_STRUCTURE_USING_VECTOR_H 1
55 #include <CGAL/basic.h>
56 #endif // CGAL_BASIC_H
57 #ifndef CGAL_PROTECT_CSTDDEF
59 #define CGAL_PROTECT_CSTDDEF
61 #ifndef CGAL_PROTECT_ALGORITHM
63 #define CGAL_PROTECT_ALGORITHM
65 #ifndef CGAL_PROTECT_VECTOR
67 #define CGAL_PROTECT_VECTOR
69 #ifndef CGAL_CIRCULATOR_H
72 #ifndef CGAL_N_STEP_ADAPTOR_H
76 #ifndef CGAL_HALFEDGE_DATA_STRUCTURE_DECORATOR_H
81 #define _HDS_vector_vertex _Hvv
82 #define _HDS_vector_halfedge _Hvh
83 #define _HDS_vector_facet _Hvf
92 template <
class V,
class H,
class F>
111 template <
class V,
class H,
class F>
145 template <
class V,
class H,
class F>
171 template <
class V,
class H,
class F>
182 typedef typename Facet::Plane
Plane;
190 typedef typename Halfedge_vector::size_type
Size;
192 typedef typename Halfedge_vector::difference_type
402 h->H::set_opposite(g);
403 g->H::set_opposite(h);
414 h->H::set_opposite(g);
415 g->H::set_opposite(h);
458 h->H::set_opposite( &*g);
459 g->H::set_opposite( &*h);
466 std::vector<Halfedge_iterator>,
Tag_false){}
475 h->vertex()->set_halfedge(&*h);
481 h->facet()->set_halfedge(&*h);
537 #define CGAL_V_UPDATE(v) (&*(v_new + (Vertex_const_iterator(v) - v_old)))
538 #define CGAL_H_UPDATE(h) (&*(h_new + (Halfedge_const_iterator(h) - h_old)))
539 #define CGAL_H_UPDATE_I(h) (h_new + (Halfedge_const_iterator(h) - h_old))
540 #define CGAL_F_UPDATE(f) (&*(f_new + (Facet_const_iterator(f) - f_old)))
542 template <
class V,
class H,
class F>
562 if ( ! h->is_border())
569 #undef CGAL_H_UPDATE_I
572 template <
class V,
class H,
class F>
575 nb_border_halfedges = 0;
577 border_halfedges = halfedges_end();
581 while ( ll != edges_end() && (! (*ll).is_border()) &&
582 (!(*ll).opposite()->is_border() ))
584 if ( ll == edges_end())
589 typedef std::vector<Halfedge_iterator> HVector;
591 hvector.reserve( halfedges.size());
594 hvector.push_back(
i);
597 typename HVector::iterator llhv = hvector.begin()+2*(ll-edges_begin());
601 typename HVector::iterator rrhv = hvector.end();
609 while ( rr > ll && ((*rr).is_border() ||
610 (*rr).opposite()->is_border())) {
611 if ( ! (*rr).opposite()->is_border()) {
613 update_opposite( rr);
622 std::swap( *((*ll).opposite()), *((*rr).opposite()));
624 update_opposite( ll);
625 update_opposite( rr);
630 while ( !(*ll).is_border() && !(*ll).opposite()->is_border()) {
640 std::swap( *((*ll).opposite()), *((*rr).opposite()));
642 update_opposite( ll);
643 update_opposite( rr);
646 if ( ! (*rr).opposite()->is_border()) {
648 update_opposite( rr);
664 if ( (*rr).is_border() && ! ((*rr).opposite()->is_border())) {
666 update_opposite( rr);
673 ! (*(ll-1)).
opposite()->is_border());
675 nb_border_edges = (edges_end() - ll);
676 nb_border_halfedges = 0;
678 HVector inv_vector( halfedges.size());
680 for (
typename HVector::iterator
k = hvector.begin();
681 k != hvector.end(); ++
k){
682 inv_vector[*
k - halfedges_begin()] =
683 halfedges_begin() + (
k - hvector.begin());
688 (*h).set_next( &* (inv_vector[ (*h).next() - &(halfedges.front())]));
689 update_prev( h, halfedges.begin(), inv_vector,
693 if ( (*h).is_border())
694 nb_border_halfedges++;
707 #endif // CGAL_HALFEDGE_DATA_STRUCTURE_USING_VECTOR_H //
Facet * new_facet(const Facet *f)
Halfedge::Supports_halfedge_prev Supports_halfedge_prev
Tag_false Supports_removal
Facet_const_iterator facets_end() const
_HDS_vector_halfedge< V, H, F > Halfedge
_HDS_vector_facet< V, H, F > Facet
void swap(int &a, int &b)
#define CGAL_assertion(EX)
Halfedge_const_iterator border_halfedges_begin() const
Vertex * new_vertex(const Vertex *v)
const Halfedge * halfedge() const
void set_halfedge(Halfedge *h)
void set_facet(Facet *facet)
Halfedge::Supports_halfedge_facet Supports_halfedge_facet
void reserve(Size v, Size h, Size f)
H::Supports_halfedge_vertex Supports_halfedge_vertex
Halfedge_iterator halfedges_end()
_HDS_vector_vertex< V, H, F > Vertex
void update_vertex(Halfedge_iterator h, Tag_true, Tag_true)
Halfedge::Supports_halfedge_vertex Supports_halfedge_vertex
Halfedge_vector::size_type Size
N_step_adaptor< Halfedge_iterator, 2, Halfedge &, Halfedge *, Halfedge, std::ptrdiff_t, iterator_category > Edge_iterator
void update_facet(Halfedge_iterator, Tag_false, Tag_false)
Halfedge_const_iterator halfedges_begin() const
void set_next(Halfedge *h)
void update_prev(Halfedge_iterator h, Halfedge_iterator base, std::vector< Halfedge_iterator > inv, Tag_true)
void update_facet(Halfedge_iterator, Tag_false, Tag_true)
Facet::Supports_facet_normal Supports_facet_normal
Size capacity_of_halfedges() const
void update_facet(Halfedge_iterator h, Tag_true, Tag_true)
Vertex_iterator vertices_begin()
_HDS_vector_vertex< V, H, F > Vertex
std::size_t bytes() const
Facet_const_iterator facets_begin() const
std::size_t bytes_reserved() const
Vertex * new_vertex(const Point &p)
_HDS_vector_vertex(const Point &p)
void set_facet_halfedge(Facet *f, Halfedge *g) const
#define CGAL_H_UPDATE_I(h)
H::Supports_halfedge_prev Supports_halfedge_prev
void set_prev(Halfedge *h)
const Halfedge * halfedge() const
void update_vertex(Halfedge_iterator, Tag_false, Tag_false)
void update_prev(Halfedge_iterator, Halfedge_iterator, std::vector< Halfedge_iterator >, Tag_false)
Halfedge * new_edge(const Halfedge *he)
Halfedge_iterator border_halfedges_begin()
void update_facet(Halfedge_iterator, Tag_true, Tag_false)
Halfedge_vector::difference_type Difference
const Halfedge * opposite() const
Vertex * get_vertex(Halfedge *h) const
Vertex::Supports_vertex_halfedge Supports_vertex_halfedge
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
N_step_adaptor< Halfedge_const_iterator, 2, const Halfedge &, const Halfedge *, Halfedge, std::ptrdiff_t, iterator_category > Edge_const_iterator
Facet::Supports_facet_plane Supports_facet_plane
std::random_access_iterator_tag iterator_category
Vertex_const_iterator vertices_end() const
void set_vertex(Vertex *ve)
Vertex_vector::const_iterator Vertex_const_iterator
Halfedge_vector halfedges
const Halfedge * prev() const
_HDS_vector_halfedge< V, H, F > Halfedge
Halfedge_vector::const_iterator Halfedge_const_iterator
Size size_of_facets() const
Halfedge_vector::iterator Halfedge_iterator
Halfedge_data_structure_using_vector()
void update_opposite(Edge_iterator h)
_HDS_vector_facet< V, H, F > Facet
Size size_of_border_halfedges() const
void pointer_update(Vertex_const_iterator v_old, Halfedge_const_iterator h_old, Facet_const_iterator f_old)
_HDS_vector_vertex< V, H, F > Vertex
Facet_vector::const_iterator Facet_const_iterator
Facet * get_facet(Halfedge *h) const
Halfedge_data_structure_using_vector< V, H, F > Self
Halfedge_iterator border_halfedges
_HDS_vector_halfedge< V, H, F > Halfedge
void update_opposite(Halfedge_iterator h)
const Vertex * vertex() const
Edge_iterator edges_end()
Edge_iterator edges_begin()
const Facet * facet() const
_HDS_vector_facet< V, H, F > Facet
void set_opposite(void *h)
Edge_const_iterator border_edges_begin() const
Size size_of_vertices() const
Vertex::Supports_vertex_point Supports_vertex_point
_HDS_vector_facet< V, H, F > Facet
Halfedge_const_iterator halfedges_end() const
_HDS_vector_halfedge< V, H, F > Halfedge
Vertex_const_iterator vertices_begin() const
void update_vertex(Halfedge_iterator, Tag_false, Tag_true)
Edge_iterator border_edges_begin()
Edge_const_iterator edges_begin() const
Halfedge_data_structure_using_vector(const Self &hds)
void set_facet(Halfedge *h, Facet *f) const
const Halfedge * next() const
std::vector< Halfedge > Halfedge_vector
CGAL_BEGIN_NAMESPACE T opposite(const T &t)
void inv(Matrix3D &Ainv, const Matrix3D &A)
Halfedge_data_structure_using_vector(Size v, Size h, Size f)
void set_vertex_halfedge(Vertex *v, Halfedge *g) const
Size capacity_of_facets() const
Vertex_vector::iterator Vertex_iterator
#define CGAL_BEGIN_NAMESPACE
void set_vertex(Halfedge *h, Vertex *v) const
std::vector< Vertex > Vertex_vector
void set_halfedge(Halfedge *h)
Facet_vector::iterator Facet_iterator
Facet::Supports_facet_halfedge Supports_facet_halfedge
Facet_iterator facets_begin()
std::vector< Facet > Facet_vector
Halfedge * get_prev(Halfedge *h) const
Size capacity_of_vertices() const
_HDS_vector_vertex< V, H, F > Vertex
void set_prev(Halfedge *h, Halfedge *g) const
#define CGAL_END_NAMESPACE
Vertex_iterator vertices_end()
void update_vertex(Halfedge_iterator, Tag_true, Tag_false)
Size size_of_halfedges() const
Halfedge_iterator halfedges_begin()
Edge_const_iterator edges_end() const
Self & operator=(const Self &hds)
H::Supports_halfedge_facet Supports_halfedge_facet
Size size_of_border_edges() const
Facet_iterator facets_end()