Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56825 - in sandbox/ggl/formal_review_request/boost/ggl: core extensions/io/svg iterators strategies/spherical util
From: barend.gehrels_at_[hidden]
Date: 2009-10-14 09:43:52


Author: barendgehrels
Date: 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
New Revision: 56825
URL: http://svn.boost.org/trac/boost/changeset/56825

Log:
Supposed to have been committed earlier, small doc fixes
Added:
   sandbox/ggl/formal_review_request/boost/ggl/iterators/circular_iterator.hpp (contents, props changed)
Text files modified:
   sandbox/ggl/formal_review_request/boost/ggl/core/cs.hpp | 64 +++------------------------------------
   sandbox/ggl/formal_review_request/boost/ggl/extensions/io/svg/write_svg.hpp | 10 +-----
   sandbox/ggl/formal_review_request/boost/ggl/iterators/base.hpp | 3 +
   sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/haversine.hpp | 4 +-
   sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/sph_area.hpp | 2
   sandbox/ggl/formal_review_request/boost/ggl/util/get_cs_as_radian.hpp | 11 ++----
   sandbox/ggl/formal_review_request/boost/ggl/util/math.hpp | 7 ----
   7 files changed, 17 insertions(+), 84 deletions(-)

Modified: sandbox/ggl/formal_review_request/boost/ggl/core/cs.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/core/cs.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/core/cs.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -28,17 +28,18 @@
 
 /*!
     \brief Unit of plan angles: degrees
- \ingroup utility
+ \ingroup cs
 */
 class degree {};
 
 
 /*!
     \brief Unit of plan angles: radians
- \ingroup utility
+ \ingroup cs
 */
 class radian {};
 
+
 namespace cs
 {
 
@@ -52,20 +53,6 @@
 struct cartesian {};
 
 
-/*!
- \brief EPSG Cartesian coordinate system
- \details EPSG (European Petrol Survey Group) has a standard list of projections,
- each having a code
- \see
- \ingroup cs
- \tparam Code the EPSG code
- \todo Maybe derive from boost::mpl::int_<EpsgCode>
-*/
-template<std::size_t Code>
-struct epsg
-{
- static const std::size_t epsg_code = Code;
-};
 
 
 /*!
@@ -74,6 +61,7 @@
     known as lat,long or lo,la or phi,lambda
     \see http://en.wikipedia.org/wiki/Geographic_coordinate_system
     \ingroup cs
+ \note might be moved to extensions/gis/geographic
 */
 template<typename DegreeOrRadian>
 struct geographic
@@ -81,18 +69,7 @@
     typedef DegreeOrRadian units;
 };
 
-/*!
- \brief Earth Centered, Earth Fixed
- \details Defines a Cartesian coordinate system x,y,z with the center of the earth as its origin,
- going through the Greenwich
- \see http://en.wikipedia.org/wiki/ECEF
- \see http://en.wikipedia.org/wiki/Geodetic_system
- \note Also known as "Geocentric", but geocentric is also an astronomic coordinate system
- \ingroup cs
-*/
-struct ecef
-{
-};
+
 
 /*!
     \brief Spherical coordinate system, in degree or in radian
@@ -128,26 +105,6 @@
 };
 
 
-namespace celestial
-{
-
-/*!
- \brief Ecliptic (celestial) coordinate system
- \details Defines the astronomical ecliptic coordinate system "that uses the ecliptic for its fundamental plane"
- It uses Beta and Lambda as its latitude and longitude.
- \see http://en.wikipedia.org/wiki/Ecliptic_coordinate_system
- \ingroup cs
-*/
-template<typename DegreeOrRadian>
-struct ecliptic
-{
- typedef DegreeOrRadian units;
-};
-
-// TODO: More celestial coordinate systems could be defined
-
-} // namespace celestial
-
 } // namespace cs
 
 namespace traits
@@ -182,17 +139,6 @@
     typedef cartesian_tag type;
 };
 
-template<>
-struct cs_tag<cs::ecef>
-{
- typedef cartesian_tag type;
-};
-
-template <std::size_t C>
-struct cs_tag<cs::epsg<C> >
-{
- typedef cartesian_tag type;
-};
 
 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
 } // namespace traits

Modified: sandbox/ggl/formal_review_request/boost/ggl/extensions/io/svg/write_svg.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/extensions/io/svg/write_svg.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/extensions/io/svg/write_svg.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -22,7 +22,7 @@
 #include <ggl/core/ring_type.hpp>
 
 /*!
-\defgroup svg svg: stream SVG (Scalable Vector Graphics)
+\defgroup svg x Extension svg: Stream SVG (Scalable Vector Graphics)
 */
 
 namespace ggl
@@ -249,14 +249,8 @@
 };
 
 /*!
-\brief Object generator to conveniently stream objects without including streamsvg
+\brief Main svg function to stream geometries as SVG
 \ingroup svg
-\par Example:
-Small example showing how to use the make_svg helper function
-\dontinclude doxygen_examples.cpp
-\skip example_as_svg_vector
-\line {
-\until }
 */
 template <typename Geometry>
 inline svg_manipulator<Geometry> svg(Geometry const& t, std::string const& style, int size = -1)

