Browse Source

Trade: removed redundant `inline` keyword.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
777b406840
  1. 28
      src/Trade/AbstractImporter.h
  2. 2
      src/Trade/AbstractMaterialData.h
  3. 10
      src/Trade/ImageData.h
  4. 18
      src/Trade/MeshData2D.h
  5. 24
      src/Trade/MeshData3D.h
  6. 2
      src/Trade/MeshObjectData2D.h
  7. 2
      src/Trade/MeshObjectData3D.h
  8. 8
      src/Trade/ObjectData2D.h
  9. 10
      src/Trade/ObjectData3D.h
  10. 8
      src/Trade/PhongMaterialData.h
  11. 4
      src/Trade/SceneData.h

28
src/Trade/AbstractImporter.h

@ -98,7 +98,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
* Convenience alternative to above function useful when array size is
* known at compile-time.
*/
template<std::size_t size, class T> inline bool openData(const T(&data)[size]) {
template<std::size_t size, class T> bool openData(const T(&data)[size]) {
return openData(data, size*sizeof(T));
}
@ -129,10 +129,10 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
* @note The function is not const, because the value will probably
* be lazy-populated.
*/
virtual inline Int defaultScene() { return -1; }
virtual Int defaultScene() { return -1; }
/** @brief %Scene count */
virtual inline UnsignedInt sceneCount() const { return 0; }
virtual UnsignedInt sceneCount() const { return 0; }
/**
* @brief %Scene ID for given name
@ -160,7 +160,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual SceneData* scene(UnsignedInt id);
/** @brief %Light count */
virtual inline UnsignedInt lightCount() const { return 0; }
virtual UnsignedInt lightCount() const { return 0; }
/**
* @brief %Light ID for given name
@ -188,7 +188,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual LightData* light(UnsignedInt id);
/** @brief Camera count */
virtual inline UnsignedInt cameraCount() const { return 0; }
virtual UnsignedInt cameraCount() const { return 0; }
/**
* @brief Camera ID for given name
@ -216,7 +216,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual CameraData* camera(UnsignedInt id);
/** @brief Two-dimensional object count */
virtual inline UnsignedInt object2DCount() const { return 0; }
virtual UnsignedInt object2DCount() const { return 0; }
/**
* @brief Two-dimensional object ID for given name
@ -244,7 +244,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual ObjectData2D* object2D(UnsignedInt id);
/** @brief Three-dimensional object count */
virtual inline UnsignedInt object3DCount() const { return 0; }
virtual UnsignedInt object3DCount() const { return 0; }
/**
* @brief Three-dimensional object ID for given name
@ -272,7 +272,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual ObjectData3D* object3D(UnsignedInt id);
/** @brief Two-dimensional mesh count */
virtual inline UnsignedInt mesh2DCount() const { return 0; }
virtual UnsignedInt mesh2DCount() const { return 0; }
/**
* @brief Two-dimensional mesh ID for given name
@ -300,7 +300,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual MeshData2D* mesh2D(UnsignedInt id);
/** @brief Three-dimensional mesh count */
virtual inline UnsignedInt mesh3DCount() const { return 0; }
virtual UnsignedInt mesh3DCount() const { return 0; }
/**
* @brief Three-dimensional mesh ID for given name
@ -328,7 +328,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual MeshData3D* mesh3D(UnsignedInt id);
/** @brief Material count */
virtual inline UnsignedInt materialCount() const { return 0; }
virtual UnsignedInt materialCount() const { return 0; }
/**
* @brief Material ID for given name
@ -356,7 +356,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual AbstractMaterialData* material(UnsignedInt id);
/** @brief %Texture count */
virtual inline UnsignedInt textureCount() const { return 0; }
virtual UnsignedInt textureCount() const { return 0; }
/**
* @brief %Texture ID for given name
@ -384,7 +384,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual TextureData* texture(UnsignedInt id);
/** @brief One-dimensional image count */
virtual inline UnsignedInt image1DCount() const { return 0; }
virtual UnsignedInt image1DCount() const { return 0; }
/**
* @brief One-dimensional image ID for given name
@ -412,7 +412,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual ImageData1D* image1D(UnsignedInt id);
/** @brief Two-dimensional image count */
virtual inline UnsignedInt image2DCount() const { return 0; }
virtual UnsignedInt image2DCount() const { return 0; }
/**
* @brief Two-dimensional image ID for given name
@ -440,7 +440,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
virtual ImageData2D* image2D(UnsignedInt id);
/** @brief Three-dimensional image count */
virtual inline UnsignedInt image3DCount() const { return 0; }
virtual UnsignedInt image3DCount() const { return 0; }
/**
* @brief Three-dimensional image ID for given name

2
src/Trade/AbstractMaterialData.h

@ -59,7 +59,7 @@ class MAGNUM_EXPORT AbstractMaterialData {
virtual ~AbstractMaterialData() = 0;
/** @brief Material type */
inline Type type() const { return _type; }
Type type() const { return _type; }
private:
Type _type;

10
src/Trade/ImageData.h

@ -55,17 +55,17 @@ template<UnsignedInt dimensions> class ImageData: public AbstractImage {
* Note that the image data are not copied on construction, but they
* are deleted on class destruction.
*/
inline explicit ImageData(const typename DimensionTraits<Dimensions, Int>::VectorType& size, ImageFormat format, ImageType type, void* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<unsigned char*>(data)) {}
explicit ImageData(const typename DimensionTraits<Dimensions, Int>::VectorType& size, ImageFormat format, ImageType type, void* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<unsigned char*>(data)) {}
/** @brief Destructor */
inline ~ImageData() { delete[] _data; }
~ImageData() { delete[] _data; }
/** @brief %Image size */
inline typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; }
typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; }
/** @brief Pointer to raw data */
inline unsigned char* data() { return _data; }
inline const unsigned char* data() const { return _data; } /**< @overload */
unsigned char* data() { return _data; }
const unsigned char* data() const { return _data; } /**< @overload */
private:
Math::Vector<Dimensions, Int> _size;

