Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Sequence of boolops on general polygons

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Sequence of boolops on general polygons


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Sequence of boolops on general polygons
  • Date: Mon, 11 Feb 2013 17:09:48 +0200

On Tue, Feb 5, 2013 at 1:40 PM, Shriramana Sharma <> wrote:
In this connection I also have some queries regarding the lines which
are found in the example bezier_traits_adapter.cpp:

typedef CGAL::Gps_traits_2<Traits_2>                    Gps_traits_2;
typedef Gps_traits_2::General_polygon_2                 Polygon_2;
typedef Gps_traits_2::General_polygon_with_holes_2      Polygon_with_holes_2;
typedef std::list<Polygon_with_holes_2>                 Polygon_set;

1)

a) Whether CGAL::General_polygon_set_2<Traits_2> cannot be used in the
place of the last line?

No---these are two different entities. (Perhaps you know this by now...)

b) Or perhaps should CGAL::General_polygon_set_2<Gps_traits_2> be used?

Nop
 

c) What is the difference between Gps_traits_2 and Traits_2?

The former is a model of the concept GeneralPolygonSetTraits_2.
The latter is a model of the concept ArrangementDirectionalXMonotoneTraits_2.
The concept GeneralPolygonSetTraits_2 is a generalization of the concept ArrangementDirectionalXMonotoneTraits_2.


2) In the previous example the lines:

typedef CGAL::General_polygon_set_2<Traits_2>             Polygon_set_2;
typedef Traits_2::General_polygon_2                       Polygon_2;
typedef Traits_2::General_polygon_with_holes_2            Polygon_with_holes_2;

... are seen so why in this example the typedefs of Polygon and
Polygon_with_holes are done from Gps_traits_2 and not Traits_2
directly? (This connects with 1b and 1c above.)

Traits_2 does not provide these nested types. These types are exactly the additional requirements of the generalization.

3) Why isn't there a consistent interface:

typedef CGAL::General_polygon_2<Traits_2>             Polygon_2;
typedef CGAL::General_polygon_with_holes_2<Traits_2>
Polygon_with_holes_2;
typedef CGAL::General_polygon_set_2<Traits_2>             Polygon_set_2;

but Polygon_set_2 is always initialized from the template with the
traits class as parameter and the other two are instead typedef-ed
from a member type of the traits class?

I don't know exactly how to answer this question except for saying that these types serve different purposes, so naturally they different interfaces are used.
 

--
Shriramana Sharma

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





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





Archive powered by MHonArc 2.6.18.

Top of Page