Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package
Chronological Thread
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package
- Date: Tue, 30 Jun 2020 09:53:28 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:TEYUmRKJBG/ByP09stmcpTZWNBhigK39O0sv0rFitYgXK/79rarrMEGX3/hxlliBBdydt6sZzbCO6+u5AD1IyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfLN/IA+ooQnNqsUajpZuJrs1xxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuA+vqQJxw4DUY4+bOvRxcazfctwGSmRMRdpRWi9bD4+gc4cCAegMMOBFpIf9vVsOqh6+CBGiCO3y1DBHnWX53bYm0+QgDw7G2hErEdQJsHTOrdX1M7sSWv2xwKfJ0zrDaPZW1inh6IjSchEvoeuDUq5sccrW00kuFwbJgluNooHiJDOV0uMNs3Ka7+pnSeKjkWsnqwVqrzigw8cjkIjJhoYPxl/Y8iV5xZ84KNulQ0F0fdCqCoFftz2GN4RoWMMiRXlltig0xLAHt5O2fTQHxYo5yhPcdfGKcoeF7xbiWeifLzl1mm5odb2hixqu9UWtyePxWMa33VpWsydJj9jBuHAC2RHV98OJRPx9/kK71jaO0QDe8u5EIUEolarbNp4u2aQ8mYYUsUTGBiP2mUP2jLWXdko+4OSo5f7nb7P7rZGfL495kh/yPrgql8ClAuk1MhICU3aF9eihzrHu8k70TK1UgvIsjqXVrZXXKtoHqqGjBgJZzJov5wu6AjqoytsUg2ULIVdedx6bgYXkNFTDLfT3APiig1mhlStkyvPHM7DhB5jCM3nOn6r6crt79kVS0hA8zcpF6JJRErwBIOz8Wkv2tNHACx82KQ20w+L+BNRzzIMSRHuDAqGWPa7Rq1OI6eUvI+6DZI8RpjnxMeQq5/nrjXMhmF8de7em3YcPZXymAvhrJ1+VbHnsj9sbD2sGoBcyQPblhVCBSTJTYmy9X6M45jE1EoKmCoLDS5i2gLyF2ye7BJxWZmdaClyWFHfoc56JW/gJaC2II89hliYIWqSmS48kzR2urhP1y6J7LurI/S0VrY7s1Ndv6O3XjB096D10D9+B3GGQVGF0hXgFRyQ23aB6uUxy0E2P0al+g/xCFNxc/elFUgkgNc2U8uphFtqnWh7dZszbDxG9U9C+CHcwSMgwypkAeQFmCtC6h1fC2SStRLQanrjOCJ0v+b/HxCvMId1gwUrLxLV0j0U6WtAdciq9l6tn/k7SAZTImgOXjeGxZKEE1WnM8mmEimGBtUUdXA9rWrjeRiMjYR7dot39o0/DVLSzEq8PMw1byMfEJLEZRMfuiAAMf/rpMc/CYm+300O3HxeP2vvMQ4ftfmgBxjTzAUMYlBoCvDzOYRM6AT2gpH6YCThGGlfmYkeq+u57/iDoBnQoxh2HOhUyn4G+/QQY0KTFF6Ejm4kcsSJkkA1aWU6n1ouPWdWFrgtlOq5bZIFluQYV5SfirwV4e6eYAeVnj18afR5wuhq3hRpyA4RE18MtqSFzlVcgGeejyFpEMgig89XwN7nQcDSg+Rmub+vJwAib3orGvKgI7/s8phPouwT7Tkc=
The following PR fixes the issue:
https://github.com/CGAL/cgal/pull/4820
Note that if (i = 0) is an assignment and will be evaluated to true.
Best,
Sebastien.
On 6/30/20 1:45 AM, Trần Anh ( via cgal-discuss Mailing List) wrote:
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 :).
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [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+.