Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aos 2 dcel extension efif #8710

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ namespace CGAL {

inline void* _clean_pointer(const void* p)
{
static_assert(sizeof(void*) == sizeof(size_t));
const size_t mask = ~1;
const size_t val = (reinterpret_cast<size_t>(p) & mask);
static_assert(sizeof(void*) == sizeof(std::size_t));
const std::size_t mask = ~1;
const std::size_t val = (reinterpret_cast<std::size_t>(p) & mask);

return (reinterpret_cast<void*>(val));
}

inline void* _set_lsb(const void* p)
{
const size_t mask = 1;
const size_t val = (reinterpret_cast<size_t>(p) | mask);
const std::size_t mask = 1;
const std::size_t val = (reinterpret_cast<std::size_t>(p) | mask);
return (reinterpret_cast<void*>( val));
}

inline bool _is_lsb_set(const void* p)
{
const size_t mask = 1;
const size_t val = reinterpret_cast<size_t>(p);
const std::size_t mask = 1;
const std::size_t val = reinterpret_cast<std::size_t>(p);
return ((val & mask) != 0);
}

Expand Down Expand Up @@ -565,7 +565,7 @@ class Arr_face : public F,
Outer_ccb_const_iterator;

/*! obtains the number of outer CCBs the face has. */
size_t number_of_outer_ccbs() const { return (this->outer_ccbs.size()); }
std::size_t number_of_outer_ccbs() const { return (this->outer_ccbs.size()); }

/*! obtains an iterator for the first outer CCB of the face. */
Outer_ccb_iterator outer_ccbs_begin() { return (this->outer_ccbs.begin()); }
Expand Down Expand Up @@ -601,7 +601,7 @@ class Arr_face : public F,
typedef Inner_ccb_const_iterator Hole_const_iterator;

/*! obtains the number of inner CCBs the face has. */
size_t number_of_inner_ccbs() const { return (this->inner_ccbs.size()); }
std::size_t number_of_inner_ccbs() const { return (this->inner_ccbs.size()); }

/*! obtains an iterator for the first inner CCB of the face. */
Inner_ccb_iterator inner_ccbs_begin() { return (this->inner_ccbs.begin()); }
Expand Down Expand Up @@ -646,7 +646,7 @@ class Arr_face : public F,
}

// Backward compatibility:
size_t number_of_holes() const { return number_of_inner_ccbs(); }
std::size_t number_of_holes() const { return number_of_inner_ccbs(); }
Hole_iterator holes_begin() { return inner_ccbs_begin(); }
Hole_iterator holes_end() { return inner_ccbs_end(); }
Hole_const_iterator holes_begin() const { return inner_ccbs_begin(); }
Expand All @@ -669,7 +669,7 @@ class Arr_face : public F,
Isolated_vertex_const_iterator;

/*! obtains the number of isloated vertices inside the face. */
size_t number_of_isolated_vertices() const
std::size_t number_of_isolated_vertices() const
{ return (this->iso_verts.size()); }

/*! obtains an iterator for the first isloated vertex inside the face. */
Expand Down Expand Up @@ -986,13 +986,13 @@ class Arr_dcel_base {
typedef In_place_list<Inner_ccb, false> Inner_ccb_list;
typedef In_place_list<Isolated_vertex, false> Iso_vert_list;

typedef std::allocator_traits<Allocator> Allocator_traits;
typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator;
typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator;
typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator;
typedef typename Allocator_traits::template rebind_alloc<Outer_ccb> Outer_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Inner_ccb> Inner_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Isolated_vertex> Iso_vert_allocator;
typedef std::allocator_traits<Allocator> Allocator_traits;
typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator;
typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator;
typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator;
typedef typename Allocator_traits::template rebind_alloc<Outer_ccb> Outer_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Inner_ccb> Inner_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Isolated_vertex> Iso_vert_allocator;

public:
typedef typename Halfedge_list::size_type Size;
Expand All @@ -1002,7 +1002,6 @@ class Arr_dcel_base {
typedef std::bidirectional_iterator_tag iterator_category;

protected:

Vertex_list vertices; // The vertices container.
Halfedge_list halfedges; // The halfedges container.
Face_list faces; // The faces container.
Expand Down
12 changes: 8 additions & 4 deletions Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class Arr_extended_vertex : public VertexBase {

template <typename Point_>
struct rebind {
using Point_2 = Point_;
using other = typename Vertex_base::template rebind<Point_2>;
using Pnt = Point_;
using Rebind_vertex_base = typename Vertex_base::template rebind<Pnt>;
using Other_vertex_base = typename Rebind_vertex_base::other;
using other = Arr_extended_vertex<Other_vertex_base, Vertex_data>;
};
};

Expand Down Expand Up @@ -101,8 +103,10 @@ class Arr_extended_halfedge : public HalfedgeBase {

template <typename XMonotoneCurve>
struct rebind {
using X_monotonote_curve_2 = XMonotoneCurve;
using other = typename Halfedge_base::template rebind<X_monotonote_curve_2>;
using Xcv = XMonotoneCurve;
using Rebind_halfedge_base = typename Halfedge_base::template rebind<Xcv>;
using Other_halfedge_base = typename Rebind_halfedge_base::other;
using other = Arr_extended_halfedge<Other_halfedge_base, Halfedge_data>;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class Arr_basic_insertion_traits_2 {
// vertex to the extended point.
if (! vh->is_at_open_boundary() && m_base_equal(base_p, vh->point()))
return (Point_2(base_p, vh));
else return (Point_2(base_p));
return (Point_2(base_p));
}
};

Expand Down Expand Up @@ -308,7 +308,7 @@ class Arr_basic_insertion_traits_2 {
// vertex to the extended point.
if (! vh->is_at_open_boundary() && m_base_equal(base_p, vh->point()))
return (Point_2(base_p, vh));
else return (Point_2(base_p));
return (Point_2(base_p));
}
};

Expand Down
1 change: 1 addition & 0 deletions Installation/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

- Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed.
- Fixed the Landmark point-location strategy so that it can be applied to arrangements on a sphere.
- Fixed a bug in the extensions of vertex and halfedge types of the DCEL when used to instantiate Arrangement_with_history_2 or similar arrangement classes that derive from Arrangement_2.

## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1)

Expand Down
Loading