|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76912 - in trunk/boost/geometry: arithmetic extensions/arithmetic io/wkt
From: barend.gehrels_at_[hidden]
Date: 2012-02-06 13:41:47
Author: barendgehrels
Date: 2012-02-06 13:41:46 EST (Mon, 06 Feb 2012)
New Revision: 76912
URL: http://svn.boost.org/trac/boost/changeset/76912
Log:
Manually reversed move of cross_product.hpp from extensions and renamal of stream_wkt to iomanip (because it is in /wkt/ we now call it stream.hpp)
Added:
trunk/boost/geometry/extensions/arithmetic/cross_product.hpp
- copied, changed from r76903, /trunk/boost/geometry/arithmetic/cross_product.hpp
trunk/boost/geometry/io/wkt/stream.hpp
- copied, changed from r76903, /trunk/boost/geometry/io/wkt/iomanip.hpp
Removed:
trunk/boost/geometry/arithmetic/cross_product.hpp
trunk/boost/geometry/io/wkt/iomanip.hpp
Text files modified:
trunk/boost/geometry/extensions/arithmetic/cross_product.hpp | 6 +++---
trunk/boost/geometry/io/wkt/stream.hpp | 10 +++++-----
trunk/boost/geometry/io/wkt/wkt.hpp | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
Deleted: trunk/boost/geometry/arithmetic/cross_product.hpp
==============================================================================
--- trunk/boost/geometry/arithmetic/cross_product.hpp 2012-02-06 13:41:46 EST (Mon, 06 Feb 2012)
+++ (empty file)
@@ -1,110 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-
-// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
-// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
-
-// 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_ARITHMETIC_CROSS_PRODUCT_HPP
-#define BOOST_GEOMETRY_ARITHMETIC_CROSS_PRODUCT_HPP
-
-
-#include <cstddef>
-
-#include <boost/geometry/core/access.hpp>
-#include <boost/geometry/geometries/concepts/point_concept.hpp>
-#include <boost/geometry/util/select_coordinate_type.hpp>
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail
-{
-
-template <typename P1, typename P2, std::size_t Dimension>
-struct cross_product
-{
- // We define cross product only for 2d (see Wolfram) and 3d.
- // In Math, it is also well-defined for 7-dimension.
- // Generalisation of cross product to n-dimension is defined as
- // wedge product but it is not direct analogue to binary cross product.
-};
-
-template <typename P1, typename P2>
-struct cross_product<P1, P2, 2>
-{
- typedef P1 return_type;
-
- static inline return_type apply(P1 const& p1, P2 const& p2)
- {
- assert_dimension<P1, 2>();
- assert_dimension<P2, 2>();
-
- // For 2-dimensions, analog of the cross product U(x,y) and V(x,y) is
- // Ux * Vy - Uy * Vx
- // which is returned as 0-component (or X) of 2d vector, 1-component is undefined.
- return_type v;
- set<0>(v, get<0>(p1) * get<1>(p2) - get<1>(p1) * get<0>(p2));
- return v;
- }
-};
-
-template <typename P1, typename P2>
-struct cross_product<P1, P2, 3>
-{
- typedef P1 return_type;
-
- static inline return_type apply(P1 const& p1, P2 const& p2)
- {
- assert_dimension<P1, 3>();
- assert_dimension<P2, 3>();
-
- return_type v;
- set<0>(v, get<1>(p1) * get<2>(p2) - get<2>(p1) * get<1>(p2));
- set<1>(v, get<2>(p1) * get<0>(p2) - get<0>(p1) * get<2>(p2));
- set<2>(v, get<0>(p1) * get<1>(p2) - get<1>(p1) * get<0>(p2));
- return v;
- }
-};
-
-} // namespace detail
-#endif // DOXYGEN_NO_DETAIL
-
-
-// TODO: This is a simple draft. If relevant, it can be extended to:
-// - accept vectors of different coordinate_type, but common coordinate_system
-// - if vectors are of mixed 2d and 3d, lower dimension is used
-// - define result_type that will generate type of vector based on:
-// -- select_coordinate_type
-// -- selection of lower dimension
-
-/*!
-\brief Computes the cross product of two vectors.
-\details Both vectors shall be of the same type.
- This type also determines type of result vector.
-\ingroup arithmetic
-\param p1 first vector
-\param p2 second vector
-\return the cross product vector
- */
-template <typename P1, typename P2>
-inline P1 cross_product(P1 const& p1, P2 const& p2)
-{
- BOOST_CONCEPT_ASSERT( (concept::ConstPoint<P1>) );
- BOOST_CONCEPT_ASSERT( (concept::ConstPoint<P2>) );
-
- return detail::cross_product
- <
- P1, P2,
- dimension<P1>::type::value
- >::apply(p1, p2);
-}
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_ARITHMETIC_CROSS_PRODUCT_HPP
Copied: trunk/boost/geometry/extensions/arithmetic/cross_product.hpp (from r76903, /trunk/boost/geometry/arithmetic/cross_product.hpp)
==============================================================================
--- /trunk/boost/geometry/arithmetic/cross_product.hpp (original)
+++ trunk/boost/geometry/extensions/arithmetic/cross_product.hpp 2012-02-06 13:41:46 EST (Mon, 06 Feb 2012)
@@ -8,8 +8,8 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_GEOMETRY_ARITHMETIC_CROSS_PRODUCT_HPP
-#define BOOST_GEOMETRY_ARITHMETIC_CROSS_PRODUCT_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_ARITHMETIC_CROSS_PRODUCT_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ARITHMETIC_CROSS_PRODUCT_HPP
#include <cstddef>
@@ -107,4 +107,4 @@
}} // namespace boost::geometry
-#endif // BOOST_GEOMETRY_ARITHMETIC_CROSS_PRODUCT_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_ARITHMETIC_CROSS_PRODUCT_HPP
Deleted: trunk/boost/geometry/io/wkt/iomanip.hpp
==============================================================================
--- trunk/boost/geometry/io/wkt/iomanip.hpp 2012-02-06 13:41:46 EST (Mon, 06 Feb 2012)
+++ (empty file)
@@ -1,40 +0,0 @@
-// 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.
-
-// 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_IO_WKT_IOMANIP_HPP
-#define BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
-
-#include <boost/geometry/io/wkt/write.hpp>
-
-// This short file contains only one manipulator, streaming as WKT
-// Don't include this in any standard-included header file.
-
-// Don't use namespace boost::geometry, to enable the library to stream custom geometries which
-// are living outside the namespace boost::geometry
-
-/*!
-\brief Streams a geometry as Well-Known Text
-\ingroup wkt
-*/
-template<typename Char, typename Traits, typename Geometry>
-inline std::basic_ostream<Char, Traits>& operator<<
- (
- std::basic_ostream<Char, Traits> &os,
- Geometry const& geom
- )
-{
- os << boost::geometry::wkt(geom);
- return os;
-}
-
-#endif // BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
Copied: trunk/boost/geometry/io/wkt/stream.hpp (from r76903, /trunk/boost/geometry/io/wkt/iomanip.hpp)
==============================================================================
--- /trunk/boost/geometry/io/wkt/iomanip.hpp (original)
+++ trunk/boost/geometry/io/wkt/stream.hpp 2012-02-06 13:41:46 EST (Mon, 06 Feb 2012)
@@ -11,16 +11,16 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
-#define BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
+#ifndef BOOST_GEOMETRY_IO_WKT_STREAM_HPP
+#define BOOST_GEOMETRY_IO_WKT_STREAM_HPP
#include <boost/geometry/io/wkt/write.hpp>
// This short file contains only one manipulator, streaming as WKT
// Don't include this in any standard-included header file.
-// Don't use namespace boost::geometry, to enable the library to stream custom geometries which
-// are living outside the namespace boost::geometry
+// Don't use namespace boost::geometry, to enable the library to stream custom
+// geometries which are living outside the namespace boost::geometry
/*!
\brief Streams a geometry as Well-Known Text
@@ -37,4 +37,4 @@
return os;
}
-#endif // BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
+#endif // BOOST_GEOMETRY_IO_WKT_STREAM_HPP
Modified: trunk/boost/geometry/io/wkt/wkt.hpp
==============================================================================
--- trunk/boost/geometry/io/wkt/wkt.hpp (original)
+++ trunk/boost/geometry/io/wkt/wkt.hpp 2012-02-06 13:41:46 EST (Mon, 06 Feb 2012)
@@ -18,8 +18,8 @@
#include <boost/geometry/io/wkt/write.hpp>
// BSG 2011-02-03
-// We don't include iomanip by default. That tries to stream anything not known
+// We don't include stream.hpp by default. That tries to stream anything not known
// by default (such as ttmath) and reports errors.
-// Users can include iomanip themselves (if they want to)
+// Users can include stream.hpp themselves (if they want to)
#endif // BOOST_GEOMETRY_IO_WKT_WKT_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