#ifndef Magnum_SceneGraph_AbstractTranslationRotationScaling3D_h #define Magnum_SceneGraph_AbstractTranslationRotationScaling3D_h /* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš 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 Magnum::SceneGraph::AbstractTranslationRotationScaling3D */ #include "AbstractTranslationRotation3D.h" namespace Magnum { namespace SceneGraph { /** @brief Base for three-dimensional transformations supporting translation, rotation and scaling @see @ref scenegraph, AbstractTranslationRotationScaling2D */ #ifndef DOXYGEN_GENERATING_OUTPUT template #else template #endif class AbstractTranslationRotationScaling3D: public AbstractTranslationRotation3D { public: explicit AbstractTranslationRotationScaling3D(); /** * @brief Scale object * @param vector Scaling vector * @param type Transformation type * @return Pointer to self (for method chaining) * * @see Vector3::xScale(), Vector3::yScale(), Vector3::zScale() */ AbstractTranslationRotationScaling3D* scale(const Math::Vector3& vector, TransformationType type = TransformationType::Global) { doScale(vector, type); return this; } /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT AbstractTranslationRotationScaling3D* resetTransformation() { AbstractTranslationRotation3D::resetTransformation(); return this; } AbstractTranslationRotationScaling3D* translate(const Math::Vector3& vector, TransformationType type = TransformationType::Global) { AbstractTranslationRotation3D::translate(vector, type); return this; } AbstractTranslationRotationScaling3D* rotate(Math::Rad angle, const Math::Vector3& normalizedAxis, TransformationType type = TransformationType::Global) { AbstractTranslationRotation3D::rotate(angle, normalizedAxis, type); return this; } AbstractTranslationRotationScaling3D* rotateX(Math::Rad angle, TransformationType type = TransformationType::Global) { AbstractTranslationRotation3D::rotateX(angle, type); return this; } AbstractTranslationRotationScaling3D* rotateY(Math::Rad angle, TransformationType type = TransformationType::Global) { AbstractTranslationRotation3D::rotateY(angle, type); return this; } AbstractTranslationRotationScaling3D* rotateZ(Math::Rad angle, TransformationType type = TransformationType::Global) { AbstractTranslationRotation3D::rotateZ(angle, type); return this; } #endif #ifdef DOXYGEN_GENERATING_OUTPUT protected: #else private: #endif /** @brief Polymorphic implementation for scale() */ virtual void doScale(const Math::Vector3& vector, TransformationType type) = 0; }; template inline AbstractTranslationRotationScaling3D::AbstractTranslationRotationScaling3D() = default; }} #endif