Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package
Chronological Thread
- From: Trần Anh <>
- To:
- Subject: Re: [cgal-discuss] Conditional deletion of edge while iterating in Arrangement_2 package
- Date: Tue, 30 Jun 2020 21:03:43 +0930
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:VuWUMRPQYDCLfxBUhUYl6mtUPXoX/o7sNwtQ0KIMzox0K/z9rsbcNUDSrc9gkEXOFd2Cra4d1ayO6+u5ASRAuc/H7ClfNsQUFlcssoY/p0QYGsmLCEn2frbBThcRO4B8bmJj5GyxKkNPGczzNBX4q3y26iMOSF2kbVImbuv6FZTPgMupyuu854PcYxlShDq6fLh+MAi6oR/eu8ULgIZuMLo9xgfGrndVZ+hd2GdkKU6Okxrm6cq84Z5u/z5Mt/498sJLTLn3cbk/QbFEFjotLno75NfstRnNTAuP4mUTX2ALmRdWAAbL8Q/3UI7pviT1quRy1i+aPdbrTb8vQjSt871rSB7zhygZMTMy7XzahdZxjKJfpxKhugB/zovJa4ybKPZyYqXQds4cSGFcXMheSjZBD5uzYIsBDeUPPehWoYrgqVUQsRSzHhOjCP/1xzJSmnP6wa833uI8Gg/GxgwgGNcOvWzKotXvN6ASV/2+wbXOzTXDcvhb3iv96JLSfRAnpfGMQK9wcdTQyUYxCwPKlFOQqYz+MjOa0+QCqWmb7+56We2zjG4nrhh8rz6yzcgjlofHnJgaykzY9Spn2oY1I8W1RUBlbdO5EZZeuDyWOpdrTs8+XWxluTg3x7IbtJKncyUHypAqywPdZvCbbYWF4hzuWfueLDp2hHxpZrCyigus/EWm1+byWM600FNQoSpElNnBrn8N1x3P6siHV/ty5V2t1iqI1wDW8u1EIEY0lbDaK5E72LIwmIATvELeFSH1gEX7lLGaelkg9+Sy6OnqYq/qqoKCO4J3kA3zPboil8qiCuoiKAcORXKU+eGk2b3j40L5RLJKg+UzkqbDsZDaId0Xp6C8AwNIy4oj5RmyAym83NQXmnkHK11FeBaZgITzJ17OJ/X4Ae++g1Sqjjhr2+jLMqP9DpjJNHTOk7fscaxg50JCywc/199S64xMBrEEOv3zW0vxtNLCDh8+Ngy52/rnCM9n2YMYXWKPH7KZML3TsVCW+uIgOe+MZI8OtTbyLvgq/f/ujXsjlVABeqmp2IMbaGqkEfR+P0WZfX3sj88dHmcFpAU+SPXmh0CDUT5Ie3myQrk85iogBYK9DYbDQ5itj6ab0Ce6GJ1WfGFGBUqWHXfmbYXXE8oKcz+Yd899jiQfB//mUJ4kzRjotQngyrMhIPCT4TwdrZuk1d574KrYmhg2sDB1FM+AyHrecmdvg2koWzoyiaBjvVRmmBDEyrl9m/UeFNpJ5voPXB19Lo/Z1+U9Ctb8XUXKcd6NDVqnWd67Gipic9Qq3tUyblZhTtW+kgjYjW3tGK4Qj7XNBZou86ua0WK2PNd403+B1a8viB4tTcJLcGGnnaVi7BOAO4mcmEqQk+OmdL8XwTXW3GaF12uH+k9CAyBqVqCQYWqVYAP/q9Sxsl/YRrmqFKk5MwZdwMiCAqRPY9zty15BQaGwa5zlf2utljLoVl6zzbSWYd+yIjlP7GDmEEEB1jsr0zOeLwFnX3WupmvfCHplEle9Oxq9o9k7k2uySwoP9y/PakRg07Sv/RtM3K6TTvoS2vQPvyJz8mwpTmb45MrfDp+7nyQkfKhYZolgslJO1GacqAkke5L8deZtgVkRdwkxtETrhU16
Thanks for the quick response
Sebastien :).
Out of curiosity, is milestone 4.14.4 the version number of CGAL? I thought CGAL is at 5.x already. If it is not, why are milestone number and CGAL version different?
On Tue, 30 Jun 2020 at 17:24, "Sebastien Loriot (GeometryFactory)" <> wrote:
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
>
--
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+.