|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67002 - sandbox/geometry/libs/geometry/example/with_external_libs
From: barend.gehrels_at_[hidden]
Date: 2010-12-04 06:52:36
Author: barendgehrels
Date: 2010-12-04 06:52:28 EST (Sat, 04 Dec 2010)
New Revision: 67002
URL: http://svn.boost.org/trac/boost/changeset/67002
Log:
Qt update
Text files modified:
sandbox/geometry/libs/geometry/example/with_external_libs/qt.vsprops | 2 +-
sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.cpp | 39 +++++++++++++++------------------------
sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.vcproj | 8 ++------
3 files changed, 18 insertions(+), 31 deletions(-)
Modified: sandbox/geometry/libs/geometry/example/with_external_libs/qt.vsprops
==============================================================================
--- sandbox/geometry/libs/geometry/example/with_external_libs/qt.vsprops (original)
+++ sandbox/geometry/libs/geometry/example/with_external_libs/qt.vsprops 2010-12-04 06:52:28 EST (Sat, 04 Dec 2010)
@@ -2,7 +2,7 @@
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
- Name="wxwidgets"
+ Name="qt"
>
<Tool
Name="VCCLCompilerTool"
Modified: sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.cpp (original)
+++ sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.cpp 2010-12-04 06:52:28 EST (Sat, 04 Dec 2010)
@@ -7,11 +7,11 @@
// Qt Example
-// Qt is a well-known and often used platform independent widget library
+// Qt is a well-known and often used platform independent windows library
// To build and run this example:
// 1) download (from http://qt.nokia.com), configure and make QT
-// 2) if necessary, adapt Qt clause in include path
+// 2) if necessary, adapt Qt clause in include path (note there is a Qt property sheet)
#include <sstream>
@@ -22,11 +22,11 @@
#include <boost/geometry/geometries/register/ring.hpp>
-// Adapt a QPointF such that it can be handled by GGL
+// Adapt a QPointF such that it can be handled by Boost.Geometry
BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(QPointF, double, cs::cartesian, x, y, setX, setY)
// Adapt a QPolygonF as well.
-// A QPolygonF has no holes (interiors) so it is similar to a GGL ring
+// A QPolygonF has no holes (interiors) so it is similar to a Boost.Geometry ring
BOOST_GEOMETRY_REGISTER_RING(QPolygonF)
@@ -36,38 +36,37 @@
// http://en.wikipedia.org/wiki/Qt_(toolkit)#Qt_hello_world
QApplication app(argc, argv);
- // Declare a polygon. This is just Qt. The Qt Polygon can be used
- // in GGL as well, just by its oneline registration above.
+ // Declare a Qt polygon. The Qt Polygon can be used
+ // in Boost.Geometry, just by its oneline registration above.
QPolygonF polygon;
- // Qt methods can be used, in this case to add points
+ // Use Qt to add points to polygon
polygon
<< QPointF(10, 20) << QPointF(20, 30)
<< QPointF(30, 20) << QPointF(20, 10)
<< QPointF(10, 20);
- // GGL methods can be used, e.g. to calculate area
+ // Use Boost.Geometry e.g. to calculate area
std::ostringstream out;
- out << "GGL area: " << boost::geometry::area(polygon) << std::endl;
+ out << "Boost.Geometry area: " << boost::geometry::area(polygon) << std::endl;
- // Some functionality is defined in both Qt and GGL
+ // Some functionality is defined in both Qt and Boost.Geometry
QPointF p(20,20);
out << "Qt contains: "
<< (polygon.containsPoint(p, Qt::WindingFill) ? "yes" : "no")
<< std::endl
- << "GGL within: "
+ << "Boost.Geometry within: "
<< (boost::geometry::within(p, polygon) ? "yes" : "no")
<< std::endl;
- // Detail: if point is ON boundary, Qt says yes, GGL says no.
-
+ // Detail: if point is ON boundary, Qt says yes, Boost.Geometry says no.
// Qt defines an iterator
- // (which is actually required for GGL, it's part of the ring-concept)
- // such that GGL can use the points of this polygon
+ // (which is required for of the Boost.Geometry ring-concept)
+ // such that Boost.Geometry can use the points of this polygon
QPolygonF::const_iterator it;
for (it = polygon.begin(); it != polygon.end(); ++it)
{
- // Stream Delimiter-Separated, just to show something GGL can do
+ // Stream Delimiter-Separated, just to show something Boost.Geometry can do
out << boost::geometry::dsv(*it) << std::endl;
}
@@ -78,13 +77,5 @@
QLabel label(out.str().c_str());
label.show();
return app.exec();
-
- // What else could be useful, functionality that GGL has and Qt not (yet)?
- // - simplify a polygon (to get less points and preserve shape)
- // - clip a polygon with a box
- // - calculate the centroid
- // - calculate the perimeter
- // - calculate the convex hull
- // - transform it using matrix transformations
}
Modified: sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.vcproj (original)
+++ sandbox/geometry/libs/geometry/example/with_external_libs/x01_qt_example.vcproj 2010-12-04 06:52:28 EST (Sat, 04 Dec 2010)
@@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""
+ AdditionalIncludeDirectories="../../../.."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -60,9 +60,7 @@
/>
<Tool
Name="VCLinkerTool"
-
AdditionalLibraryDirectories=""
-
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
@@ -117,7 +115,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
+ AdditionalIncludeDirectories="../../../.."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -133,9 +131,7 @@
/>
<Tool
Name="VCLinkerTool"
-
AdditionalLibraryDirectories=""
-
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
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