Subject: CGAL users discussion list
List archive
[cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package
Chronological Thread
- From: Trần Anh <>
- To:
- Subject: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package
- Date: Tue, 30 Jun 2020 09:15:38 +0930
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:OzE3xR09DDj/XqVYsmDT+DRfVm0co7zxezQtwd8ZseIWI/ad9pjvdHbS+e9qxAeQG9mCtrQe07Kd6fuocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmTqwbalsIBmqsQndudcajIV/Iast1xXFpWdFdf5Lzm1yP1KTmBj85sa0/JF99ilbpuws+c1dX6jkZqo0VbNXAigoPGAz/83rqALMTRCT6XsGU2UZiQRHDg7Y5xznRJjxsy/6tu1g2CmGOMD9UL45VSi+46ptVRTljjoMOTwk/2HNksF/g6JVrhyiqRJi3YDbfJqYO+Bicq7HZ94WWXZNU8RXWidcAo28dYwPD+8ZMOhGtYn6pF0OpgaiCAmqBOPk1zhFhmPs3aIg1eQhFRzG3BE+H9IPrnvUsM/6NKESUe2uw6nIyC/Mb/JS2Tvn9IfIdRUhrOiKULltfsXf1VMhGBnZjlWMt4PlJTWV2/wCvmWG4ORsS/6jh3I5pgxvojaj28Qhh4nXio4I1lzJ+jt1zZg1K9CmTEN1b8CpHZtQuiyEOIZ7X98uTnxrtSomzLANpJ21fDASxZg52xLSb+aLfouI7x75SeqdPzR1iGhqdb+wgRu57FKuxffmVsau1VZHtipFncfItnAKzxHT79KISvp5/ku41zeP0h3f5vhKIU07mqfXMZEhwrk3lpoctUTMADX6l1nxjK+Tbkkk++6o5Pr7Yrj+uJOQK4t5hhv9P6kugMCzHPo0PwsUU2WU9umwzLjj8lf4QLVOgP02iK7ZsJXCKMQHvK62GQlV0oI+6xaiETem0coXnWUdI1JDeBKKlIfpO1TUL/D5CfezmUijkDBux/zeJL3uHo3NLmTfkLfmZbty90FcxxA3zdxG+p1UC6oBL+7uWk/qr9zVFQQ5Mgyxw+b/EtpxzIIeWWSVAq+YKqzeq1GI5vh8a9WLMYQasTK4J/k+7OP1llc4n0UcdO+nx8g5cne9S8h8qUPRSHzsyoMdC24MuhcjUu3nlFSEURZcYn+zW+Q34TRtW9HuNpvKWo342O/J5yy8BJADPjkXWGDJKm/hcsC/Y9lJbSuTJsF7lTldDOquToYg0VelswqokuM7fNqRwTURsNfY7PYw//fazEhg+jl9DsDb2GaIHTktwzE4AgQu1aU6mnRTj1eO1a8i3q5dHN1XouxMC0I0acKawOt9BNT/HAnGe4XRRQ==
Hi,
I have a set of edges in an Arrangement and would like to delete the edges based on some condition while iterating through the edges. I have the following example:
#include <CGAL/Cartesian.h>
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
typedef CGAL::Cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Point_2 Point_2;
typedef Traits_2::X_monotone_curve_2 Segment_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
int main()
{
Arrangement_2 arr;
Segment_2 cv[3];
Point_2 p1(0, 0), p2(0, 4), p3(4, 0);
cv[0] = Segment_2(p1, p2);
cv[1] = Segment_2(p2, p3);
cv[2] = Segment_2(p3, p1);
CGAL::insert(arr, &cv[0], &cv[3]); Arrangement_2::Edge_iterator curr;
Arrangement_2::Edge_iterator next = arr.edges_begin(); int i = 0; for (curr = next++; curr != arr.edges_end(); curr = next++)
{
if (i = 0)
{
arr.remove_edge(curr);
}
} return (0);
}
However, my Visual Studio was not very happy with the operation curr = next++. I was trying to replicate Arrangement_on_surface_2/isolated_vertices.cpp. Very much appreciate your help :).
- [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package, Trần Anh, 06/30/2020
- Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package, Sebastien Loriot (GeometryFactory), 06/30/2020
- Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package, Trần Anh, 06/30/2020
- Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package, Sebastien Loriot (GeometryFactory), 06/30/2020
- Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package, Trần Anh, 06/30/2020
- Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package, Sebastien Loriot (GeometryFactory), 06/30/2020
Archive powered by MHonArc 2.6.19+.