Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2
Chronological Thread
- From: Efi Fogel <>
- To:
- Subject: Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2
- Date: Mon, 21 Mar 2016 18:46:58 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:eDNcTB1UYuhrGvFOsmDT+DRfVm0co7zxezQtwd8ZsegeIvad9pjvdHbS+e9qxAeQG96Lu7Qd0qGH6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6CyZ3unLHqs7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Loc8dVdW/D6Y7ggVu4fSy83Nng8osztrxjKCwWVoWANV30f1RtODQ+C5x7zWtL9szDxq/FmixWdaMb5RLRxVTW55LpwUzfpjj0GPng36jL5kMt12Y9VoVqPoBNyx8aAbY+UOv1xc6f1ctYTRG4HVcFUAX8SSrigZpcCWrJSdd1TqJPw8gMD
You have 2 definitions of the type Arrangement_2:
1. typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
2. Gen_Polygon_set_2::Arrangement_2& arr = gps.arrangement();
Anyhow, the following compiles:
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/Polygon_set_2.h>
#include <CGAL/Gps_circle_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_batched_point_location.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Gps_circle_segment_traits_2<Kernel> Traits_2;
typedef CGAL::General_polygon_set_2<Traits_2> Gen_Polygon_set_2;
typedef Traits_2::Point_2 Point_2;
typedef Gen_Polygon_set_2::Arrangement_2 Arrangement_2;
typedef CGAL::Arr_point_location_result<Arrangement_2> Point_location_result;
typedef std::pair<Point_2, Point_location_result::Type> Query_result;
typedef Traits_2::General_polygon_with_holes_2 Gen_Polygon_with_holes_2;
int main()
{
Gen_Polygon_with_holes_2 pwh;
Gen_Polygon_set_2 gps(pwh);
Gen_Polygon_set_2::Arrangement_2& arr = gps.arrangement();
std::list<Query_result> results;
std::list<Point_2> points;
locate(arr, points.begin(), points.end(), std::back_inserter(results));
return 0;
}
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
On Mon, Mar 21, 2016 at 5:11 PM, KHartmann <> wrote:
Thanks Efi,
I'm close to getting "locate" to compile but boost doesn't like something
about the way I'm doing things.
Could you tell me why the following code won't compile? The Visual Studio
error message is below the code.
If I comment out the "locate" line, it compiles.
Kevin
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/Polygon_set_2.h>
#include <CGAL/Arr_batched_point_location.h>
typedef CGAL::Lazy_kernel<CGAL::Simple_cartesian<CGAL::Gmpq> > Kernel;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel>
Polygon_with_holes_2;
typedef CGAL::Polygon_set_2<Kernel> Polygon_set_2;
typedef Kernel::Circle_2 Circle_2;
typedef CGAL::Gps_circle_segment_traits_2<Kernel> Traits_2;
typedef CGAL::General_polygon_set_2<Traits_2> Gen_Polygon_set_2;
typedef Traits_2::General_polygon_2 Gen_Polygon_2;
typedef Traits_2::General_polygon_with_holes_2
Gen_Polygon_with_holes_2;
typedef Traits_2::Curve_2 Curve_2;
typedef Traits_2::X_monotone_curve_2
X_monotone_curve_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef Gen_Polygon_set_2::Arrangement_2::Point_2 Arr_Point_2;
typedef CGAL::Arr_point_location_result<Arrangement_2>
Point_location_result;
typedef std::pair<Arr_Point_2, Point_location_result::Type> Query_result;
bool TestContainment( Gen_Polygon_with_holes_2& pwh )
{
Gen_Polygon_set_2 gps( pwh );
Gen_Polygon_set_2::Arrangement_2& arr = gps.arrangement();
std::list<Arr_Point_2> points;
points.push_back(Arr_Point_2(1, 2));
points.push_back(Arr_Point_2(4, 3));
std::list<Query_result> results;
CGAL::locate( arr, points.begin(), points.end(), std::back_inserter(
results ));
return false;
}
Error 41 error C2665:
'boost::detail::variant::make_initializer_node::apply<BaseIndexPair,Iterator>::initializer_node::initialize'
: none of the 7 overloads could convert all the argument types
D:\boost\boost-1.56.0\boost\variant\variant.hpp 1442
--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Test-for-General-polygon-with-holes-2-containment-of-a-Point-2-tp4661702p4661709.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
--
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] Test for General_polygon_with_holes_2 containment of a Point_2, KHartmann, 03/18/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, Efi Fogel, 03/19/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, KHartmann, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, Efi Fogel, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, KHartmann, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, Efi Fogel, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, KHartmann, 03/22/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, Efi Fogel, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, KHartmann, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, Efi Fogel, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, KHartmann, 03/21/2016
- Re: [cgal-discuss] Test for General_polygon_with_holes_2 containment of a Point_2, Efi Fogel, 03/19/2016
Archive powered by MHonArc 2.6.18.