Browse Source

Forward declaration header for Math namespace.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
5ca096512e
  1. 1
      doc/compilation-speedup.dox
  2. 6
      src/AbstractShaderProgram.h
  3. 12
      src/DimensionTraits.h
  4. 18
      src/Magnum.h
  5. 1
      src/Math/CMakeLists.txt
  6. 50
      src/Math/Math.h
  7. 6
      src/TypeTraits.h

1
doc/compilation-speedup.dox

@ -19,6 +19,7 @@ some types it can be too cumbersome -- e.g. too many template parameters,
typedefs etc. In this case a header with forward declarations is usually
available, each namespace has its own:
- Math/Math.h
- Magnum.h
- DebugTools/DebugTools.h
- Physics/Physics.h

6
src/AbstractShaderProgram.h

@ -31,12 +31,6 @@
namespace Magnum {
namespace Math {
template<std::size_t, std::size_t, class> class RectangularMatrix;
template<std::size_t, class> class Matrix;
template<std::size_t, class> class Vector;
}
#ifndef DOXYGEN_GENERATING_OUTPUT
namespace Implementation {
template<class> struct Attribute;

12
src/DimensionTraits.h

@ -23,18 +23,6 @@
namespace Magnum {
namespace Math {
template<std::size_t, class> class Vector;
template<class> class Vector2;
template<class> class Vector3;
template<class> class Point2D;
template<class> class Point3D;
template<class> class Matrix3;
template<class> class Matrix4;
}
/** @brief Matrix, point and vector specializations for given dimension count */
template<std::uint8_t dimensions, class T = GLfloat> struct DimensionTraits {
DimensionTraits() = delete;

18
src/Magnum.h

@ -20,8 +20,10 @@
*/
#include <cstdint>
#include <corradeConfigure.h>
#include "Math/Math.h"
#include "corradeConfigure.h"
#include "magnumConfigure.h"
#ifndef MAGNUM_TARGET_GLES
@ -56,23 +58,9 @@ namespace Corrade {
namespace Magnum {
namespace Math {
template<class> class Vector2;
template<class> class Vector3;
template<class> class Vector4;
template<class> class Point2D;
template<class> class Point3D;
template<class> class Matrix3;
template<class> class Matrix4;
template<class> class Quaternion;
template<class T> constexpr T deg(T value);
template<class T> constexpr T rad(T value);
template<class T> class Constants;
namespace Geometry {
template<class> class Rectangle;
}
}
/* Bring debugging facility from Corrade::Utility namespace */

1
src/Math/CMakeLists.txt

@ -1,6 +1,7 @@
set(MagnumMath_HEADERS
Constants.h
Functions.h
Math.h
MathTypeTraits.h
Matrix.h
Matrix3.h

50
src/Math/Math.h

@ -0,0 +1,50 @@
#ifndef Magnum_Math_Math_h
#define Magnum_Math_Math_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
This file is part of Magnum.
Magnum is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
Magnum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details.
*/
/** @file
* @brief Forward declarations for Magnum::Math namespace
*/
#include <cstddef>
namespace Magnum { namespace Math {
/* Class Constants used only statically */
template<std::size_t, class> class Matrix;
template<class> class Matrix3;
template<class> class Matrix4;
template<class> class Point2D;
template<class> class Point3D;
template<class> class Quaternion;
template<std::size_t, std::size_t, class> class RectangularMatrix;
template<std::size_t, class> class Vector;
template<class> class Vector2;
template<class> class Vector3;
template<class> class Vector4;
namespace Geometry {
template<class> class Rectangle;
}
}}
#endif

6
src/TypeTraits.h

@ -28,12 +28,6 @@
namespace Magnum {
namespace Math {
template<std::size_t, std::size_t, class> class RectangularMatrix;
template<std::size_t, class> class Matrix;
template<std::size_t, class> class Vector;
}
/**
@brief Traits class for plain OpenGL types

Loading…
Cancel
Save