From 777f8e3ba2d8e07470a8b984d283c5872b49fdd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 13 Dec 2011 14:56:32 +0100 Subject: [PATCH] C++11 way of disabling access to irrelevant functions in Scene. --- src/Object.h | 2 +- src/Scene.h | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Object.h b/src/Object.h index 28ce2e1c4..93a789994 100644 --- a/src/Object.h +++ b/src/Object.h @@ -70,7 +70,7 @@ class Object { inline const std::set& children() const { return _children; } /** @brief Set parent object */ - virtual void setParent(Object* parent); + void setParent(Object* parent); /** * @brief Transformation matrix diff --git a/src/Scene.h b/src/Scene.h index 76a8736f0..7a273ff1c 100644 --- a/src/Scene.h +++ b/src/Scene.h @@ -26,13 +26,16 @@ namespace Magnum { /** @brief %Scene */ class Scene: public Object { private: - virtual void setParent(Object* parent) {} - Object::setTransformation; - Object::multiplyTransformation; - Object::setTransformationFrom; - Object::translate; - Object::scale; - Object::rotate; + void setParent(Object* parent) = delete; + void setTransformation(const Matrix4& transformation) = delete; + void multiplyTransformation(const Matrix4& transformation, bool global = true) = delete; + void setTransformationFrom(Object* another) = delete; + void translate(Vector3 vec, bool global = true) = delete; + void translate(GLfloat x, GLfloat y, GLfloat z, bool global = true) = delete; + void scale(Vector3 vec, bool global = true) = delete; + void scale(GLfloat x, GLfloat y, GLfloat z, bool global = true) = delete; + void rotate(GLfloat angle, Vector3 vec, bool global = true) = delete; + void rotate(GLfloat angle, GLfloat x, GLfloat y, GLfloat z, bool global = true) = delete; public: /** @brief Features */