diff --git a/CMakeLists.txt b/CMakeLists.txt index b017dbf37..1cb28776a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ cmake_dependent_option(WITH_TGAIMPORTER "Build TgaImporter plugin" OFF "NOT WITH cmake_dependent_option(WITH_AUDIO "Build Audio library" OFF "NOT WITH_AL_INFO;NOT WITH_ANYAUDIOIMPORTER;NOT WITH_WAVAUDIOIMPORTER" ON) option(WITH_DEBUGTOOLS "Build DebugTools library" ON) cmake_dependent_option(WITH_MESHTOOLS "Build MeshTools library" ON "NOT WITH_OBJIMPORTER" ON) -option(WITH_SHAPES "Build Shapes library" ON) +option(WITH_SHAPES "Build Shapes library" OFF) cmake_dependent_option(WITH_SCENEGRAPH "Build SceneGraph library" ON "NOT WITH_SHAPES" ON) option(WITH_SHADERS "Build Shaders library" ON) cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_FONTCONVERTER;NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON) diff --git a/doc/building.dox b/doc/building.dox index 5b8441586..2a289d9d6 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -452,9 +452,9 @@ information. See also @ref corrade-cmake and @ref Corrade/Corrade.h for related info for the Corrade library. By default the engine is built with nearly everything except the @ref Audio -library, plugins, command-line utilities and application libraries (see below). -Using the following `WITH_*` CMake options you can specify which parts will -be built and which not: +and @ref Shapes libraries, plugins, command-line utilities and application +libraries (see below). Using the following `WITH_*` CMake options you can +specify which parts will be built and which not: - `WITH_AUDIO` --- Build the @ref Audio library. Depends on [OpenAL](https://www.openal.org/), not built by default. @@ -469,8 +469,8 @@ be built and which not: automatically if `WITH_SHAPES` is enabled. - `WITH_SHADERS` --- Build the @ref Shaders library. Enables also building of the GL library. -- `WITH_SHAPES` --- Build the @ref Shapes library. Enables also building of - the SceneGraph library. +- `WITH_SHAPES` @m_class{m-label m-danger} **deprecated** --- Build the + @ref Shapes library. Enables also building of the SceneGraph library. - `WITH_TEXT` --- Build the @ref Text library. Enables also building of the TextureTools and GL libraries. - `WITH_TEXTURETOOLS` --- Build the @ref TextureTools library. Enabled diff --git a/doc/changelog.dox b/doc/changelog.dox index 6a975eab6..587342fc7 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -315,6 +315,14 @@ See also: @subsection changelog-latest-deprecated Deprecated APIs +- The @ref Magnum::Shapes library is a failed design experiment and is + scheduled for removal in a future release, together with + @ref DebugTools::ShapeRenderer. 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. - @ref Platform::GlutApplication is based on an outdated toolkit and thus scheduled for removal in a future release. Please consider switching to @ref Platform::Sdl2Application or @ref Platform::GlfwApplication as soon as @@ -347,6 +355,8 @@ See also: @subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs +- The @ref Magnum::Shapes library is not built by default anymore due to its + deprecated status - @ref Audio::Playable is now by default omnidirectional instead of having source in direction of negative Z axis (the direction has effect only when setting inner and outer cone properties of @ref Audio::Source). diff --git a/doc/cmake.dox b/doc/cmake.dox index 7f37cb00b..e462f24a6 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -112,7 +112,7 @@ the components. The optional components are: - `Primitives` --- @ref Primitives library - `SceneGraph` --- @ref SceneGraph library - `Shaders` --- @ref Shaders library -- `Shapes` --- @ref Shapes library +- `Shapes` @m_class{m-label m-danger} **deprecated** --- @ref Shapes library - `Text` --- @ref Text library - `TextureTools` --- @ref TextureTools library - `Trade` --- @ref Trade library diff --git a/doc/features.dox b/doc/features.dox index 46d57f848..6832b64e2 100644 --- a/doc/features.dox +++ b/doc/features.dox @@ -39,7 +39,8 @@ necessary to read through everything, pick only what you need. - @subpage opengl-wrapping --- @copybrief opengl-wrapping - @subpage shaders --- @copybrief shaders - @subpage scenegraph --- @copybrief scenegraph -- @subpage shapes --- @copybrief shapes +- @subpage shapes @m_class{m-label m-danger} **deprecated** --- + @copybrief shapes - @subpage debug-tools --- @copybrief debug-tools - @subpage ui --- @copybrief ui */ diff --git a/doc/namespaces.dox b/doc/namespaces.dox index 0161ff7a2..0787f4ca6 100644 --- a/doc/namespaces.dox +++ b/doc/namespaces.dox @@ -356,11 +356,27 @@ See @ref building, @ref cmake and @ref shaders for more information. */ /** @dir Magnum/Shapes - * @brief Namespace @ref Magnum::Shapes - */ +@brief Namespace @ref Magnum::Shapes + +@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. +*/ /** @namespace Magnum::Shapes @brief Shape library +@deprecated This 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. + Collision detection system. This library is built if `WITH_SHAPES` is enabled when building Magnum. To use diff --git a/doc/shapes.dox b/doc/shapes.dox index d728904ea..eedeb843d 100644 --- a/doc/shapes.dox +++ b/doc/shapes.dox @@ -30,6 +30,16 @@ namespace Magnum { @tableofcontents @m_footernavigation +@deprecated This 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 "Math::Distance" and + @ref Magnum::Math::Intersection "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 "BulletIntegration" or at + [Box2D](https://box2d.org/), which has a @ref examples-box2d "Magnum example" + as well. + The essential thing in collision detection is to define a complex object with collection of simple shapes, for which it is easy to detect collisions. The library is contained in @ref Shapes namespace, see its documentation for more diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 8ac79f149..6b01586f0 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -342,13 +342,16 @@ endif() # Component distinction (listing them explicitly to avoid mistakes with finding # components from other repositories) set(_MAGNUM_LIBRARY_COMPONENT_LIST - Audio DebugTools GL MeshTools Primitives SceneGraph Shaders Shapes Text + Audio DebugTools GL MeshTools Primitives SceneGraph Shaders Text TextureTools Trade Vk AndroidApplication GlfwApplication GlutApplication GlxApplication Sdl2Application XEglApplication WindowlessCglApplication WindowlessEglApplication WindowlessGlxApplication WindowlessIosApplication WindowlessWglApplication WindowlessWindowsEglApplication CglContext EglContext GlxContext WglContext OpenGLTester) +if(MAGNUM_BUILD_DEPRECATED) + list(APPEND _MAGNUM_LIBRARY_COMPONENT_LIST Shapes) +endif() set(_MAGNUM_PLUGIN_COMPONENT_LIST AnyAudioImporter AnyImageConverter AnyImageImporter AnySceneImporter MagnumFont MagnumFontConverter ObjImporter TgaImageConverter TgaImporter @@ -364,14 +367,17 @@ if(MAGNUM_TARGET_GL) # MeshTools, Primitives, SceneGraph, Shaders and Shapes are used only for # GL renderers. All of this is optional, compiled in only if the base # library was selected. - list(APPEND _MAGNUM_DebugTools_DEPENDENCIES MeshTools Primitives SceneGraph Shaders Shapes Trade GL) + list(APPEND _MAGNUM_DebugTools_DEPENDENCIES MeshTools Primitives SceneGraph Shaders Trade GL) set(_MAGNUM_DebugTools_MeshTools_DEPENDENCY_IS_OPTIONAL ON) set(_MAGNUM_DebugTools_Primitives_DEPENDENCY_IS_OPTIONAL ON) set(_MAGNUM_DebugTools_SceneGraph_DEPENDENCY_IS_OPTIONAL ON) set(_MAGNUM_DebugTools_Shaders_DEPENDENCY_IS_OPTIONAL ON) - set(_MAGNUM_DebugTools_Shapes_DEPENDENCY_IS_OPTIONAL ON) set(_MAGNUM_DebugTools_Trade_DEPENDENCY_IS_OPTIONAL ON) set(_MAGNUM_DebugTools_GL_DEPENDENCY_IS_OPTIONAL ON) + if(MAGNUM_BUILD_DEPRECATED) + list(APPEND _MAGNUM_DebugTools_DEPENDENCIES Shapes) + set(_MAGNUM_DebugTools_Shapes_DEPENDENCY_IS_OPTIONAL ON) + endif() endif() set(_MAGNUM_MeshTools_DEPENDENCIES ) @@ -404,7 +410,9 @@ endif() set(_MAGNUM_Primitives_DEPENDENCIES Trade) set(_MAGNUM_SceneGraph_DEPENDENCIES ) set(_MAGNUM_Shaders_DEPENDENCIES GL) -set(_MAGNUM_Shapes_DEPENDENCIES SceneGraph) +if(MAGNUM_BUILD_DEPRECATED) + set(_MAGNUM_Shapes_DEPENDENCIES SceneGraph) +endif() set(_MAGNUM_Text_DEPENDENCIES TextureTools GL) set(_MAGNUM_TextureTools_DEPENDENCIES ) diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index e2d3b712a..c4ac15170 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -72,6 +72,10 @@ if(TARGET_GL) endif() if(WITH_SHAPES) + if(NOT MAGNUM_BUILD_DEPRECATED) + message(FATAL_ERROR "Shapes are scheduled for removal and not available if BUILD_DEPRECATED is disabled. See the docs for alternatives.") + endif() + list(APPEND MagnumDebugTools_SRCS ShapeRenderer.cpp diff --git a/src/Magnum/DebugTools/DebugTools.h b/src/Magnum/DebugTools/DebugTools.h index cbc2c0f26..45a1300c3 100644 --- a/src/Magnum/DebugTools/DebugTools.h +++ b/src/Magnum/DebugTools/DebugTools.h @@ -49,10 +49,14 @@ class ObjectRendererOptions; class ResourceManager; -template class ShapeRenderer; -typedef ShapeRenderer<2> ShapeRenderer2D; -typedef ShapeRenderer<3> ShapeRenderer3D; -class ShapeRendererOptions; +#ifdef MAGNUM_BUILD_DEPRECATED +CORRADE_IGNORE_DEPRECATED_PUSH +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeRenderer; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeRenderer<2> ShapeRenderer2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeRenderer<3> ShapeRenderer3D; +class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeRendererOptions; +CORRADE_IGNORE_DEPRECATED_POP +#endif #endif #endif diff --git a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp index cfcc5a77a..8590144f6 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "AbstractBoxRenderer.h" #include "Magnum/GL/Mesh.h" @@ -33,6 +35,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH AbstractBoxRenderer<2>::AbstractBoxRenderer(): AbstractShapeRenderer<2>("box2d", "box2d-vertices", {}) { if(!wireframeMesh) AbstractShapeRenderer<2>::createResources(Primitives::squareWireframe()); } @@ -40,5 +43,6 @@ AbstractBoxRenderer<2>::AbstractBoxRenderer(): AbstractShapeRenderer<2>("box2d", AbstractBoxRenderer<3>::AbstractBoxRenderer(): AbstractShapeRenderer<3>("box3d", "box3d-vertices", "box3d-indices") { if(!wireframeMesh) AbstractShapeRenderer<3>::createResources(Primitives::cubeWireframe()); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h index 66dfc35e3..817738cfd 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h +++ b/src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h @@ -32,6 +32,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class AbstractBoxRenderer; template<> class AbstractBoxRenderer<2>: public AbstractShapeRenderer<2> { @@ -43,6 +44,7 @@ template<> class AbstractBoxRenderer<3>: public AbstractShapeRenderer<3> { public: AbstractBoxRenderer(); }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp index 573036b6c..289961362 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "AbstractShapeRenderer.h" #include @@ -38,6 +40,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH namespace { template ResourceKey shaderKey(); @@ -130,5 +133,6 @@ template void AbstractShapeRenderer::createR template class AbstractShapeRenderer<2>; template class AbstractShapeRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h index 67a88b051..ce97476ce 100644 --- a/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h +++ b/src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h @@ -35,6 +35,7 @@ namespace Magnum { +CORRADE_IGNORE_DEPRECATED_PUSH namespace Shapes { namespace Implementation { template struct AbstractShape; }} @@ -64,6 +65,9 @@ template class AbstractShapeRenderer { Resource indexBuffer, vertexBuffer; }; -}}} +}} +CORRADE_IGNORE_DEPRECATED_POP + +} #endif diff --git a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp index db6a2f15d..d44a9fa1e 100644 --- a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "AxisAlignedBoxRenderer.h" #include "Magnum/GL/Mesh.h" @@ -32,6 +34,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template AxisAlignedBoxRenderer::AxisAlignedBoxRenderer(const Shapes::Implementation::AbstractShape& axisAlignedBox): axisAlignedBox(static_cast>&>(axisAlignedBox).shape) {} template void AxisAlignedBoxRenderer::draw(Resource& options, const MatrixTypeFor& projectionMatrix) { @@ -44,5 +47,6 @@ template void AxisAlignedBoxRenderer::draw(R template class AxisAlignedBoxRenderer<2>; template class AxisAlignedBoxRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h index 67ae1a0ea..846016556 100644 --- a/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h +++ b/src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class AxisAlignedBoxRenderer: public AbstractBoxRenderer { public: explicit AxisAlignedBoxRenderer(const Shapes::Implementation::AbstractShape& axisAlignedBox); @@ -41,6 +42,7 @@ template class AxisAlignedBoxRenderer: public AbstractBo private: const Shapes::AxisAlignedBox& axisAlignedBox; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp b/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp index bcb6a0f83..b652b0922 100644 --- a/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/BoxRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "BoxRenderer.h" #include "Magnum/GL/Mesh.h" @@ -32,6 +34,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template BoxRenderer::BoxRenderer(const Shapes::Implementation::AbstractShape& box): box(static_cast>&>(box).shape) {} template void BoxRenderer::draw(Resource& options, const MatrixTypeFor& projectionMatrix) { @@ -42,5 +45,6 @@ template void BoxRenderer::draw(Resource; template class BoxRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/BoxRenderer.h b/src/Magnum/DebugTools/Implementation/BoxRenderer.h index 1368c1b14..7e36258bf 100644 --- a/src/Magnum/DebugTools/Implementation/BoxRenderer.h +++ b/src/Magnum/DebugTools/Implementation/BoxRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class BoxRenderer: public AbstractBoxRenderer { public: explicit BoxRenderer(const Shapes::Implementation::AbstractShape& box); @@ -41,6 +42,7 @@ template class BoxRenderer: public AbstractBoxRenderer& box; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp index 9937df5d1..c9e07a1eb 100644 --- a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "CapsuleRenderer.h" #include "Magnum/DebugTools/ResourceManager.h" @@ -39,6 +41,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH AbstractCapsuleRenderer<2>::AbstractCapsuleRenderer(): AbstractShapeRenderer<2>("capsule2d", "capsule2d-vertices", "capsule2d-indices") { constexpr UnsignedInt rings = 10; if(!wireframeMesh) createResources(Primitives::capsule2DWireframe(rings, 1, 1.0f)); @@ -123,5 +126,6 @@ template void CapsuleRenderer::draw(Resource template class CapsuleRenderer<2>; template class CapsuleRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h index c0f8330b8..7f26df820 100644 --- a/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h +++ b/src/Magnum/DebugTools/Implementation/CapsuleRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class AbstractCapsuleRenderer; template<> class AbstractCapsuleRenderer<2>: public AbstractShapeRenderer<2> { @@ -61,6 +62,7 @@ template class CapsuleRenderer: public AbstractCapsuleRe private: const Shapes::Capsule& capsule; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h b/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h index 05974e03c..33cdb13cb 100644 --- a/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h @@ -35,6 +35,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template std::array, 3> capsuleRendererTransformation(const VectorTypeFor& a, const VectorTypeFor& b, Float radius); template<> std::array capsuleRendererTransformation<2>(const Vector2& a, const Vector2& b, const Float radius) { @@ -101,6 +102,7 @@ template<> std::array capsuleRendererTransformation<3>(const Vector3 Matrix4::translation(b-capDistance)*rotationScaling }}; } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp b/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp index 53f231270..19580fceb 100644 --- a/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "CylinderRenderer.h" #include "Magnum/DebugTools/ShapeRenderer.h" @@ -38,6 +40,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH AbstractCylinderRenderer<2>::AbstractCylinderRenderer(): AbstractShapeRenderer<2>("cylinder2d", "cylinder2d-vertices", {}) { if(!wireframeMesh) createResources(Primitives::squareWireframe()); } @@ -57,5 +60,6 @@ template void CylinderRenderer::draw(Resourc template class CylinderRenderer<2>; template class CylinderRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/CylinderRenderer.h b/src/Magnum/DebugTools/Implementation/CylinderRenderer.h index 5956f5c6a..5dcbc45d8 100644 --- a/src/Magnum/DebugTools/Implementation/CylinderRenderer.h +++ b/src/Magnum/DebugTools/Implementation/CylinderRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class AbstractCylinderRenderer; template<> class AbstractCylinderRenderer<2>: public AbstractShapeRenderer<2> { @@ -53,6 +54,7 @@ template class CylinderRenderer: public AbstractCylinder private: const Shapes::Cylinder& cylinder; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h b/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h index 66927295f..87805f048 100644 --- a/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h @@ -33,6 +33,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template MatrixTypeFor cylinderRendererTransformation(const VectorTypeFor& a, const VectorTypeFor& b, Float radius); template<> Matrix3 cylinderRendererTransformation<2>(const Vector2& a, const Vector2& b, const Float radius) { @@ -83,6 +84,7 @@ template<> Matrix4 cylinderRendererTransformation<3>(const Vector3& a, const Vec /* Scaling and translation */ return Matrix4::translation(0.5f*(a + b))*rotation*Matrix4::scaling({radius, length, radius}); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp index a42b9a453..fd4ab3006 100644 --- a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "LineSegmentRenderer.h" #include "Magnum/DebugTools/ShapeRenderer.h" @@ -37,6 +39,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH namespace { template ResourceKey meshKey(); template<> inline ResourceKey meshKey<2>() { return ResourceKey("line2d"); } @@ -64,5 +67,6 @@ template void LineSegmentRenderer::draw(Reso template class LineSegmentRenderer<2>; template class LineSegmentRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h index 0dbbd8582..c1e740b0b 100644 --- a/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h +++ b/src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class LineSegmentRenderer: public AbstractShapeRenderer { public: explicit LineSegmentRenderer(const Shapes::Implementation::AbstractShape& line); @@ -41,6 +42,7 @@ template class LineSegmentRenderer: public AbstractShape private: const Shapes::LineSegment& line; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h b/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h index ed3031b56..7e9a69ed7 100644 --- a/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h +++ b/src/Magnum/DebugTools/Implementation/LineSegmentRendererTransformation.h @@ -29,11 +29,13 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template MatrixTypeFor lineSegmentRendererTransformation(const VectorTypeFor& a, const VectorTypeFor& b) { auto transformation = MatrixTypeFor::translation(a); transformation.right() = b - a; return transformation; } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/PointRenderer.cpp b/src/Magnum/DebugTools/Implementation/PointRenderer.cpp index 76b20fb75..2aef36ecb 100644 --- a/src/Magnum/DebugTools/Implementation/PointRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/PointRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "PointRenderer.h" #include "Magnum/DebugTools/ShapeRenderer.h" @@ -35,6 +37,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH namespace { template ResourceKey meshKey(); template<> inline ResourceKey meshKey<2>() { return ResourceKey("point2d"); } @@ -64,5 +67,6 @@ template void PointRenderer::draw(Resource; template class PointRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/PointRenderer.h b/src/Magnum/DebugTools/Implementation/PointRenderer.h index 8ef0d32cb..2874172bc 100644 --- a/src/Magnum/DebugTools/Implementation/PointRenderer.h +++ b/src/Magnum/DebugTools/Implementation/PointRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class PointRenderer: public AbstractShapeRenderer { public: explicit PointRenderer(const Shapes::Implementation::AbstractShape& point); @@ -41,6 +42,7 @@ template class PointRenderer: public AbstractShapeRender private: const Shapes::Point& point; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp b/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp index ec4783094..6d78587cc 100644 --- a/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp +++ b/src/Magnum/DebugTools/Implementation/SphereRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "SphereRenderer.h" #include "Magnum/DebugTools/ShapeRenderer.h" @@ -36,6 +38,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH AbstractSphereRenderer<2>::AbstractSphereRenderer(): AbstractShapeRenderer<2>("sphere2d", "sphere2d-vertices", {}) { if(!wireframeMesh) createResources(Primitives::circle2DWireframe(40)); } @@ -56,5 +59,6 @@ template void SphereRenderer::draw(Resource< template class SphereRenderer<2>; template class SphereRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Implementation/SphereRenderer.h b/src/Magnum/DebugTools/Implementation/SphereRenderer.h index 5e8b52dfd..d5acf3e8c 100644 --- a/src/Magnum/DebugTools/Implementation/SphereRenderer.h +++ b/src/Magnum/DebugTools/Implementation/SphereRenderer.h @@ -31,6 +31,7 @@ namespace Magnum { namespace DebugTools { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template class AbstractSphereRenderer; template<> class AbstractSphereRenderer<2>: public AbstractShapeRenderer<2> { @@ -53,6 +54,7 @@ template class SphereRenderer: public AbstractSphereRend private: const Shapes::Sphere& sphere; }; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/ResourceManager.cpp b/src/Magnum/DebugTools/ResourceManager.cpp index 14decf032..407279d9a 100644 --- a/src/Magnum/DebugTools/ResourceManager.cpp +++ b/src/Magnum/DebugTools/ResourceManager.cpp @@ -23,21 +23,36 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "ResourceManager.h" #include "Magnum/ResourceManager.hpp" #include "Magnum/DebugTools/ForceRenderer.h" #include "Magnum/DebugTools/ObjectRenderer.h" -#include "Magnum/DebugTools/ShapeRenderer.h" #include "Magnum/GL/AbstractShaderProgram.h" #include "Magnum/GL/Buffer.h" #include "Magnum/GL/Mesh.h" #include "Magnum/GL/MeshView.h" +#ifdef MAGNUM_BUILD_DEPRECATED +#include "Magnum/DebugTools/ShapeRenderer.h" +#endif + namespace Magnum { namespace Implementation { - template struct MAGNUM_DEBUGTOOLS_EXPORT ResourceManagerLocalInstanceImplementation; + #ifdef MAGNUM_BUILD_DEPRECATED + CORRADE_IGNORE_DEPRECATED_PUSH + #endif + template struct MAGNUM_DEBUGTOOLS_EXPORT ResourceManagerLocalInstanceImplementation; + #ifdef MAGNUM_BUILD_DEPRECATED + CORRADE_IGNORE_DEPRECATED_POP + #endif } namespace DebugTools { @@ -45,7 +60,11 @@ namespace DebugTools { ResourceManager::ResourceManager() { setFallback(new ForceRendererOptions); setFallback(new ObjectRendererOptions); + #ifdef MAGNUM_BUILD_DEPRECATED + CORRADE_IGNORE_DEPRECATED_PUSH setFallback(new ShapeRendererOptions); + CORRADE_IGNORE_DEPRECATED_POP + #endif } ResourceManager::~ResourceManager() = default; diff --git a/src/Magnum/DebugTools/ResourceManager.h b/src/Magnum/DebugTools/ResourceManager.h index a4d5458a6..765511104 100644 --- a/src/Magnum/DebugTools/ResourceManager.h +++ b/src/Magnum/DebugTools/ResourceManager.h @@ -38,17 +38,27 @@ #include "Magnum/DebugTools/visibility.h" #include "Magnum/GL/GL.h" #include "Magnum/SceneGraph/SceneGraph.h" -#include "Magnum/Shapes/Shapes.h" /** @todo fix this better */ #ifdef CORRADE_MSVC2017_COMPATIBILITY #include "Magnum/DebugTools/ForceRenderer.h" #include "Magnum/DebugTools/ObjectRenderer.h" -#include "Magnum/DebugTools/ShapeRenderer.h" #include "Magnum/GL/AbstractShaderProgram.h" #include "Magnum/GL/Buffer.h" #include "Magnum/GL/Mesh.h" #include "Magnum/GL/MeshView.h" + +#ifdef MAGNUM_BUILD_DEPRECATED +#if !defined(Magnum_DebugTools_ShapeRenderer_h) && !defined(_MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES) +#define Magnum_DebugTools_ShapeRenderer_h_not_included +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES +#endif +#include "Magnum/DebugTools/ShapeRenderer.h" +#ifdef Magnum_DebugTools_ShapeRenderer_h_not_included +#undef Magnum_DebugTools_ShapeRenderer_h_not_included +#undef _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES +#endif +#endif #endif #ifdef MAGNUM_TARGET_GL @@ -64,11 +74,22 @@ information. @ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features for more information. */ -class MAGNUM_DEBUGTOOLS_EXPORT ResourceManager: public Magnum::ResourceManager { +#ifdef MAGNUM_BUILD_DEPRECATED +CORRADE_IGNORE_DEPRECATED_PUSH +#endif +class MAGNUM_DEBUGTOOLS_EXPORT ResourceManager: public Magnum::ResourceManager +{ public: explicit ResourceManager(); ~ResourceManager(); }; +#ifdef MAGNUM_BUILD_DEPRECATED +CORRADE_IGNORE_DEPRECATED_POP +#endif #else #error this header is available only in the OpenGL build #endif diff --git a/src/Magnum/DebugTools/ShapeRenderer.cpp b/src/Magnum/DebugTools/ShapeRenderer.cpp index 15b9892ba..433e1127f 100644 --- a/src/Magnum/DebugTools/ShapeRenderer.cpp +++ b/src/Magnum/DebugTools/ShapeRenderer.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "ShapeRenderer.h" #include "Magnum/DebugTools/ResourceManager.h" @@ -40,6 +42,7 @@ namespace Magnum { namespace DebugTools { +CORRADE_IGNORE_DEPRECATED_PUSH namespace Implementation { template<> void createDebugMesh(ShapeRenderer<2>& renderer, const Shapes::Implementation::AbstractShape<2>& shape) { @@ -129,5 +132,6 @@ template void ShapeRenderer::draw(const Matr template class ShapeRenderer<2>; template class ShapeRenderer<3>; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/DebugTools/ShapeRenderer.h b/src/Magnum/DebugTools/ShapeRenderer.h index 922a025ee..dc348ecf0 100644 --- a/src/Magnum/DebugTools/ShapeRenderer.h +++ b/src/Magnum/DebugTools/ShapeRenderer.h @@ -27,8 +27,16 @@ #ifdef MAGNUM_TARGET_GL /** @file - * @brief Class @ref Magnum::DebugTools::ShapeRenderer, @ref Magnum::DebugTools::ShapeRendererOptions, typedef @ref Magnum::DebugTools::ShapeRenderer2D, @ref Magnum::DebugTools::ShapeRenderer3D - */ +@brief Class @ref Magnum::DebugTools::ShapeRenderer, @ref Magnum::DebugTools::ShapeRendererOptions, typedef @ref Magnum::DebugTools::ShapeRenderer2D, @ref Magnum::DebugTools::ShapeRenderer3D + +@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. +*/ #endif #include "Magnum/Resource.h" @@ -36,11 +44,22 @@ #include "Magnum/SceneGraph/Drawable.h" #include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/shapeImplementation.h" +#include "Magnum/DebugTools/DebugTools.h" #include "Magnum/DebugTools/visibility.h" +#ifndef MAGNUM_BUILD_DEPRECATED +#error the Shapes library is scheduled for removal, see the docs for alternatives +#endif + +/* I still have a test for this class and it shouldn't pollute the log there */ +#ifndef _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES +CORRADE_DEPRECATED_FILE("the Shapes library is scheduled for removal, see the docs for alternatives") +#endif + #ifdef MAGNUM_TARGET_GL namespace Magnum { namespace DebugTools { +CORRADE_IGNORE_DEPRECATED_PUSH template class ShapeRenderer; namespace Implementation { @@ -52,13 +71,21 @@ namespace Implementation { /** @brief Shape renderer options +@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 ShapeRenderer documentation for more information. @note This class is available only if Magnum is compiled with @ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features for more information. */ -class ShapeRendererOptions { +class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeRendererOptions { public: /** * @brief Shape rendering mode @@ -124,6 +151,14 @@ class ShapeRendererOptions { /** @brief Shape renderer +@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. + Visualizes collision shapes using wireframe primitives. See @ref debug-tools-renderers for more information. @@ -149,7 +184,7 @@ new DebugTools::ShapeRenderer2D(shape, "red", debugDrawables); @todo Different drawing style for inverted shapes? (marking the "inside" somehow) */ -template class MAGNUM_DEBUGTOOLS_EXPORT ShapeRenderer: public SceneGraph::Drawable { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_DEBUGTOOLS_EXPORT ShapeRenderer: public SceneGraph::Drawable { #ifndef DOXYGEN_GENERATING_OUTPUT friend void Implementation::createDebugMesh<>(ShapeRenderer&, const Shapes::Implementation::AbstractShape&); #endif @@ -178,11 +213,32 @@ template class MAGNUM_DEBUGTOOLS_EXPORT ShapeRenderer: p std::vector*> _renderers; }; -/** @brief Two-dimensional shape renderer */ -typedef ShapeRenderer<2> ShapeRenderer2D; +/** +@brief Two-dimensional shape renderer + +@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") ShapeRenderer<2> ShapeRenderer2D; -/** @brief Three-dimensional shape renderer */ -typedef ShapeRenderer<3> ShapeRenderer3D; +/** +@brief Three-dimensional shape renderer + +@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") ShapeRenderer<3> ShapeRenderer3D; +CORRADE_IGNORE_DEPRECATED_POP }} #else diff --git a/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp b/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp index 0b11afecc..2d40ddb76 100644 --- a/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/CapsuleRendererTest.cpp @@ -51,6 +51,7 @@ CapsuleRendererTest::CapsuleRendererTest() { &CapsuleRendererTest::common3D}); } +CORRADE_IGNORE_DEPRECATED_PUSH void CapsuleRendererTest::zeroLength2D() { const Vector2 a(0.5f, 3.0f); std::array transformation = Implementation::capsuleRendererTransformation<2>(a, a, 3.5f); @@ -171,6 +172,7 @@ void CapsuleRendererTest::common3D() { CORRADE_COMPARE(transformation[1].translation(), 0.5f*(a + b)); CORRADE_COMPARE(transformation[2].translation(), b-capDistance); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp b/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp index 18dee7f69..00d6591ed 100644 --- a/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/CylinderRendererTest.cpp @@ -51,6 +51,7 @@ CylinderRendererTest::CylinderRendererTest() { &CylinderRendererTest::common3D}); } +CORRADE_IGNORE_DEPRECATED_PUSH void CylinderRendererTest::zeroLength2D() { const Vector2 a(0.5f, 3.0f); const Matrix3 transformation = Implementation::cylinderRendererTransformation<2>(a, a, 3.5f); @@ -119,6 +120,7 @@ void CylinderRendererTest::common3D() { CORRADE_COMPARE(transformation.translation(), 0.5f*(a + b)); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp b/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp index 13d91c44f..526be0ce9 100644 --- a/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp +++ b/src/Magnum/DebugTools/Test/LineSegmentRendererTest.cpp @@ -45,6 +45,7 @@ LineSegmentRendererTest::LineSegmentRendererTest() { &LineSegmentRendererTest::line3D}); } +CORRADE_IGNORE_DEPRECATED_PUSH void LineSegmentRendererTest::line2D() { const Vector2 a(-2.0f, 3.0f); const Vector2 b(3.4f, -1.5f); @@ -62,6 +63,7 @@ void LineSegmentRendererTest::line3D() { CORRADE_COMPARE(matrix.transformPoint({0.0f, 0.0f, 0.0f}), a); CORRADE_COMPARE(matrix.transformPoint({1.0f, 0.0f, 0.0f}), b); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/AbstractShape.cpp b/src/Magnum/Shapes/AbstractShape.cpp index 3c2a1b548..2ebcd9b26 100644 --- a/src/Magnum/Shapes/AbstractShape.cpp +++ b/src/Magnum/Shapes/AbstractShape.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "AbstractShape.h" #include @@ -33,6 +35,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template AbstractShape::AbstractShape(SceneGraph::AbstractObject& object, ShapeGroup* group): SceneGraph::AbstractGroupedFeature, Float>(object, group) { SceneGraph::AbstractFeature::setCachedTransformations(SceneGraph::CachedTransformation::Absolute); } @@ -65,5 +68,6 @@ template void AbstractShape::markDirty() { template class MAGNUM_SHAPES_EXPORT AbstractShape<2>; template class MAGNUM_SHAPES_EXPORT AbstractShape<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/AbstractShape.h b/src/Magnum/Shapes/AbstractShape.h index 00c9d7c67..cad85519b 100644 --- a/src/Magnum/Shapes/AbstractShape.h +++ b/src/Magnum/Shapes/AbstractShape.h @@ -26,17 +26,29 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::AbstractShape, typedef @ref Magnum::Shapes::AbstractShape2D, @ref Magnum::Shapes::AbstractShape3D - */ +@brief Class @ref Magnum::Shapes::AbstractShape, typedef @ref Magnum::Shapes::AbstractShape2D, @ref Magnum::Shapes::AbstractShape3D + +@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/Magnum.h" #include "Magnum/DimensionTraits.h" #include "Magnum/SceneGraph/AbstractGroupedFeature.h" #include "Magnum/Shapes/shapeImplementation.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 namespace Implementation { template inline const AbstractShape& getAbstractShape(const Shapes::AbstractShape& shape) { return shape.abstractTransformedShape(); @@ -46,11 +58,19 @@ namespace Implementation { /** @brief Base class for object shapes +@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. + This class is not directly instantiable, use @ref Shape instead. See @ref shapes for brief introduction. @see @ref AbstractShape2D, @ref AbstractShape3D */ -template class MAGNUM_SHAPES_EXPORT AbstractShape: public SceneGraph::AbstractGroupedFeature, Float> { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT AbstractShape: public SceneGraph::AbstractGroupedFeature, Float> { #ifndef CORRADE_MSVC2017_COMPATIBILITY friend const Implementation::AbstractShape& Implementation::getAbstractShape<>(const AbstractShape&); #else @@ -120,11 +140,32 @@ template class MAGNUM_SHAPES_EXPORT AbstractShape: publi virtual const Implementation::AbstractShape MAGNUM_SHAPES_LOCAL & abstractTransformedShape() const = 0; }; -/** @brief Base class for two-dimensional object shapes */ -typedef AbstractShape<2> AbstractShape2D; +/** +@brief Base class for two-dimensional object shapes + +@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") AbstractShape<2> AbstractShape2D; -/** @brief Base class for three-dimensional object shapes */ -typedef AbstractShape<3> AbstractShape3D; +/** +@brief Base class for three-dimensional object shapes + +@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") AbstractShape<3> AbstractShape3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/AxisAlignedBox.cpp b/src/Magnum/Shapes/AxisAlignedBox.cpp index a0574a83d..1ba5953ae 100644 --- a/src/Magnum/Shapes/AxisAlignedBox.cpp +++ b/src/Magnum/Shapes/AxisAlignedBox.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "AxisAlignedBox.h" #include "Magnum/Math/Matrix3.h" @@ -31,6 +33,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template AxisAlignedBox AxisAlignedBox::transformed(const MatrixTypeFor& matrix) const { return AxisAlignedBox(matrix.transformPoint(_min), matrix.transformPoint(_max)); @@ -45,5 +48,6 @@ template bool AxisAlignedBox::operator%(cons template class MAGNUM_SHAPES_EXPORT AxisAlignedBox<2>; template class MAGNUM_SHAPES_EXPORT AxisAlignedBox<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/AxisAlignedBox.h b/src/Magnum/Shapes/AxisAlignedBox.h index 5b846b01d..7b479a9c2 100644 --- a/src/Magnum/Shapes/AxisAlignedBox.h +++ b/src/Magnum/Shapes/AxisAlignedBox.h @@ -26,24 +26,43 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::AxisAlignedBox, typedef @ref Magnum::Shapes::AxisAlignedBox2D, @ref Magnum::Shapes.:AxisAlignedBox3D - */ +@brief Class @ref Magnum::Shapes::AxisAlignedBox, typedef @ref Magnum::Shapes::AxisAlignedBox2D, @ref Magnum::Shapes.:AxisAlignedBox3D + +@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 Axis-aligned box +@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 AxisAlignedBox2D, @ref AxisAlignedBox3D @todo Assert for rotation */ -template class MAGNUM_SHAPES_EXPORT AxisAlignedBox { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT AxisAlignedBox { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -89,14 +108,45 @@ template class MAGNUM_SHAPES_EXPORT AxisAlignedBox { VectorTypeFor _min, _max; }; -/** @brief Two-dimensional axis-aligned box */ -typedef AxisAlignedBox<2> AxisAlignedBox2D; +/** +@brief Two-dimensional axis-aligned box + +@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") AxisAlignedBox<2> AxisAlignedBox2D; -/** @brief Three-dimensional axis-aligned box */ -typedef AxisAlignedBox<3> AxisAlignedBox3D; +/** +@brief Three-dimensional axis-aligned box + +@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") AxisAlignedBox<3> AxisAlignedBox3D; -/** @collisionoccurenceoperator{Point,AxisAlignedBox} */ -template inline bool operator%(const Point& a, const AxisAlignedBox& b) { return b % a; } +/** +@collisionoccurenceoperator{Point,AxisAlignedBox} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Point& a, const AxisAlignedBox& b) { return b % a; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Box.cpp b/src/Magnum/Shapes/Box.cpp index f26df921b..a69a00364 100644 --- a/src/Magnum/Shapes/Box.cpp +++ b/src/Magnum/Shapes/Box.cpp @@ -23,10 +23,13 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Box.h" namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template Box Box::transformed(const MatrixTypeFor& matrix) const { return Box(matrix*_transformation); } @@ -35,5 +38,6 @@ template Box Box::transformed(co template class MAGNUM_SHAPES_EXPORT Box<2>; template class MAGNUM_SHAPES_EXPORT Box<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Box.h b/src/Magnum/Shapes/Box.h index e63b6d938..24d088b07 100644 --- a/src/Magnum/Shapes/Box.h +++ b/src/Magnum/Shapes/Box.h @@ -26,26 +26,46 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Box, typedef @ref Magnum::Shapes::Box2D, @ref Magnum::Shapes::Box3D - */ +@brief Class @ref Magnum::Shapes::Box, typedef @ref Magnum::Shapes::Box2D, @ref Magnum::Shapes::Box3D + +@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/Matrix3.h" #include "Magnum/Math/Matrix4.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 Unit-size box with assigned transformation matrix +@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. + Unit-size means that half extents are equal to 1, equivalent to e.g. sphere radius. See @ref shapes for brief introduction. @see @ref Box2D, @ref Box3D @todo Use quat + position + size instead? @todo Assert for skew */ -template class MAGNUM_SHAPES_EXPORT Box { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Box { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -78,11 +98,32 @@ template class MAGNUM_SHAPES_EXPORT Box { MatrixTypeFor _transformation; }; -/** @brief Two-dimensional box */ -typedef Box<2> Box2D; +/** +@brief Two-dimensional box + +@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") Box<2> Box2D; -/** @brief Three-dimensional box */ -typedef Box<3> Box3D; +/** +@brief Three-dimensional box + +@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") Box<3> Box3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/CMakeLists.txt b/src/Magnum/Shapes/CMakeLists.txt index 2d3217675..1d3b51753 100644 --- a/src/Magnum/Shapes/CMakeLists.txt +++ b/src/Magnum/Shapes/CMakeLists.txt @@ -23,6 +23,10 @@ # DEALINGS IN THE SOFTWARE. # +if(NOT MAGNUM_BUILD_DEPRECATED) + message(FATAL_ERROR "Shapes are scheduled for removal and not available if BUILD_DEPRECATED is disabled. See the docs for alternatives.") +endif() + set(MagnumShapes_SRCS AbstractShape.cpp AxisAlignedBox.cpp diff --git a/src/Magnum/Shapes/Capsule.cpp b/src/Magnum/Shapes/Capsule.cpp index 1bd576ffb..2fe18c853 100644 --- a/src/Magnum/Shapes/Capsule.cpp +++ b/src/Magnum/Shapes/Capsule.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Capsule.h" #include "Magnum/Magnum.h" @@ -35,6 +37,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template Capsule Capsule::transformed(const MatrixTypeFor& matrix) const { return Capsule(matrix.transformPoint(_a), matrix.transformPoint(_b), matrix.uniformScaling()*_radius); } @@ -53,5 +56,6 @@ template bool Capsule::operator%(const Spher template class MAGNUM_SHAPES_EXPORT Capsule<2>; template class MAGNUM_SHAPES_EXPORT Capsule<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Capsule.h b/src/Magnum/Shapes/Capsule.h index 2e4238a2f..157f8fae6 100644 --- a/src/Magnum/Shapes/Capsule.h +++ b/src/Magnum/Shapes/Capsule.h @@ -26,26 +26,45 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Capsule, typedef @ref Magnum::Shapes::Capsule2D, @ref Magnum::Shapes::Capsule3D - */ +@brief Class @ref Magnum::Shapes::Capsule, typedef @ref Magnum::Shapes::Capsule2D, @ref Magnum::Shapes::Capsule3D + +@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 Capsule defined by cylinder start and end point and radius +@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. + Unlike other elements the capsule expects uniform scaling. See @ref shapes for brief introduction. @see @ref Capsule2D, @ref Capsule3D, @ref Cylinder @todo Store the radius as squared value to avoid sqrt/pow? Will complicate collision detection with sphere. */ -template class MAGNUM_SHAPES_EXPORT Capsule { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Capsule { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -101,17 +120,58 @@ template class MAGNUM_SHAPES_EXPORT Capsule { Float _radius; }; -/** @brief Two-dimensional capsule */ -typedef Capsule<2> Capsule2D; +/** +@brief Two-dimensional capsule + +@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") Capsule<2> Capsule2D; -/** @brief Three-dimensional capsule */ -typedef Capsule<3> Capsule3D; +/** +@brief Three-dimensional capsule + +@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") Capsule<3> Capsule3D; -/** @collisionoccurenceoperator{Point,Capsule} */ -template inline bool operator%(const Point& a, const Capsule& b) { return b % a; } +/** +@collisionoccurenceoperator{Point,Capsule} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Point& a, const Capsule& b) { return b % a; } -/** @collisionoccurenceoperator{Sphere,Capsule} */ -template inline bool operator%(const Sphere& a, const Capsule& b) { return b % a; } +/** +@collisionoccurenceoperator{Sphere,Capsule} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Sphere& a, const Capsule& b) { return b % a; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Collision.h b/src/Magnum/Shapes/Collision.h index 75e99f034..2ecf6968f 100644 --- a/src/Magnum/Shapes/Collision.h +++ b/src/Magnum/Shapes/Collision.h @@ -26,18 +26,38 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Collision, typedef @ref Magnum::Shapes::Collision2D, @ref Magnum::Shapes::Collision3D - */ +@brief Class @ref Magnum::Shapes::Collision, typedef @ref Magnum::Shapes::Collision2D, @ref Magnum::Shapes::Collision3D + +@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/Vector2.h" #include "Magnum/Math/Vector3.h" +#include "Magnum/Shapes/Shapes.h" + +/* File-level deprecation warning issued from Shapes.h */ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH /** @brief Collision data +@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. + Contains information about collision between objects A and B, described by contact position, separation normal and separation distance. @@ -51,7 +71,7 @@ If the collision not occured, contact position and separation normal is undefined (i.e., *not* normalized) and separation distance is negative or zero. @see @ref Collision2D, @ref Collision3D */ -template class Collision { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision { public: /** * @brief Default constructor @@ -121,11 +141,32 @@ template class Collision { Float _separationDistance; }; -/** @brief Two-dimensional collision data */ -typedef Collision<2> Collision2D; +/** +@brief Two-dimensional collision data + +@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") Collision<2> Collision2D; -/** @brief Three-dimensional collision data */ -typedef Collision<3> Collision3D; +/** +@brief Three-dimensional collision data + +@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") Collision<3> Collision3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Composition.cpp b/src/Magnum/Shapes/Composition.cpp index ba2203966..93e95008e 100644 --- a/src/Magnum/Shapes/Composition.cpp +++ b/src/Magnum/Shapes/Composition.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Composition.h" #include @@ -32,6 +34,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH /* Hierarchy implementation notes: @@ -152,5 +155,6 @@ template bool Composition::collides(const Im template class MAGNUM_SHAPES_EXPORT Composition<2>; template class MAGNUM_SHAPES_EXPORT Composition<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Composition.h b/src/Magnum/Shapes/Composition.h index c0fb87303..5714bd110 100644 --- a/src/Magnum/Shapes/Composition.h +++ b/src/Magnum/Shapes/Composition.h @@ -26,8 +26,16 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Composition, typedef @ref Magnum::Shapes::Composition2D, @ref Magnum::Shapes::Composition3D, enum @ref Magnum::Shapes::CompositionOperation - */ +@brief Class @ref Magnum::Shapes::Composition, typedef @ref Magnum::Shapes::Composition2D, @ref Magnum::Shapes::Composition3D, enum @ref Magnum::Shapes::CompositionOperation + +@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 #include @@ -39,8 +47,11 @@ #include "Magnum/Shapes/shapeImplementation.h" #include "Magnum/Shapes/visibility.h" +/* File-level deprecation warning issued from Shapes.h */ + namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH namespace Implementation { template struct ShapeHelper; @@ -52,8 +63,18 @@ namespace Implementation { } } -/** @brief Shape operation */ -enum class CompositionOperation: UnsignedByte { +/** +@brief Shape operation + +@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. +*/ +enum class CORRADE_DEPRECATED_ENUM("scheduled for removal, see the docs for alternatives") CompositionOperation: UnsignedByte { Not, /**< Boolean NOT */ And, /**< Boolean AND */ Or /**< Boolean OR */ @@ -62,9 +83,17 @@ enum class CompositionOperation: UnsignedByte { /** @brief Composition of shapes +@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. + Result of logical operations on shapes. See @ref shapes for brief introduction. */ -template class MAGNUM_SHAPES_EXPORT Composition { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Composition { friend Implementation::AbstractShape& Implementation::getAbstractShape<>(Composition&, std::size_t); friend const Implementation::AbstractShape& Implementation::getAbstractShape<>(const Composition&, std::size_t); friend Implementation::ShapeHelper>; @@ -187,24 +216,66 @@ template class MAGNUM_SHAPES_EXPORT Composition { Containers::Array _nodes; }; -/** @brief Two-dimensional shape composition */ -typedef Composition<2> Composition2D; +/** +@brief Two-dimensional shape composition + +@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. +*/ +CORRADE_IGNORE_DEPRECATED_PUSH /* Otherwise GCC warns on the typedef :/ */ +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition<2> Composition2D; +CORRADE_IGNORE_DEPRECATED_POP -/** @brief Three-dimensional shape composition */ -typedef Composition<3> Composition3D; +/** +@brief Three-dimensional shape composition + +@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. +*/ +CORRADE_IGNORE_DEPRECATED_PUSH /* Otherwise GCC warns on the typedef :/ */ +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition<3> Composition3D; +CORRADE_IGNORE_DEPRECATED_POP #ifdef DOXYGEN_GENERATING_OUTPUT -/** @debugoperatorclassenum{Composition,Composition::Type} */ +/** +@debugoperatorclassenum{Composition,Composition::Type} + +@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. +*/ template Debug& operator<<(Debug& debug, typename Composition::Type value); #endif /** @relates Composition @brief Collision occurence of shape with Composition + +@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. */ #ifdef DOXYGEN_GENERATING_OUTPUT template inline bool operator%(const T& a, const Composition& b) { #else -template inline auto operator%(const T& a, const Composition& b) -> typename std::enable_if::type()), typename Implementation::ShapeDimensionTraits::Type>::value, bool>::type { +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") auto operator%(const T& a, const Composition& b) -> typename std::enable_if::type()), typename Implementation::ShapeDimensionTraits::Type>::value, bool>::type { #endif return b % a; } @@ -212,27 +283,51 @@ template inline auto operator%(const T& a, cons #ifdef DOXYGEN_GENERATING_OUTPUT /** @relates Composition @brief Logical NOT of shape + +@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. */ -template inline Composition operator!(T a); +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition operator!(T a); /** @relates Composition @brief Logical AND of two shapes +@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. + [Short-circuit evaluation](http://en.wikipedia.org/wiki/Short-circuit_evaluation) is used here, so this operation can be used for providing simplified shape version, because collision with @p b is computed only if @p a collides. See @ref shapes-simplification for an example. */ -template inline Composition operator&&(T a, T b); +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition operator&&(T a, T b); /** @relates Composition @brief Logical OR of two shapes +@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. + [Short-circuit evaluation](http://en.wikipedia.org/wiki/Short-circuit_evaluation) is used, so if collision with @p a is detected, collision with @p b is not computed. */ -template inline Composition operator||(T a, T b); +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition operator||(T a, T b); #endif #ifndef DOXYGEN_GENERATING_OUTPUT @@ -243,13 +338,13 @@ template inline Composition operator||(T a, T b); std::is_same::type()), typename Implementation::ShapeDimensionTraits::Type>::value && \ std::is_same::type()), typename Implementation::ShapeDimensionTraits::Type>::value, \ Composition>::type -template inline auto operator!(T&& a) -> enableIfIsShapeType { +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") auto operator!(T&& a) -> enableIfIsShapeType { return Composition(CompositionOperation::Not, std::forward(a)); } -template inline auto operator&&(T&& a, U&& b) -> enableIfAreShapeType { +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") auto operator&&(T&& a, U&& b) -> enableIfAreShapeType { return Composition(CompositionOperation::And, std::forward(a), std::forward(b)); } -template inline auto operator||(T&& a, U&& b) -> enableIfAreShapeType { +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") auto operator||(T&& a, U&& b) -> enableIfAreShapeType { return Composition(CompositionOperation::Or, std::forward(a), std::forward(b)); } #undef enableIfIsShapeType @@ -293,6 +388,7 @@ template template inline const T& Compositiontype(), *static_cast(nullptr)); return static_cast*>(_shapes[i])->shape; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Cylinder.cpp b/src/Magnum/Shapes/Cylinder.cpp index 01a6db035..da6365e53 100644 --- a/src/Magnum/Shapes/Cylinder.cpp +++ b/src/Magnum/Shapes/Cylinder.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Cylinder.h" #include "Magnum/Magnum.h" @@ -35,6 +37,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template Cylinder Cylinder::transformed(const MatrixTypeFor& matrix) const { return Cylinder(matrix.transformPoint(_a), matrix.transformPoint(_b), matrix.uniformScaling()*_radius); } @@ -53,5 +56,6 @@ template bool Cylinder::operator%(const Sphe template class MAGNUM_SHAPES_EXPORT Cylinder<2>; template class MAGNUM_SHAPES_EXPORT Cylinder<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Cylinder.h b/src/Magnum/Shapes/Cylinder.h index 086ecf6d0..5c1036391 100644 --- a/src/Magnum/Shapes/Cylinder.h +++ b/src/Magnum/Shapes/Cylinder.h @@ -26,26 +26,45 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Cylinder, typedef @ref Magnum::Shapes::Cylinder2D, @ref Magnum::Shapes::Cylinder3D - */ +@brief Class @ref Magnum::Shapes::Cylinder, typedef @ref Magnum::Shapes::Cylinder2D, @ref Magnum::Shapes::Cylinder3D + +@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 cylinder defined by line and radius +@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. + Unlike other elements the cylinder expects uniform scaling. See @ref shapes for brief introduction. @see @ref Cylinder2D, @ref Cylinder3D, @ref Capsule @todo Store the radius as squared value to avoid sqrt/pow? Will complicate collision detection with sphere. */ -template class MAGNUM_SHAPES_EXPORT Cylinder { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Cylinder { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -101,17 +120,58 @@ template class MAGNUM_SHAPES_EXPORT Cylinder { Float _radius; }; -/** @brief Infinite two-dimensional cylinder */ -typedef Cylinder<2> Cylinder2D; +/** +@brief Infinite two-dimensional cylinder + +@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") Cylinder<2> Cylinder2D; -/** @brief Infinite three-dimensional cylinder */ -typedef Cylinder<3> Cylinder3D; +/** +@brief Infinite three-dimensional cylinder + +@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") Cylinder<3> Cylinder3D; -/** @collisionoccurenceoperator{Point,Cylinder} */ -template inline bool operator%(const Point& a, const Cylinder& b) { return b % a; } +/** +@collisionoccurenceoperator{Point,Cylinder} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Point& a, const Cylinder& b) { return b % a; } -/** @collisionoccurenceoperator{Sphere,Cylinder} */ -template inline bool operator%(const Sphere& a, const Cylinder& b) { return b % a; } +/** +@collisionoccurenceoperator{Sphere,Cylinder} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Sphere& a, const Cylinder& b) { return b % a; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp b/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp index d5f98f2e2..dfcaedfcd 100644 --- a/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp +++ b/src/Magnum/Shapes/Implementation/CollisionDispatch.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "CollisionDispatch.h" #include "Magnum/Shapes/AxisAlignedBox.h" @@ -37,6 +39,7 @@ namespace Magnum { namespace Shapes { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template<> bool collides(const AbstractShape<2>& a, const AbstractShape<2>& b) { if(a.type() < b.type()) return collides(b, a); @@ -125,5 +128,6 @@ template<> Collision<3> collision(const AbstractShape<3>& a, const AbstractShape return {}; } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Implementation/CollisionDispatch.h b/src/Magnum/Shapes/Implementation/CollisionDispatch.h index 87ee40f28..e3c866603 100644 --- a/src/Magnum/Shapes/Implementation/CollisionDispatch.h +++ b/src/Magnum/Shapes/Implementation/CollisionDispatch.h @@ -30,6 +30,7 @@ namespace Magnum { namespace Shapes { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template struct AbstractShape; /* @@ -45,6 +46,7 @@ each combination). template bool collides(const AbstractShape& a, const AbstractShape& b); template Collision collision(const AbstractShape& a, const AbstractShape& b); +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Line.cpp b/src/Magnum/Shapes/Line.cpp index 7c1b3db97..3b03ec48b 100644 --- a/src/Magnum/Shapes/Line.cpp +++ b/src/Magnum/Shapes/Line.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Line.h" #include "Magnum/Math/Matrix3.h" @@ -30,6 +32,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template Line Line::transformed(const MatrixTypeFor& matrix) const { return Line(matrix.transformPoint(_a), matrix.transformPoint(_b)); @@ -40,5 +43,6 @@ template Line Line::transformed( template class MAGNUM_SHAPES_EXPORT Line<2>; template class MAGNUM_SHAPES_EXPORT Line<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Line.h b/src/Magnum/Shapes/Line.h index 3b4e32070..15159ae17 100644 --- a/src/Magnum/Shapes/Line.h +++ b/src/Magnum/Shapes/Line.h @@ -26,23 +26,43 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Line, typedef @ref Magnum::Shapes::Line2D, @ref Magnum::Shapes::Line3D - */ +@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 MAGNUM_SHAPES_EXPORT Line { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Line { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -85,11 +105,33 @@ template class MAGNUM_SHAPES_EXPORT Line { VectorTypeFor _a, _b; }; -/** @brief Infinite two-dimensional line */ -typedef Line<2> Line2D; +/** +@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. +*/ -/** @brief Infinite three-dimensional line */ -typedef Line<3> Line3D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Line<3> Line3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/LineSegment.h b/src/Magnum/Shapes/LineSegment.h index 8cb5b03a5..50f6a82c6 100644 --- a/src/Magnum/Shapes/LineSegment.h +++ b/src/Magnum/Shapes/LineSegment.h @@ -26,20 +26,39 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::LineSegment, typedef @ref Magnum::Shapes::LineSegment2D, @ref Magnum::Shapes::LineSegment3D - */ +@brief Class @ref Magnum::Shapes::LineSegment, typedef @ref Magnum::Shapes::LineSegment2D, @ref Magnum::Shapes::LineSegment3D + +@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/Shapes/Line.h" +/* File-level deprecation warning issued from Shapes.h */ + namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH /** @brief Line segment, defined by starting and ending point +@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 LineSegment2D, @ref LineSegment3D */ -template class LineSegment: public Line { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") LineSegment: public Line { public: /** * @brief Default constructor @@ -60,11 +79,32 @@ template class LineSegment: public Line { constexpr LineSegment(const Line& line): Line(line) {} }; -/** @brief Two-dimensional line segment */ -typedef LineSegment<2> LineSegment2D; +/** +@brief Two-dimensional line segment + +@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") LineSegment<2> LineSegment2D; -/** @brief Three-dimensional line segment */ -typedef LineSegment<3> LineSegment3D; +/** +@brief Three-dimensional line segment + +@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") LineSegment<3> LineSegment3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Plane.cpp b/src/Magnum/Shapes/Plane.cpp index 1916b8d60..04ea98a2c 100644 --- a/src/Magnum/Shapes/Plane.cpp +++ b/src/Magnum/Shapes/Plane.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Plane.h" #include "Magnum/Math/Intersection.h" @@ -31,6 +33,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH Plane Plane::transformed(const Matrix4& matrix) const { /* Using matrix.rotation() would result in two more normalizations (slow), using .normalized() instead of matrix.uniformScaling() would not check @@ -48,5 +51,6 @@ bool Plane::operator%(const LineSegment3D& other) const { Float t = Math::Intersection::planeLine(Math::planeEquation(_normal, _position), other.a(), other.b()-other.a()); return t > 0.0f && t < 1.0f; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Plane.h b/src/Magnum/Shapes/Plane.h index 3cd3b60b5..30e7638d9 100644 --- a/src/Magnum/Shapes/Plane.h +++ b/src/Magnum/Shapes/Plane.h @@ -26,23 +26,42 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Plane - */ +@brief Class @ref Magnum::Shapes::Plane + +@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/Magnum.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 plane, defined by position and normal (3D only) +@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. + Unlike other elements the plane expects uniform scaling. See @ref shapes for brief introduction. */ -class MAGNUM_SHAPES_EXPORT Plane { +class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Plane { public: enum: UnsignedInt { Dimensions = 3 /**< Dimension count */ @@ -90,17 +109,33 @@ class MAGNUM_SHAPES_EXPORT Plane { /** @relatesalso Line @brief Collision occurence of @ref Line and @ref Plane +@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 Plane::operator%(const Line3D&) const */ -inline bool operator%(const Line3D& a, const Plane& b) { return b % a; } +inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Line3D& a, const Plane& b) { return b % a; } /** @relatesalso LineSegment @brief Collision occurence of @ref LineSegment and @ref Plane +@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 Plane::operator%(const LineSegment3D&) const */ -inline bool operator%(const LineSegment3D& a, const Plane& b) { return b % a; } - +inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const LineSegment3D& a, const Plane& b) { return b % a; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Point.cpp b/src/Magnum/Shapes/Point.cpp index ca085427e..eb5bbf90d 100644 --- a/src/Magnum/Shapes/Point.cpp +++ b/src/Magnum/Shapes/Point.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Point.h" #include "Magnum/Math/Matrix3.h" @@ -30,6 +32,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template Point Point::transformed(const MatrixTypeFor& matrix) const { return Point(matrix.transformPoint(_position)); } @@ -38,5 +41,6 @@ template Point Point::transforme template class MAGNUM_SHAPES_EXPORT Point<2>; template class MAGNUM_SHAPES_EXPORT Point<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Point.h b/src/Magnum/Shapes/Point.h index 7d1db9a92..1e47a4ff8 100644 --- a/src/Magnum/Shapes/Point.h +++ b/src/Magnum/Shapes/Point.h @@ -26,22 +26,42 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Point, typedef @ref Magnum::Shapes::Point2D, @ref Magnum::Shapes::Point3D - */ +@brief Class @ref Magnum::Shapes::Point, typedef @ref Magnum::Shapes::Point2D, @ref Magnum::Shapes::Point3D + +@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 Point +@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 Point2D, @ref Point3D */ -template class MAGNUM_SHAPES_EXPORT Point { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Point { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -74,11 +94,32 @@ template class MAGNUM_SHAPES_EXPORT Point { VectorTypeFor _position; }; -/** @brief Two-dimensional point */ -typedef Point<2> Point2D; +/** +@brief Two-dimensional point + +@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") Point<2> Point2D; -/** @brief Three-dimensional point */ -typedef Point<3> Point3D; +/** +@brief Three-dimensional point + +@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") Point<3> Point3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Shape.cpp b/src/Magnum/Shapes/Shape.cpp index 24c5ceb4a..7c6e2254d 100644 --- a/src/Magnum/Shapes/Shape.cpp +++ b/src/Magnum/Shapes/Shape.cpp @@ -23,12 +23,15 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Shape.h" #include "Magnum/Shapes/Composition.h" namespace Magnum { namespace Shapes { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH template void ShapeHelper>::set(Shapes::Shape>& shape, const Composition& composition) { shape._transformedShape.shape = shape._shape.shape = composition; } @@ -45,5 +48,6 @@ template void ShapeHelper>::tran template struct MAGNUM_SHAPES_EXPORT ShapeHelper>; template struct MAGNUM_SHAPES_EXPORT ShapeHelper>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Shape.h b/src/Magnum/Shapes/Shape.h index 50408518b..092b494b4 100644 --- a/src/Magnum/Shapes/Shape.h +++ b/src/Magnum/Shapes/Shape.h @@ -26,15 +26,26 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Shape - */ +@brief Class @ref Magnum::Shapes::Shape + +@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/Shapes/AbstractShape.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 namespace Implementation { template struct ShapeHelper; } @@ -42,6 +53,14 @@ namespace Implementation { /** @brief Object shape +@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. + Adds shape for collision detection to object. Each Shape is part of some @ref ShapeGroup, which essentially maintains a set of objects which can collide with each other. See @ref shapes for brief introduction. @@ -67,7 +86,7 @@ Shapes::AbstractShape3D* firstCollision = shapes.firstCollision(shape); @see @ref scenegraph, @ref ShapeGroup2D, @ref ShapeGroup3D, @ref DebugTools::ShapeRenderer */ -template class Shape: public AbstractShape { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Shape: public AbstractShape { friend Implementation::ShapeHelper; public: @@ -152,6 +171,7 @@ namespace Implementation { static void transform(Shapes::Shape>& shape, const MatrixTypeFor& absoluteTransformationMatrix); }; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/ShapeGroup.cpp b/src/Magnum/Shapes/ShapeGroup.cpp index d2a223cbb..d6642c331 100644 --- a/src/Magnum/Shapes/ShapeGroup.cpp +++ b/src/Magnum/Shapes/ShapeGroup.cpp @@ -23,12 +23,15 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "ShapeGroup.h" #include "Magnum/Shapes/AbstractShape.h" namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template void ShapeGroup::setClean() { /* Clean all objects */ if(!this->isEmpty()) { @@ -56,5 +59,6 @@ template AbstractShape* ShapeGroup; template class MAGNUM_SHAPES_EXPORT ShapeGroup<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/ShapeGroup.h b/src/Magnum/Shapes/ShapeGroup.h index 5609add53..2ca45975a 100644 --- a/src/Magnum/Shapes/ShapeGroup.h +++ b/src/Magnum/Shapes/ShapeGroup.h @@ -26,8 +26,16 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::ShapeGroup, typedef @ref Magnum::Shapes::ShapeGroup2D, @ref Magnum::Shapes::ShapeGroup3D - */ +@brief Class @ref Magnum::Shapes::ShapeGroup, typedef @ref Magnum::Shapes::ShapeGroup2D, @ref Magnum::Shapes::ShapeGroup3D + +@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 @@ -35,15 +43,26 @@ #include "Magnum/Shapes/AbstractShape.h" #include "Magnum/Shapes/visibility.h" +/* File-level deprecation warning issued from Shapes.h */ + namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH /** @brief Group of shapes +@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 Shape for more information. See @ref shapes for brief introduction. @see @ref scenegraph, @ref ShapeGroup2D, @ref ShapeGroup3D */ -template class MAGNUM_SHAPES_EXPORT ShapeGroup: public SceneGraph::FeatureGroup, Float> { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT ShapeGroup: public SceneGraph::FeatureGroup, Float> { friend AbstractShape; public: @@ -94,18 +113,35 @@ template class MAGNUM_SHAPES_EXPORT ShapeGroup: public S /** @brief Group of two-dimensional shapes +@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 Shape for more information. @see @ref ShapeGroup3D */ -typedef ShapeGroup<2> ShapeGroup2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeGroup<2> ShapeGroup2D; /** @brief Group of three-dimensional shapes +@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 Shape for more information. @see @ref ShapeGroup2D */ -typedef ShapeGroup<3> ShapeGroup3D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeGroup<3> ShapeGroup3D; +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Shapes.h b/src/Magnum/Shapes/Shapes.h index 81f1adf1b..93568a95a 100644 --- a/src/Magnum/Shapes/Shapes.h +++ b/src/Magnum/Shapes/Shapes.h @@ -26,70 +26,91 @@ */ /** @file - * @brief Forward declarations for the @ref Magnum::Shapes namespace - */ +@brief Forward declarations for the @ref Magnum::Shapes namespace + +@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 #include "Magnum/Types.h" -namespace Magnum { namespace Shapes { +#ifndef MAGNUM_BUILD_DEPRECATED +#error the Shapes library is scheduled for removal, see the docs for alternatives +#endif + +/* I still have a test for this class and it shouldn't pollute the log there */ +#ifndef _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES +CORRADE_DEPRECATED_FILE("the Shapes library is scheduled for removal, see the docs for alternatives") +#endif + +namespace Magnum { namespace CORRADE_DEPRECATED_NAMESPACE("scheduled for removal, see the docs for alternatives") Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH #ifndef DOXYGEN_GENERATING_OUTPUT -template class AbstractShape; -typedef AbstractShape<2> AbstractShape2D; -typedef AbstractShape<3> AbstractShape3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") AbstractShape; +typedef AbstractShape<2> CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") AbstractShape2D; +typedef AbstractShape<3> CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") AbstractShape3D; -template class AxisAlignedBox; -typedef AxisAlignedBox<2> AxisAlignedBox2D; -typedef AxisAlignedBox<3> AxisAlignedBox3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") AxisAlignedBox; +typedef AxisAlignedBox<2> CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") AxisAlignedBox2D; +typedef AxisAlignedBox<3> CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") AxisAlignedBox3D; -template class Box; -typedef Box<2> Box2D; -typedef Box<3> Box3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Box; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Box<2> Box2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Box<3> Box3D; -template class Capsule; -typedef Capsule<2> Capsule2D; -typedef Capsule<3> Capsule3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Capsule; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Capsule<2> Capsule2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Capsule<3> Capsule3D; -template class Collision; -typedef Collision<2> Collision2D; -typedef Collision<3> Collision3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision<2> Collision2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision<3> Collision3D; -template class Composition; -typedef Composition<2> Composition2D; -typedef Composition<3> Composition3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition<2> Composition2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Composition<3> Composition3D; -template class Cylinder; -typedef Cylinder<2> Cylinder2D; -typedef Cylinder<3> Cylinder3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Cylinder; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Cylinder<2> Cylinder2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Cylinder<3> Cylinder3D; -template class Line; -typedef Line<2> Line2D; -typedef Line<3> Line3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Line; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Line<2> Line2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Line<3> Line3D; -template class LineSegment; -typedef LineSegment<2> LineSegment2D; -typedef LineSegment<3> LineSegment3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") LineSegment; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") LineSegment<2> LineSegment2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") LineSegment<3> LineSegment3D; -template class Shape; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Shape; -template class ShapeGroup; -typedef ShapeGroup<2> ShapeGroup2D; -typedef ShapeGroup<3> ShapeGroup3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeGroup; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeGroup<2> ShapeGroup2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") ShapeGroup<3> ShapeGroup3D; -template class Sphere; -typedef Sphere<2> Sphere2D; -typedef Sphere<3> Sphere3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Sphere; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Sphere<2> Sphere2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Sphere<3> Sphere3D; -template class InvertedSphere; -typedef InvertedSphere<2> InvertedSphere2D; -typedef InvertedSphere<3> InvertedSphere3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") InvertedSphere; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") InvertedSphere<2> InvertedSphere2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") InvertedSphere<3> InvertedSphere3D; -class Plane; +class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Plane; -template class Point; -typedef Point<2> Point2D; -typedef Point<3> Point3D; +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Point; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Point<2> Point2D; +typedef CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Point<3> Point3D; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Sphere.cpp b/src/Magnum/Shapes/Sphere.cpp index d636513de..236f8806c 100644 --- a/src/Magnum/Shapes/Sphere.cpp +++ b/src/Magnum/Shapes/Sphere.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Sphere.h" #include "Magnum/Magnum.h" @@ -35,6 +37,7 @@ namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH template Sphere Sphere::transformed(const MatrixTypeFor& matrix) const { return Sphere(matrix.transformPoint(_position), matrix.uniformScaling()*_radius); } @@ -149,5 +152,6 @@ template class MAGNUM_SHAPES_EXPORT Sphere<3>; template class MAGNUM_SHAPES_EXPORT InvertedSphere<2>; template class MAGNUM_SHAPES_EXPORT InvertedSphere<3>; #endif +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Sphere.h b/src/Magnum/Shapes/Sphere.h index 2b1d8b64c..f47f805eb 100644 --- a/src/Magnum/Shapes/Sphere.h +++ b/src/Magnum/Shapes/Sphere.h @@ -26,27 +26,46 @@ */ /** @file - * @brief Class @ref Magnum::Shapes::Sphere, typedef @ref Magnum::Shapes::Sphere2D, @ref Magnum::Shapes::Sphere3D - */ +@brief Class @ref Magnum::Shapes::Sphere, typedef @ref Magnum::Shapes::Sphere2D, @ref Magnum::Shapes::Sphere3D + +@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/Collision.h" #include "Magnum/Shapes/Shapes.h" +#include "Magnum/Shapes/Collision.h" #include "Magnum/Shapes/visibility.h" +/* File-level deprecation warning issued from Shapes.h */ + namespace Magnum { namespace Shapes { +CORRADE_IGNORE_DEPRECATED_PUSH /** @brief Sphere defined by position and radius +@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. + Unlike other elements the sphere expects uniform scaling. See @ref shapes for brief introduction. @see @ref Sphere2D, @ref Sphere3D @todo Store the radius as squared value to avoid sqrt/pow? Will complicate collision detection with another sphere. */ -template class MAGNUM_SHAPES_EXPORT Sphere { +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT Sphere { public: enum: UnsignedInt { Dimensions = dimensions /**< Dimension count */ @@ -104,20 +123,48 @@ template class MAGNUM_SHAPES_EXPORT Sphere { Float _radius; }; -/** @brief Two-dimensional sphere */ -typedef Sphere<2> Sphere2D; +/** +@brief Two-dimensional sphere + +@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") Sphere<2> Sphere2D; -/** @brief Three-dimensional sphere */ -typedef Sphere<3> Sphere3D; +/** +@brief Three-dimensional sphere + +@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") Sphere<3> Sphere3D; /** @brief Inverted sphere defined by position and radius +@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. + Inverted version of @ref Sphere, detecting collisions on the outside, not on the inside. See @ref shapes for brief introduction. @see @ref InvertedSphere2D, @ref InvertedSphere3D */ -template class MAGNUM_SHAPES_EXPORT InvertedSphere: +template class CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") MAGNUM_SHAPES_EXPORT InvertedSphere: #ifdef DOXYGEN_GENERATING_OUTPUT public Sphere #else @@ -163,35 +210,136 @@ template class MAGNUM_SHAPES_EXPORT InvertedSphere: constexpr /*implicit*/ InvertedSphere(const Sphere& other): Sphere(other) {} }; -/** @brief Inverted two-dimensional sphere */ -typedef InvertedSphere<2> InvertedSphere2D; +/** +@brief Inverted two-dimensional sphere + +@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") InvertedSphere<2> InvertedSphere2D; -/** @brief Inverted three-dimensional sphere */ -typedef InvertedSphere<3> InvertedSphere3D; +/** +@brief Inverted three-dimensional sphere + +@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") InvertedSphere<3> InvertedSphere3D; -/** @collisionoccurenceoperator{Point,Sphere} */ -template inline bool operator%(const Point& a, const Sphere& b) { return b % a; } +/** +@collisionoccurenceoperator{Point,Sphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Point& a, const Sphere& b) { return b % a; } -/** @collisionoccurenceoperator{Point,InvertedSphere} */ -template inline bool operator%(const Point& a, const InvertedSphere& b) { return b % a; } +/** +@collisionoccurenceoperator{Point,InvertedSphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Point& a, const InvertedSphere& b) { return b % a; } -/** @collisionoperator{Point,Sphere} */ -template inline Collision operator/(const Point& a, const Sphere& b) { return (b/a).flipped(); } +/** +@collisionoperator{Point,Sphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision operator/(const Point& a, const Sphere& b) { return (b/a).flipped(); } -/** @collisionoperator{Point,InvertedSphere} */ -template inline Collision operator/(const Point& a, const InvertedSphere& b) { return (b/a).flipped(); } +/** +@collisionoperator{Point,InvertedSphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision operator/(const Point& a, const InvertedSphere& b) { return (b/a).flipped(); } -/** @collisionoccurenceoperator{Line,Sphere} */ -template inline bool operator%(const Line& a, const Sphere& b) { return b % a; } +/** +@collisionoccurenceoperator{Line,Sphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Line& a, const Sphere& b) { return b % a; } -/** @collisionoccurenceoperator{LineSegment,Sphere} */ -template inline bool operator%(const LineSegment& a, const Sphere& b) { return b % a; } +/** +@collisionoccurenceoperator{LineSegment,Sphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const LineSegment& a, const Sphere& b) { return b % a; } -/** @collisionoccurenceoperator{Sphere,InvertedSphere} */ -template inline bool operator%(const Sphere& a, const InvertedSphere& b) { return b % a; } +/** +@collisionoccurenceoperator{Sphere,InvertedSphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") bool operator%(const Sphere& a, const InvertedSphere& b) { return b % a; } -/** @collisionoperator{Sphere,InvertedSphere} */ -template inline Collision operator/(const Sphere& a, const InvertedSphere& b) { return (b/a).flipped(); } +/** +@collisionoperator{Sphere,InvertedSphere} + +@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. +*/ +template inline CORRADE_DEPRECATED("scheduled for removal, see the docs for alternatives") Collision operator/(const Sphere& a, const InvertedSphere& b) { return (b/a).flipped(); } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp b/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp index d757be87f..5fc77a808 100644 --- a/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp +++ b/src/Magnum/Shapes/Test/AxisAlignedBoxTest.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Math/Matrix4.h" #include "Magnum/Magnum.h" #include "Magnum/Shapes/AxisAlignedBox.h" @@ -44,6 +46,7 @@ AxisAlignedBoxTest::AxisAlignedBoxTest() { &AxisAlignedBoxTest::collisionPoint}); } +CORRADE_IGNORE_DEPRECATED_PUSH void AxisAlignedBoxTest::transformed() { const auto box = Shapes::AxisAlignedBox3D({-1.0f, -2.0f, -3.0f}, {1.0f, 2.0f, 3.0f}) .transformed(Matrix4::translation(Vector3(1.0f))*Matrix4::scaling({2.0f, -1.0f, 1.5f})); @@ -59,6 +62,7 @@ void AxisAlignedBoxTest::collisionPoint() { VERIFY_NOT_COLLIDES(box, point1); VERIFY_COLLIDES(box, point2); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/BoxTest.cpp b/src/Magnum/Shapes/Test/BoxTest.cpp index 5c310b21c..ed40d0e5e 100644 --- a/src/Magnum/Shapes/Test/BoxTest.cpp +++ b/src/Magnum/Shapes/Test/BoxTest.cpp @@ -25,6 +25,8 @@ #include +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Box.h" @@ -41,11 +43,13 @@ BoxTest::BoxTest() { addTests({&BoxTest::transformed}); } +CORRADE_IGNORE_DEPRECATED_PUSH void BoxTest::transformed() { const auto box = Shapes::Box3D(Matrix4::translation({1.0f, 2.0f, -3.0f})) .transformed(Matrix4::scaling({2.0f, -1.0f, 1.5f})); CORRADE_COMPARE(box.transformation(), Matrix4::scaling({2.0f, -1.0f, 1.5f})*Matrix4::translation({1.0f, 2.0f, -3.0f})); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/CapsuleTest.cpp b/src/Magnum/Shapes/Test/CapsuleTest.cpp index a03f00e8b..e0d09e9ba 100644 --- a/src/Magnum/Shapes/Test/CapsuleTest.cpp +++ b/src/Magnum/Shapes/Test/CapsuleTest.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Math/Matrix3.h" #include "Magnum/Math/Matrix4.h" @@ -49,6 +51,7 @@ CapsuleTest::CapsuleTest() { &CapsuleTest::collisionSphere}); } +CORRADE_IGNORE_DEPRECATED_PUSH void CapsuleTest::transformed() { const Shapes::Capsule3D capsule({1.0f, 2.0f, 3.0f}, {-1.0f, -2.0f, -3.0f}, 7.0f); @@ -79,6 +82,7 @@ void CapsuleTest::collisionSphere() { VERIFY_COLLIDES(capsule, sphere1); VERIFY_NOT_COLLIDES(capsule, sphere2); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/CollisionTest.cpp b/src/Magnum/Shapes/Test/CollisionTest.cpp index 9f240f793..a9091062c 100644 --- a/src/Magnum/Shapes/Test/CollisionTest.cpp +++ b/src/Magnum/Shapes/Test/CollisionTest.cpp @@ -25,6 +25,8 @@ #include +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Shapes/Collision.h" @@ -42,6 +44,7 @@ CollisionTest::CollisionTest() { &CollisionTest::flipped}); } +CORRADE_IGNORE_DEPRECATED_PUSH void CollisionTest::boolConversion() { CORRADE_VERIFY(!Collision3D()); CORRADE_VERIFY(!Collision3D({}, {2.0f, 0.0f, 0.0f}, 0.0f)); @@ -55,6 +58,7 @@ void CollisionTest::flipped() { CORRADE_COMPARE(flipped.separationNormal(), Vector3(-1.0f, 0.0f, 0.0f)); CORRADE_COMPARE(flipped.separationDistance(), 0.5f); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/CompositionTest.cpp b/src/Magnum/Shapes/Test/CompositionTest.cpp index d2872025d..d6fd0fe04 100644 --- a/src/Magnum/Shapes/Test/CompositionTest.cpp +++ b/src/Magnum/Shapes/Test/CompositionTest.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Math/Matrix3.h" #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Point.h" @@ -62,6 +64,7 @@ CompositionTest::CompositionTest() { &CompositionTest::transformed}); } +CORRADE_IGNORE_DEPRECATED_PUSH void CompositionTest::negated() { const Shapes::Composition2D a = !Shapes::Point2D(Vector2::xAxis(0.5f)); @@ -182,6 +185,7 @@ void CompositionTest::transformed() { CORRADE_COMPARE(b.get(2).min(), Vector2(1.5f, -7.0f)); CORRADE_COMPARE(b.get(2).max(), Vector2(2.0f, -6.5f)); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/CylinderTest.cpp b/src/Magnum/Shapes/Test/CylinderTest.cpp index 7c5f24a0f..ae3d0814a 100644 --- a/src/Magnum/Shapes/Test/CylinderTest.cpp +++ b/src/Magnum/Shapes/Test/CylinderTest.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Math/Matrix3.h" #include "Magnum/Math/Matrix4.h" @@ -49,6 +51,7 @@ CylinderTest::CylinderTest() { &CylinderTest::collisionSphere}); } +CORRADE_IGNORE_DEPRECATED_PUSH void CylinderTest::transformed() { const Shapes::Cylinder3D cylinder({1.0f, 2.0f, 3.0f}, {-1.0f, -2.0f, -3.0f}, 7.0f); @@ -79,6 +82,7 @@ void CylinderTest::collisionSphere() { VERIFY_COLLIDES(cylinder, sphere1); VERIFY_NOT_COLLIDES(cylinder, sphere2); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/LineTest.cpp b/src/Magnum/Shapes/Test/LineTest.cpp index 32ff808d5..29e09a473 100644 --- a/src/Magnum/Shapes/Test/LineTest.cpp +++ b/src/Magnum/Shapes/Test/LineTest.cpp @@ -25,6 +25,8 @@ #include +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Line.h" @@ -41,12 +43,14 @@ LineTest::LineTest() { addTests({&LineTest::transformed}); } +CORRADE_IGNORE_DEPRECATED_PUSH void LineTest::transformed() { const auto line = Shapes::Line3D({1.0f, 2.0f, 3.0f}, {-1.0f, -2.0f, -3.0f}) .transformed(Matrix4::rotation(Deg(90.0f), Vector3::zAxis())); CORRADE_COMPARE(line.a(), Vector3(-2.0f, 1.0f, 3.0f)); CORRADE_COMPARE(line.b(), Vector3(2.0f, -1.0f, -3.0f)); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/PlaneTest.cpp b/src/Magnum/Shapes/Test/PlaneTest.cpp index aa99e597f..1b6608ef3 100644 --- a/src/Magnum/Shapes/Test/PlaneTest.cpp +++ b/src/Magnum/Shapes/Test/PlaneTest.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/LineSegment.h" #include "Magnum/Shapes/Point.h" @@ -46,6 +48,7 @@ PlaneTest::PlaneTest() { &PlaneTest::collisionLineSegment}); } +CORRADE_IGNORE_DEPRECATED_PUSH void PlaneTest::transformed() { const Shapes::Plane plane({1.0f, 2.0f, 3.0f}, {Constants::sqrt2(), -Constants::sqrt2(), 0}); @@ -76,6 +79,7 @@ void PlaneTest::collisionLineSegment() { VERIFY_NOT_COLLIDES(plane, line2); VERIFY_NOT_COLLIDES(plane, line3); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/PointTest.cpp b/src/Magnum/Shapes/Test/PointTest.cpp index 3c4df9c69..f89fcfe9b 100644 --- a/src/Magnum/Shapes/Test/PointTest.cpp +++ b/src/Magnum/Shapes/Test/PointTest.cpp @@ -25,6 +25,8 @@ #include +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Math/Matrix4.h" #include "Magnum/Shapes/Point.h" @@ -41,11 +43,13 @@ PointTest::PointTest() { addTests({&PointTest::transformed}); } +CORRADE_IGNORE_DEPRECATED_PUSH void PointTest::transformed() { const auto point = Shapes::Point3D({1.0f, 2.0f, 3.0f}) .transformed(Matrix4::translation({5.0f, 6.0f, 7.0f})); CORRADE_COMPARE(point.position(), Vector3(6.0f, 8.0f, 10.0f)); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp index 31a81a29d..cd0aa7ac9 100644 --- a/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeImplementationTest.cpp @@ -26,6 +26,8 @@ #include #include +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Shapes/shapeImplementation.h" namespace Magnum { namespace Shapes { namespace Test { @@ -40,6 +42,7 @@ ShapeImplementationTest::ShapeImplementationTest() { addTests({&ShapeImplementationTest::debug}); } +CORRADE_IGNORE_DEPRECATED_PUSH void ShapeImplementationTest::debug() { std::ostringstream o; Debug(&o) << Implementation::ShapeDimensionTraits<2>::Type::Composition << Implementation::ShapeDimensionTraits<2>::Type(0xbe); @@ -49,6 +52,7 @@ void ShapeImplementationTest::debug() { Debug(&o) << Implementation::ShapeDimensionTraits<3>::Type::Plane << Implementation::ShapeDimensionTraits<3>::Type(0xbe); CORRADE_COMPARE(o.str(), "Shapes::Shape3D::Type::Plane Shapes::Shape3D::Type(0xbe)\n"); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/ShapeTest.cpp b/src/Magnum/Shapes/Test/ShapeTest.cpp index b83e82fbf..b61dcf2f0 100644 --- a/src/Magnum/Shapes/Test/ShapeTest.cpp +++ b/src/Magnum/Shapes/Test/ShapeTest.cpp @@ -25,6 +25,8 @@ #include +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Shapes/Composition.h" #include "Magnum/Shapes/Point.h" #include "Magnum/Shapes/Shape.h" @@ -59,6 +61,7 @@ ShapeTest::ShapeTest() { &ShapeTest::shapeGroup}); } +CORRADE_IGNORE_DEPRECATED_PUSH void ShapeTest::clean() { Scene3D scene; ShapeGroup3D shapes; @@ -221,6 +224,7 @@ void ShapeTest::shapeGroup() { a.setClean(); CORRADE_COMPARE(point.position(), Vector2(5.25f, -1.0f)); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/Test/SphereTest.cpp b/src/Magnum/Shapes/Test/SphereTest.cpp index aa2f79250..dd2ca5507 100644 --- a/src/Magnum/Shapes/Test/SphereTest.cpp +++ b/src/Magnum/Shapes/Test/SphereTest.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "Magnum/Magnum.h" #include "Magnum/Math/Matrix3.h" #include "Magnum/Math/Matrix4.h" @@ -56,6 +58,7 @@ SphereTest::SphereTest() { &SphereTest::collisionSphereInverted}); } +CORRADE_IGNORE_DEPRECATED_PUSH void SphereTest::transformed() { const Shapes::Sphere3D sphere({1.0f, 2.0f, 3.0f}, 7.0f); @@ -171,6 +174,7 @@ void SphereTest::collisionSphereInverted() { const Shapes::Sphere3D sphere3({1.5f, 2.0f, 3.0f}, 1.0f); CORRADE_VERIFY(!(sphere%sphere3) && !(sphere/sphere3)); } +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/shapeImplementation.cpp b/src/Magnum/Shapes/shapeImplementation.cpp index d45441946..b88177410 100644 --- a/src/Magnum/Shapes/shapeImplementation.cpp +++ b/src/Magnum/Shapes/shapeImplementation.cpp @@ -23,12 +23,15 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_DO_NOT_WARN_DEPRECATED_SHAPES + #include "shapeImplementation.h" #include namespace Magnum { namespace Shapes { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH Debug& operator<<(Debug& debug, ShapeDimensionTraits<2>::Type value) { switch(value) { /* LCOV_EXCL_START */ @@ -77,5 +80,6 @@ template AbstractShape::AbstractShape() = de template struct AbstractShape<2>; template struct AbstractShape<3>; +CORRADE_IGNORE_DEPRECATED_POP }}} diff --git a/src/Magnum/Shapes/shapeImplementation.h b/src/Magnum/Shapes/shapeImplementation.h index 005698784..ec23efb5a 100644 --- a/src/Magnum/Shapes/shapeImplementation.h +++ b/src/Magnum/Shapes/shapeImplementation.h @@ -35,6 +35,7 @@ namespace Magnum { namespace Shapes { namespace Implementation { +CORRADE_IGNORE_DEPRECATED_PUSH /* Adding new collision type: @@ -181,6 +182,7 @@ template struct Shape: AbstractShape { static_cast*>(result)->shape = shape.transformed(matrix); } }; +CORRADE_IGNORE_DEPRECATED_POP }}}