|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67043 - in sandbox/geometry/libs/geometry/example: . extensions/gis/latlong extensions/gis/projections
From: barend.gehrels_at_[hidden]
Date: 2010-12-05 16:48:39
Author: barendgehrels
Date: 2010-12-05 16:48:38 EST (Sun, 05 Dec 2010)
New Revision: 67043
URL: http://svn.boost.org/trac/boost/changeset/67043
Log:
Shows Boost.Polygon point in example
Text files modified:
sandbox/geometry/libs/geometry/example/01_point_example.cpp | 14 ++++++++++----
sandbox/geometry/libs/geometry/example/extensions/gis/latlong/distance_example.cpp | 2 --
sandbox/geometry/libs/geometry/example/extensions/gis/projections/p03_projmap_example.cpp | 3 +--
3 files changed, 11 insertions(+), 8 deletions(-)
Modified: sandbox/geometry/libs/geometry/example/01_point_example.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/example/01_point_example.cpp (original)
+++ sandbox/geometry/libs/geometry/example/01_point_example.cpp 2010-12-05 16:48:38 EST (Sun, 05 Dec 2010)
@@ -14,6 +14,7 @@
#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
#include <boost/geometry/geometries/adapted/boost_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/boost_polygon.hpp>
int main()
@@ -27,19 +28,22 @@
// 2: its own type targetted to Cartesian (x,y) coordinates
model::d2::point_xy<double> pt2;
- // 3: it supports Boost tuple's (by including the headerfile)
+ // 3: it supports Boost tuple's
boost::tuple<double, double> pt3;
// 4: it supports normal arrays
double pt4[2];
- // 5: it supports boost arrays
+ // 5: it supports arrays-as-points from Boost.Array
boost::array<double, 2> pt5;
- // 6: in the past there was a typedef point_2d
+ // 6: it supports points from Boost.Polygon
+ boost::polygon::point_data<double> pt6;
+
+ // 7: in the past there was a typedef point_2d
// But users are now supposted to do that themselves:
typedef model::d2::point_xy<double> point_2d;
- point_2d pt6;
+ point_2d pt7;
// 7: there are more variants, and you can create your own.
@@ -53,6 +57,8 @@
assign(pt4, 4, 4);
assign(pt5, 5, 5);
assign(pt6, 6, 6);
+ assign(pt7, 7, 7);
+
double d1 = distance(pt1, pt2);
double d2 = distance(pt3, pt4);
Modified: sandbox/geometry/libs/geometry/example/extensions/gis/latlong/distance_example.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/example/extensions/gis/latlong/distance_example.cpp (original)
+++ sandbox/geometry/libs/geometry/example/extensions/gis/latlong/distance_example.cpp 2010-12-05 16:48:38 EST (Sun, 05 Dec 2010)
@@ -105,8 +105,6 @@
double dr = distance(city3_prj, ar_xy);
std::cout << "projected: " << 0.001 * dr << std::endl;
- double const radius = 6378137.0;
-
dr = distance(city3, model::segment<latlon_point>(city1, city2));
std::cout << "in LL: " << 0.001 * dr << std::endl;
Modified: sandbox/geometry/libs/geometry/example/extensions/gis/projections/p03_projmap_example.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/example/extensions/gis/projections/p03_projmap_example.cpp (original)
+++ sandbox/geometry/libs/geometry/example/extensions/gis/projections/p03_projmap_example.cpp 2010-12-05 16:48:38 EST (Sun, 05 Dec 2010)
@@ -107,8 +107,7 @@
true
> svg_transformer(bbox, 800, 600);
- // Create the background. Because projections might reverse the world,
- // so we use SVG-coordinates here
+ // Create the background
boost::geometry::model::box<svg_point> box;
boost::geometry::assign(box, 0, 0, 800, 600);
out << boost::geometry::svg(box, "fill:rgb(0,0,255)") << std::endl;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk