Browse Source

Math: removed deprecated Geometry::Rectangle class.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
959180dfd8
  1. 4
      src/Magnum/AbstractTexture.h
  2. 4
      src/Magnum/Buffer.h
  3. 4
      src/Magnum/DebugOutput.h
  4. 26
      src/Magnum/Magnum.h
  5. 6
      src/Magnum/Math/Geometry/CMakeLists.txt
  6. 75
      src/Magnum/Math/Geometry/Rectangle.h
  7. 6
      src/Magnum/Math/Math.h
  8. 38
      src/Magnum/Math/Test/RangeTest.cpp
  9. 4
      src/Magnum/Mesh.h
  10. 4
      src/Magnum/MeshView.h
  11. 4
      src/Magnum/PrimitiveQuery.h
  12. 4
      src/Magnum/Resource.h
  13. 4
      src/Magnum/SampleQuery.h
  14. 4
      src/Magnum/SceneGraph/AbstractObject.h
  15. 4
      src/Magnum/TimeQuery.h

4
src/Magnum/AbstractTexture.h

@ -35,6 +35,10 @@
#include "Magnum/DimensionTraits.h"
#include "Magnum/Sampler.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
namespace Implementation {

4
src/Magnum/Buffer.h

@ -39,6 +39,10 @@
#include "Magnum/AbstractObject.h"
#include "Magnum/Magnum.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
/**

4
src/Magnum/DebugOutput.h

@ -36,6 +36,10 @@
#include "Magnum/OpenGL.h"
#include "Magnum/visibility.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
namespace Implementation { struct DebugState; }

26
src/Magnum/Magnum.h

@ -34,10 +34,6 @@
#include "Magnum/Types.h"
#include "Magnum/Math/Math.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
#ifndef DOXYGEN_GENERATING_OUTPUT
typedef unsigned int GLenum; /* Needed for *Format and *Type enums */
#endif
@ -303,20 +299,6 @@ typedef Math::Range2D<Int> Range2Di;
/** @brief Signed integer 3D range */
typedef Math::Range3D<Int> Range3Di;
#ifdef MAGNUM_BUILD_DEPRECATED
/**
@copybrief Range2D
@deprecated Use @ref Magnum::Range2D "Range2D" instead.
*/
typedef CORRADE_DEPRECATED("use Range2D instead") Math::Geometry::Rectangle<Float> Rectangle;
/**
@copybrief Range2Di
@deprecated Use @ref Magnum::Range2Di "Range2Di" instead.
*/
typedef CORRADE_DEPRECATED("use Range2Di instead") Math::Geometry::Rectangle<Int> Rectanglei;
#endif
/*@}*/
#ifndef MAGNUM_TARGET_GLES
@ -419,14 +401,6 @@ typedef Math::Range2D<Double> Range2Dd;
/** @brief Double 3D range */
typedef Math::Range3D<Double> Range3Dd;
#ifdef MAGNUM_BUILD_DEPRECATED
/**
@copybrief Range2Dd
@deprecated Use @ref Magnum::Range2Dd instead.
*/
typedef CORRADE_DEPRECATED("use Range2Dd instead") Math::Geometry::Rectangle<Double> Rectangled;
#endif
/*@}*/
#endif

6
src/Magnum/Math/Geometry/CMakeLists.txt

@ -27,12 +27,6 @@ set(MagnumMathGeometry_HEADERS
Distance.h
Intersection.h)
# Deprecated headers
if(BUILD_DEPRECATED)
set(MagnumMathGeometry_HEADERS ${MagnumMathGeometry_HEADERS}
Rectangle.h)
endif()
# Force IDEs to display all header files in project view
add_custom_target(MagnumMathGeometry SOURCES ${MagnumMathGeometry_HEADERS})

75
src/Magnum/Math/Geometry/Rectangle.h

@ -1,75 +0,0 @@
#ifndef Magnum_Math_Geometry_Rectangle_h
#define Magnum_Math_Geometry_Rectangle_h
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/** @file
* @brief Class @ref Magnum::Math::Geometry::Rectangle
* @deprecated Use @ref Magnum/Math/Range.h instead.
*/
#include "Magnum/Math/Range.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
namespace Magnum { namespace Math { namespace Geometry {
/**
@copybrief Math::Range2D
@deprecated Use @ref Magnum::Math::Range2D "Math::Range2D" instead.
*/
template<class T> class CORRADE_DEPRECATED("use Math::Range2D instead") Rectangle: public Range2D<T> {
public:
/** @copydoc Range2D() */
constexpr Rectangle() = default;
/** @copydoc Range2D(const Vector2<T>&, const Vector2<T>&) */
constexpr Rectangle(const Vector2<T>& min, const Vector2<T>& max): Range2D<T>(min, max) {}
/** @copydoc Range2D(const Range<2, T>&) */
constexpr Rectangle(const Range<2, T>& other): Range2D<T>(other) {}
/** @copydoc Range2D(const Range2D<U>&) */
template<class U> constexpr explicit Rectangle(const Range2D<U>& other): Range2D<T>(other) {}
/** @copydoc Range2D::sizeX() */
T width() const { return Range2D<T>::sizeX(); }
/** @copydoc Range2D::sizeY() */
T height() const { return Range2D<T>::sizeY(); }
};
}}}
namespace Corrade { namespace Utility {
/** @configurationvalue{Magnum::Math::Geometry::Rectangle} */
template<class T> struct ConfigurationValue<Magnum::Math::Geometry::Rectangle<T>>: public ConfigurationValue<Magnum::Math::Range2D<T>> {};
}}
#else
#error use Magnum/Math/Range.h instead
#endif
#endif

6
src/Magnum/Math/Math.h

@ -77,12 +77,6 @@ template<UnsignedInt, class> class Range;
template<class T> using Range1D = Range<1, T>;
template<class> class Range2D;
template<class> class Range3D;
#ifdef MAGNUM_BUILD_DEPRECATED
namespace Geometry {
template<class> class Rectangle;
}
#endif
#endif
}}

