Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84542 - in trunk/boost/geometry/extensions: algebra algebra/algorithms algebra/core algebra/geometries algebra/geometries/concepts ball/algorithms
From: adam.wulkiewicz_at_[hidden]
Date: 2013-05-28 18:45:59


Author: awulkiew
Date: 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
New Revision: 84542
URL: http://svn.boost.org/trac/boost/changeset/84542

Log:
geometry extensions: Added Vector concept, implemented assign(), clear(), num_points.hpp(), implemented translations for Point and Box. Fixed includes in extensions/ball.
Added:
   trunk/boost/geometry/extensions/algebra/
   trunk/boost/geometry/extensions/algebra/algebra.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/algorithms/
   trunk/boost/geometry/extensions/algebra/algorithms/assign.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/algorithms/clear.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/algorithms/num_points.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/algorithms/translate.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/algorithms/translation.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/core/
   trunk/boost/geometry/extensions/algebra/core/access.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/core/coordinate_system.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/core/coordinate_type.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/core/tags.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/core/topological_dimension.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/geometries/
   trunk/boost/geometry/extensions/algebra/geometries/concepts/
   trunk/boost/geometry/extensions/algebra/geometries/concepts/check.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp (contents, props changed)
   trunk/boost/geometry/extensions/algebra/geometries/vector.hpp (contents, props changed)
Text files modified:
   trunk/boost/geometry/extensions/ball/algorithms/area.hpp | 2 +-
   trunk/boost/geometry/extensions/ball/algorithms/clear.hpp | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Added: trunk/boost/geometry/extensions/algebra/algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/algebra.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,37 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGEBRA_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGEBRA_HPP
+
+#include <boost/geometry/extensions/algebra/core/access.hpp>
+#include <boost/geometry/extensions/algebra/core/coordinate_dimension.hpp>
+#include <boost/geometry/extensions/algebra/core/coordinate_system.hpp>
+#include <boost/geometry/extensions/algebra/core/coordinate_type.hpp>
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+#include <boost/geometry/extensions/algebra/core/topological_dimension.hpp>
+
+#include <boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp>
+#include <boost/geometry/extensions/algebra/geometries/concepts/check.hpp>
+
+#include <boost/geometry/extensions/algebra/geometries/vector.hpp>
+
+#include <boost/geometry/extensions/algebra/algorithms/assign.hpp>
+#include <boost/geometry/extensions/algebra/algorithms/clear.hpp>
+#include <boost/geometry/extensions/algebra/algorithms/num_points.hpp>
+
+#include <boost/geometry/extensions/algebra/algorithms/translation.hpp>
+#include <boost/geometry/extensions/algebra/algorithms/translate.hpp>
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGEBRA_HPP

Added: trunk/boost/geometry/extensions/algebra/algorithms/assign.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/algorithms/assign.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,71 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_ASSIGN_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_ASSIGN_HPP
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+template <typename Vector>
+struct assign_zero<vector_tag, Vector>
+ : detail::assign::assign_zero_point<Vector>
+{};
+
+template <typename V>
+struct assign<vector_tag, V, 2>
+{
+ typedef typename coordinate_type<V>::type coordinate_type;
+
+ template <typename T>
+ static inline void apply(V& v, T const& c1, T const& c2)
+ {
+ set<0>(v, boost::numeric_cast<coordinate_type>(c1));
+ set<1>(v, boost::numeric_cast<coordinate_type>(c2));
+ }
+};
+
+template <typename V>
+struct assign<vector_tag, V, 3>
+{
+ typedef typename coordinate_type<V>::type coordinate_type;
+
+ template <typename T>
+ static inline void apply(V& v, T const& c1, T const& c2, T const& c3)
+ {
+ set<0>(v, boost::numeric_cast<coordinate_type>(c1));
+ set<1>(v, boost::numeric_cast<coordinate_type>(c2));
+ set<2>(v, boost::numeric_cast<coordinate_type>(c3));
+ }
+};
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_ASSIGN_HPP

Added: trunk/boost/geometry/extensions/algebra/algorithms/clear.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/algorithms/clear.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,48 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_CLEAR_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_CLEAR_HPP
+
+
+#include <boost/geometry/algorithms/clear.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+
+template <typename Geometry>
+struct clear<vector_tag, Geometry>
+ : detail::clear::no_action<Geometry>
+{};
+
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_CLEAR_HPP

