Browse Source

Trade: using new type aliases in whole Trade namespace.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
7af5ff17b6
  1. 170
      src/Trade/AbstractImporter.h
  2. 10
      src/Trade/ImageData.h
  3. 20
      src/Trade/MeshData2D.h
  4. 26
      src/Trade/MeshData3D.h
  5. 6
      src/Trade/MeshObjectData2D.h
  6. 6
      src/Trade/MeshObjectData3D.h
  7. 12
      src/Trade/ObjectData2D.h
  8. 12
      src/Trade/ObjectData3D.h
  9. 6
      src/Trade/PhongMaterialData.h
  10. 8
      src/Trade/SceneData.h
  11. 4
      src/Trade/Trade.h

170
src/Trade/AbstractImporter.h

@ -105,10 +105,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* @note The function is not const, because the value will probably * @note The function is not const, because the value will probably
* be lazy-populated. * be lazy-populated.
*/ */
virtual inline std::int32_t defaultScene() { return -1; } virtual inline Int defaultScene() { return -1; }
/** @brief %Scene count */ /** @brief %Scene count */
virtual inline std::uint32_t sceneCount() const { return 0; } virtual inline UnsignedInt sceneCount() const { return 0; }
/** /**
* @brief %Scene ID for given name * @brief %Scene ID for given name
@ -116,7 +116,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no scene for given name exists, returns -1. * If no scene for given name exists, returns -1.
* @see sceneName() * @see sceneName()
*/ */
virtual std::int32_t sceneForName(const std::string& name); virtual Int sceneForName(const std::string& name);
/** /**
* @brief %Scene name * @brief %Scene name
@ -124,7 +124,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see sceneForName() * @see sceneForName()
*/ */
virtual std::string sceneName(std::uint32_t id); virtual std::string sceneName(UnsignedInt id);
/** /**
* @brief %Scene * @brief %Scene
@ -132,10 +132,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given scene or nullptr, if no such scene exists. * Returns pointer to given scene or nullptr, if no such scene exists.
*/ */
virtual SceneData* scene(std::uint32_t id); virtual SceneData* scene(UnsignedInt id);
/** @brief %Light count */ /** @brief %Light count */
virtual inline std::uint32_t lightCount() const { return 0; } virtual inline UnsignedInt lightCount() const { return 0; }
/** /**
* @brief %Light ID for given name * @brief %Light ID for given name
@ -143,7 +143,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no light for given name exists, returns -1. * If no light for given name exists, returns -1.
* @see lightName() * @see lightName()
*/ */
virtual std::int32_t lightForName(const std::string& name); virtual Int lightForName(const std::string& name);
/** /**
* @brief %Light name * @brief %Light name
@ -151,7 +151,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see lightForName() * @see lightForName()
*/ */
virtual std::string lightName(std::uint32_t id); virtual std::string lightName(UnsignedInt id);
/** /**
* @brief %Light * @brief %Light
@ -159,10 +159,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given light or nullptr, if no such light exists. * Returns pointer to given light or nullptr, if no such light exists.
*/ */
virtual LightData* light(std::uint32_t id); virtual LightData* light(UnsignedInt id);
/** @brief Camera count */ /** @brief Camera count */
virtual inline std::uint32_t cameraCount() const { return 0; } virtual inline UnsignedInt cameraCount() const { return 0; }
/** /**
* @brief Camera ID for given name * @brief Camera ID for given name
@ -170,7 +170,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no camera for given name exists, returns -1. * If no camera for given name exists, returns -1.
* @see cameraName() * @see cameraName()
*/ */
virtual std::int32_t cameraForName(const std::string& name); virtual Int cameraForName(const std::string& name);
/** /**
* @brief Camera name * @brief Camera name
@ -178,7 +178,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see cameraForName() * @see cameraForName()
*/ */
virtual std::string cameraName(std::uint32_t id); virtual std::string cameraName(UnsignedInt id);
/** /**
* @brief Camera * @brief Camera
@ -187,10 +187,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given camera or nullptr, if no such camera * Returns pointer to given camera or nullptr, if no such camera
* exists. * exists.
*/ */
virtual CameraData* camera(std::uint32_t id); virtual CameraData* camera(UnsignedInt id);
/** @brief Two-dimensional object count */ /** @brief Two-dimensional object count */
virtual inline std::uint32_t object2DCount() const { return 0; } virtual inline UnsignedInt object2DCount() const { return 0; }
/** /**
* @brief Two-dimensional object ID for given name * @brief Two-dimensional object ID for given name
@ -198,7 +198,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no scene for given name exists, returns -1. * If no scene for given name exists, returns -1.
* @see object2DName() * @see object2DName()
*/ */
virtual std::int32_t object2DForName(const std::string& name); virtual Int object2DForName(const std::string& name);
/** /**
* @brief Two-dimensional object name * @brief Two-dimensional object name
@ -206,7 +206,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see object2DForName() * @see object2DForName()
*/ */
virtual std::string object2DName(std::uint32_t id); virtual std::string object2DName(UnsignedInt id);
/** /**
* @brief Two-dimensional object * @brief Two-dimensional object
@ -215,10 +215,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given object or nullptr, if no such object * Returns pointer to given object or nullptr, if no such object
* exists. * exists.
*/ */
virtual ObjectData2D* object2D(std::uint32_t id); virtual ObjectData2D* object2D(UnsignedInt id);
/** @brief Three-dimensional object count */ /** @brief Three-dimensional object count */
virtual inline std::uint32_t object3DCount() const { return 0; } virtual inline UnsignedInt object3DCount() const { return 0; }
/** /**
* @brief Three-dimensional object ID for given name * @brief Three-dimensional object ID for given name
@ -226,7 +226,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no scene for given name exists, returns -1. * If no scene for given name exists, returns -1.
* @see object3DName() * @see object3DName()
*/ */
virtual std::int32_t object3DForName(const std::string& name); virtual Int object3DForName(const std::string& name);
/** /**
* @brief Three-dimensional object name * @brief Three-dimensional object name
@ -234,7 +234,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see object3DForName() * @see object3DForName()
*/ */
virtual std::string object3DName(std::uint32_t id); virtual std::string object3DName(UnsignedInt id);
/** /**
* @brief Three-dimensional object * @brief Three-dimensional object
@ -243,10 +243,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given object or nullptr, if no such object * Returns pointer to given object or nullptr, if no such object
* exists. * exists.
*/ */
virtual ObjectData3D* object3D(std::uint32_t id); virtual ObjectData3D* object3D(UnsignedInt id);
/** @brief Two-dimensional mesh count */ /** @brief Two-dimensional mesh count */
virtual inline std::uint32_t mesh2DCount() const { return 0; } virtual inline UnsignedInt mesh2DCount() const { return 0; }
/** /**
* @brief Two-dimensional mesh ID for given name * @brief Two-dimensional mesh ID for given name
@ -254,7 +254,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no mesh for given name exists, returns -1. * If no mesh for given name exists, returns -1.
* @see mesh2DName() * @see mesh2DName()
*/ */
virtual std::int32_t mesh2DForName(const std::string& name); virtual Int mesh2DForName(const std::string& name);
/** /**
* @brief Two-dimensional mesh name * @brief Two-dimensional mesh name
@ -262,7 +262,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see mesh2DForName() * @see mesh2DForName()
*/ */
virtual std::string mesh2DName(std::uint32_t id); virtual std::string mesh2DName(UnsignedInt id);
/** /**
* @brief Two-dimensional mesh * @brief Two-dimensional mesh
@ -270,10 +270,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given mesh or nullptr, if no such mesh exists. * Returns pointer to given mesh or nullptr, if no such mesh exists.
*/ */
virtual MeshData2D* mesh2D(std::uint32_t id); virtual MeshData2D* mesh2D(UnsignedInt id);
/** @brief Three-dimensional mesh count */ /** @brief Three-dimensional mesh count */
virtual inline std::uint32_t mesh3DCount() const { return 0; } virtual inline UnsignedInt mesh3DCount() const { return 0; }
/** /**
* @brief Three-dimensional mesh ID for given name * @brief Three-dimensional mesh ID for given name
@ -281,7 +281,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no mesh for given name exists, returns -1. * If no mesh for given name exists, returns -1.
* @see mesh3DName() * @see mesh3DName()
*/ */
virtual std::int32_t mesh3DForName(const std::string& name); virtual Int mesh3DForName(const std::string& name);
/** /**
* @brief Three-dimensional mesh name * @brief Three-dimensional mesh name
@ -289,7 +289,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see mesh3DForName() * @see mesh3DForName()
*/ */
virtual std::string mesh3DName(std::uint32_t id); virtual std::string mesh3DName(UnsignedInt id);
/** /**
* @brief Three-dimensional mesh * @brief Three-dimensional mesh
@ -297,10 +297,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given mesh or nullptr, if no such mesh exists. * Returns pointer to given mesh or nullptr, if no such mesh exists.
*/ */
virtual MeshData3D* mesh3D(std::uint32_t id); virtual MeshData3D* mesh3D(UnsignedInt id);
/** @brief Material count */ /** @brief Material count */
virtual inline std::uint32_t materialCount() const { return 0; } virtual inline UnsignedInt materialCount() const { return 0; }
/** /**
* @brief Material ID for given name * @brief Material ID for given name
@ -308,7 +308,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no material for given name exists, returns -1. * If no material for given name exists, returns -1.
* @see materialName() * @see materialName()
*/ */
virtual std::int32_t materialForName(const std::string& name); virtual Int materialForName(const std::string& name);
/** /**
* @brief Material name * @brief Material name
@ -316,7 +316,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see materialForName() * @see materialForName()
*/ */
virtual std::string materialName(std::uint32_t id); virtual std::string materialName(UnsignedInt id);
/** /**
* @brief Material * @brief Material
@ -325,10 +325,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given material or nullptr, if no such material * Returns pointer to given material or nullptr, if no such material
* exists. * exists.
*/ */
virtual AbstractMaterialData* material(std::uint32_t id); virtual AbstractMaterialData* material(UnsignedInt id);
/** @brief %Texture count */ /** @brief %Texture count */
virtual inline std::uint32_t textureCount() const { return 0; } virtual inline UnsignedInt textureCount() const { return 0; }
/** /**
* @brief %Texture ID for given name * @brief %Texture ID for given name
@ -336,7 +336,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no texture for given name exists, returns -1. * If no texture for given name exists, returns -1.
* @see textureName() * @see textureName()
*/ */
virtual std::int32_t textureForName(const std::string& name); virtual Int textureForName(const std::string& name);
/** /**
* @brief %Texture name * @brief %Texture name
@ -344,7 +344,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see textureForName() * @see textureForName()
*/ */
virtual std::string textureName(std::uint32_t id); virtual std::string textureName(UnsignedInt id);
/** /**
* @brief %Texture * @brief %Texture
@ -353,10 +353,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given texture or nullptr, if no such texture * Returns pointer to given texture or nullptr, if no such texture
* exists. * exists.
*/ */
virtual TextureData* texture(std::uint32_t id); virtual TextureData* texture(UnsignedInt id);
/** @brief One-dimensional image count */ /** @brief One-dimensional image count */
virtual inline std::uint32_t image1DCount() const { return 0; } virtual inline UnsignedInt image1DCount() const { return 0; }
/** /**
* @brief One-dimensional image ID for given name * @brief One-dimensional image ID for given name
@ -364,7 +364,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no image for given name exists, returns -1. * If no image for given name exists, returns -1.
* @see image1Dname() * @see image1Dname()
*/ */
virtual std::int32_t image1DForName(const std::string& name); virtual Int image1DForName(const std::string& name);
/** /**
* @brief One-dimensional image name * @brief One-dimensional image name
@ -372,7 +372,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see image1DForName() * @see image1DForName()
*/ */
virtual std::string image1DName(std::uint32_t id); virtual std::string image1DName(UnsignedInt id);
/** /**
* @brief One-dimensional image * @brief One-dimensional image
@ -380,10 +380,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given image or nullptr, if no such image exists. * Returns pointer to given image or nullptr, if no such image exists.
*/ */
virtual ImageData1D* image1D(std::uint32_t id); virtual ImageData1D* image1D(UnsignedInt id);
/** @brief Two-dimensional image count */ /** @brief Two-dimensional image count */
virtual inline std::uint32_t image2DCount() const { return 0; } virtual inline UnsignedInt image2DCount() const { return 0; }
/** /**
* @brief Two-dimensional image ID for given name * @brief Two-dimensional image ID for given name
@ -391,7 +391,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no image for given name exists, returns -1. * If no image for given name exists, returns -1.
* @see image2DName() * @see image2DName()
*/ */
virtual std::int32_t image2DForName(const std::string& name); virtual Int image2DForName(const std::string& name);
/** /**
* @brief Two-dimensional image name * @brief Two-dimensional image name
@ -399,7 +399,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see image2DForName() * @see image2DForName()
*/ */
virtual std::string image2DName(std::uint32_t id); virtual std::string image2DName(UnsignedInt id);
/** /**
* @brief Two-dimensional image * @brief Two-dimensional image
@ -407,10 +407,10 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given image or nullptr, if no such image exists. * Returns pointer to given image or nullptr, if no such image exists.
*/ */
virtual ImageData2D* image2D(std::uint32_t id); virtual ImageData2D* image2D(UnsignedInt id);
/** @brief Three-dimensional image count */ /** @brief Three-dimensional image count */
virtual inline std::uint32_t image3DCount() const { return 0; } virtual inline UnsignedInt image3DCount() const { return 0; }
/** /**
* @brief Three-dimensional image ID for given name * @brief Three-dimensional image ID for given name
@ -418,7 +418,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no image for given name exists, returns -1. * If no image for given name exists, returns -1.
* @see image3DName() * @see image3DName()
*/ */
virtual std::int32_t image3DForName(const std::string& name); virtual Int image3DForName(const std::string& name);
/** /**
* @brief Three-dimensional image name * @brief Three-dimensional image name
@ -426,7 +426,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* @see image3DForName() * @see image3DForName()
*/ */
virtual std::string image3DName(std::uint32_t id); virtual std::string image3DName(UnsignedInt id);
/** /**
* @brief Three-dimensional image * @brief Three-dimensional image
@ -434,7 +434,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* *
* Returns pointer to given image or nullptr, if no such image exists. * Returns pointer to given image or nullptr, if no such image exists.
*/ */
virtual ImageData3D* image3D(std::uint32_t id); virtual ImageData3D* image3D(UnsignedInt id);
/*@}*/ /*@}*/
}; };
@ -442,42 +442,42 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
CORRADE_ENUMSET_OPERATORS(AbstractImporter::Features) CORRADE_ENUMSET_OPERATORS(AbstractImporter::Features)
/* Implementations for inline functions with unused parameters */ /* Implementations for inline functions with unused parameters */
inline std::int32_t AbstractImporter::sceneForName(const std::string&) { return -1; } inline Int AbstractImporter::sceneForName(const std::string&) { return -1; }
inline std::string AbstractImporter::sceneName(std::uint32_t) { return {}; } inline std::string AbstractImporter::sceneName(UnsignedInt) { return {}; }
inline SceneData* AbstractImporter::scene(std::uint32_t) { return nullptr; } inline SceneData* AbstractImporter::scene(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::lightForName(const std::string&) { return -1; } inline Int AbstractImporter::lightForName(const std::string&) { return -1; }
inline std::string AbstractImporter::lightName(std::uint32_t) { return {}; } inline std::string AbstractImporter::lightName(UnsignedInt) { return {}; }
inline LightData* AbstractImporter::light(std::uint32_t) { return nullptr; } inline LightData* AbstractImporter::light(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::cameraForName(const std::string&) { return -1; } inline Int AbstractImporter::cameraForName(const std::string&) { return -1; }
inline std::string AbstractImporter::cameraName(std::uint32_t) { return {}; } inline std::string AbstractImporter::cameraName(UnsignedInt) { return {}; }
inline CameraData* AbstractImporter::camera(std::uint32_t) { return nullptr; } inline CameraData* AbstractImporter::camera(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::object2DForName(const std::string&) { return -1; } inline Int AbstractImporter::object2DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::object2DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::object2DName(UnsignedInt) { return {}; }
inline ObjectData2D* AbstractImporter::object2D(std::uint32_t) { return nullptr; } inline ObjectData2D* AbstractImporter::object2D(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::object3DForName(const std::string&) { return -1; } inline Int AbstractImporter::object3DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::object3DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::object3DName(UnsignedInt) { return {}; }
inline ObjectData3D* AbstractImporter::object3D(std::uint32_t) { return nullptr; } inline ObjectData3D* AbstractImporter::object3D(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::mesh2DForName(const std::string&) { return -1; } inline Int AbstractImporter::mesh2DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::mesh2DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::mesh2DName(UnsignedInt) { return {}; }
inline MeshData2D* AbstractImporter::mesh2D(std::uint32_t) { return nullptr; } inline MeshData2D* AbstractImporter::mesh2D(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::mesh3DForName(const std::string&) { return -1; } inline Int AbstractImporter::mesh3DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::mesh3DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::mesh3DName(UnsignedInt) { return {}; }
inline MeshData3D* AbstractImporter::mesh3D(std::uint32_t) { return nullptr; } inline MeshData3D* AbstractImporter::mesh3D(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::materialForName(const std::string&) { return -1; } inline Int AbstractImporter::materialForName(const std::string&) { return -1; }
inline std::string AbstractImporter::materialName(std::uint32_t) { return {}; } inline std::string AbstractImporter::materialName(UnsignedInt) { return {}; }
inline AbstractMaterialData* AbstractImporter::material(std::uint32_t) { return nullptr; } inline AbstractMaterialData* AbstractImporter::material(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::textureForName(const std::string&) { return -1; } inline Int AbstractImporter::textureForName(const std::string&) { return -1; }
inline std::string AbstractImporter::textureName(std::uint32_t) { return {}; } inline std::string AbstractImporter::textureName(UnsignedInt) { return {}; }
inline TextureData* AbstractImporter::texture(std::uint32_t) { return nullptr; } inline TextureData* AbstractImporter::texture(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::image1DForName(const std::string&) { return -1; } inline Int AbstractImporter::image1DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::image1DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::image1DName(UnsignedInt) { return {}; }
inline ImageData1D* AbstractImporter::image1D(std::uint32_t) { return nullptr; } inline ImageData1D* AbstractImporter::image1D(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::image2DForName(const std::string&) { return -1; } inline Int AbstractImporter::image2DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::image2DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::image2DName(UnsignedInt) { return {}; }
inline ImageData2D* AbstractImporter::image2D(std::uint32_t) { return nullptr; } inline ImageData2D* AbstractImporter::image2D(UnsignedInt) { return nullptr; }
inline std::int32_t AbstractImporter::image3DForName(const std::string&) { return -1; } inline Int AbstractImporter::image3DForName(const std::string&) { return -1; }
inline std::string AbstractImporter::image3DName(std::uint32_t) { return {}; } inline std::string AbstractImporter::image3DName(UnsignedInt) { return {}; }
inline ImageData3D* AbstractImporter::image3D(std::uint32_t) { return nullptr; } inline ImageData3D* AbstractImporter::image3D(UnsignedInt) { return nullptr; }
}} }}

10
src/Trade/ImageData.h

@ -32,9 +32,9 @@ Access to image data provided by AbstractImporter subclasses. Interchangeable
with Image, ImageWrapper or BufferImage. with Image, ImageWrapper or BufferImage.
@see ImageData1D, ImageData2D, ImageData3D @see ImageData1D, ImageData2D, ImageData3D
*/ */
template<std::uint8_t dimensions> class ImageData: public AbstractImage { template<UnsignedInt dimensions> class ImageData: public AbstractImage {
public: public:
const static std::uint8_t Dimensions = dimensions; /**< @brief %Image dimension count */ const static UnsignedInt Dimensions = dimensions; /**< @brief %Image dimension count */
/** /**
* @brief Constructor * @brief Constructor
@ -46,20 +46,20 @@ template<std::uint8_t dimensions> class ImageData: public AbstractImage {
* Note that the image data are not copied on construction, but they * Note that the image data are not copied on construction, but they
* are deleted on class destruction. * are deleted on class destruction.
*/ */
inline ImageData(const typename DimensionTraits<Dimensions, GLsizei>::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<char*>(data)) {} inline ImageData(const typename DimensionTraits<Dimensions, Int>::VectorType& size, Format format, Type type, GLvoid* data): AbstractImage(format, type), _size(size), _data(reinterpret_cast<char*>(data)) {}
/** @brief Destructor */ /** @brief Destructor */
inline ~ImageData() { delete[] _data; } inline ~ImageData() { delete[] _data; }
/** @brief %Image size */ /** @brief %Image size */
inline typename DimensionTraits<Dimensions, GLsizei>::VectorType size() const { return _size; } inline typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; }
/** @brief Pointer to raw data */ /** @brief Pointer to raw data */
inline void* data() { return _data; } inline void* data() { return _data; }
inline const void* data() const { return _data; } /**< @overload */ inline const void* data() const { return _data; } /**< @overload */
private: private:
Math::Vector<Dimensions, GLsizei> _size; Math::Vector<Dimensions, Int> _size;
char* _data; char* _data;
}; };

20
src/Trade/MeshData2D.h

@ -47,7 +47,7 @@ class MAGNUM_EXPORT MeshData2D {
* @param textureCoords2D Array with two-dimensional texture * @param textureCoords2D Array with two-dimensional texture
* coordinate arrays or empty array * coordinate arrays or empty array
*/ */
inline MeshData2D(Mesh::Primitive primitive, std::vector<std::uint32_t>* indices, std::vector<std::vector<Vector2>*> positions, std::vector<std::vector<Vector2>*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(positions), _textureCoords2D(textureCoords2D) {} inline MeshData2D(Mesh::Primitive primitive, std::vector<UnsignedInt>* indices, std::vector<std::vector<Vector2>*> positions, std::vector<std::vector<Vector2>*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(positions), _textureCoords2D(textureCoords2D) {}
/** @brief Move constructor */ /** @brief Move constructor */
MeshData2D(MeshData2D&&) = default; MeshData2D(MeshData2D&&) = default;
@ -65,11 +65,11 @@ class MAGNUM_EXPORT MeshData2D {
* @brief Indices * @brief Indices
* @return Indices or nullptr if the mesh is not indexed. * @return Indices or nullptr if the mesh is not indexed.
*/ */
inline std::vector<std::uint32_t>* indices() { return _indices; } inline std::vector<UnsignedInt>* indices() { return _indices; }
inline const std::vector<std::uint32_t>* indices() const { return _indices; } /**< @overload */ inline const std::vector<UnsignedInt>* indices() const { return _indices; } /**< @overload */
/** @brief Count of vertex position arrays */ /** @brief Count of vertex position arrays */
inline std::uint32_t positionArrayCount() const { return _positions.size(); } inline UnsignedInt positionArrayCount() const { return _positions.size(); }
/** /**
* @brief Positions * @brief Positions
@ -77,11 +77,11 @@ class MAGNUM_EXPORT MeshData2D {
* @return Positions or nullptr if there is no vertex array with given * @return Positions or nullptr if there is no vertex array with given
* ID. * ID.
*/ */
inline std::vector<Vector2>* positions(std::uint32_t id) { return _positions[id]; } inline std::vector<Vector2>* positions(UnsignedInt id) { return _positions[id]; }
inline const std::vector<Vector2>* positions(std::uint32_t id) const { return _positions[id]; } /**< @overload */ inline const std::vector<Vector2>* positions(UnsignedInt id) const { return _positions[id]; } /**< @overload */
/** @brief Count of 2D texture coordinate arrays */ /** @brief Count of 2D texture coordinate arrays */
inline std::uint32_t textureCoords2DArrayCount() const { return _textureCoords2D.size(); } inline UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }
/** /**
* @brief 2D texture coordinates * @brief 2D texture coordinates
@ -89,12 +89,12 @@ class MAGNUM_EXPORT MeshData2D {
* @return %Texture coordinates or nullptr if there is no texture * @return %Texture coordinates or nullptr if there is no texture
* coordinates array with given ID. * coordinates array with given ID.
*/ */
inline std::vector<Vector2>* textureCoords2D(std::uint32_t id) { return _textureCoords2D[id]; } inline std::vector<Vector2>* textureCoords2D(UnsignedInt id) { return _textureCoords2D[id]; }
inline const std::vector<Vector2>* textureCoords2D(std::uint32_t id) const { return _textureCoords2D[id]; } /**< @overload */ inline const std::vector<Vector2>* textureCoords2D(UnsignedInt id) const { return _textureCoords2D[id]; } /**< @overload */
private: private:
Mesh::Primitive _primitive; Mesh::Primitive _primitive;
std::vector<std::uint32_t>* _indices; std::vector<UnsignedInt>* _indices;
std::vector<std::vector<Vector2>*> _positions; std::vector<std::vector<Vector2>*> _positions;
std::vector<std::vector<Vector2>*> _textureCoords2D; std::vector<std::vector<Vector2>*> _textureCoords2D;
}; };

26
src/Trade/MeshData3D.h

@ -48,7 +48,7 @@ class MAGNUM_EXPORT MeshData3D {
* @param textureCoords2D Array with two-dimensional texture * @param textureCoords2D Array with two-dimensional texture
* coordinate arrays or empty array * coordinate arrays or empty array
*/ */
inline MeshData3D(Mesh::Primitive primitive, std::vector<std::uint32_t>* indices, std::vector<std::vector<Vector3>*> positions, std::vector<std::vector<Vector3>*> normals, std::vector<std::vector<Vector2>*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(positions), _normals(normals), _textureCoords2D(textureCoords2D) {} inline MeshData3D(Mesh::Primitive primitive, std::vector<UnsignedInt>* indices, std::vector<std::vector<Vector3>*> positions, std::vector<std::vector<Vector3>*> normals, std::vector<std::vector<Vector2>*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(positions), _normals(normals), _textureCoords2D(textureCoords2D) {}
/** @brief Move constructor */ /** @brief Move constructor */
MeshData3D(MeshData3D&&) = default; MeshData3D(MeshData3D&&) = default;
@ -66,11 +66,11 @@ class MAGNUM_EXPORT MeshData3D {
* @brief Indices * @brief Indices
* @return Indices or nullptr if the mesh is not indexed. * @return Indices or nullptr if the mesh is not indexed.
*/ */
inline std::vector<std::uint32_t>* indices() { return _indices; } inline std::vector<UnsignedInt>* indices() { return _indices; }
inline const std::vector<std::uint32_t>* indices() const { return _indices; } /**< @overload */ inline const std::vector<UnsignedInt>* indices() const { return _indices; } /**< @overload */
/** @brief Count of vertex position arrays */ /** @brief Count of vertex position arrays */
inline std::uint32_t positionArrayCount() const { return _positions.size(); } inline UnsignedInt positionArrayCount() const { return _positions.size(); }
/** /**
* @brief Positions * @brief Positions
@ -78,11 +78,11 @@ class MAGNUM_EXPORT MeshData3D {
* @return Positions or nullptr if there is no vertex array with given * @return Positions or nullptr if there is no vertex array with given
* ID. * ID.
*/ */
inline std::vector<Vector3>* positions(std::uint32_t id) { return _positions[id]; } inline std::vector<Vector3>* positions(UnsignedInt id) { return _positions[id]; }
inline const std::vector<Vector3>* positions(std::uint32_t id) const { return _positions[id]; } /**< @overload */ inline const std::vector<Vector3>* positions(UnsignedInt id) const { return _positions[id]; } /**< @overload */
/** @brief Count of normal arrays */ /** @brief Count of normal arrays */
inline std::uint32_t normalArrayCount() const { return _normals.size(); } inline UnsignedInt normalArrayCount() const { return _normals.size(); }
/** /**
* @brief Normals * @brief Normals
@ -90,11 +90,11 @@ class MAGNUM_EXPORT MeshData3D {
* @return Normals or nullptr if there is no normal array with given * @return Normals or nullptr if there is no normal array with given
* ID. * ID.
*/ */
inline std::vector<Vector3>* normals(std::uint32_t id) { return _normals[id]; } inline std::vector<Vector3>* normals(UnsignedInt id) { return _normals[id]; }
inline const std::vector<Vector3>* normals(std::uint32_t id) const { return _normals[id]; } /**< @overload */ inline const std::vector<Vector3>* normals(UnsignedInt id) const { return _normals[id]; } /**< @overload */
/** @brief Count of 2D texture coordinate arrays */ /** @brief Count of 2D texture coordinate arrays */
inline std::uint32_t textureCoords2DArrayCount() const { return _textureCoords2D.size(); } inline UnsignedInt textureCoords2DArrayCount() const { return _textureCoords2D.size(); }
/** /**
* @brief 2D texture coordinates * @brief 2D texture coordinates
@ -102,12 +102,12 @@ class MAGNUM_EXPORT MeshData3D {
* @return %Texture coordinates or nullptr if there is no texture * @return %Texture coordinates or nullptr if there is no texture
* coordinates array with given ID. * coordinates array with given ID.
*/ */
inline std::vector<Vector2>* textureCoords2D(std::uint32_t id) { return _textureCoords2D[id]; } inline std::vector<Vector2>* textureCoords2D(UnsignedInt id) { return _textureCoords2D[id]; }
inline const std::vector<Vector2>* textureCoords2D(std::uint32_t id) const { return _textureCoords2D[id]; } /**< @overload */ inline const std::vector<Vector2>* textureCoords2D(UnsignedInt id) const { return _textureCoords2D[id]; } /**< @overload */
private: private:
Mesh::Primitive _primitive; Mesh::Primitive _primitive;
std::vector<std::uint32_t>* _indices; std::vector<UnsignedInt>* _indices;
std::vector<std::vector<Vector3>*> _positions; std::vector<std::vector<Vector3>*> _positions;
std::vector<std::vector<Vector3>*> _normals; std::vector<std::vector<Vector3>*> _normals;
std::vector<std::vector<Vector2>*> _textureCoords2D; std::vector<std::vector<Vector2>*> _textureCoords2D;

6
src/Trade/MeshObjectData2D.h

@ -45,13 +45,13 @@ class MeshObjectData2D: public ObjectData2D {
* *
* Creates object with mesh instance type. * Creates object with mesh instance type.
*/ */
inline MeshObjectData2D(const std::vector<std::uint32_t>& children, const Matrix4& transformation, std::uint32_t instance, std::uint32_t material): ObjectData2D(children, transformation, InstanceType::Mesh, instance), _material(material) {} inline MeshObjectData2D(const std::vector<UnsignedInt>& children, const Matrix4& transformation, UnsignedInt instance, UnsignedInt material): ObjectData2D(children, transformation, InstanceType::Mesh, instance), _material(material) {}
/** @brief Material ID */ /** @brief Material ID */
inline std::uint32_t material() const { return _material; } inline UnsignedInt material() const { return _material; }
private: private:
std::uint32_t _material; UnsignedInt _material;
}; };
}} }}

6
src/Trade/MeshObjectData3D.h

@ -45,13 +45,13 @@ class MeshObjectData3D: public ObjectData3D {
* *
* Creates object with mesh instance type. * Creates object with mesh instance type.
*/ */
inline MeshObjectData3D(const std::vector<std::uint32_t>& children, const Matrix4& transformation, std::uint32_t instance, std::uint32_t material): ObjectData3D(children, transformation, InstanceType::Mesh, instance), _material(material) {} inline MeshObjectData3D(const std::vector<UnsignedInt>& children, const Matrix4& transformation, UnsignedInt instance, UnsignedInt material): ObjectData3D(children, transformation, InstanceType::Mesh, instance), _material(material) {}
/** @brief Material ID */ /** @brief Material ID */
inline std::uint32_t material() const { return _material; } inline UnsignedInt material() const { return _material; }
private: private:
std::uint32_t _material; UnsignedInt _material;
}; };
}} }}

