Skip to content

Commit

Permalink
support CGAL_v5.6 (breaking changes introduced)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Feb 13, 2024
1 parent 0da82db commit eabcf87
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions code/method/alpha_shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ inline std::vector<Face_handle> AlphaShape::get_all_finite_facets()

for (Finite_faces_iterator fit = finite_faces_begin(); fit != finite_faces_end(); ++fit) {
Face_handle pFace = fit;
CGAL_triangulation_postcondition(pFace != NULL);
CGAL_postcondition(pFace != NULL);
if (classify(pFace) == AlphaShape::INTERIOR)
facets.push_back(pFace);
}
Expand All @@ -187,7 +187,7 @@ inline void AlphaShape::traverse(const Face_handle& pFace, std::map<Face_handle,
for (int i = 0; i < 3; i++)
{
pNeighbor = fh->neighbor(i);
CGAL_triangulation_assertion(pNeighbor != NULL);
CGAL_assertion(pNeighbor != NULL);
if (classify(pNeighbor) == AlphaShape::INTERIOR){
int& id = ids[pNeighbor];
if (id == -1){
Expand Down Expand Up @@ -215,7 +215,7 @@ inline int AlphaShape::enumerate_solid_components(std::map<Face_handle, int>& co
for (face_it = finite_faces_begin(); face_it != finite_faces_end(); ++face_it)
{
Face_handle pFace = face_it;
CGAL_triangulation_postcondition(pFace != NULL);
CGAL_postcondition(pFace != NULL);

if (classify(pFace) == AlphaShape::INTERIOR) {
int& id = status[pFace];
Expand Down
48 changes: 24 additions & 24 deletions code/method/alpha_shape_CGAL4.11_and_later.h
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ Alpha_shape_2<Dt,EACT>::initialize_interval_edge_map()
{
// both faces are infinite by definition unattached
// the edge is finite by construction
CGAL_triangulation_precondition((is_infinite(pNeighbor)
CGAL_precondition((is_infinite(pNeighbor)
&& is_infinite(pFace)));
interval = make_triple(squared_radius(pFace, i),
Infinity,
Expand All @@ -863,7 +863,7 @@ Alpha_shape_2<Dt,EACT>::initialize_interval_edge_map()
else
{ // is_infinite(pNeighbor)

CGAL_triangulation_precondition((is_infinite(pNeighbor)
CGAL_precondition((is_infinite(pNeighbor)
&& !is_infinite(pFace)));
if (is_attached(pFace, i))
interval = make_triple(UNDEFINED,
Expand Down Expand Up @@ -1113,7 +1113,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_vertex_list()const {
// which might be infinity
// write the vertex
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) == REGULAR));
CGAL_assertion((classify(v) == REGULAR));
Alpha_shape_vertices_list.push_back(v);
}
}
Expand All @@ -1126,7 +1126,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_vertex_list()const {
++vertex_alpha_it)
{
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) == SINGULAR));
CGAL_assertion((classify(v) == SINGULAR));

Alpha_shape_vertices_list.push_back(v);
}
Expand Down Expand Up @@ -1163,7 +1163,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
{
pInterval = &(*edge_alpha_it).first;

CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 2
// thus singular

Expand All @@ -1175,7 +1175,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
// and alpha is smaller than the upper boundary
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR));
Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first,
Expand All @@ -1195,7 +1195,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const

if (pInterval->first == UNDEFINED)
{
CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 2
// thus singular

Expand All @@ -1207,7 +1207,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
// and alpha is smaller than the upper boundary
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR));
Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first,
Expand All @@ -1223,7 +1223,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
// if alpha is smaller than the upper boundary
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first,
CGAL_assertion(((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR)
|| (classify((*edge_alpha_it).second.first,
Expand Down Expand Up @@ -1328,7 +1328,7 @@ Alpha_shape_2<Dt,EACT>::number_of_solid_components(const Type_of_alpha& alpha) c
++face_it)
{
Face_handle pFace = face_it;
CGAL_triangulation_postcondition( pFace != NULL);
CGAL_postcondition( pFace != NULL);

if (classify(pFace, alpha) == INTERIOR){
Data& data = marked_face_set[pFace];
Expand Down Expand Up @@ -1362,7 +1362,7 @@ Alpha_shape_2<Dt,EACT>::traverse(const Face_handle& pFace,
for (int i=0; i<3; i++)
{
pNeighbor = fh->neighbor(i);
CGAL_triangulation_assertion(pNeighbor != NULL);
CGAL_assertion(pNeighbor != NULL);
if (classify(pNeighbor, alpha) == INTERIOR){
Data& data = marked_face_set[pNeighbor];
if(data == false){
Expand Down Expand Up @@ -1520,7 +1520,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
// write the vertex

v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) ==
CGAL_assertion((classify(v) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
// if we used Edelsbrunner and Muecke's definition
// regular means incident to a higher-dimensional face
Expand All @@ -1542,7 +1542,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
{
pInterval = &(*edge_alpha_it).first;

CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 1
// thus singular

Expand All @@ -1569,10 +1569,10 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
f = pNeighbor;
}

CGAL_triangulation_assertion((classify(f) ==
CGAL_assertion((classify(f) ==
Alpha_shape_2<Dt,EACT>::INTERIOR));

CGAL_triangulation_assertion((classify(f, i) ==
CGAL_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::REGULAR));

os << V[f->vertex(f->ccw(i))] << ' '
Expand Down Expand Up @@ -1601,7 +1601,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
// write the vertex

v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) ==
CGAL_assertion((classify(v) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
V[v] = number_of_vertices++;
os << v->point() << std::endl;
Expand All @@ -1614,7 +1614,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
++vertex_alpha_it)
{
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) ==
CGAL_assertion((classify(v) ==
Alpha_shape_2<Dt,EACT>::SINGULAR));

V[v] = number_of_vertices++;
Expand Down Expand Up @@ -1658,7 +1658,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
if (pInterval->second != Infinity &&
pInterval->second <= get_alpha())
{
CGAL_triangulation_assertion((classify(f, i) ==
CGAL_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
// assure that all vertices are in ccw order
if (classify(f) == Alpha_shape_2<Dt,EACT>::EXTERIOR)
Expand All @@ -1671,7 +1671,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
f = pNeighbor;
}

CGAL_triangulation_assertion((classify(f) ==
CGAL_assertion((classify(f) ==
Alpha_shape_2<Dt,EACT>::INTERIOR));

os << V[f->vertex(f->ccw(i))] << ' '
Expand All @@ -1686,7 +1686,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
// write the singular edges
if (pInterval->first != UNDEFINED)
{
CGAL_triangulation_assertion((classify(f, i) ==
CGAL_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::SINGULAR));
os << V[f->vertex(f->ccw(i))] << ' '
<< V[f->vertex(f->cw(i))] << std::endl;
Expand Down Expand Up @@ -1745,7 +1745,7 @@ Alpha_shape_2<Dt,EACT>::Output ()
// which might be infinity
// visualize the boundary

CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR));

Expand Down Expand Up @@ -1775,7 +1775,7 @@ Alpha_shape_2<Dt,EACT>::Output ()
if (pInterval->first == UNDEFINED)
{

CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 1
// thus singular

Expand All @@ -1788,7 +1788,7 @@ Alpha_shape_2<Dt,EACT>::Output ()
// which might be infinity
// visualize the boundary

CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR));
L.push_back((this->segment((*edge_alpha_it).second.first,
Expand All @@ -1808,7 +1808,7 @@ Alpha_shape_2<Dt,EACT>::Output ()
// which might be infinity
// visualize the boundary

CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first,
CGAL_assertion(((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR) ||
(classify((*edge_alpha_it).second.first,
Expand Down
Binary file added data/sphere.bvg
Binary file not shown.

0 comments on commit eabcf87

Please sign in to comment.