Added: trunk/boost/geometry/extensions/algebra/algorithms/num_points.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/algorithms/num_points.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,47 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_NUM_POINTS_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_NUM_POINTS_HPP
+
+#include <boost/geometry/algorithms/num_points.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+template <typename Geometry>
+struct num_points<vector_tag, Geometry>
+ : detail::num_points::other_count<0>
+{};
+
+
+
+} // namespace dispatch
+#endif
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_NUM_POINTS_HPP

Added: trunk/boost/geometry/extensions/algebra/algorithms/translate.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/algorithms/translate.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,143 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATE_HPP
+
+#include <boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp>
+#include <boost/geometry/arithmetic/arithmetic.hpp>
+
+namespace boost { namespace geometry {
+
+namespace detail { namespace translate {
+
+template <typename Box, typename Vector, std::size_t Dimension>
+struct box_cartesian
+{
+ BOOST_MPL_ASSERT_MSG((0 < Dimension), INVALID_DIMENSION, (Box));
+
+ static inline void apply(Box & box, Vector const& vector)
+ {
+ box_cartesian<Box, Vector, Dimension-1>::apply(box, vector);
+ set<min_corner, Dimension-1>(box, get<min_corner, Dimension-1>(box) + get<Dimension-1>(vector));
+ set<max_corner, Dimension-1>(box, get<max_corner, Dimension-1>(box) + get<Dimension-1>(vector));
+ }
+};
+
+template <typename Box, typename Vector>
+struct box_cartesian<Box, Vector, 1>
+{
+ static inline void apply(Box & box, Vector const& vector)
+ {
+ set<min_corner, 0>(box, get<min_corner, 0>(box) + get<0>(vector));
+ set<max_corner, 0>(box, get<max_corner, 0>(box) + get<0>(vector));
+ }
+};
+
+}} // namespace detail::translate
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch {
+
+template <typename Geometry, typename Vector, typename Tag = typename tag<Geometry>::type>
+struct translate
+{
+ BOOST_MPL_ASSERT_MSG(false, NOT_IMPLEMENTED_FOR_THIS_TAG, (Tag));
+};
+
+template <typename Point, typename Vector>
+struct translate<Point, Vector, point_tag>
+{
+ BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
+
+ static inline void apply(Point & point, Vector const& vector)
+ {
+ typedef boost::mpl::bool_<
+ boost::is_same<
+ typename traits::coordinate_system<Point>::type,
+ cs::cartesian
+ >::value
+ > is_cartesian;
+ apply(point, vector, is_cartesian());
+ }
+
+ static inline void apply(Point & point, Vector const& vector, boost::mpl::bool_<true> /*is_cartesian*/)
+ {
+ for_each_coordinate(point, detail::point_operation<Vector, std::plus>(vector));
+ }
+
+ static inline void apply(Point & point, Vector const& vector, boost::mpl::bool_<false> /*is_cartesian*/)
+ {
+ typedef typename traits::coordinate_system<Point>::type cs;
+ BOOST_MPL_ASSERT_MSG(false, NOT_IMPLEMENTED_FOR_THIS_CS, (cs));
+ }
+};
+
+template <typename Box, typename Vector>
+struct translate<Box, Vector, box_tag>
+{
+ typedef typename traits::point_type<Box>::type point_type;
+
+ BOOST_CONCEPT_ASSERT( (concept::Point<point_type>) );
+
+ static inline void apply(Box & box, Vector const& vector)
+ {
+ typedef boost::mpl::bool_<
+ boost::is_same<
+ typename traits::coordinate_system<point_type>::type,
+ cs::cartesian
+ >::value
+ > is_cartesian;
+ apply(box, vector, is_cartesian());
+ }
+
+ static inline void apply(Box & box, Vector const& vector, boost::mpl::bool_<true> /*is_cartesian*/)
+ {
+ geometry::detail::box_cartesian<
+ Box, Vector, traits::dimension<point_type>::value
+ >::apply(box, vector);
+ }
+
+ static inline void apply(Box & box, Vector const& vector, boost::mpl::bool_<false> /*is_cartesian*/)
+ {
+ typedef typename traits::coordinate_system<point_type>::type cs;
+ BOOST_MPL_ASSERT_MSG(false, NOT_IMPLEMENTED_FOR_THIS_CS, (cs));
+ }
+};
+
+// TODO - other geometries
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+template <typename Geometry, typename Vector>
+inline void translate(Geometry & g, Vector const& v)
+{
+ concept::check_concepts_and_equal_dimensions<Geometry, Vector const>();
+
+ dispatch::translate<Geometry, Vector>::apply(g, v);
+}
+
+template <typename GeometrySrc, typename Vector, typename GeometryDst>
+inline void translated(GeometrySrc const& gsrc, Vector const& v, GeometryDst & gdst)
+{
+ geometry::convert(gsrc, gdst);
+ geometry::translate(gdst, v);
+}
+
+template <typename GeometryDst, typename GeometrySrc, typename Vector>
+inline GeometryDst return_translated(GeometrySrc const& gsrc, Vector const& v)
+{
+ GeometryDst res;
+ translated(gsrc, v, res);
+ return res;
+}
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATE_HPP

Added: trunk/boost/geometry/extensions/algebra/algorithms/translation.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/algorithms/translation.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,44 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATION_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATION_HPP
+
+#include <boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp>
+
+//#include <boost/geometry/geometries/concepts/point_concept.hpp>
+//#include <boost/geometry/util/for_each_coordinate.hpp>
+#include <boost/geometry/arithmetic/arithmetic.hpp>
+
+namespace boost { namespace geometry
+{
+
+// TODO - implement point_operation2 taking two arguments
+
+template <typename Point1, typename Point2, typename Vector>
+inline void translation(Point1 const& p1, Point2 const& p2, Vector & v)
+{
+ concept::check_concepts_and_equal_dimensions<Point1 const, Point2 const>();
+ // TODO - replace the following by check_equal_dimensions
+ concept::check_concepts_and_equal_dimensions<Point1 const, Vector>();
+
+ for_each_coordinate(v, detail::point_assignment<Point2>(p2));
+ for_each_coordinate(v, detail::point_operation<Point1, std::minus>(p1));
+}
+
+template <typename Vector, typename Point1, typename Point2>
+inline Vector return_translation(Point1 const& p1, Point2 const& p2)
+{
+ Vector v;
+ translation(p1, p2, v);
+ return v;
+}
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_ASSIGN_HPP

Added: trunk/boost/geometry/extensions/algebra/core/access.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/core/access.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,65 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_ACCESS_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_ACCESS_HPP
+
+
+
+#include <boost/geometry/core/access.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace core_dispatch
+{
+
+template <typename Vector, typename CoordinateType, std::size_t Dimension>
+struct access<vector_tag, Vector, CoordinateType, Dimension, boost::false_type>
+{
+ static inline CoordinateType get(Vector const& v)
+ {
+ return traits::access<Vector, Dimension>::get(v);
+ }
+ static inline void set(Vector& v, CoordinateType const& value)
+ {
+ traits::access<Vector, Dimension>::set(v, value);
+ }
+};
+
+template <typename Vector, typename CoordinateType, std::size_t Dimension>
+struct access<vector_tag, Vector, CoordinateType, Dimension, boost::true_type>
+{
+ static inline CoordinateType get(Vector const* v)
+ {
+ return traits::access<typename boost::remove_pointer<Vector>::type, Dimension>::get(*v);
+ }
+ static inline void set(Vector* v, CoordinateType const& value)
+ {
+ traits::access<typename boost::remove_pointer<Vector>::type, Dimension>::set(*v, value);
+ }
+};
+
+
+} // namespace core_dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_ACCESS_HPP

Added: trunk/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,37 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_DIMENSION_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_DIMENSION_HPP
+
+#include <boost/geometry/core/coordinate_system.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+namespace boost { namespace geometry {
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace core_dispatch {
+
+template <typename V>
+struct dimension<vector_tag, V>
+ : traits::dimension<typename geometry::util::bare_type<V>::type>
+{};
+
+} // namespace core_dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_DIMENSION_HPP

Added: trunk/boost/geometry/extensions/algebra/core/coordinate_system.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/core/coordinate_system.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,41 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_SYSTEM_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_SYSTEM_HPP
+
+#include <boost/geometry/core/coordinate_system.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+namespace boost { namespace geometry {
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace core_dispatch {
+
+template <typename Vector>
+struct coordinate_system<vector_tag, Vector>
+{
+ typedef typename traits::coordinate_system
+ <
+ typename geometry::util::bare_type<Vector>::type
+ >::type type;
+};
+
+} // namespace core_dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_SYSTEM_HPP

Added: trunk/boost/geometry/extensions/algebra/core/coordinate_type.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/core/coordinate_type.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,41 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_TYPE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_TYPE_HPP
+
+#include <boost/geometry/core/coordinate_type.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+namespace boost { namespace geometry {
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace core_dispatch {
+
+template <typename Vector>
+struct coordinate_type<vector_tag, Vector>
+{
+ typedef typename traits::coordinate_type
+ <
+ typename geometry::util::bare_type<Vector>::type
+ >::type type;
+};
+
+} // namespace core_dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_TYPE_HPP

Added: trunk/boost/geometry/extensions/algebra/core/tags.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/core/tags.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,29 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TAGS_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TAGS_HPP
+
+
+namespace boost { namespace geometry
+{
+
+
+struct vector_tag {};
+
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TAGS_HPP

Added: trunk/boost/geometry/extensions/algebra/core/topological_dimension.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/core/topological_dimension.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,45 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TOPOLOGICAL_DIMENSION_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TOPOLOGICAL_DIMENSION_HPP
+
+
+#include <boost/geometry/core/topological_dimension.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace core_dispatch
+{
+
+
+template <>
+struct top_dim<vector_tag> : boost::mpl::int_<0> {};
+
+
+} // namespace core_dispatch
+#endif
+
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TOPOLOGICAL_DIMENSION_HPP

Added: trunk/boost/geometry/extensions/algebra/geometries/concepts/check.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/geometries/concepts/check.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,50 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_CHECK_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_CHECK_HPP
+
+
+#include <boost/geometry/geometries/concepts/check.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+template <typename Geometry>
+struct check<Geometry, vector_tag, true>
+ : detail::concept_check::check<concept::ConstVector<Geometry> >
+{};
+
+template <typename Geometry>
+struct check<Geometry, vector_tag, false>
+ : detail::concept_check::check<concept::Vector<Geometry> >
+{};
+
+} // namespace dispatch
+#endif
+
+
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_CHECK_HPP

Added: trunk/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,112 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_VECTOR_CONCEPT_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_VECTOR_CONCEPT_HPP
+
+#include <boost/concept_check.hpp>
+
+#include <boost/geometry/core/coordinate_dimension.hpp>
+#include <boost/geometry/core/access.hpp>
+
+namespace boost { namespace geometry { namespace concept {
+
+template <typename Geometry>
+class Vector
+{
+#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
+
+ typedef typename coordinate_type<Geometry>::type ctype;
+ typedef typename coordinate_system<Geometry>::type csystem;
+
+ enum { ccount = dimension<Geometry>::value };
+
+
+ template <typename V, std::size_t Dimension, std::size_t DimensionCount>
+ struct dimension_checker
+ {
+ static void apply()
+ {
+ V* v = 0;
+ geometry::set<Dimension>(*v, geometry::get<Dimension>(*v));
+ dimension_checker<V, Dimension+1, DimensionCount>::apply();
+ }
+ };
+
+
+ template <typename V, std::size_t DimensionCount>
+ struct dimension_checker<V, DimensionCount, DimensionCount>
+ {
+ static void apply() {}
+ };
+
+public:
+
+ /// BCCL macro to apply the Vector concept
+ BOOST_CONCEPT_USAGE(Vector)
+ {
+ static const bool cs_check = ::boost::is_same<csystem, cs::cartesian>::value;
+ BOOST_MPL_ASSERT_MSG(cs_check, NOT_IMPLEMENTED_FOR_THIS_CS, (csystem));
+
+ dimension_checker<Geometry, 0, ccount>::apply();
+ }
+#endif
+};
+
+
+template <typename Geometry>
+class ConstVector
+{
+#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
+
+ typedef typename coordinate_type<Geometry>::type ctype;
+ typedef typename coordinate_system<Geometry>::type csystem;
+
+ enum { ccount = dimension<Geometry>::value };
+
+ template <typename V, std::size_t Dimension, std::size_t DimensionCount>
+ struct dimension_checker
+ {
+ static void apply()
+ {
+ const V* v = 0;
+ ctype coord(geometry::get<Dimension>(*v));
+ boost::ignore_unused_variable_warning(coord);
+ dimension_checker<V, Dimension+1, DimensionCount>::apply();
+ }
+ };
+
+
+ template <typename V, std::size_t DimensionCount>
+ struct dimension_checker<V, DimensionCount, DimensionCount>
+ {
+ static void apply() {}
+ };
+
+public:
+
+ /// BCCL macro to apply the ConstVector concept
+ BOOST_CONCEPT_USAGE(ConstVector)
+ {
+ static const bool cs_check = ::boost::is_same<csystem, cs::cartesian>::value;
+ BOOST_MPL_ASSERT_MSG(cs_check, NOT_IMPLEMENTED_FOR_THIS_CS, (csystem));
+
+ dimension_checker<Geometry, 0, ccount>::apply();
+ }
+#endif
+};
+
+}}} // namespace boost::geometry::concept
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_VECTOR_CONCEPT_HPP

Added: trunk/boost/geometry/extensions/algebra/geometries/vector.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/extensions/algebra/geometries/vector.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -0,0 +1,133 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// 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 BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_VECTOR_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_VECTOR_HPP
+
+#include <cstddef>
+
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/convert.hpp>
+
+#include <boost/geometry/extensions/algebra/core/tags.hpp>
+#include <boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp>
+
+namespace boost { namespace geometry
+{
+
+namespace model
+{
+
+template <typename CoordinateType, std::size_t DimensionCount>
+class vector
+{
+ BOOST_CONCEPT_ASSERT( (concept::Vector<vector>) );
+
+public:
+
+ /// @brief Default constructor, no initialization
+ inline vector()
+ {}
+
+ /// @brief Constructor to set one, two or three values
+ inline explicit vector(CoordinateType const& v0, CoordinateType const& v1 = 0, CoordinateType const& v2 = 0)
+ {
+ if (DimensionCount >= 1) m_values[0] = v0;
+ if (DimensionCount >= 2) m_values[1] = v1;
+ if (DimensionCount >= 3) m_values[2] = v2;
+ }
+
+ /// @brief Get a coordinate
+ /// @tparam K coordinate to get
+ /// @return the coordinate
+ template <std::size_t K>
+ inline CoordinateType const& get() const
+ {
+ BOOST_STATIC_ASSERT(K < DimensionCount);
+ return m_values[K];
+ }
+
+ /// @brief Set a coordinate
+ /// @tparam K coordinate to set
+ /// @param value value to set
+ template <std::size_t K>
+ inline void set(CoordinateType const& value)
+ {
+ BOOST_STATIC_ASSERT(K < DimensionCount);
+ m_values[K] = value;
+ }
+
+private:
+
+ CoordinateType m_values[DimensionCount];
+};
+
+
+} // namespace model
+
+#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+namespace traits
+{
+
+template <typename CoordinateType, std::size_t DimensionCount>
+struct tag<model::vector<CoordinateType, DimensionCount> >
+{
+ typedef vector_tag type;
+};
+
+template <typename CoordinateType, std::size_t DimensionCount>
+struct coordinate_type<model::vector<CoordinateType, DimensionCount> >
+{
+ typedef CoordinateType type;
+};
+
+template <typename CoordinateType, std::size_t DimensionCount>
+struct coordinate_system<model::vector<CoordinateType, DimensionCount> >
+{
+ typedef cs::cartesian type;
+};
+
+template <typename CoordinateType, std::size_t DimensionCount>
+struct dimension<model::vector<CoordinateType, DimensionCount> >
+ : boost::mpl::int_<DimensionCount>
+{};
+
+template
+<
+ typename CoordinateType,
+ std::size_t DimensionCount,
+ std::size_t Dimension
+>
+struct access<model::vector<CoordinateType, DimensionCount>, Dimension>
+{
+ static inline CoordinateType get(
+ model::vector<CoordinateType, DimensionCount> const& v)
+ {
+ return v.template get<Dimension>();
+ }
+
+ static inline void set(
+ model::vector<CoordinateType, DimensionCount> & v,
+ CoordinateType const& value)
+ {
+ v.template set<Dimension>(value);
+ }
+};
+
+} // namespace traits
+#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_VECTOR_HPP

Modified: trunk/boost/geometry/extensions/ball/algorithms/area.hpp
==============================================================================
--- trunk/boost/geometry/extensions/ball/algorithms/area.hpp (original)
+++ trunk/boost/geometry/extensions/ball/algorithms/area.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -17,7 +17,7 @@
 #include <boost/math/constants/constants.hpp>
 
 #include <boost/geometry/algorithms/area.hpp>
-#include <boost/geometry/extensions/nsphere/core/tags.hpp>
+#include <boost/geometry/extensions/ball/core/tags.hpp>
 
 
 

Modified: trunk/boost/geometry/extensions/ball/algorithms/clear.hpp
==============================================================================
--- trunk/boost/geometry/extensions/ball/algorithms/clear.hpp (original)
+++ trunk/boost/geometry/extensions/ball/algorithms/clear.hpp 2013-05-28 18:45:57 EDT (Tue, 28 May 2013)
@@ -17,7 +17,7 @@
 
 #include <boost/geometry/algorithms/clear.hpp>
 
-#include <boost/geometry/extensions/nsphere/core/tags.hpp>
+#include <boost/geometry/extensions/ball/core/tags.hpp>
 
 
 


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