Skip to content

Commit

Permalink
SceneGraph: updates for the new documentation theme.
Browse files Browse the repository at this point in the history
No proofreading.
  • Loading branch information
mosra committed Jan 18, 2018
1 parent b124cdc commit 0b49130
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 91 deletions.
22 changes: 12 additions & 10 deletions src/Magnum/SceneGraph/AbstractFeature.h
Expand Up @@ -84,23 +84,24 @@ 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
@ref scenegraph-features-caching for introduction.
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} {
Expand All @@ -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<class T> explicit TransformingFeature(SceneGraph::Object<T>& object):
Expand All @@ -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)
Expand Down Expand Up @@ -286,7 +288,7 @@ template<UnsignedInt dimensions, class T> 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
*/
Expand All @@ -304,7 +306,7 @@ typedef AbstractBasicFeature2D<Float> 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
*/
Expand Down
15 changes: 8 additions & 7 deletions src/Magnum/SceneGraph/AbstractGroupedFeature.h
Expand Up @@ -41,19 +41,20 @@ 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<Drawable> {
// ...
};
typedef SceneGraph::FeatureGroup3D<Drawable> 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)
Expand Down Expand Up @@ -110,7 +111,7 @@ template<UnsignedInt dimensions, class Derived, class T> 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
*/
Expand All @@ -121,7 +122,7 @@ template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractG
/**
@brief Base grouped feature for two-dimensional float scenes
Convenience alternative to `AbstractBasicGroupedFeature2D<Derived, Float>`.
Convenience alternative to @cpp AbstractBasicGroupedFeature2D<Derived, Float> @ce.
See @ref AbstractGroupedFeature for more information.
@see @ref AbstractGroupedFeature3D
*/
Expand All @@ -132,7 +133,7 @@ template<class Derived> 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
*/
Expand All @@ -143,7 +144,7 @@ template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractG
/**
@brief Base grouped feature for three-dimensional float scenes
Convenience alternative to `AbstractBasicGroupedFeature3D<Derived, Float>`.
Convenience alternative to @cpp AbstractBasicGroupedFeature3D<Derived, Float> @ce.
See @ref AbstractGroupedFeature for more information.
@see @ref AbstractGroupedFeature2D
*/
Expand Down
22 changes: 12 additions & 10 deletions src/Magnum/SceneGraph/AbstractObject.h
Expand Up @@ -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()) {
// ...
Expand All @@ -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"
Expand Down Expand Up @@ -159,7 +160,8 @@ template<UnsignedInt dimensions, class T> 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<dimensions, T>* scene() { return doScene(); }

Expand Down Expand Up @@ -230,9 +232,9 @@ template<UnsignedInt dimensions, class T> 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(); }
Expand Down Expand Up @@ -293,7 +295,7 @@ template<UnsignedInt dimensions, class T> 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
*/
Expand All @@ -311,7 +313,7 @@ typedef AbstractBasicObject2D<Float> 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
*/
Expand Down
7 changes: 3 additions & 4 deletions src/Magnum/SceneGraph/AbstractTransformation.h
Expand Up @@ -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"
Expand Down Expand Up @@ -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
*/
Expand All @@ -125,7 +124,7 @@ typedef AbstractBasicTransformation2D<Float> 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
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Magnum/SceneGraph/AbstractTranslation.h
Expand Up @@ -129,7 +129,7 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
/**
@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
*/
Expand All @@ -152,7 +152,7 @@ typedef AbstractBasicTranslation2D<Float> 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
*/
Expand Down
18 changes: 9 additions & 9 deletions src/Magnum/SceneGraph/AbstractTranslationRotation3D.h
Expand Up @@ -101,7 +101,7 @@ template<class T> 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()
*/
Expand All @@ -115,8 +115,8 @@ template<class T> 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<T>& rotateXLocal(Math::Rad<T> angle) {
doRotateXLocal(angle);
Expand Down Expand Up @@ -151,7 +151,7 @@ template<class T> 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()
*/
Expand All @@ -165,8 +165,8 @@ template<class T> 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<T>& rotateYLocal(Math::Rad<T> angle) {
doRotateY(angle);
Expand Down Expand Up @@ -201,7 +201,7 @@ template<class T> 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()
*/
Expand All @@ -215,8 +215,8 @@ template<class T> 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<T>& rotateZLocal(Math::Rad<T> angle) {
doRotateZLocal(angle);
Expand Down

0 comments on commit 0b49130

Please sign in to comment.