#ifndef Magnum_Shapes_Line_h #define Magnum_Shapes_Line_h /* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Vladimír Vondruš Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @file @brief Class @ref Magnum::Shapes::Line, typedef @ref Magnum::Shapes::Line2D, @ref Magnum::Shapes::Line3D @deprecated The @ref Magnum::Shapes library is a failed design experiment and is scheduled for removal in a future release. Related geometry algorithms were moved to @ref Magnum::Math::Distance and @ref Magnum::Math::Intersection; if you need a full-fledged physics library, please have look at [Bullet](https://bulletphysics.org), which has Magnum integration in @ref Magnum::BulletIntegration, or at [Box2D](https://box2d.org/), which has a @ref examples-box2d "Magnum example" as well. */ #include "Magnum/DimensionTraits.h" #include "Magnum/Math/Vector3.h" #include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/visibility.h" /* File-level deprecation warning issued from Shapes.h */ namespace Magnum { namespace Shapes { CORRADE_IGNORE_DEPRECATED_PUSH /** @brief Infinite line, defined by two points @deprecated The @ref Shapes library is a failed design experiment and is scheduled for removal in a future release. Related geometry algorithms were moved to @ref Math::Distance and @ref Math::Intersection; if you need a full-fledged physics library, please have look at [Bullet](https://bulletphysics.org), which has Magnum integration in @ref BulletIntegration, or at [Box2D](https://box2d.org/), which has a @ref examples-box2d "Magnum example" as well. See @ref shapes for brief introduction. @see @ref Line2D, @ref Line3D @todo collision detection of two Line2D */ template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Line { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ }; /** * @brief Default constructor * * Creates line with both points at origin. */ constexpr /*implicit*/ Line() {} /** @brief Constructor */ constexpr /*implicit*/ Line(const VectorTypeFor& a, const typename DimensionTraits::VectorType& b): _a(a), _b(b) {} /** @brief Transformed shape */ Line transformed(const MatrixTypeFor& matrix) const; /** @brief First point */ constexpr VectorTypeFor a() const { return _a; } /** @brief Set first point */ void setA(const VectorTypeFor& a) { _a = a; } /** @brief Second point */ constexpr VectorTypeFor b() const { return _b; } /** @brief Set second point */ void setB(const VectorTypeFor& b) { _b = b; } private: VectorTypeFor _a, _b; }; /** @brief Infinite two-dimensional line @deprecated The @ref Shapes library is a failed design experiment and is scheduled for removal in a future release. Related geometry algorithms were moved to @ref Math::Distance and @ref Math::Intersection; if you need a full-fledged physics library, please have look at [Bullet](https://bulletphysics.org), which has Magnum integration in @ref BulletIntegration, or at [Box2D](https://box2d.org/), which has a @ref examples-box2d "Magnum example" as well. */ typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Line<2> Line2D; /** @brief Infinite three-dimensional line @deprecated The @ref Shapes library is a failed design experiment and is scheduled for removal in a future release. Related geometry algorithms were moved to @ref Math::Distance and @ref Math::Intersection; if you need a full-fledged physics library, please have look at [Bullet](https://bulletphysics.org), which has Magnum integration in @ref BulletIntegration, or at [Box2D](https://box2d.org/), which has a @ref examples-box2d "Magnum example" as well. */ typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Line<3> Line3D; CORRADE_IGNORE_DEPRECATED_POP }} #endif