18
src/Trade/MeshData2D.h

@ -68,17 +68,17 @@ class MAGNUM_EXPORT MeshData2D {
MeshData2D& operator=(MeshData2D&&);
/** @brief Primitive */
inline Mesh::Primitive primitive() const { return _primitive; }
Mesh::Primitive primitive() const { return _primitive; }
/**
* @brief Indices
* @return Indices or nullptr if the mesh is not indexed.
*/
inline std::vector<UnsignedInt>* indices() { return _indices; }
inline const std::vector<UnsignedInt>* indices() const { return _indices; } /**< @overload */
std::vector<UnsignedInt>* indices() { return _indices; }
const std::vector<UnsignedInt>* indices() const { return _indices; } /**< @overload */
/** @brief Count of vertex position arrays */
inline UnsignedInt positionArrayCount() const { return _positions.size(); }
UnsignedInt positionArrayCount() const { return _positions.size(); }
/**
* @brief Positions
@ -86,11 +86,11 @@ class MAGNUM_EXPORT MeshData2D {
* @return Positions or nullptr if there is no vertex array with given
* ID.
*/
inline std::vector<Vector2>* positions(UnsignedInt id) { return _positions[id]; }
inline const std::vector<Vector2>* positions(UnsignedInt id) const { return _positions[id]; } /**< @overload */
std::vector<Vector2>* positions(UnsignedInt id) { return _positions[id]; }
const std::vector<Vector2>* positions(UnsignedInt id) const { return _positions[id]; } /**< @overload */
/** @brief Count of 2D texture coordinate arrays */
inline UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }
UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }
/**
* @brief 2D texture coordinates
@ -98,8 +98,8 @@ class MAGNUM_EXPORT MeshData2D {
* @return %Texture coordinates or nullptr if there is no texture
* coordinates array with given ID.
*/
inline std::vector<Vector2>* textureCoords2D(UnsignedInt id) { return _textureCoords2D[id]; }
inline const std::vector<Vector2>* textureCoords2D(UnsignedInt id) const { return _textureCoords2D[id]; } /**< @overload */
std::vector<Vector2>* textureCoords2D(UnsignedInt id) { return _textureCoords2D[id]; }
const std::vector<Vector2>* textureCoords2D(UnsignedInt id) const { return _textureCoords2D[id]; } /**< @overload */
private:
Mesh::Primitive _primitive;

