Browse Source

Doc++

Crosslinked types from Math namespace with typedefs in Magnum namespace.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
8a3d2c12c6
  1. 4
      doc/coding-style.dox
  2. 5
      doc/scenegraph.dox
  3. 2
      src/Context.cpp
  4. 8
      src/Math/Constants.h
  5. 1
      src/Math/Matrix3.h
  6. 1
      src/Math/Matrix4.h
  7. 2
      src/Math/Point2D.h
  8. 2
      src/Math/Point3D.h
  9. 1
      src/Math/Vector2.h
  10. 1
      src/Math/Vector3.h
  11. 1
      src/Math/Vector4.h
  12. 7
      src/SceneGraph/Object.h

4
doc/coding-style.dox

@ -21,6 +21,10 @@ needed. You are encouraged to read it first:
Headers shouldn't have `using` declarations inside them (unless there is good Headers shouldn't have `using` declarations inside them (unless there is good
excuse, see Magnum.h). excuse, see Magnum.h).
Headers have `*.h` extension, @ref compilation-speedup-hpp "template implementation headers"
have `*.hpp` extension (hinting that they are something between `*.h` and
`*.cpp` files).
@subsection cpp-format Code format @subsection cpp-format Code format
@subsubsection cpp-naming Naming @subsubsection cpp-naming Naming

5
doc/scenegraph.dox