Modified: sandbox/ggl/formal_review_request/boost/ggl/iterators/base.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/iterators/base.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/iterators/base.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -13,6 +13,7 @@
 #include <boost/iterator/iterator_adaptor.hpp>
 #include <boost/iterator/iterator_categories.hpp>
 
+#ifndef DOXYGEN_NO_DETAIL
 namespace ggl { namespace detail { namespace iterators {
 
 template <typename T, typename Iterator>
@@ -51,5 +52,7 @@
 };
 
 }}} // namespace ggl::detail::iterators
+#endif
+
 
 #endif // GGL_ITERATORS_BASE_HPP

Added: sandbox/ggl/formal_review_request/boost/ggl/iterators/circular_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/ggl/formal_review_request/boost/ggl/iterators/circular_iterator.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -0,0 +1,92 @@
+// Generic Geometry Library
+//
+// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef GGL_ITERATORS_CIRCULAR_ITERATOR_HPP
+#define GGL_ITERATORS_CIRCULAR_ITERATOR_HPP
+
+#include <boost/iterator.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/iterator/iterator_categories.hpp>
+
+#include <ggl/iterators/base.hpp>
+
+namespace ggl
+{
+
+/*!
+ \brief Iterator which goes circular through a range, starting at a point, ending at that point
+ \tparam Iterator iterator on which this class is based on
+ \ingroup iterators
+*/
+template <typename Iterator>
+struct circular_iterator :
+ public detail::iterators::iterator_base
+ <
+ circular_iterator<Iterator>,
+ Iterator
+ >
+{
+ friend class boost::iterator_core_access;
+
+ explicit inline circular_iterator(Iterator begin, Iterator end, Iterator start)
+ : m_begin(begin)
+ , m_end(end)
+ , m_start(start)
+ {
+ this->base_reference() = start;
+ }
+
+ // Constructor to indicate the end of a range, to enable e.g. std::copy
+ explicit inline circular_iterator(Iterator end)
+ : m_begin(end)
+ , m_end(end)
+ , m_start(end)
+ {
+ this->base_reference() = end;
+ }
+
+ /// Navigate to a certain position, should be in [start .. end], it at end
+ /// it will circle again.
+ inline void moveto(Iterator it)
+ {
+ this->base_reference() = it;
+ check_end();
+ }
+
+private:
+
+ inline void increment()
+ {
+ if (this->base() != m_end)
+ {
+ (this->base_reference())++;
+ check_end();
+ }
+ }
+
+ inline void check_end()
+ {
+ if (this->base() == this->m_end)
+ {
+ this->base_reference() = this->m_begin;
+ }
+
+ if (this->base() == m_start)
+ {
+ this->base_reference() = this->m_end;
+ }
+ }
+
+ Iterator m_begin;
+ Iterator m_end;
+ Iterator m_start;
+};
+
+} // namespace ggl
+
+#endif // GGL_ITERATORS_CIRCULAR_ITERATOR_HPP

Modified: sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/haversine.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/haversine.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/haversine.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -51,7 +51,7 @@
                 //typedef spherical_distance return_type;
                 typedef double return_type;
 
- inline haversine(double r = constants::average_earth_radius)
+ inline haversine(double r = 1.0)
                     : m_radius(r)
                 {}
 
@@ -89,7 +89,7 @@
             public :
                 typedef double return_type;
 
- inline ll_point_segment(double r = constants::average_earth_radius) : m_radius(r)
+ inline ll_point_segment(double r = 1.0) : m_radius(r)
                 {}
 
                 inline return_type operator()(P const& p, S const& s) const

Modified: sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/sph_area.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/sph_area.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/strategies/spherical/sph_area.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -51,7 +51,7 @@
                     double m_radius;
 
                     // TODO: make this 1.0 & implement other construct to let user specify
- inline excess_sum(double radius = constants::average_earth_radius)
+ inline excess_sum(double radius = 1.0) //constants::average_earth_radius)
                         : m_sum(0)
                         , m_radius(radius)
                     {}

Modified: sandbox/ggl/formal_review_request/boost/ggl/util/get_cs_as_radian.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/util/get_cs_as_radian.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/util/get_cs_as_radian.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -10,14 +10,11 @@
 #ifndef GGL_UTIL_GET_CS_AS_RADIAN_HPP
 #define GGL_UTIL_GET_CS_AS_RADIAN_HPP
 
-
-#include <boost/type_traits/remove_const.hpp>
-
-
-
+#include <ggl/core/cs.hpp>
 
 namespace ggl {
 
+#ifndef DOXYGEN_NO_DETAIL
 namespace detail {
 
     template <typename CoordinateSystem>
@@ -35,8 +32,8 @@
         typedef cs::spherical<radian> type;
     };
 
-}
-
+} // namespace detail
+#endif
 
 
 

Modified: sandbox/ggl/formal_review_request/boost/ggl/util/math.hpp
==============================================================================
--- sandbox/ggl/formal_review_request/boost/ggl/util/math.hpp (original)
+++ sandbox/ggl/formal_review_request/boost/ggl/util/math.hpp 2009-10-14 09:43:50 EDT (Wed, 14 Oct 2009)
@@ -85,13 +85,6 @@
 
 } // namespace math
 
-// To be moved somewhere.
-namespace constants
-{
-
-double const average_earth_radius = 6372795.0;
-
-} // namespace constants
 
 } // namespace ggl
 


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