24
src/Trade/MeshData3D.h

@ -69,17 +69,17 @@ class MAGNUM_EXPORT MeshData3D {
MeshData3D& operator=(MeshData3D&&);
/** @brief Primitive */
inline Mesh::Primitive primitive() const { return _primitive; }
Mesh::Primitive primitive() const { return _primitive; }
/**
* @brief Indices
* @return Indices or nullptr if the mesh is not indexed.
*/
inline std::vector<UnsignedInt>* indices() { return _indices; }
inline const std::vector<UnsignedInt>* indices() const { return _indices; } /**< @overload */
std::vector<UnsignedInt>* indices() { return _indices; }
const std::vector<UnsignedInt>* indices() const { return _indices; } /**< @overload */
/** @brief Count of vertex position arrays */
inline UnsignedInt positionArrayCount() const { return _positions.size(); }
UnsignedInt positionArrayCount() const { return _positions.size(); }
/**
* @brief Positions
@ -87,11 +87,11 @@ class MAGNUM_EXPORT MeshData3D {
* @return Positions or nullptr if there is no vertex array with given
* ID.
*/
inline std::vector<Vector3>* positions(UnsignedInt id) { return _positions[id]; }
inline const std::vector<Vector3>* positions(UnsignedInt id) const { return _positions[id]; } /**< @overload */
std::vector<Vector3>* positions(UnsignedInt id) { return _positions[id]; }
const std::vector<Vector3>* positions(UnsignedInt id) const { return _positions[id]; } /**< @overload */
/** @brief Count of normal arrays */
inline UnsignedInt normalArrayCount() const { return _normals.size(); }
UnsignedInt normalArrayCount() const { return _normals.size(); }
/**
* @brief Normals
@ -99,11 +99,11 @@ class MAGNUM_EXPORT MeshData3D {
* @return Normals or nullptr if there is no normal array with given
* ID.
*/
inline std::vector<Vector3>* normals(UnsignedInt id) { return _normals[id]; }
inline const std::vector<Vector3>* normals(UnsignedInt id) const { return _normals[id]; } /**< @overload */
std::vector<Vector3>* normals(UnsignedInt id) { return _normals[id]; }
const std::vector<Vector3>* normals(UnsignedInt id) const { return _normals[id]; } /**< @overload */
/** @brief Count of 2D texture coordinate arrays */
inline UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }
UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }
/**
* @brief 2D texture coordinates
@ -111,8 +111,8 @@ class MAGNUM_EXPORT MeshData3D {
* @return %Texture coordinates or nullptr if there is no texture
* coordinates array with given ID.
*/
inline std::vector<Vector2>* textureCoords2D(UnsignedInt id) { return _textureCoords2D[id]; }
inline const std::vector<Vector2>* textureCoords2D(UnsignedInt id) const { return _textureCoords2D[id]; } /**< @overload */
std::vector<Vector2>* textureCoords2D(UnsignedInt id) { return _textureCoords2D[id]; }
const std::vector<Vector2>* textureCoords2D(UnsignedInt id) const { return _textureCoords2D[id]; } /**< @overload */
private:
Mesh::Primitive _primitive;

2
src/Trade/MeshObjectData2D.h