12
src/Trade/ObjectData2D.h

@ -54,20 +54,20 @@ class ObjectData2D {
* @param instanceType Instance type * @param instanceType Instance type
* @param instanceId Instance ID * @param instanceId Instance ID
*/ */
inline ObjectData2D(const std::vector<std::uint32_t>& children, const Matrix3& transformation, InstanceType instanceType, std::uint32_t instanceId): _children(children), _transformation(transformation), _instanceType(instanceType), _instanceId(instanceId) {} inline ObjectData2D(const std::vector<UnsignedInt>& children, const Matrix3& transformation, InstanceType instanceType, UnsignedInt instanceId): _children(children), _transformation(transformation), _instanceType(instanceType), _instanceId(instanceId) {}
/** /**
* @brief Constructor for empty instance * @brief Constructor for empty instance
* @param children Child objects * @param children Child objects
* @param transformation Transformation (relative to parent) * @param transformation Transformation (relative to parent)
*/ */
inline ObjectData2D(const std::vector<std::uint32_t>& children, const Matrix3& transformation): _children(children), _transformation(transformation), _instanceType(InstanceType::Empty), _instanceId(-1) {} inline ObjectData2D(const std::vector<UnsignedInt>& children, const Matrix3& transformation): _children(children), _transformation(transformation), _instanceType(InstanceType::Empty), _instanceId(-1) {}
/** @brief Destructor */ /** @brief Destructor */
inline virtual ~ObjectData2D() {} inline virtual ~ObjectData2D() {}
/** @brief Child objects */ /** @brief Child objects */
inline std::vector<std::uint32_t>& children() { return _children; } inline std::vector<UnsignedInt>& children() { return _children; }
/** @brief Transformation (relative to parent) */ /** @brief Transformation (relative to parent) */
inline Matrix3 transformation() const { return _transformation; } inline Matrix3 transformation() const { return _transformation; }
@ -86,13 +86,13 @@ class ObjectData2D {
* @return ID of given camera / light / mesh etc., specified by * @return ID of given camera / light / mesh etc., specified by
* instanceType() * instanceType()
*/ */
inline std::int32_t instanceId() const { return _instanceId; } inline Int instanceId() const { return _instanceId; }
private: private:
std::vector<std::uint32_t> _children; std::vector<UnsignedInt> _children;
Matrix3 _transformation; Matrix3 _transformation;
InstanceType _instanceType; InstanceType _instanceType;
std::int32_t _instanceId; Int _instanceId;
}; };
/** @debugoperator{Magnum::Trade::ObjectData2D} */ /** @debugoperator{Magnum::Trade::ObjectData2D} */

