Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84610 - in trunk/boost/geometry/extensions/algebra: . algorithms core geometries
From: adam.wulkiewicz_at_[hidden]
Date: 2013-06-02 14:18:59


Author: awulkiew
Date: 2013-06-02 14:18:58 EDT (Sun, 02 Jun 2013)
New Revision: 84610
URL: http://svn.boost.org/trac/boost/changeset/84610

Log:
geometry extensions: fixed error in rotation_quaternion, removed translate().
Removed:
   trunk/boost/geometry/extensions/algebra/algorithms/translate.hpp
   trunk/boost/geometry/extensions/algebra/core/topological_dimension.hpp
Text files modified:
   trunk/boost/geometry/extensions/algebra/algebra.hpp | 1 -
   trunk/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp | 6 +++---
   2 files changed, 3 insertions(+), 4 deletions(-)

Modified: trunk/boost/geometry/extensions/algebra/algebra.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algebra/algebra.hpp (original)
+++ trunk/boost/geometry/extensions/algebra/algebra.hpp 2013-06-02 14:18:58 EDT (Sun, 02 Jun 2013)
@@ -20,7 +20,6 @@
 #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/rotation_quaternion_concept.hpp>

Deleted: trunk/boost/geometry/extensions/algebra/algorithms/translate.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algebra/algorithms/translate.hpp 2013-06-02 14:18:58 EDT (Sun, 02 Jun 2013)
+++ (empty file)
@@ -1,143 +0,0 @@
-// 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::translate::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

Deleted: trunk/boost/geometry/extensions/algebra/core/topological_dimension.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algebra/core/topological_dimension.hpp 2013-06-02 14:18:58 EDT (Sun, 02 Jun 2013)
+++ (empty file)
@@ -1,50 +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.
-// 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> {};
-//
-//template <>
-//struct top_dim<rotation_quaternion_tag> : boost::mpl::int_<0> {};
-//
-//template <>
-//struct top_dim<rotation_matrix_tag> : boost::mpl::int_<0> {};
-
-} // namespace core_dispatch
-#endif
-
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_TOPOLOGICAL_DIMENSION_HPP

Modified: trunk/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp (original)
+++ trunk/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp 2013-06-02 14:18:58 EDT (Sun, 02 Jun 2013)
@@ -41,9 +41,9 @@
     inline rotation_quaternion(T const& w, T const& x, T const& y, T const& z)
     {
         m_values[0] = w;
- m_values[1] = w;
- m_values[2] = w;
- m_values[3] = w;
+ m_values[1] = x;
+ m_values[2] = y;
+ m_values[3] = z;
     }
 
     /// @brief Get a coordinate


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