diff --git a/src/Magnum/SceneGraph/AbstractFeature.h b/src/Magnum/SceneGraph/AbstractFeature.h index a1ad197194..2802aa604d 100644 --- a/src/Magnum/SceneGraph/AbstractFeature.h +++ b/src/Magnum/SceneGraph/AbstractFeature.h @@ -84,13 +84,13 @@ Contained in @ref Object, takes care of transformation caching. See Uses @ref Corrade::Containers::LinkedList for accessing holder object and sibling features. -## Subclassing +@section SceneGraph-AbstractFeature-subclassing Subclassing Feature is templated on dimension count and underlying transformation type, so it can be used only on object having transformation with the same dimension count and type. -### Caching transformations in features +@subsection SceneGraph-AbstractFeature-subclassing-caching Caching transformations in features Features can cache absolute transformation of the object instead of computing it from scratch every time to achieve better performance. See @@ -98,9 +98,10 @@ it from scratch every time to achieve better performance. See In order to have caching, you must enable it first, because by default the caching is disabled. You can enable it using @ref setCachedTransformations() -and then implement corresponding cleaning function(s) -- either @ref clean(), +and then implement corresponding cleaning function(s) --- either @ref clean(), @ref cleanInverted() or both. Example: -@code + +@code{.cpp} class CachingFeature: public SceneGraph::AbstractFeature3D { public: explicit CachingFeature(SceneGraph::AbstractObject3D& object): SceneGraph::AbstractFeature3D{object} { @@ -117,15 +118,16 @@ class CachingFeature: public SceneGraph::AbstractFeature3D { @endcode Before using the cached value explicitly request object cleaning by calling -`object()->setClean()`. +@cpp object()->setClean() @ce. -### Accessing object transformation +@subsection SceneGraph-AbstractFeature-subclassing-object-transformation Accessing object transformation The feature has by default only access to @ref AbstractObject, which doesn't know about any used transformation. By using small template trick in the constructor it is possible to gain access to transformation interface in the constructor: -@code + +@code{.cpp} class TransformingFeature: public SceneGraph::AbstractFeature3D { public: template explicit TransformingFeature(SceneGraph::Object& object): @@ -138,7 +140,7 @@ class TransformingFeature: public SceneGraph::AbstractFeature3D { See @ref scenegraph-features-transformation for more detailed information. -## Explicit template specializations +@section SceneGraph-AbstractFeature-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" type) @@ -286,7 +288,7 @@ template class AbstractFeature /** @brief Base feature for two-dimensional scenes -Convenience alternative to `AbstractFeature<2, T>`. See +Convenience alternative to @cpp AbstractFeature<2, T> @ce. See @ref AbstractFeature for more information. @see @ref AbstractFeature2D, @ref AbstractBasicFeature3D */ @@ -304,7 +306,7 @@ typedef AbstractBasicFeature2D AbstractFeature2D; /** @brief Base feature for three-dimensional scenes -Convenience alternative to `AbstractFeature<3, T>`. See +Convenience alternative to @cpp AbstractFeature<3, T> @ce. See @ref AbstractFeature for more information. @see @ref AbstractFeature3D, @ref AbstractBasicFeature2D */ diff --git a/src/Magnum/SceneGraph/AbstractGroupedFeature.h b/src/Magnum/SceneGraph/AbstractGroupedFeature.h index 60f55db4df..eb3e02e11b 100644 --- a/src/Magnum/SceneGraph/AbstractGroupedFeature.h +++ b/src/Magnum/SceneGraph/AbstractGroupedFeature.h @@ -41,11 +41,12 @@ namespace Magnum { namespace SceneGraph { Used together with @ref FeatureGroup. -## Subclassing +@section SceneGraph-AbstractGroupedFeature-subclassing Subclassing Usage is via subclassing the feature using [CRTP](http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) and typedef'ing @ref FeatureGroup to accept only given type, e.g.: -@code + +@code{.cpp} class Drawable: public SceneGraph::AbstractGroupedFeature3D { // ... }; @@ -53,7 +54,7 @@ class Drawable: public SceneGraph::AbstractGroupedFeature3D { typedef SceneGraph::FeatureGroup3D DrawableGroup; @endcode -## Explicit template specializations +@section SceneGraph-AbstractGroupedFeature-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" type) @@ -110,7 +111,7 @@ template class AbstractGroupedFe /** @brief Base grouped feature for two-dimensional scenes -Convenience alternative to `AbstractGroupedFeature<2, Derived, T>`. See +Convenience alternative to @cpp AbstractGroupedFeature<2, Derived, T> @ce. See @ref AbstractGroupedFeature for more information. @see @ref AbstractGroupedFeature2D, @ref AbstractBasicGroupedFeature3D */ @@ -121,7 +122,7 @@ template using AbstractBasicGroupedFeature2D = AbstractG /** @brief Base grouped feature for two-dimensional float scenes -Convenience alternative to `AbstractBasicGroupedFeature2D`. +Convenience alternative to @cpp AbstractBasicGroupedFeature2D @ce. See @ref AbstractGroupedFeature for more information. @see @ref AbstractGroupedFeature3D */ @@ -132,7 +133,7 @@ template using AbstractGroupedFeature2D = AbstractBasicGroupedFea /** @brief Base grouped feature for three-dimensional scenes -Convenience alternative to `AbstractGroupedFeature<3, Derived, T>`. See +Convenience alternative to @cpp AbstractGroupedFeature<3, Derived, T> @ce. See @ref AbstractGroupedFeature for more information. @see @ref AbstractGroupedFeature3D, @ref AbstractBasicGroupedFeature2D */ @@ -143,7 +144,7 @@ template using AbstractBasicGroupedFeature3D = AbstractG /** @brief Base grouped feature for three-dimensional float scenes -Convenience alternative to `AbstractBasicGroupedFeature3D`. +Convenience alternative to @cpp AbstractBasicGroupedFeature3D @ce. See @ref AbstractGroupedFeature for more information. @see @ref AbstractGroupedFeature2D */ diff --git a/src/Magnum/SceneGraph/AbstractObject.h b/src/Magnum/SceneGraph/AbstractObject.h index b62f5eeeaa..40a3f6c481 100644 --- a/src/Magnum/SceneGraph/AbstractObject.h +++ b/src/Magnum/SceneGraph/AbstractObject.h @@ -52,7 +52,8 @@ subclass instead. See also @ref scenegraph for more information. Uses @ref Corrade::Containers::LinkedList for efficient feature management. Traversing through the feature list can be done using range-based for: -@code + +@code{.cpp} AbstractObject3D object; for(AbstractFeature3D& feature: object.features()) { // ... @@ -62,14 +63,14 @@ for(AbstractFeature3D& feature: object.features()) { Or, if you need more flexibility, like in the following code. It is also possible to go in reverse order using @ref Corrade::Containers::LinkedList::last() and @ref AbstractFeature::previousFeature(). -@code + +@code{.cpp} for(AbstractFeature3D* feature = object.features().first(); feature; feature = feature->nextFeature()) { // ... } @endcode -@anchor SceneGraph-AbstractObject-explicit-specializations -## Explicit template specializations +@section SceneGraph-AbstractObject-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" @@ -159,7 +160,8 @@ template class AbstractObject /** * @brief Scene - * @return Scene or `nullptr`, if the object is not part of any scene. + * @return Scene or @cpp nullptr @ce, if the object is not part of any + * scene. */ AbstractObject* scene() { return doScene(); } @@ -230,9 +232,9 @@ template class AbstractObject /** * @brief Whether absolute transformation is dirty * - * Returns `true` if transformation of the object or any parent has - * changed since last call to @ref setClean(), `false` otherwise. All - * objects are dirty by default. + * Returns @cpp true @ce if transformation of the object or any parent + * has changed since last call to @ref setClean(), @cpp false @ce + * otherwise. All objects are dirty by default. * @see @ref scenegraph-features-caching */ bool isDirty() const { return doIsDirty(); } @@ -293,7 +295,7 @@ template class AbstractObject /** @brief Base object for two-dimensional scenes -Convenience alternative to `AbstractObject<2, T>`. See +Convenience alternative to @cpp AbstractObject<2, T> @ce. See @ref AbstractObject for more information. @see @ref AbstractObject2D, @ref AbstractBasicObject3D */ @@ -311,7 +313,7 @@ typedef AbstractBasicObject2D AbstractObject2D; /** @brief Base object for three-dimensional scenes -Convenience alternative to `AbstractObject<3, T>`. See +Convenience alternative to @cpp AbstractObject<3, T> @ce. See @ref AbstractObject for more information. @see @ref AbstractObject3D, @ref AbstractBasicObject2D */ diff --git a/src/Magnum/SceneGraph/AbstractTransformation.h b/src/Magnum/SceneGraph/AbstractTransformation.h index ef96485600..fdd31d99b9 100644 --- a/src/Magnum/SceneGraph/AbstractTransformation.h +++ b/src/Magnum/SceneGraph/AbstractTransformation.h @@ -42,8 +42,7 @@ namespace Magnum { namespace SceneGraph { Provides transformation implementation for @ref Object instances. See @ref scenegraph-features-transformation for more information. -@anchor SceneGraph-AbstractTransformation-explicit-specializations -## Explicit template specializations +@section SceneGraph-AbstractTransformation-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" @@ -107,7 +106,7 @@ enum class CORRADE_DEPRECATED_ENUM("use *() and *Local() overloads instead") Tra /** @brief Base transformation for two-dimensional scenes -Convenience alternative to `AbstractTransformation<2, T>`. See +Convenience alternative to @cpp AbstractTransformation<2, T> @ce. See @ref AbstractTransformation for more information. @see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D */ @@ -125,7 +124,7 @@ typedef AbstractBasicTransformation2D AbstractTransformation2D; /** @brief Base transformation for three-dimensional scenes -Convenience alternative to `AbstractTransformation<3, T>`. See +Convenience alternative to @cpp AbstractTransformation<3, T> @ce. See @ref AbstractTransformation for more information. @see @ref AbstractTransformation3D, @ref AbstractBasicTransformation2D */ diff --git a/src/Magnum/SceneGraph/AbstractTranslation.h b/src/Magnum/SceneGraph/AbstractTranslation.h index 6cae52e2a2..25149501f0 100644 --- a/src/Magnum/SceneGraph/AbstractTranslation.h +++ b/src/Magnum/SceneGraph/AbstractTranslation.h @@ -129,7 +129,7 @@ class AbstractTranslation: public AbstractTransformation { /** @brief Base transformation for two-dimensional scenes supporting translation -Convenience alternative to `AbstractTranslation<2, T, TranslationType>`. +Convenience alternative to @cpp AbstractTranslation<2, T, TranslationType> @ce. See @ref AbstractTranslation for more information. @see @ref AbstractTranslation2D, @ref AbstractBasicTranslation3D */ @@ -152,7 +152,7 @@ typedef AbstractBasicTranslation2D AbstractTranslation2D; /** @brief Base transformation for three-dimensional scenes supporting translation -Convenience alternative to `AbstractTranslation<3, T, TranslationType>`. +Convenience alternative to @cpp AbstractTranslation<3, T, TranslationType> @ce. See @ref AbstractTranslation for more information. @see @ref AbstractTranslation3D, @ref AbstractBasicTranslation2D */ diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h b/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h index 09eedd5f38..0c02da4dd7 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h @@ -101,7 +101,7 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic * @return Reference to self (for method chaining) * * In some implementations faster than calling - * `rotate(angle, Vector3::xAxis())`, see subclasses for more + * @cpp rotate(angle, Vector3::xAxis()) @ce, see subclasses for more * information. * @see @ref rotateXLocal() */ @@ -115,8 +115,8 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic * * Similar to the above, except that the transformation is applied * before all others. In some implementations faster than calling - * `rotateLocal(angle, Vector3::xAxis())`, see subclasses for more - * information. + * @cpp rotateLocal(angle, Vector3::xAxis()) @ce, see subclasses for + * more information. */ AbstractBasicTranslationRotation3D& rotateXLocal(Math::Rad angle) { doRotateXLocal(angle); @@ -151,7 +151,7 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic * @return Reference to self (for method chaining) * * In some implementations faster than calling - * `rotate(angle, Vector3::yAxis())`, see subclasses for more + * @cpp rotate(angle, Vector3::yAxis()) @ce, see subclasses for more * information. * @see @ref rotateYLocal() */ @@ -165,8 +165,8 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic * * Similar to the above, except that the transformation is applied * before all others. In some implementations faster than calling - * `rotateLocal(angle, Vector3::yAxis())`, see subclasses for more - * information. + * @cpp rotateLocal(angle, Vector3::yAxis()) @ce, see subclasses for + * more information. */ AbstractBasicTranslationRotation3D& rotateYLocal(Math::Rad angle) { doRotateY(angle); @@ -201,7 +201,7 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic * @return Reference to self (for method chaining) * * In some implementations faster than calling - * `rotate(angle, Vector3::zAxis())`, see subclasses for more + * @cpp rotate(angle, Vector3::zAxis()) @ce, see subclasses for more * information. * @see @ref rotateZLocal() */ @@ -215,8 +215,8 @@ template class AbstractBasicTranslationRotation3D: public AbstractBasic * * Similar to the above, except that the transformation is applied * before all others. In some implementations faster than calling - * `rotateLocal(angle, Vector3::zAxis())`, see subclasses for more - * information. + * @cpp rotateLocal(angle, Vector3::zAxis()) @ce, see subclasses for + * more information. */ AbstractBasicTranslationRotation3D& rotateZLocal(Math::Rad angle) { doRotateZLocal(angle); diff --git a/src/Magnum/SceneGraph/Animable.h b/src/Magnum/SceneGraph/Animable.h index bac0f0133f..3629938b0e 100644 --- a/src/Magnum/SceneGraph/Animable.h +++ b/src/Magnum/SceneGraph/Animable.h @@ -65,14 +65,15 @@ MAGNUM_SCENEGRAPH_EXPORT Debug& operator<<(Debug& debug, AnimationState value); Adds animation feature to object. Each Animable is part of some @ref AnimableGroup, which takes care of running the animations. -## Usage +@section SceneGraph-Animable Usage First thing is to add @ref Animable feature to some object and implement @ref animationStep(). You can do it conveniently using multiple inheritance (see @ref scenegraph-features for introduction). Override @ref animationStep() to implement your animation, the function provides both absolute animation time and time delta. Example: -@code + +@code{.cpp} typedef SceneGraph::Object Object3D; typedef SceneGraph::Scene Scene3D; @@ -97,7 +98,8 @@ given set of animations. You can also use @ref AnimableGroup::add() and The animation is initially in stopped state and without repeat, see @ref setState(), @ref setRepeated() and @ref setRepeatCount() for more information. -@code + +@code{.cpp} Scene3D scene; SceneGraph::AnimableGroup3D animables; @@ -110,7 +112,8 @@ Animation step is performed by calling @ref AnimableGroup::step() in your draw event implementation. The function expects absolute time from relative to some fixed point in the past and time delta (i.e. duration of the frame). You can use @ref Timeline for that, see its documentation for more information. -@code + +@code{.cpp} Timeline timeline; timeline.start(); @@ -123,15 +126,15 @@ void MyApplication::drawEvent() { } @endcode -## Using multiple animable groups to improve performance +@section SceneGraph-Animable-multiple-groups Using multiple animable groups to improve performance -@ref AnimableGroup is optimized for case when no animation is running -- it +@ref AnimableGroup is optimized for case when no animation is running --- it just puts itself to rest and waits until some animation changes its state to @ref AnimationState::Running again. If you put animations which are not pernamently running into separate group, they will not be traversed every time the @ref AnimableGroup::step() gets called, saving precious frame time. -## Explicit template specializations +@section SceneGraph-Animable-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" @@ -192,7 +195,7 @@ template class Animable: public AbstractGrouped * @brief Enable/disable repeated animation * @return Reference to self (for method chaining) * - * Default is `false`. + * Default is @cpp false @ce. * @see @ref setRepeatCount() */ Animable& setRepeated(bool repeated) { @@ -211,8 +214,8 @@ template class Animable: public AbstractGrouped * @brief Set repeat count * @return Reference to self (for method chaining) * - * Has effect only if repeated animation is enabled. `0` means - * infinitely repeated animation. Default is `0`. + * Has effect only if repeated animation is enabled. @cpp 0 @ce means + * infinitely repeated animation. Default is @cpp 0 @ce. * @see @ref setRepeated() */ Animable& setRepeatCount(UnsignedShort count) { @@ -223,7 +226,7 @@ template class Animable: public AbstractGrouped /** * @brief Group containing this animable * - * If the animable doesn't belong to any group, returns `nullptr`. + * If the animable doesn't belong to any group, returns @cpp nullptr @ce. */ AnimableGroup* animables(); const AnimableGroup* animables() const; /**< @overload */ @@ -233,8 +236,8 @@ template class Animable: public AbstractGrouped * @brief Set animation duration * @return Reference to self (for method chaining) * - * Sets duration of the animation cycle in seconds. Set to `0.0f` for - * infinite non-repeating animation. Default is `0.0f`. + * Sets duration of the animation cycle in seconds. Set to @cpp 0.0f @ce + * for infinite non-repeating animation. Default is @cpp 0.0f @ce. */ /* Protected so only animation implementer can change it */ Animable& setDuration(Float duration) { @@ -326,7 +329,7 @@ template class Animable: public AbstractGrouped /** @brief Animable for two-dimensional scenes -Convenience alternative to `Animable<2, T>`. See @ref Animable for more +Convenience alternative to @cpp Animable<2, T> @ce. See @ref Animable for more information. @see @ref Animable2D, @ref BasicAnimable3D */ @@ -344,7 +347,7 @@ typedef BasicAnimable2D Animable2D; /** @brief Animable for three-dimensional scenes -Convenience alternative to `Animable<3, T>`. See @ref Animable for more +Convenience alternative to @cpp Animable<3, T> @ce. See @ref Animable for more information. @see @ref Animable3D, @ref BasicAnimable2D */ diff --git a/src/Magnum/SceneGraph/AnimableGroup.h b/src/Magnum/SceneGraph/AnimableGroup.h index fc33d33617..c57623ccc7 100644 --- a/src/Magnum/SceneGraph/AnimableGroup.h +++ b/src/Magnum/SceneGraph/AnimableGroup.h @@ -75,7 +75,7 @@ template class AnimableGroup: public FeatureGro /** @brief Animable group for two-dimensional scenes -Convenience alternative to `AnimableGroup<2, T>`. See Animable for +Convenience alternative to @cpp AnimableGroup<2, T> @ce. See @ref Animable for more information. @see @ref AnimableGroup2D, @ref BasicAnimableGroup3D */ @@ -93,7 +93,7 @@ typedef BasicAnimableGroup2D AnimableGroup2D; /** @brief Animable group for three-dimensional scenes -Convenience alternative to `AnimableGroup<3, T>`. See Animable for +Convenience alternative to @cpp AnimableGroup<3, T> @ce. See @ref Animable for more information. @see @ref AnimableGroup3D, @ref BasicAnimableGroup2D */ diff --git a/src/Magnum/SceneGraph/Camera.h b/src/Magnum/SceneGraph/Camera.h index fed1c096e3..7cb4240e50 100644 --- a/src/Magnum/SceneGraph/Camera.h +++ b/src/Magnum/SceneGraph/Camera.h @@ -64,21 +64,22 @@ displays OpenGL unit cube `[(-1, -1, -1); (1, 1, 1)]` and doesn't do any aspect ratio correction. Common setup example for 2D scenes: -@code + +@code{.cpp} SceneGraph::Camera2D camera{&cameraObject}; camera.setProjectionMatrix(Matrix3::projection({4.0f/3.0f, 1.0f})) .setAspectRatioPolicy(SceneGraph::AspectRatioPolicy::Extend); @endcode Common setup example for 3D scenes: -@code + +@code{.cpp} SceneGraph::Camera3D camera{&cameraObject}; camera.setProjectionMatrix(Matrix3::perspectiveProjection(35.0_degf, 1.0f, 0.001f, 100.0f)) .setAspectRatioPolicy(SceneGraph::AspectRatioPolicy::Extend); @endcode -@anchor SceneGraph-Camera-explicit-specializations -## Explicit template specializations +@section SceneGraph-Camera-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" @@ -203,13 +204,16 @@ template class Camera: public AbstractFeatureabsoluteTransformation().transformPoint(position); * @endcode * @@ -258,7 +262,7 @@ template class Camera: public AbstractFeature`. See @ref Camera for more +Convenience alternative to @cpp Camera<2, T> @ce. See @ref Camera for more information. @see @ref Camera2D, @ref BasicCamera3D */ @@ -276,7 +280,7 @@ typedef BasicCamera2D Camera2D; /** @brief Camera for three-dimensional scenes -Convenience alternative to `Camera<3, T>`. See @ref Camera for more +Convenience alternative to @cpp Camera<3, T> @ce. See @ref Camera for more information. @see @ref Camera3D, @ref BasicCamera2D */ diff --git a/src/Magnum/SceneGraph/Drawable.h b/src/Magnum/SceneGraph/Drawable.h index f2b2e398ff..9723e3fb52 100644 --- a/src/Magnum/SceneGraph/Drawable.h +++ b/src/Magnum/SceneGraph/Drawable.h @@ -40,13 +40,14 @@ Adds drawing functionality to the object. Each Drawable is part of some @ref DrawableGroup and the whole group can be drawn with particular camera using @ref Camera::draw(). -## Usage +@section SceneGraph-Drawable-usage Usage First thing is to add @ref Drawable feature to some object and implement @ref draw() function. You can do it conveniently using multiple inheritance (see @ref scenegraph-features for introduction). Example drawable object that draws blue sphere: -@code + +@code{.cpp} typedef SceneGraph::Object Object3D; typedef SceneGraph::Scene Scene3D; @@ -81,7 +82,8 @@ have single function to set composite transformation and projection matrix. In that case you need to combine the two matrices manually like in the following code. Some shaders have additional requirements for various transformation matrices, see their respective documentation for details. -@code + +@code{.cpp} Shaders::Flat3D shader; shader.setTransformationProjectionMatrix(camera.projectionMatrix()*transformationMatrix); @endcode @@ -90,7 +92,8 @@ There is no way to just draw all the drawables in the scene, you need to create some drawable group and add the drawable objects to both the scene and the group. You can also use @ref DrawableGroup::add() and @ref DrawableGroup::remove() instead of passing the group in the constructor. -@code + +@code{.cpp} Scene3D scene; SceneGraph::DrawableGroup3D drawables; @@ -106,7 +109,8 @@ transformation). Using the camera and the drawable group you can perform drawing in your @ref Platform::Sdl2Application::drawEvent() "drawEvent()" implementation. See @ref Camera2D and @ref Camera3D documentation for more information. -@code + +@code{.cpp} auto cameraObject = new Object3D(&scene); cameraObject->translate(Vector3::zAxis(5.0f)); auto camera = new SceneGraph::Camera3D(&cameraObject); @@ -123,14 +127,15 @@ void MyApplication::drawEvent() { } @endcode -## Using multiple drawable groups to improve performance +@section SceneGraph-Drawable-multiple-groups Using multiple drawable groups to improve performance You can organize your drawables to multiple groups to minimize OpenGL state -changes -- for example put all objects using the same shader, the same light +changes --- for example put all objects using the same shader, the same light setup etc into one group, then put all transparent into another and set common parameters once for whole group instead of setting them again in each @ref draw() implementation. Example: -@code + +@code{.cpp} Shaders::PhongShader shader; SceneGraph::DrawableGroup3D phongObjects, transparentObjects; @@ -155,7 +160,7 @@ void MyApplication::drawEvent() { } @endcode -## Explicit template specializations +@section SceneGraph-Drawable-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" @@ -208,7 +213,7 @@ template class Drawable: public AbstractGrouped /** @brief Drawable for two-dimensional scenes -Convenience alternative to `Drawable<2, T>`. See @ref Drawable for more +Convenience alternative to @cpp Drawable<2, T> @ce. See @ref Drawable for more information. @see @ref Drawable2D, @ref BasicDrawable3D */ @@ -226,7 +231,7 @@ typedef BasicDrawable2D Drawable2D; /** @brief Drawable for three-dimensional scenes -Convenience alternative to `Drawable<3, T>`. See @ref Drawable for more +Convenience alternative to @cpp Drawable<3, T> @ce. See @ref Drawable for more information. @see @ref Drawable3D, @ref BasicDrawable3D */ @@ -255,7 +260,7 @@ template using DrawableGroup = FeatureGroup`. See @ref Drawable for +Convenience alternative to @cpp DrawableGroup<2, T> @ce. See @ref Drawable for more information. @see @ref DrawableGroup2D, @ref BasicDrawableGroup3D */ @@ -273,7 +278,7 @@ typedef BasicDrawableGroup2D DrawableGroup2D; /** @brief Group of drawables for three-dimensional scenes -Convenience alternative to `DrawableGroup<3, T>`. See @ref Drawable for +Convenience alternative to @cpp DrawableGroup<3, T> @ce. See @ref Drawable for more information. @see @ref DrawableGroup3D, @ref BasicDrawableGroup2D */ diff --git a/src/Magnum/SceneGraph/FeatureGroup.h b/src/Magnum/SceneGraph/FeatureGroup.h index 7c678af1b4..6fc89453f4 100644 --- a/src/Magnum/SceneGraph/FeatureGroup.h +++ b/src/Magnum/SceneGraph/FeatureGroup.h @@ -116,7 +116,7 @@ template class FeatureGroup: pub /** @brief Base feature group for two-dimensional scenes -Convenience alternative to `FeatureGroup<2, Feature, T>`. See +Convenience alternative to @cpp FeatureGroup<2, Feature, T> @ce. See @ref AbstractGroupedFeature for more information. @see @ref FeatureGroup2D, @ref BasicFeatureGroup3D */ @@ -127,7 +127,7 @@ template using BasicFeatureGroup2D = FeatureGroup<2, Fea /** @brief Base feature group for two-dimensional float scenes -Convenience alternative to `BasicFeatureGroup2D`. See +Convenience alternative to @cpp BasicFeatureGroup2D @ce. See @ref AbstractGroupedFeature for more information. @see @ref FeatureGroup3D */ @@ -138,7 +138,7 @@ template using FeatureGroup2D = BasicFeatureGroup2D`. See +Convenience alternative to @cpp FeatureGroup<3, Feature, T> @ce. See @ref AbstractGroupedFeature for more information. @see @ref FeatureGroup3D, @ref BasicFeatureGroup2D */ @@ -149,7 +149,7 @@ template using BasicFeatureGroup3D = FeatureGroup<3, Fea /** @brief Base feature group for three-dimensional float scenes -Convenience alternative to `BasicFeatureGroup3D`. See +Convenience alternative to @cpp BasicFeatureGroup3D @ce. See @ref AbstractGroupedFeature for more information. @see @ref FeatureGroup2D */ diff --git a/src/Magnum/SceneGraph/Object.h b/src/Magnum/SceneGraph/Object.h index 749cc827dc..2b2329fde9 100644 --- a/src/Magnum/SceneGraph/Object.h +++ b/src/Magnum/SceneGraph/Object.h @@ -58,14 +58,16 @@ for introduction. Common usage is to typedef @ref Object with desired transformation type to save unnecessary typing later, along with @ref Scene and possibly other types, e.g.: -@code + +@code{.cpp} typedef SceneGraph::Scene Scene3D; typedef SceneGraph::Object Object3D; @endcode Uses @ref Corrade::Containers::LinkedList for efficient hierarchy management. Traversing through the list of child objects can be done using range-based for: -@code + +@code{.cpp} Object3D o; for(Object3D& child: o.children()) { // ... @@ -75,14 +77,14 @@ for(Object3D& child: o.children()) { Or, if you need more flexibility, like in the following code. It is also possible to go in reverse order using @ref Corrade::Containers::LinkedList::last() and @ref previousSibling(). -@code + +@code{.cpp} for(Object3D* child = o->children().first(); child; child = child->nextSibling()) { // ... } @endcode -@anchor SceneGraph-Object-explicit-specializations -## Explicit template specializations +@section SceneGraph-Object-explicit-specializations Explicit template specializations The following specializations are explicitly compiled into @ref SceneGraph library. For other specializations (e.g. using @ref Magnum::Double "Double" diff --git a/src/Magnum/SceneGraph/TranslationTransformation.h b/src/Magnum/SceneGraph/TranslationTransformation.h index d6c3fb52a9..41136db072 100644 --- a/src/Magnum/SceneGraph/TranslationTransformation.h +++ b/src/Magnum/SceneGraph/TranslationTransformation.h @@ -172,7 +172,7 @@ class TranslationTransformation: public AbstractTranslation`. +Convenience alternative to @cpp TranslationTransformation<2, T, TranslationType> @ce. See @ref TranslationTransformation for more information. @see @ref TranslationTransformation2D, @ref BasicTranslationTransformation3D */ @@ -195,7 +195,7 @@ typedef BasicTranslationTransformation2D TranslationTransformation2D; /** @brief Base transformation for three-dimensional scenes supporting translation -Convenience alternative to `TranslationTransformation<3, T, TranslationType>`. +Convenience alternative to @cpp TranslationTransformation<3, T, TranslationType> @ce. See @ref TranslationTransformation for more information. @see @ref TranslationTransformation3D, @ref BasicTranslationTransformation2D */