12
src/Trade/ObjectData3D.h

@ -55,20 +55,20 @@ class ObjectData3D {
* @param instanceType Instance type * @param instanceType Instance type
* @param instanceId Instance ID * @param instanceId Instance ID
*/ */
inline ObjectData3D(const std::vector<std::uint32_t>& children, const Matrix4& transformation, InstanceType instanceType, std::uint32_t instanceId): _children(children), _transformation(transformation), _instanceType(instanceType), _instanceId(instanceId) {} inline ObjectData3D(const std::vector<UnsignedInt>& children, const Matrix4& transformation, InstanceType instanceType, UnsignedInt instanceId): _children(children), _transformation(transformation), _instanceType(instanceType), _instanceId(instanceId) {}
/** /**
* @brief Constructor for empty instance * @brief Constructor for empty instance
* @param children Child objects * @param children Child objects
* @param transformation Transformation (relative to parent) * @param transformation Transformation (relative to parent)
*/ */
inline ObjectData3D(const std::vector<std::uint32_t>& children, const Matrix4& transformation): _children(children), _transformation(transformation), _instanceType(InstanceType::Empty), _instanceId(-1) {} inline ObjectData3D(const std::vector<UnsignedInt>& children, const Matrix4& transformation): _children(children), _transformation(transformation), _instanceType(InstanceType::Empty), _instanceId(-1) {}
/** @brief Destructor */ /** @brief Destructor */
inline virtual ~ObjectData3D() {} inline virtual ~ObjectData3D() {}
/** @brief Child objects */ /** @brief Child objects */
inline std::vector<std::uint32_t>& children() { return _children; } inline std::vector<UnsignedInt>& children() { return _children; }
/** @brief Transformation (relative to parent) */ /** @brief Transformation (relative to parent) */
inline Matrix4 transformation() const { return _transformation; } inline Matrix4 transformation() const { return _transformation; }
@ -87,13 +87,13 @@ class ObjectData3D {
* @return ID of given camera / light / mesh etc., specified by * @return ID of given camera / light / mesh etc., specified by
* instanceType() * instanceType()
*/ */
inline std::int32_t instanceId() const { return _instanceId; } inline Int instanceId() const { return _instanceId; }
private: private:
std::vector<std::uint32_t> _children; std::vector<UnsignedInt> _children;
Matrix4 _transformation; Matrix4 _transformation;
InstanceType _instanceType; InstanceType _instanceType;
std::int32_t _instanceId; Int _instanceId;
}; };
/** @debugoperator{Magnum::Trade::ObjectData3D} */ /** @debugoperator{Magnum::Trade::ObjectData3D} */

