From e9329745e89913c387f020e7db4b523bbf223cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 31 Oct 2012 14:12:23 +0100 Subject: [PATCH] Using `override` keyword in all places I can think of at this time. --- src/Contexts/AbstractXWindowContext.h | 4 +++- src/Contexts/EglContextHandler.h | 10 ++++++---- src/Contexts/GlutWindowContext.h | 4 +++- src/Contexts/GlxContextHandler.h | 12 +++++++----- src/Contexts/Sdl2WindowContext.h | 4 +++- src/Physics/AxisAlignedBox.h | 6 ++++-- src/Physics/Box.h | 6 ++++-- src/Physics/Capsule.h | 8 +++++--- src/Physics/Line.h | 6 ++++-- src/Physics/LineSegment.h | 2 +- src/Physics/Plane.h | 12 +++++++----- src/Physics/Point.h | 6 ++++-- src/Physics/ShapeGroup.h | 8 +++++--- src/Physics/Sphere.h | 8 +++++--- 14 files changed, 61 insertions(+), 35 deletions(-) diff --git a/src/Contexts/AbstractXWindowContext.h b/src/Contexts/AbstractXWindowContext.h index 75e8eccd2..dc84d51f5 100644 --- a/src/Contexts/AbstractXWindowContext.h +++ b/src/Contexts/AbstractXWindowContext.h @@ -33,6 +33,8 @@ #include "AbstractWindowContext.h" #include "AbstractContextHandler.h" +#include "magnumCompatibility.h" + namespace Magnum { class Context; @@ -67,7 +69,7 @@ class AbstractXWindowContext: public AbstractWindowContext { */ virtual ~AbstractXWindowContext() = 0; - int exec(); + int exec() override; /** @brief Exit application main loop */ inline void exit() { flags |= Flag::Exit; } diff --git a/src/Contexts/EglContextHandler.h b/src/Contexts/EglContextHandler.h index 824aa0177..7c9eab9c6 100644 --- a/src/Contexts/EglContextHandler.h +++ b/src/Contexts/EglContextHandler.h @@ -28,6 +28,8 @@ #include "AbstractContextHandler.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Contexts { #ifndef DOXYGEN_GENERATING_OUTPUT @@ -48,14 +50,14 @@ class EglContextHandler: public AbstractContextHandler class PHYSICS_EXPORT AxisAlignedBox: public Ab /** @brief Constructor */ inline AxisAlignedBox(const typename DimensionTraits::VectorType& position, const typename DimensionTraits::VectorType& size): _position(position), _transformedPosition(position), _size(size), _transformedSize(size) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::AxisAlignedBox; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; /** @brief Position */ inline typename DimensionTraits::VectorType position() const { diff --git a/src/Physics/Box.h b/src/Physics/Box.h index d70aac3ab..d92ab64ab 100644 --- a/src/Physics/Box.h +++ b/src/Physics/Box.h @@ -23,6 +23,8 @@ #include "Math/Matrix4.h" #include "AbstractShape.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { /** @@ -35,11 +37,11 @@ template class PHYSICS_EXPORT Box: public AbstractShape /** @brief Constructor */ inline Box(const typename DimensionTraits::MatrixType& transformation): _transformation(transformation), _transformedTransformation(transformation) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::Box; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; /** @brief Transformation */ inline typename DimensionTraits::MatrixType transformation() const { diff --git a/src/Physics/Capsule.h b/src/Physics/Capsule.h index 7e20a9814..c493f1db9 100644 --- a/src/Physics/Capsule.h +++ b/src/Physics/Capsule.h @@ -22,6 +22,8 @@ #include "Math/Vector3.h" #include "AbstractShape.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { template class Point; @@ -39,13 +41,13 @@ template class PHYSICS_EXPORT Capsule: public AbstractS /** @brief Constructor */ inline Capsule(const typename DimensionTraits::VectorType& a, const typename DimensionTraits::VectorType& b, float radius): _a(a), _transformedA(a), _b(b), _transformedB(b), _radius(radius), _transformedRadius(radius) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::Capsule; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; - bool collides(const AbstractShape* other) const; + bool collides(const AbstractShape* other) const override; /** @brief Start point */ inline typename DimensionTraits::VectorType a() const { diff --git a/src/Physics/Line.h b/src/Physics/Line.h index 9f16e3d2b..39cb70363 100644 --- a/src/Physics/Line.h +++ b/src/Physics/Line.h @@ -22,6 +22,8 @@ #include "Math/Vector3.h" #include "AbstractShape.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { /** @@ -35,11 +37,11 @@ template class PHYSICS_EXPORT Line: public AbstractShap /** @brief Constructor */ inline Line(const typename DimensionTraits::VectorType& a, const typename DimensionTraits::VectorType& b): _a(a), _transformedA(a), _b(b), _transformedB(b) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::Line; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; /** @brief First point */ inline typename DimensionTraits::VectorType a() const { diff --git a/src/Physics/LineSegment.h b/src/Physics/LineSegment.h index 82fe11861..8c0d00242 100644 --- a/src/Physics/LineSegment.h +++ b/src/Physics/LineSegment.h @@ -33,7 +33,7 @@ template class LineSegment: public Line { /** @brief Constructor */ inline LineSegment(const typename DimensionTraits::VectorType& a, const typename DimensionTraits::VectorType& b): Line(a, b) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::LineSegment; } }; diff --git a/src/Physics/Plane.h b/src/Physics/Plane.h index 3895b6f6d..c17114b16 100644 --- a/src/Physics/Plane.h +++ b/src/Physics/Plane.h @@ -22,6 +22,8 @@ #include "Math/Vector3.h" #include "AbstractShape.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { template class Line; @@ -35,14 +37,14 @@ class PHYSICS_EXPORT Plane: public AbstractShape<3> { /** @brief Constructor */ inline Plane(const Vector3& position, const Vector3& normal): _position(position), _transformedPosition(position), _normal(normal), _transformedNormal(normal) {} - inline Type type() const { return Type::Plane; } + inline Type type() const override { return Type::Plane; } #ifndef DOXYGEN_GENERATING_OUTPUT - void applyTransformation(const Matrix4& transformation); - bool collides(const AbstractShape<3>* other) const; + void applyTransformation(const Matrix4& transformation) override; + bool collides(const AbstractShape<3>* other) const override; #else - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); - bool collides(const AbstractShape* other) const; + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; + bool collides(const AbstractShape* other) const override; #endif /** @brief Position */ diff --git a/src/Physics/Point.h b/src/Physics/Point.h index 9f867762c..142b315e0 100644 --- a/src/Physics/Point.h +++ b/src/Physics/Point.h @@ -22,6 +22,8 @@ #include "Math/Vector3.h" #include "AbstractShape.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { /** @@ -34,11 +36,11 @@ template class PHYSICS_EXPORT Point: public AbstractSha /** @brief Constructor */ inline Point(const typename DimensionTraits::VectorType& position): _position(position), _transformedPosition(position) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::Point; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; /** @brief Position */ inline typename DimensionTraits::VectorType position() const { diff --git a/src/Physics/ShapeGroup.h b/src/Physics/ShapeGroup.h index de8ab7fd8..8a3533e84 100644 --- a/src/Physics/ShapeGroup.h +++ b/src/Physics/ShapeGroup.h @@ -24,6 +24,8 @@ #include #include +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { #ifndef DOXYGEN_GENERATING_OUTPUT @@ -99,13 +101,13 @@ template class PHYSICS_EXPORT ShapeGroup: public Abstra /** @brief Move assignment */ ShapeGroup& operator=(ShapeGroup&& other); - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::ShapeGroup; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; - bool collides(const AbstractShape* other) const; + bool collides(const AbstractShape* other) const override; /** * @brief First object in the group diff --git a/src/Physics/Sphere.h b/src/Physics/Sphere.h index 245ed9a4c..9a91966ca 100644 --- a/src/Physics/Sphere.h +++ b/src/Physics/Sphere.h @@ -22,6 +22,8 @@ #include "Math/Vector3.h" #include "AbstractShape.h" +#include "magnumCompatibility.h" + namespace Magnum { namespace Physics { template class Line; @@ -40,13 +42,13 @@ template class PHYSICS_EXPORT Sphere: public AbstractSh /** @brief Constructor */ inline Sphere(const typename DimensionTraits::VectorType& position, float radius): _position(position), _transformedPosition(position), _radius(radius), _transformedRadius(radius) {} - inline typename AbstractShape::Type type() const { + inline typename AbstractShape::Type type() const override { return AbstractShape::Type::Sphere; } - void applyTransformation(const typename DimensionTraits::MatrixType& transformation); + void applyTransformation(const typename DimensionTraits::MatrixType& transformation) override; - bool collides(const AbstractShape* other) const; + bool collides(const AbstractShape* other) const override; /** @brief Position */ inline typename DimensionTraits::VectorType position() const {