@ -57,7 +57,7 @@ class MAGNUM_EXPORT MeshObjectData2D: public ObjectData2D {
explicit MeshObjectData2D(std::vector<UnsignedInt> children, const Matrix3& transformation, UnsignedInt instance, UnsignedInt material);
/** @brief Material ID */
inline UnsignedInt material() const { return _material; }
UnsignedInt material() const { return _material; }
private:
UnsignedInt _material;

2
src/Trade/MeshObjectData3D.h

@ -57,7 +57,7 @@ class MAGNUM_EXPORT MeshObjectData3D: public ObjectData3D {
explicit MeshObjectData3D(std::vector<UnsignedInt> children, const Matrix4& transformation, UnsignedInt instance, UnsignedInt material);
/** @brief Material ID */
inline UnsignedInt material() const { return _material; }
UnsignedInt material() const { return _material; }
private:
UnsignedInt _material;

8
src/Trade/ObjectData2D.h

@ -76,10 +76,10 @@ class MAGNUM_EXPORT ObjectData2D {
virtual ~ObjectData2D();
/** @brief Child objects */
inline std::vector<UnsignedInt>& children() { return _children; }
std::vector<UnsignedInt>& children() { return _children; }
/** @brief Transformation (relative to parent) */
inline Matrix3 transformation() const { return _transformation; }
Matrix3 transformation() const { return _transformation; }
/**
* @brief Instance type
@ -88,14 +88,14 @@ class MAGNUM_EXPORT ObjectData2D {
* If the instance is of type InstanceType::Mesh, the instance can be
* casted to MeshObjectData2D and provide more information.
*/
inline InstanceType instanceType() const { return _instanceType; }
InstanceType instanceType() const { return _instanceType; }
/**
* @brief Instance ID
* @return ID of given camera / light / mesh etc., specified by
* instanceType()
*/
inline Int instanceId() const { return _instanceId; }
Int instanceId() const { return _instanceId; }
private:
std::vector<UnsignedInt> _children;

10
src/Trade/ObjectData3D.h

@ -74,13 +74,13 @@ class MAGNUM_EXPORT ObjectData3D {
explicit ObjectData3D(std::vector<UnsignedInt> children, const Matrix4& transformation);
/** @brief Destructor */
inline virtual ~ObjectData3D() {}
virtual ~ObjectData3D() {}
/** @brief Child objects */
inline std::vector<UnsignedInt>& children() { return _children; }
std::vector<UnsignedInt>& children() { return _children; }
/** @brief Transformation (relative to parent) */
inline Matrix4 transformation() const { return _transformation; }
Matrix4 transformation() const { return _transformation; }
/**
* @brief Instance type
@ -89,14 +89,14 @@ class MAGNUM_EXPORT ObjectData3D {
* If the instance is of type InstanceType::Mesh, the instance can be
* casted to MeshObjectData3D and provide more information.
*/
inline InstanceType instanceType() const { return _instanceType; }
InstanceType instanceType() const { return _instanceType; }
/**
* @brief Instance ID
* @return ID of given camera / light / mesh etc., specified by
* instanceType()
*/
inline Int instanceId() const { return _instanceId; }
Int instanceId() const { return _instanceId; }
private:
std::vector<UnsignedInt> _children;

8
src/Trade/PhongMaterialData.h

@ -49,16 +49,16 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
explicit PhongMaterialData(const Vector3& ambientColor, const Vector3& diffuseColor, const Vector3& specularColor, Float shininess);
/** @brief Ambient color */
inline Vector3 ambientColor() const { return _ambientColor; }
Vector3 ambientColor() const { return _ambientColor; }
/** @brief Diffuse color */
inline Vector3 diffuseColor() const { return _diffuseColor; }
Vector3 diffuseColor() const { return _diffuseColor; }
/** @brief Specular color */
inline Vector3 specularColor() const { return _specularColor; }
Vector3 specularColor() const { return _specularColor; }
/** @brief Shininess */
inline Float shininess() const { return _shininess; }
Float shininess() const { return _shininess; }
private:
Vector3 _ambientColor,

4
src/Trade/SceneData.h

@ -54,10 +54,10 @@ class MAGNUM_EXPORT SceneData {
explicit SceneData(std::vector<UnsignedInt> children2D, std::vector<UnsignedInt> children3D);
/** @brief Two-dimensional child objects */
inline const std::vector<UnsignedInt>& children2D() const { return _children2D; }
const std::vector<UnsignedInt>& children2D() const { return _children2D; }
/** @brief Three-dimensional child objects */
inline const std::vector<UnsignedInt>& children3D() const { return _children3D; }
const std::vector<UnsignedInt>& children3D() const { return _children3D; }
private:
std::vector<UnsignedInt> _children2D,

Loading…
Cancel
Save