diff --git a/src/DebugTools/Implementation/AbstractBoxRenderer.cpp b/src/DebugTools/Implementation/AbstractBoxRenderer.cpp index 60fb738a8..5c7624d37 100644 --- a/src/DebugTools/Implementation/AbstractBoxRenderer.cpp +++ b/src/DebugTools/Implementation/AbstractBoxRenderer.cpp @@ -32,11 +32,11 @@ namespace Magnum { namespace DebugTools { namespace Implementation { AbstractBoxRenderer<2>::AbstractBoxRenderer(): AbstractShapeRenderer<2>("box2d", "box2d-vertices", {}) { - if(!wireframeMesh) this->createResources(Primitives::Square::wireframe()); + if(!wireframeMesh) AbstractShapeRenderer<2>::createResources(Primitives::Square::wireframe()); } AbstractBoxRenderer<3>::AbstractBoxRenderer(): AbstractShapeRenderer<3>("box3d", "box3d-vertices", "box3d-indices") { - if(!wireframeMesh) this->createResources(Primitives::Cube::wireframe()); + if(!wireframeMesh) AbstractShapeRenderer<3>::createResources(Primitives::Cube::wireframe()); } template class AbstractBoxRenderer<2>; diff --git a/src/DebugTools/Implementation/AbstractShapeRenderer.cpp b/src/DebugTools/Implementation/AbstractShapeRenderer.cpp index 40ceea33f..c8e7789d8 100644 --- a/src/DebugTools/Implementation/AbstractShapeRenderer.cpp +++ b/src/DebugTools/Implementation/AbstractShapeRenderer.cpp @@ -102,7 +102,7 @@ template AbstractShapeRenderer::AbstractShap template AbstractShapeRenderer::~AbstractShapeRenderer() {} template void AbstractShapeRenderer::createResources(typename MeshData::Type data) { - create(data, this->wireframeMesh, this->vertexBuffer, this->indexBuffer); + create(data, wireframeMesh, vertexBuffer, indexBuffer); } template class AbstractShapeRenderer<2>; diff --git a/src/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp b/src/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp index 80e90c22d..5a497c2da 100644 --- a/src/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp +++ b/src/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp @@ -34,12 +34,12 @@ namespace Magnum { namespace DebugTools { namespace Implementation { template AxisAlignedBoxRenderer::AxisAlignedBoxRenderer(const Shapes::Implementation::AbstractShape* axisAlignedBox): axisAlignedBox(static_cast>*>(axisAlignedBox)->shape) {} template void AxisAlignedBoxRenderer::draw(Resource& options, const typename DimensionTraits::MatrixType& projectionMatrix) { - this->wireframeShader->setTransformationProjectionMatrix(projectionMatrix* + AbstractBoxRenderer::wireframeShader->setTransformationProjectionMatrix(projectionMatrix* DimensionTraits::MatrixType::translation((axisAlignedBox.min()+axisAlignedBox.max())/2)* DimensionTraits::MatrixType::scaling(axisAlignedBox.max()-axisAlignedBox.min())) .setColor(options->color()) .use(); - this->wireframeMesh->draw(); + AbstractBoxRenderer::wireframeMesh->draw(); } template class AxisAlignedBoxRenderer<2>; diff --git a/src/DebugTools/Implementation/BoxRenderer.cpp b/src/DebugTools/Implementation/BoxRenderer.cpp index 245e112a9..dd5a45239 100644 --- a/src/DebugTools/Implementation/BoxRenderer.cpp +++ b/src/DebugTools/Implementation/BoxRenderer.cpp @@ -34,10 +34,10 @@ namespace Magnum { namespace DebugTools { namespace Implementation { template BoxRenderer::BoxRenderer(const Shapes::Implementation::AbstractShape* box): box(static_cast>*>(box)->shape) {} template void BoxRenderer::draw(Resource& options, const typename DimensionTraits::MatrixType& projectionMatrix) { - this->wireframeShader->setTransformationProjectionMatrix(projectionMatrix*box.transformation()) + AbstractBoxRenderer::wireframeShader->setTransformationProjectionMatrix(projectionMatrix*box.transformation()) .setColor(options->color()) .use(); - this->wireframeMesh->draw(); + AbstractBoxRenderer::wireframeMesh->draw(); } template class BoxRenderer<2>; diff --git a/src/DebugTools/Implementation/LineSegmentRenderer.cpp b/src/DebugTools/Implementation/LineSegmentRenderer.cpp index 8b6cd5020..9d0ee7524 100644 --- a/src/DebugTools/Implementation/LineSegmentRenderer.cpp +++ b/src/DebugTools/Implementation/LineSegmentRenderer.cpp @@ -51,15 +51,15 @@ namespace { } template LineSegmentRenderer::LineSegmentRenderer(const Shapes::Implementation::AbstractShape* line): AbstractShapeRenderer(meshKey(), vertexBufferKey(), {}), line(static_cast>*>(line)->shape) { - if(!this->wireframeMesh) this->createResources(meshData()); + if(!AbstractShapeRenderer::wireframeMesh) AbstractShapeRenderer::createResources(meshData()); } template void LineSegmentRenderer::draw(Resource& options, const typename DimensionTraits::MatrixType& projectionMatrix) { - this->wireframeShader->setTransformationProjectionMatrix(projectionMatrix* + AbstractShapeRenderer::wireframeShader->setTransformationProjectionMatrix(projectionMatrix* Implementation::lineSegmentRendererTransformation(line.a(), line.b())) .setColor(options->color()) .use(); - this->wireframeMesh->draw(); + AbstractShapeRenderer::wireframeMesh->draw(); } template class LineSegmentRenderer<2>; diff --git a/src/DebugTools/Implementation/PointRenderer.cpp b/src/DebugTools/Implementation/PointRenderer.cpp index 43459800c..458014adb 100644 --- a/src/DebugTools/Implementation/PointRenderer.cpp +++ b/src/DebugTools/Implementation/PointRenderer.cpp @@ -49,17 +49,17 @@ namespace { } template PointRenderer::PointRenderer(const Shapes::Implementation::AbstractShape* point): AbstractShapeRenderer(meshKey(), vertexBufferKey(), {}), point(static_cast>*>(point)->shape) { - if(!this->wireframeMesh) this->createResources(meshData()); + if(!AbstractShapeRenderer::wireframeMesh) AbstractShapeRenderer::createResources(meshData()); } template void PointRenderer::draw(Resource& options, const typename DimensionTraits::MatrixType& projectionMatrix) { /* Half scale, because the point is 2x2(x2) */ - this->wireframeShader->setTransformationProjectionMatrix(projectionMatrix* + AbstractShapeRenderer::wireframeShader->setTransformationProjectionMatrix(projectionMatrix* DimensionTraits::MatrixType::translation(point.position())* DimensionTraits::MatrixType::scaling(typename DimensionTraits::VectorType(options->pointSize()/2))) .setColor(options->color()) .use(); - this->wireframeMesh->draw(); + AbstractShapeRenderer::wireframeMesh->draw(); } template class PointRenderer<2>; diff --git a/src/DebugTools/Implementation/SphereRenderer.cpp b/src/DebugTools/Implementation/SphereRenderer.cpp index 0a5a25bbb..8f13afac0 100644 --- a/src/DebugTools/Implementation/SphereRenderer.cpp +++ b/src/DebugTools/Implementation/SphereRenderer.cpp @@ -46,12 +46,12 @@ AbstractSphereRenderer<3>::AbstractSphereRenderer(): AbstractShapeRenderer<3>("s template SphereRenderer::SphereRenderer(const Shapes::Implementation::AbstractShape* sphere): sphere(static_cast>*>(sphere)->shape) {} template void SphereRenderer::draw(Resource& options, const typename DimensionTraits::MatrixType& projectionMatrix) { - this->wireframeShader->setTransformationProjectionMatrix(projectionMatrix* + AbstractShapeRenderer::wireframeShader->setTransformationProjectionMatrix(projectionMatrix* DimensionTraits::MatrixType::translation(sphere.position())* DimensionTraits::MatrixType::scaling(typename DimensionTraits::VectorType(sphere.radius()))) .setColor(options->color()) .use(); - this->wireframeMesh->draw(); + AbstractShapeRenderer::wireframeMesh->draw(); } template class SphereRenderer<2>; diff --git a/src/Image.h b/src/Image.h index b2da03fb2..cbb420d4b 100644 --- a/src/Image.h +++ b/src/Image.h @@ -133,7 +133,7 @@ template inline Image& Image::op } template inline Image::operator ImageReference() const { - return ImageReference(this->format(), this->type(), _size, _data); + return ImageReference(AbstractImage::format(), AbstractImage::type(), _size, _data); } } diff --git a/src/Math/DualComplex.h b/src/Math/DualComplex.h index 95ed5e7fb..9ee19f2e9 100644 --- a/src/Math/DualComplex.h +++ b/src/Math/DualComplex.h @@ -145,7 +145,7 @@ template class DualComplex: public Dual> { * @see Complex::angle() */ constexpr Complex rotation() const { - return this->real(); + return Dual>::real(); } /** @@ -157,7 +157,7 @@ template class DualComplex: public Dual> { * @see translation(const Vector2&) */ Vector2 translation() const { - return Vector2(this->dual()); + return Vector2(Dual>::dual()); } /** @@ -166,7 +166,7 @@ template class DualComplex: public Dual> { * @see fromMatrix(), Complex::toMatrix() */ Matrix3 toMatrix() const { - return Matrix3::from(this->real().toMatrix(), translation()); + return Matrix3::from(Dual>::real().toMatrix(), translation()); } /** @@ -178,7 +178,7 @@ template class DualComplex: public Dual> { * @todo can this be done similarly to dual quaternions? */ DualComplex operator*(const DualComplex& other) const { - return {this->real()*other.real(), this->real()*other.dual() + this->dual()}; + return {Dual>::real()*other.real(), Dual>::real()*other.dual() + Dual>::dual()}; } /** @@ -190,7 +190,7 @@ template class DualComplex: public Dual> { * @see dualConjugated(), conjugated(), Complex::conjugated() */ DualComplex complexConjugated() const { - return {this->real().conjugated(), this->dual().conjugated()}; + return {Dual>::real().conjugated(), Dual>::dual().conjugated()}; } /** @@ -215,7 +215,7 @@ template class DualComplex: public Dual> { * Dual::conjugated() */ DualComplex conjugated() const { - return {this->real().conjugated(), {-this->dual().real(), this->dual().imaginary()}}; + return {Dual>::real().conjugated(), {-Dual>::dual().real(), Dual>::dual().imaginary()}}; } /** @@ -228,7 +228,7 @@ template class DualComplex: public Dual> { * @todo Can this be done similarly to dual quaternins? */ T lengthSquared() const { - return this->real().dot(); + return Dual>::real().dot(); } /** @@ -241,7 +241,7 @@ template class DualComplex: public Dual> { * @todo can this be done similarly to dual quaternions? */ T length() const { - return this->real().length(); + return Dual>::real().length(); } /** @@ -254,7 +254,7 @@ template class DualComplex: public Dual> { * @todo can this be done similarly to dual quaternions? */ DualComplex normalized() const { - return {this->real()/length(), this->dual()}; + return {Dual>::real()/length(), Dual>::dual()}; } /** @@ -267,7 +267,7 @@ template class DualComplex: public Dual> { * @todo can this be done similarly to dual quaternions? */ DualComplex inverted() const { - return DualComplex(this->real().inverted(), {{}, {}})*DualComplex({}, -this->dual()); + return DualComplex(Dual>::real().inverted(), {{}, {}})*DualComplex({}, -Dual>::dual()); } /** @@ -280,7 +280,7 @@ template class DualComplex: public Dual> { * @todo can this be done similarly to dual quaternions? */ DualComplex invertedNormalized() const { - return DualComplex(this->real().invertedNormalized(), {{}, {}})*DualComplex({}, -this->dual()); + return DualComplex(Dual>::real().invertedNormalized(), {{}, {}})*DualComplex({}, -Dual>::dual()); } /** diff --git a/src/Math/DualQuaternion.h b/src/Math/DualQuaternion.h index e3ef06f26..cead7637a 100644 --- a/src/Math/DualQuaternion.h +++ b/src/Math/DualQuaternion.h @@ -155,7 +155,7 @@ template class DualQuaternion: public Dual> { * @see Quaternion::angle(), Quaternion::axis() */ constexpr Quaternion rotation() const { - return this->real(); + return Dual>::real(); } /** @@ -167,7 +167,7 @@ template class DualQuaternion: public Dual> { * @see translation(const Vector3&) */ Vector3 translation() const { - return (this->dual()*this->real().conjugated()).vector()*T(2); + return (Dual>::dual()*Dual>::real().conjugated()).vector()*T(2); } /** @@ -176,7 +176,7 @@ template class DualQuaternion: public Dual> { * @see fromMatrix(), Quaternion::toMatrix() */ Matrix4 toMatrix() const { - return Matrix4::from(this->real().toMatrix(), translation()); + return Matrix4::from(Dual>::real().toMatrix(), translation()); } /** @@ -188,7 +188,7 @@ template class DualQuaternion: public Dual> { * @see dualConjugated(), conjugated(), Quaternion::conjugated() */ DualQuaternion quaternionConjugated() const { - return {this->real().conjugated(), this->dual().conjugated()}; + return {Dual>::real().conjugated(), Dual>::dual().conjugated()}; } /** @@ -213,7 +213,7 @@ template class DualQuaternion: public Dual> { * Dual::conjugated() */ DualQuaternion conjugated() const { - return {this->real().conjugated(), {this->dual().vector(), -this->dual().scalar()}}; + return {Dual>::real().conjugated(), {Dual>::dual().vector(), -Dual>::dual().scalar()}}; } /** @@ -225,7 +225,7 @@ template class DualQuaternion: public Dual> { * @f] */ Dual lengthSquared() const { - return {this->real().dot(), T(2)*Quaternion::dot(this->real(), this->dual())}; + return {Dual>::real().dot(), T(2)*Quaternion::dot(Dual>::real(), Dual>::dual())}; } /** diff --git a/src/Math/Matrix.h b/src/Math/Matrix.h index badd940a4..e50272c9f 100644 --- a/src/Math/Matrix.h +++ b/src/Math/Matrix.h @@ -121,7 +121,7 @@ template class Matrix: public RectangularMatrixdiagonal().sum(); } + T trace() const { return RectangularMatrix::diagonal().sum(); } /** @brief %Matrix without given column and row */ Matrix ij(std::size_t skipCol, std::size_t skipRow) const; @@ -162,7 +162,7 @@ template class Matrix: public RectangularMatrix invertedOrthogonal() const { CORRADE_ASSERT(isOrthogonal(), "Math::Matrix::invertedOrthogonal(): the matrix is not orthogonal", {}); - return this->transposed(); + return RectangularMatrix::transposed(); } #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/SceneGraph/Animable.hpp b/src/SceneGraph/Animable.hpp index 9847e2ad8..b9a35e596 100644 --- a/src/SceneGraph/Animable.hpp +++ b/src/SceneGraph/Animable.hpp @@ -64,7 +64,7 @@ template void AnimableGroup::ste if(!_runningCount && !wakeUp) return; wakeUp = false; - for(std::size_t i = 0; i != this->size(); ++i) { + for(std::size_t i = 0; i != AnimableGroup::size(); ++i) { Animable* animable = (*this)[i]; /* The animation was stopped recently, just decrease count of running @@ -132,7 +132,7 @@ template void AnimableGroup::ste animable->animationStep(time - animable->startTime, delta); } - CORRADE_INTERNAL_ASSERT(_runningCount <= this->size()); + CORRADE_INTERNAL_ASSERT(_runningCount <= AnimableGroup::size()); } }} diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index ae5142437..e632e8ec5 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -74,19 +74,23 @@ template class FeatureGroup: pub ~FeatureGroup(); /** @brief Whether the group is empty */ - bool isEmpty() const { return this->features.empty(); } + bool isEmpty() const { + return AbstractFeatureGroup::features.empty(); + } /** @brief Count of features in the group */ - std::size_t size() const { return this->features.size(); } + std::size_t size() const { + return AbstractFeatureGroup::features.size(); + } /** @brief Feature at given index */ Feature* operator[](std::size_t index) { - return static_cast(this->features[index]); + return static_cast(AbstractFeatureGroup::features[index]); } /** @overload */ const Feature* operator[](std::size_t index) const { - return static_cast(this->features[index]); + return static_cast(AbstractFeatureGroup::features[index]); } /** @@ -155,7 +159,7 @@ template using FeatureGroup3D = BasicFeatureGroup3D FeatureGroup::~FeatureGroup() { - for(auto i: this->features) static_cast(i)->_group = nullptr; + for(auto i: AbstractFeatureGroup::features) static_cast(i)->_group = nullptr; } template FeatureGroup& FeatureGroup::add(Feature* feature) { diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index e938c1e19..f2a2bf2d9 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -94,7 +94,7 @@ template Object& Object::s const auto transformation = Transformation::compose( Transformation::inverted(parent->absoluteTransformation()), absoluteTransformation()); setParent(parent); - this->setTransformation(transformation); + Transformation::setTransformation(transformation); return *this; } diff --git a/src/Shapes/AbstractShape.cpp b/src/Shapes/AbstractShape.cpp index d9d6ef0db..c552ab15d 100644 --- a/src/Shapes/AbstractShape.cpp +++ b/src/Shapes/AbstractShape.cpp @@ -32,7 +32,7 @@ namespace Magnum { namespace Shapes { template AbstractShape::AbstractShape(SceneGraph::AbstractObject* object, ShapeGroup* group): SceneGraph::AbstractGroupedFeature, Float>(object, group) { - this->setCachedTransformations(SceneGraph::CachedTransformation::Absolute); + SceneGraph::AbstractFeature::setCachedTransformations(SceneGraph::CachedTransformation::Absolute); } template ShapeGroup* AbstractShape::group() { diff --git a/src/Trade/ImageData.h b/src/Trade/ImageData.h index 91c4e43c6..cdf9e1552 100644 --- a/src/Trade/ImageData.h +++ b/src/Trade/ImageData.h @@ -111,7 +111,7 @@ template inline ImageData& ImageData inline ImageData::operator ImageReference() const { - return ImageReference(this->format(), this->type(), _size, _data); + return ImageReference(AbstractImage::format(), AbstractImage::type(), _size, _data); } }}