6
src/Trade/PhongMaterialData.h

@ -37,7 +37,7 @@ class PhongMaterialData: public AbstractMaterialData {
* @param specularColor Specular color * @param specularColor Specular color
* @param shininess Shininess * @param shininess Shininess
*/ */
PhongMaterialData(const Vector3& ambientColor, const Vector3& diffuseColor, const Vector3& specularColor, GLfloat shininess): AbstractMaterialData(Phong), _ambientColor(ambientColor), _diffuseColor(diffuseColor), _specularColor(specularColor), _shininess(shininess) {} PhongMaterialData(const Vector3& ambientColor, const Vector3& diffuseColor, const Vector3& specularColor, Float shininess): AbstractMaterialData(Phong), _ambientColor(ambientColor), _diffuseColor(diffuseColor), _specularColor(specularColor), _shininess(shininess) {}
/** @brief Ambient color */ /** @brief Ambient color */
inline Vector3 ambientColor() const { return _ambientColor; } inline Vector3 ambientColor() const { return _ambientColor; }
@ -49,13 +49,13 @@ class PhongMaterialData: public AbstractMaterialData {
inline Vector3 specularColor() const { return _specularColor; } inline Vector3 specularColor() const { return _specularColor; }
/** @brief Shininess */ /** @brief Shininess */
inline GLfloat shininess() const { return _shininess; } inline Float shininess() const { return _shininess; }
private: private:
Vector3 _ambientColor, Vector3 _ambientColor,
_diffuseColor, _diffuseColor,
_specularColor; _specularColor;
GLfloat _shininess; Float _shininess;
}; };
}} }}

8
src/Trade/SceneData.h

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

4
src/Trade/Trade.h

@ -19,7 +19,7 @@
* @brief Forward declarations for Magnum::Trade namespace * @brief Forward declarations for Magnum::Trade namespace
*/ */
#include <cstdint> #include "Types.h"
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
@ -29,7 +29,7 @@ class AbstractImporter;
class AbstractMaterialData; class AbstractMaterialData;
class CameraData; class CameraData;
template<std::uint8_t> class ImageData; template<UnsignedInt> class ImageData;
typedef ImageData<1> ImageData1D; typedef ImageData<1> ImageData1D;
typedef ImageData<2> ImageData2D; typedef ImageData<2> ImageData2D;
typedef ImageData<3> ImageData3D; typedef ImageData<3> ImageData3D;

Loading…
Cancel
Save