@ -47,7 +47,8 @@ needs, see @ref AbstractTransformation-subclassing
and its children are Object instances. The hierarchy has some transformation and its children are Object instances. The hierarchy has some transformation
type, identical for all objects (because for example having part of the tree type, identical for all objects (because for example having part of the tree
in 2D and part in 3D just wouldn't make sense). Common usage is to typedef in 2D and part in 3D just wouldn't make sense). Common usage is to typedef
%Scene and %Object with desired transformation type: %Scene and %Object with desired transformation type to save unnecessary typing
later:
@code @code
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D; typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D; typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
@ -193,6 +194,8 @@ by calling Object::setClean(). Camera, for example, calls it automatically
before it starts rendering, as it needs its own inverse transformation to before it starts rendering, as it needs its own inverse transformation to
properly draw the objects. properly draw the objects.
See @ref AbstractFeature-subclassing-caching for more information.
@section scenegraph-construction-order Construction and destruction order @section scenegraph-construction-order Construction and destruction order
There aren't any limitations and usage trade-offs of what you can and can't do There aren't any limitations and usage trade-offs of what you can and can't do

2
src/Context.cpp

@ -33,6 +33,7 @@ using namespace std;
namespace Magnum { namespace Magnum {
#ifndef DOXYGEN_GENERATING_OUTPUT
Debug operator<<(Debug debug, Version value) { Debug operator<<(Debug debug, Version value) {
switch(value) { switch(value) {
#define _c(value, string) case Version::value: return debug << string; #define _c(value, string) case Version::value: return debug << string;
@ -56,6 +57,7 @@ Debug operator<<(Debug debug, Version value) {
return debug << "Invalid"; return debug << "Invalid";
} }
#endif
const std::vector<Extension>& Extension::extensions(Version version) { const std::vector<Extension>& Extension::extensions(Version version) {
#define _extension(prefix, vendor, extension) \ #define _extension(prefix, vendor, extension) \

8
src/Math/Constants.h

@ -21,7 +21,11 @@
namespace Magnum { namespace Math { namespace Magnum { namespace Math {
/** @brief Numeric constants */ /**
@brief Numeric constants
@see Magnum::Constants
*/
template<class T> struct Constants { template<class T> struct Constants {
/* See MathTypeTraits for answer why these are functions and not constants. */ /* See MathTypeTraits for answer why these are functions and not constants. */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
@ -60,6 +64,8 @@ Usable for entering e.g. rotation:
@code @code
Matrix4::rotation(deg(30.0f), Vector3::yAxis()); Matrix4::rotation(deg(30.0f), Vector3::yAxis());
@endcode @endcode
This function (and also rad()) is available also in Magnum namespace itself.
@see Constants, rad() @see Constants, rad()
*/ */
template<class T> inline constexpr T deg(T value) { return value*Constants<T>::pi()/180; } template<class T> inline constexpr T deg(T value) { return value*Constants<T>::pi()/180; }

1
src/Math/Matrix3.h

@ -30,6 +30,7 @@ namespace Magnum { namespace Math {
Provides functions for transformations in 2D. See Matrix4 for 3D Provides functions for transformations in 2D. See Matrix4 for 3D
transformations. See also @ref matrix-vector for brief introduction. transformations. See also @ref matrix-vector for brief introduction.
@see Magnum::Matrix3
@configurationvalueref{Magnum::Math::Matrix3} @configurationvalueref{Magnum::Math::Matrix3}
*/ */
template<class T> class Matrix3: public Matrix<3, T> { template<class T> class Matrix3: public Matrix<3, T> {

1
src/Math/Matrix4.h

@ -30,6 +30,7 @@ namespace Magnum { namespace Math {
Provides functions for transformations in 3D. See Matrix3 for 2D Provides functions for transformations in 3D. See Matrix3 for 2D
transformations. See also @ref matrix-vector for brief introduction. transformations. See also @ref matrix-vector for brief introduction.
@see Magnum::Matrix4
@configurationvalueref{Magnum::Math::Matrix4} @configurationvalueref{Magnum::Math::Matrix4}
@todo Shearing @todo Shearing
@todo Reflection @todo Reflection

2
src/Math/Point2D.h

@ -29,7 +29,7 @@ namespace Magnum { namespace Math {
Same as Vector3, except that constructors have default value for Z component Same as Vector3, except that constructors have default value for Z component
set to one. See also @ref matrix-vector for brief introduction. set to one. See also @ref matrix-vector for brief introduction.
@see Point3D @see Magnum::Point2D, Point3D
@configurationvalueref{Magnum::Math::Point2D} @configurationvalueref{Magnum::Math::Point2D}
*/ */
template<class T> class Point2D: public Vector3<T> { template<class T> class Point2D: public Vector3<T> {

2
src/Math/Point3D.h

@ -29,7 +29,7 @@ namespace Magnum { namespace Math {
Same as Vector4, except that constructors have default value for W component Same as Vector4, except that constructors have default value for W component
set to one. See also @ref matrix-vector for brief introduction. set to one. See also @ref matrix-vector for brief introduction.
@see Point2D @see Magnum::Point3D, Point2D
@configurationvalueref{Magnum::Math::Point3D} @configurationvalueref{Magnum::Math::Point3D}
*/ */
template<class T> class Point3D: public Vector4<T> { template<class T> class Point3D: public Vector4<T> {

1
src/Math/Vector2.h

@ -28,6 +28,7 @@ namespace Magnum { namespace Math {
@tparam T Data type @tparam T Data type
See @ref matrix-vector for brief introduction. See @ref matrix-vector for brief introduction.
@see Magnum::Vector2
@configurationvalueref{Magnum::Math::Vector2} @configurationvalueref{Magnum::Math::Vector2}
*/ */
template<class T> class Vector2: public Vector<2, T> { template<class T> class Vector2: public Vector<2, T> {

1
src/Math/Vector3.h

@ -29,6 +29,7 @@ namespace Magnum { namespace Math {
See @ref matrix-vector for brief introduction. See also Point2D for See @ref matrix-vector for brief introduction. See also Point2D for
homogeneous two-dimensional coordinates. homogeneous two-dimensional coordinates.
@see Magnum::Vector3
@configurationvalueref{Magnum::Math::Vector3} @configurationvalueref{Magnum::Math::Vector3}
*/ */
template<class T> class Vector3: public Vector<3, T> { template<class T> class Vector3: public Vector<3, T> {

1
src/Math/Vector4.h

@ -29,6 +29,7 @@ namespace Magnum { namespace Math {
See @ref matrix-vector for brief introduction. See also Point3D for See @ref matrix-vector for brief introduction. See also Point3D for
homogeneous three-dimensional coordinates. homogeneous three-dimensional coordinates.
@see Magnum::Vector4
@configurationvalueref{Magnum::Math::Vector4} @configurationvalueref{Magnum::Math::Vector4}
*/ */
template<class T> class Vector4: public Vector<4, T> { template<class T> class Vector4: public Vector<4, T> {

7
src/SceneGraph/Object.h

@ -49,6 +49,13 @@ Base of scene graph. Contains specific transformation implementation, takes
care of parent/children relationship and contains features. See @ref scenegraph care of parent/children relationship and contains features. See @ref scenegraph
for introduction. for introduction.
Common usage is to typedef Object with desired transformation type to save
unnecessary typing later, along with Scene and possibly other types, e.g.:
@code
typedef SceneGraph::Scene<SceneGraph::MatrixTransformation3D<>> Scene3D;
typedef SceneGraph::Object<SceneGraph::MatrixTransformation3D<>> Object3D;
@endcode
Uses Corrade::Containers::LinkedList for parent/children relationship. Uses Corrade::Containers::LinkedList for parent/children relationship.
Traversing through the list is done like in the following code. It is also Traversing through the list is done like in the following code. It is also
possible to go in reverse order using lastChild() and previousSibling(). possible to go in reverse order using lastChild() and previousSibling().

Loading…
Cancel
Save