Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] How to convert Arrangement_with_history_2 to Arrangement_2?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] How to convert Arrangement_with_history_2 to Arrangement_2?


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] How to convert Arrangement_with_history_2 to Arrangement_2?
  • Date: Sun, 26 Aug 2018 14:27:22 +0300
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:qdSH5x8msUYrdf9uRHKM819IXTAuvvDOBiVQ1KB52ugcTK2v8tzYMVDF4r011RmVBdqds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+55/ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRxDmiCgFNzA3/mLZhNFugq1Hux+uvQBzzpTObY2JKPZzfKXQds4aS2pbWcZRUjRMDIyyb4sOEuEPPeFYr4bjqFsKsBCzAhejBO3uyj9GgX/20rM10+A6HAHJ2QwvBdMOsHDOoNrpM6cSVPm4wa/VxjvAd/NbwSnx5JTMfxw7ovyBXah8fdTMxUQgDQ/Jk1edpZLjMjiIzOoCqXKb4PBlVe+3i24otQVxoj+3y8cpkIbJh4YVxknc9SV93Yo5PNO4RFN5bNK6CpdQuCaaN4x5QsMmXW5kojo1yroDuZKjfSgKzoooxwLHZvCZb4SF5gjvWeWRLDtimn5pZb2yiwyv/UWi1OHwTsy030xLripBnNnMrHcN1xnL58eZRPt9/0mh2TGA1w/N7uFJOk80la/BJJ4gxr48jIYcsUPGHiPugkX5kLeWdlk4+uiv8+nofrrmqYWYN4Ntlw7+M78uldCiAeQjKQgDRHOb+OS51L3750L1WrRKjvsskqnYqp/WP8obprTqSzNSh40s4hL6Aza928kDhlEGKkhEcVSJldvHIVbLdd32DL+RhFuhlH8/yv7HMLruD5HlIX3KkbOndrF4vR0PgDEvxMxSssoHQooKJ+j+Dxeo5Y7oSyQhOgnx+N7JTdB014cQQ2WKW/bLP6bbsFvO7eUqcbDVON0l/Q3lIv1g3MbAyGcjkAZEL6as1JoTLnu/G6Y+ehjLUT/Xmt4EVFwykE8+Qejt0gPQVDdSYzOqW/t56GhkUsSpCoDMQo3ri7uEjn+2

Is it possible that you simply forgot to include the header that contains the definition of CGAL::Dual, namely, <CGAL/graph_traits_Dual_Arrangement_2.h> ?
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Sun, 26 Aug 2018 at 14:19, Morteza Manavi <> wrote:
Exactly, compiler give error:
C2079: 'dual' uses undefined class 'CGAL::Dual<Arr_with_hist_2>'
C2440: 'initializing': cannot convert from 'Arr_with_hist_2' to 'int'
in line :
Dual_arrangement  dual(arr);
of my code.
(Notice that the error is not occur at runtime)


On Sun, Aug 26, 2018 at 2:47 PM Efi Fogel <> wrote:
What makes you think that the Dual class does not accept Arrangement_with_history_2?
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Sun, 26 Aug 2018 at 12:15, Morteza Manavi <> wrote:
Thank you Efi,
But I don't want to delete CGAL::Dual because I need to construct a dual graph representation of the arrangement, and on the other hand I need to have curve handler that it's possible with use of Arrangement_with_history_2 class.
Apparently the Dual class does not accept Arrangement_with_history_2 as input and according to your answer I can't directly convert Arrangement_with_history_2 to Arrangement_2. I think, I must write my own dual graph class that accept Arrangement_with_history_2 as input.

Morteza.

On Sun, Aug 26, 2018 at 1:50 AM Efi Fogel <> wrote:
Hi Morteza,

If you really need to convert Arrangement_with_history_2 to Arrangement_2, then you would need to reconstruct Arrangement_2, but conceptually, everything you can do with Arrangement_2 you can also do with Arrangement_with_history_2.

Is it possible that you simply forgot to include the header that contains the definition of CGAL::Dual, namely, <CGAL/graph_traits_Dual_Arrangement_2.h> ?

Anyway, if you still have a problem, please paste a complete minimal program.

Efi
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Sat, 25 Aug 2018 at 16:00, Morteza Manavi <> wrote:
Hi, I want to use Dual class to construct a dual graph of my arrangement, but I get the compile error :
C2079: 'dual' uses undefined class 'CGAL::Dual<Arr_with_hist_2>'
and I think it's for Arrangement_with_history_2 that I use to define the arrangement in the code. Now I need to convert Arr_with_hist_2 to Arrangement_2 and I don't know how to do this?
my CGAL type definition :
typedef CGAL::Cartesian<CGAL::Exact_rational>                   Kernel;
typedef Kernel::Circle_2                                        Circle_2;
typedef Kernel::Segment_2                                       Segment_2;

typedef CGAL::Arr_circle_segment_traits_2<Kernel>         Circle_Segment_traits_2;
typedef std::string                                       Curve_Name;
typedef CGAL::Arr_consolidated_curve_data_traits_2
                   <Circle_Segment_traits_2, Curve_Name>  Traits_2;
typedef Traits_2::Point_2                                 TPoint_2;
typedef Traits_2::Curve_2                                 Curve_2;
typedef Traits_2::CoordNT                                 CoordNT;

typedef CGAL::Arr_face_extended_dcel<Traits_2 , unsigned int>   Dcel ;
typedef CGAL::Arrangement_with_history_2<Traits_2, Dcel>        Arr_with_hist_2;
typedef CGAL::Dual<Arr_with_hist_2>                             Dual_arrangement;
typedef CGAL::Arr_face_index_map<Arr_with_hist_2>               Face_index_map;



Archive powered by MHonArc 2.6.18.

Top of Page