74 #ifndef CGAL_HALFEDGE_DATA_STRUCTURE_USING_VECTOR_H
75 #define CGAL_HALFEDGE_DATA_STRUCTURE_USING_VECTOR_H 1
77 #include <CGAL/basic.h>
78 #endif // CGAL_BASIC_H
79 #ifndef CGAL_PROTECT_CSTDDEF
81 #define CGAL_PROTECT_CSTDDEF
83 #ifndef CGAL_PROTECT_ALGORITHM
85 #define CGAL_PROTECT_ALGORITHM
87 #ifndef CGAL_PROTECT_VECTOR
89 #define CGAL_PROTECT_VECTOR
91 #ifndef CGAL_CIRCULATOR_H
94 #ifndef CGAL_N_STEP_ADAPTOR_H
98 #ifndef CGAL_HALFEDGE_DATA_STRUCTURE_DECORATOR_H
103 #define _HDS_vector_vertex _Hvv
104 #define _HDS_vector_halfedge _Hvh
105 #define _HDS_vector_facet _Hvf
114 template <
class V,
class H,
class F>
133 template <
class V,
class H,
class F>
167 template <
class V,
class H,
class F>
193 template <
class V,
class H,
class F>
204 typedef typename Facet::Plane
Plane;
212 typedef typename Halfedge_vector::size_type
Size;
214 typedef typename Halfedge_vector::difference_type
424 h->H::set_opposite(g);
425 g->H::set_opposite(h);
436 h->H::set_opposite(g);
437 g->H::set_opposite(h);
480 h->H::set_opposite( &*g);
481 g->H::set_opposite( &*h);
488 const std::vector<Halfedge_iterator>&,
Tag_false){}
490 const std::vector<Halfedge_iterator>&
inv,
Tag_true){
497 h->vertex()->set_halfedge(&*h);
503 h->facet()->set_halfedge(&*h);
559 #define CGAL_V_UPDATE(v) (&*(v_new + (Vertex_const_iterator(v) - v_old)))
560 #define CGAL_H_UPDATE(h) (&*(h_new + (Halfedge_const_iterator(h) - h_old)))
561 #define CGAL_H_UPDATE_I(h) (h_new + (Halfedge_const_iterator(h) - h_old))
562 #define CGAL_F_UPDATE(f) (&*(f_new + (Facet_const_iterator(f) - f_old)))
564 template <
class V,
class H,
class F>
568 Halfedge_const_iterator h_old,
569 Facet_const_iterator f_old) {
574 Vertex_iterator v_new = vertices.begin();
575 Halfedge_iterator h_new = halfedges.begin();
576 Facet_iterator f_new = facets.begin();
577 for ( Halfedge_iterator h = halfedges.begin(); h != halfedges.end(); ++h) {
584 if ( ! h->is_border())
591 #undef CGAL_H_UPDATE_I
594 template <
class V,
class H,
class F>
597 nb_border_halfedges = 0;
599 border_halfedges = halfedges_end();
602 Edge_iterator ll = edges_begin();
603 while ( ll != edges_end() && (! (*ll).is_border()) &&
604 (!(*ll).opposite()->is_border() ))
606 if ( ll == edges_end())
611 typedef std::vector<Halfedge_iterator> HVector;
613 hvector.reserve( halfedges.size());
615 for ( Halfedge_iterator
i = halfedges_begin();
i!=halfedges_end();++
i){
616 hvector.push_back(
i);
619 typename HVector::iterator llhv = hvector.begin()+2*(ll-edges_begin());
621 Edge_iterator rr = edges_end();
623 typename HVector::iterator rrhv = hvector.end();
631 while ( rr > ll && ((*rr).is_border() ||
632 (*rr).opposite()->is_border())) {
633 if ( ! (*rr).opposite()->is_border()) {
635 update_opposite( rr);
644 std::swap( *((*ll).opposite()), *((*rr).opposite()));
646 update_opposite( ll);
647 update_opposite( rr);
652 while ( !(*ll).is_border() && !(*ll).opposite()->is_border()) {
662 std::swap( *((*ll).opposite()), *((*rr).opposite()));
664 update_opposite( ll);
665 update_opposite( rr);
668 if ( ! (*rr).opposite()->is_border()) {
670 update_opposite( rr);
686 if ( (*rr).is_border() && ! ((*rr).opposite()->is_border())) {
688 update_opposite( rr);
695 ! (*(ll-1)).
opposite()->is_border());
696 border_halfedges = Halfedge_iterator( &*ll);
697 nb_border_edges = (edges_end() - ll);
698 nb_border_halfedges = 0;
700 HVector inv_vector( halfedges.size());
702 for (
typename HVector::iterator
k = hvector.begin();
703 k != hvector.end(); ++
k){
704 inv_vector[*
k - halfedges_begin()] =
705 halfedges_begin() + (
k - hvector.begin());
709 for (Halfedge_iterator h =halfedges_begin(); h != halfedges_end();++h){
710 (*h).set_next( &* (inv_vector[ (*h).next() - &(halfedges.front())]));
711 update_prev( h, halfedges.begin(), inv_vector,
712 Supports_halfedge_prev());
713 update_vertex( h, Supports_halfedge_vertex(),
714 Supports_vertex_halfedge());
715 if ( (*h).is_border())
716 nb_border_halfedges++;
718 update_facet( h, Supports_halfedge_facet(),
719 Supports_facet_halfedge());
729 #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_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
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)
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()
void update_prev(Halfedge_iterator, Halfedge_iterator, const std::vector< Halfedge_iterator > &, Tag_false)
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()
#define CGAL_H_UPDATE_I(h)
Edge_const_iterator edges_end() const
void update_prev(Halfedge_iterator h, Halfedge_iterator base, const std::vector< Halfedge_iterator > &inv, Tag_true)
Self & operator=(const Self &hds)
H::Supports_halfedge_facet Supports_halfedge_facet
Size size_of_border_edges() const
Facet_iterator facets_end()