38
src/Magnum/Math/Test/RangeTest.cpp

@ -29,10 +29,6 @@
#include "Magnum/Math/Range.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include "Magnum/Math/Geometry/Rectangle.h"
#endif
namespace Magnum { namespace Math { namespace Test {
struct RangeTest: Corrade::TestSuite::Tester {
@ -56,10 +52,6 @@ struct RangeTest: Corrade::TestSuite::Tester {
void subclassTypes();
void subclass();
#ifdef MAGNUM_BUILD_DEPRECATED
void deprecated();
#endif
void debug();
void configuration();
};
@ -92,10 +84,6 @@ RangeTest::RangeTest() {
&RangeTest::subclassTypes,
&RangeTest::subclass,
#ifdef MAGNUM_BUILD_DEPRECATED
&RangeTest::deprecated,
#endif
&RangeTest::debug,
&RangeTest::configuration});
}
@ -338,32 +326,6 @@ void RangeTest::debug() {
CORRADE_COMPARE(o.str(), "Range({34, 23}, {47, 30})\n");
}
#ifdef MAGNUM_BUILD_DEPRECATED
void RangeTest::deprecated() {
typedef Geometry::Rectangle<Float> Rectangle;
typedef Geometry::Rectangle<Int> Rectanglei;
Rectanglei a({45, 23}, {-17, 35});
CORRADE_COMPARE(Rectanglei(), Range2Di({0, 0}, {0, 0}));
CORRADE_COMPARE(a, Range2Di({45, 23}, {-17, 35}));
CORRADE_COMPARE(Rectanglei(a), Range2Di({45, 23}, {-17, 35}));
CORRADE_COMPARE(Rectangle(a), Range2D({45.0f, 23.0f}, {-17.0f, 35.0f}));
CORRADE_COMPARE(a.width(), -62);
CORRADE_COMPARE(a.height(), 12);
CORRADE_VERIFY(!(std::is_convertible<Rectangle, Rectanglei>::value));
Corrade::Utility::Configuration c;
Rectangle rect({3.0f, 3.125f}, {9.0f, 9.55f});
std::string value("3 3.125 9 9.55");
c.setValue("rectangle", rect);
CORRADE_COMPARE(c.value("rectangle"), value);
CORRADE_COMPARE(c.value<Rectangle>("rectangle"), rect);
}
#endif
void RangeTest::configuration() {
Corrade::Utility::Configuration c;

4
src/Magnum/Mesh.h

@ -36,6 +36,10 @@
#include "Magnum/AbstractObject.h"
#include "Magnum/Attribute.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
/**

4
src/Magnum/MeshView.h

@ -36,6 +36,10 @@
#include "Magnum/OpenGL.h"
#include "Magnum/visibility.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
namespace Implementation { struct MeshState; }

4
src/Magnum/PrimitiveQuery.h

@ -33,6 +33,10 @@
#include "Magnum/AbstractQuery.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
#ifndef MAGNUM_TARGET_GLES2
namespace Magnum {

4
src/Magnum/Resource.h

@ -35,6 +35,10 @@
#include "Magnum/Magnum.h"
#include "Magnum/visibility.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
/**

4
src/Magnum/SampleQuery.h

@ -31,6 +31,10 @@
#include "Magnum/AbstractQuery.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
/**

4
src/Magnum/SceneGraph/AbstractObject.h

@ -37,6 +37,10 @@
#include "Magnum/SceneGraph/SceneGraph.h"
#include "Magnum/SceneGraph/visibility.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum { namespace SceneGraph {
/**

4
src/Magnum/TimeQuery.h

@ -31,6 +31,10 @@
#include "Magnum/AbstractQuery.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum {
/**

Loading…
Cancel
Save