Browse Source

AbstractImporter: Added functions for matching IDs and names.

Also added getters for names in all *Data classes.
vectorfields
Vladimír Vondruš 14 years ago
parent
commit
28b28d66f1
  1. 2
      src/Primitives/Capsule.cpp
  2. 2
      src/Primitives/Capsule.h
  3. 2
      src/Primitives/Cube.cpp
  4. 2
      src/Primitives/Icosphere.cpp
  5. 2
      src/Primitives/Plane.cpp
  6. 80
      src/Trade/AbstractImporter.h
  7. 9
      src/Trade/AbstractMaterialData.h
  8. 15
      src/Trade/CameraData.h
  9. 10
      src/Trade/ImageData.h
  10. 15
      src/Trade/LightData.h
  11. 7
      src/Trade/MeshData.h
  12. 3
      src/Trade/MeshObjectData.h
  13. 7
      src/Trade/ObjectData.h
  14. 3
      src/Trade/PhongMaterialData.h
  15. 8
      src/Trade/SceneData.h
  16. 15
      src/Trade/TextureData.h

2
src/Primitives/Capsule.cpp

@ -19,7 +19,7 @@ using namespace std;
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Capsule::Capsule(unsigned int rings, unsigned int segments, GLfloat length, TextureCoords textureCoords): MeshData(Mesh::Primitive::Triangles, new vector<unsigned int>, {new vector<Vector4>()}, {new vector<Vector3>()}, textureCoords == TextureCoords::Generate ? vector<vector<Vector2>*>{new vector<Vector2>()} : vector<vector<Vector2>*>()), segments(segments), textureCoords(textureCoords) { Capsule::Capsule(unsigned int rings, unsigned int segments, GLfloat length, TextureCoords textureCoords): MeshData("", Mesh::Primitive::Triangles, new vector<unsigned int>, {new vector<Vector4>()}, {new vector<Vector3>()}, textureCoords == TextureCoords::Generate ? vector<vector<Vector2>*>{new vector<Vector2>()} : vector<vector<Vector2>*>()), segments(segments), textureCoords(textureCoords) {
CORRADE_ASSERT(rings >= 1 && segments >= 3, "Capsule must have at least one ring and three segments", ) CORRADE_ASSERT(rings >= 1 && segments >= 3, "Capsule must have at least one ring and three segments", )
GLfloat height = 2.0f+length; GLfloat height = 2.0f+length;

2
src/Primitives/Capsule.h

@ -52,7 +52,7 @@ class Capsule: public Trade::MeshData {
Capsule(unsigned int rings, unsigned int segments, GLfloat length, TextureCoords textureCoords = TextureCoords::DontGenerate); Capsule(unsigned int rings, unsigned int segments, GLfloat length, TextureCoords textureCoords = TextureCoords::DontGenerate);
private: private:
inline Capsule(unsigned int segments, TextureCoords textureCoords): MeshData(Mesh::Primitive::Triangles, new std::vector<unsigned int>, {new std::vector<Vector4>()}, {new std::vector<Vector3>()}, textureCoords == TextureCoords::Generate ? std::vector<std::vector<Vector2>*>{new std::vector<Vector2>()} : std::vector<std::vector<Vector2>*>()), segments(segments), textureCoords(textureCoords) {} inline Capsule(unsigned int segments, TextureCoords textureCoords): MeshData("", Mesh::Primitive::Triangles, new std::vector<unsigned int>, {new std::vector<Vector4>()}, {new std::vector<Vector3>()}, textureCoords == TextureCoords::Generate ? std::vector<std::vector<Vector2>*>{new std::vector<Vector2>()} : std::vector<std::vector<Vector2>*>()), segments(segments), textureCoords(textureCoords) {}
void capVertex(GLfloat y, GLfloat normalY, GLfloat textureCoordsV); void capVertex(GLfloat y, GLfloat normalY, GLfloat textureCoordsV);
void vertexRings(unsigned int count, GLfloat centerY, GLfloat startRingAngle, GLfloat ringAngleIncrement, GLfloat startTextureCoordsV, GLfloat textureCoordsVIncrement); void vertexRings(unsigned int count, GLfloat centerY, GLfloat startRingAngle, GLfloat ringAngleIncrement, GLfloat startTextureCoordsV, GLfloat textureCoordsVIncrement);

2
src/Primitives/Cube.cpp

@ -19,7 +19,7 @@ using namespace std;
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Cube::Cube(): MeshData(Mesh::Primitive::Triangles, new vector<unsigned int>{ Cube::Cube(): MeshData("", Mesh::Primitive::Triangles, new vector<unsigned int>{
0, 2, 1, 0, 2, 1,
2, 3, 1, 2, 3, 1,
1, 3, 5, 1, 3, 5,

2
src/Primitives/Icosphere.cpp

@ -19,7 +19,7 @@ using namespace std;
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Icosphere<0>::Icosphere(): MeshData(Mesh::Primitive::Triangles, new vector<unsigned int>{ Icosphere<0>::Icosphere(): MeshData("", Mesh::Primitive::Triangles, new vector<unsigned int>{
1, 2, 6, 1, 2, 6,
1, 7, 2, 1, 7, 2,
3, 4, 5, 3, 4, 5,

2
src/Primitives/Plane.cpp

@ -19,7 +19,7 @@ using namespace std;
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Plane::Plane(): MeshData(Mesh::Primitive::TriangleStrip, nullptr, {new vector<Vector4>{ Plane::Plane(): MeshData("", Mesh::Primitive::TriangleStrip, nullptr, {new vector<Vector4>{
{1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, 0.0f},
{1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 0.0f},
{-1.0f, -1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f},

80
src/Trade/AbstractImporter.h

@ -115,6 +115,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief %Scene count */ /** @brief %Scene count */
virtual inline unsigned int sceneCount() const { return 0; } virtual inline unsigned int sceneCount() const { return 0; }
/**
* @brief %Scene ID for given name
*
* If no scene for given name exists, returns -1.
* @see SceneData::name()
*/
virtual inline int sceneForName(const std::string& name) { return -1; }
/** /**
* @brief %Scene * @brief %Scene
* @param id %Scene ID, from range [0, sceneCount()). * @param id %Scene ID, from range [0, sceneCount()).
@ -126,6 +134,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief %Light count */ /** @brief %Light count */
virtual inline unsigned int lightCount() const { return 0; } virtual inline unsigned int lightCount() const { return 0; }
/**
* @brief %Light ID for given name
*
* If no light for given name exists, returns -1.
* @see LightData::name()
*/
virtual inline int lightForName(const std::string& name) { return -1; }
/** /**
* @brief %Light * @brief %Light
* @param id %Light ID, from range [0, lightCount()). * @param id %Light ID, from range [0, lightCount()).
@ -137,6 +153,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief %Camera count */ /** @brief %Camera count */
virtual inline unsigned int cameraCount() const { return 0; } virtual inline unsigned int cameraCount() const { return 0; }
/**
* @brief %Camera ID for given name
*
* If no camera for given name exists, returns -1.
* @see CameraData::name()
*/
virtual inline int cameraForName(const std::string& name) { return -1; }
/** /**
* @brief %Camera * @brief %Camera
* @param id %Camera ID, from range [0, cameraCount()). * @param id %Camera ID, from range [0, cameraCount()).
@ -149,6 +173,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief %Object count */ /** @brief %Object count */
virtual inline unsigned int objectCount() const { return 0; } virtual inline unsigned int objectCount() const { return 0; }
/**
* @brief %Object ID for given name
*
* If no scene for given name exists, returns -1.
* @see ObjectData::name()
*/
virtual inline int objectForName(const std::string& name) { return -1; }
/** /**
* @brief %Object * @brief %Object
* @param id %Object ID, from range [0, objectCount()). * @param id %Object ID, from range [0, objectCount()).
@ -161,6 +193,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief %Mesh count */ /** @brief %Mesh count */
virtual inline unsigned int meshCount() const { return 0; } virtual inline unsigned int meshCount() const { return 0; }
/**
* @brief %Mesh ID for given name
*
* If no mesh for given name exists, returns -1.
* @see MeshData::name()
*/
virtual inline int meshForName(const std::string& name) { return -1; }
/** /**
* @brief %Mesh * @brief %Mesh
* @param id %Mesh ID, from range [0, meshCount()). * @param id %Mesh ID, from range [0, meshCount()).
@ -172,6 +212,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief Material count */ /** @brief Material count */
virtual inline unsigned int materialCount() const { return 0; } virtual inline unsigned int materialCount() const { return 0; }
/**
* @brief Material ID for given name
*
* If no material for given name exists, returns -1.
* @see AbstractMaterialData::name()
*/
virtual inline int materialForName(const std::string& name) { return -1; }
/** /**
* @brief Material * @brief Material
* @param id Material ID, from range [0, materialCount()). * @param id Material ID, from range [0, materialCount()).
@ -184,6 +232,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief %Texture count */ /** @brief %Texture count */
virtual inline unsigned int textureCount() const { return 0; } virtual inline unsigned int textureCount() const { return 0; }
/**
* @brief %Texture ID for given name
*
* If no texture for given name exists, returns -1.
* @see TextureData::name()
*/
virtual inline int textureForName(const std::string& name) { return -1; }
/** /**
* @brief %Texture * @brief %Texture
* @param id %Texture ID, from range [0, textureCount()). * @param id %Texture ID, from range [0, textureCount()).
@ -196,6 +252,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief One-dimensional image count */ /** @brief One-dimensional image count */
virtual inline unsigned int image1DCount() const { return 0; } virtual inline unsigned int image1DCount() const { return 0; }
/**
* @brief One-dimensional image ID for given name
*
* If no image for given name exists, returns -1.
* @see ImageData1D::name()
*/
virtual inline int image1DForName(const std::string& name) { return -1; }
/** /**
* @brief One-dimensional image * @brief One-dimensional image
* @param id %Image ID, from range [0, image1DCount()). * @param id %Image ID, from range [0, image1DCount()).
@ -207,6 +271,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief Two-dimensional image count */ /** @brief Two-dimensional image count */
virtual inline unsigned int image2DCount() const { return 0; } virtual inline unsigned int image2DCount() const { return 0; }
/**
* @brief Two-dimensional image ID for given name
*
* If no image for given name exists, returns -1.
* @see ImageData2D::name()
*/
virtual inline int image2DForName(const std::string& name) { return -1; }
/** /**
* @brief Two-dimensional image * @brief Two-dimensional image
* @param id %Image ID, from range [0, image2DCount()). * @param id %Image ID, from range [0, image2DCount()).
@ -218,6 +290,14 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
/** @brief Three-dimensional image count */ /** @brief Three-dimensional image count */
virtual inline unsigned int image3DCount() const { return 0; } virtual inline unsigned int image3DCount() const { return 0; }
/**
* @brief Three-dimensional image ID for given name
*
* If no image for given name exists, returns -1.
* @see ImageData3D::name()
*/
virtual inline int image3DForName(const std::string& name) { return -1; }
/** /**
* @brief Three-dimensional image * @brief Three-dimensional image
* @param id %Image ID, from range [0, image3DCount()). * @param id %Image ID, from range [0, image3DCount()).

9
src/Trade/AbstractMaterialData.h

@ -19,6 +19,8 @@
* @brief Class Magnum::Trade::AbstractMaterialData * @brief Class Magnum::Trade::AbstractMaterialData
*/ */
#include <string>
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
/** /**
@ -40,17 +42,22 @@ class AbstractMaterialData {
/** /**
* @brief Constructor * @brief Constructor
* @param name Material name
* @param type Material type * @param type Material type
*/ */
inline AbstractMaterialData(Type type): _type(type) {} inline AbstractMaterialData(const std::string& name, Type type): _name(name), _type(type) {}
/** @brief Destructor */ /** @brief Destructor */
virtual ~AbstractMaterialData() = 0; virtual ~AbstractMaterialData() = 0;
/** @brief Material name */
inline std::string name() const { return _name; }
/** @brief Material type */ /** @brief Material type */
inline Type type() const { return _type; } inline Type type() const { return _type; }
private: private:
std::string _name;
Type _type; Type _type;
}; };

15
src/Trade/CameraData.h

@ -19,6 +19,8 @@
* @brief Class Magnum::Trade::CameraData * @brief Class Magnum::Trade::CameraData
*/ */
#include <string>
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
/** /**
@ -29,6 +31,19 @@ class MAGNUM_EXPORT CameraData {
CameraData(CameraData&& other) = delete; CameraData(CameraData&& other) = delete;
CameraData& operator=(const CameraData& other) = delete; CameraData& operator=(const CameraData& other) = delete;
CameraData& operator=(CameraData&& other) = delete; CameraData& operator=(CameraData&& other) = delete;
public:
/**
* @brief Constructor
* @param name %Camera name
*/
inline CameraData(const std::string& name): _name(name) {}
/** @brief %Camera name */
inline std::string name() const { return _name; }
private:
std::string _name;
}; };
}} }}

10
src/Trade/ImageData.h

@ -36,6 +36,7 @@ template<size_t imageDimensions> class ImageData: public AbstractImage {
/** /**
* @brief Constructor * @brief Constructor
* @param name %Image name
* @param dimensions %Image dimensions * @param dimensions %Image dimensions
* @param components Color components. Data type is detected * @param components Color components. Data type is detected
* from passed data array. * from passed data array.
@ -44,10 +45,11 @@ template<size_t imageDimensions> 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.
*/ */
template<class T> inline ImageData(const Math::Vector<Dimensions, GLsizei>& dimensions, Components components, T* data): AbstractImage(components, TypeTraits<T>::imageType()), _dimensions(dimensions), _data(reinterpret_cast<char*>(data)) {} template<class T> inline ImageData(const std::string& name, const Math::Vector<Dimensions, GLsizei>& dimensions, Components components, T* data): AbstractImage(components, TypeTraits<T>::imageType()), _name(name), _dimensions(dimensions), _data(reinterpret_cast<char*>(data)) {}
/** /**
* @brief Constructor * @brief Constructor
* @param name %Image name
* @param dimensions %Image dimensions * @param dimensions %Image dimensions
* @param components Color components * @param components Color components
* @param type Data type * @param type Data type
@ -56,11 +58,14 @@ template<size_t imageDimensions> 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 Math::Vector<Dimensions, GLsizei>& dimensions, Components components, ComponentType type, GLvoid* data): AbstractImage(components, type), _dimensions(dimensions), _data(reinterpret_cast<char*>(data)) {} inline ImageData(const std::string& name, const Math::Vector<Dimensions, GLsizei>& dimensions, Components components, ComponentType type, GLvoid* data): AbstractImage(components, type), _name(name), _dimensions(dimensions), _data(reinterpret_cast<char*>(data)) {}
/** @brief Destructor */ /** @brief Destructor */
inline ~ImageData() { delete[] _data; } inline ~ImageData() { delete[] _data; }
/** @brief %Image name */
inline std::string name() const { return _name; }
/** @brief %Image dimensions */ /** @brief %Image dimensions */
inline constexpr const Math::Vector<Dimensions, GLsizei>& dimensions() const { return _dimensions; } inline constexpr const Math::Vector<Dimensions, GLsizei>& dimensions() const { return _dimensions; }
@ -68,6 +73,7 @@ template<size_t imageDimensions> class ImageData: public AbstractImage {
inline constexpr const void* data() const { return _data; } inline constexpr const void* data() const { return _data; }
private: private:
std::string _name;
Math::Vector<Dimensions, GLsizei> _dimensions; Math::Vector<Dimensions, GLsizei> _dimensions;
char* _data; char* _data;
}; };

15
src/Trade/LightData.h

@ -19,6 +19,8 @@
* @brief Class Magnum::Trade::LightData * @brief Class Magnum::Trade::LightData
*/ */
#include <string>
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
/** /**
@ -29,6 +31,19 @@ class MAGNUM_EXPORT LightData {
LightData(LightData&& other) = delete; LightData(LightData&& other) = delete;
LightData& operator=(const LightData& other) = delete; LightData& operator=(const LightData& other) = delete;
LightData& operator=(LightData&& other) = delete; LightData& operator=(LightData&& other) = delete;
public:
/**
* @brief Constructor
* @param name %Light name
*/
inline LightData(const std::string& name): _name(name) {}
/** @brief %Light name */
inline std::string name() const { return _name; }
private:
std::string _name;
}; };
}} }}

7
src/Trade/MeshData.h

@ -38,6 +38,7 @@ class MAGNUM_EXPORT MeshData {
public: public:
/** /**
* @brief Constructor * @brief Constructor
* @param name %Mesh name
* @param primitive Primitive * @param primitive Primitive
* @param indices Array with indices or 0, if this is not * @param indices Array with indices or 0, if this is not
* indexed mesh * indexed mesh
@ -47,11 +48,14 @@ class MAGNUM_EXPORT MeshData {
* @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 MeshData(Mesh::Primitive primitive, std::vector<unsigned int>* indices, std::vector<std::vector<Vector4>*> vertices, std::vector<std::vector<Vector3>*> normals, std::vector<std::vector<Vector2>*> textureCoords2D): _primitive(primitive), _indices(indices), _vertices(vertices), _normals(normals), _textureCoords2D(textureCoords2D) {} inline MeshData(const std::string& name, Mesh::Primitive primitive, std::vector<unsigned int>* indices, std::vector<std::vector<Vector4>*> vertices, std::vector<std::vector<Vector3>*> normals, std::vector<std::vector<Vector2>*> textureCoords2D): _name(name), _primitive(primitive), _indices(indices), _vertices(vertices), _normals(normals), _textureCoords2D(textureCoords2D) {}
/** @brief Destructor */ /** @brief Destructor */
~MeshData(); ~MeshData();
/** @brief %Mesh name */
inline std::string name() const { return _name; }
/** @brief Primitive */ /** @brief Primitive */
inline Mesh::Primitive primitive() const { return _primitive; } inline Mesh::Primitive primitive() const { return _primitive; }
@ -99,6 +103,7 @@ class MAGNUM_EXPORT MeshData {
inline const std::vector<Vector2>* textureCoords2D(unsigned int id) const { return _textureCoords2D[id]; } /**< @overload */ inline const std::vector<Vector2>* textureCoords2D(unsigned int id) const { return _textureCoords2D[id]; } /**< @overload */
private: private:
std::string _name;
Mesh::Primitive _primitive; Mesh::Primitive _primitive;
std::vector<unsigned int>* _indices; std::vector<unsigned int>* _indices;
std::vector<std::vector<Vector4>*> _vertices; std::vector<std::vector<Vector4>*> _vertices;

3
src/Trade/MeshObjectData.h

@ -37,6 +37,7 @@ class MeshObjectData: public ObjectData {
public: public:
/** /**
* @brief Constructor * @brief Constructor
* @param name %Mesh object name
* @param children Child objects * @param children Child objects
* @param transformation Transformation (relative to parent) * @param transformation Transformation (relative to parent)
* @param instance Instance ID * @param instance Instance ID
@ -44,7 +45,7 @@ class MeshObjectData: public ObjectData {
* *
* Creates object with mesh instance type. * Creates object with mesh instance type.
*/ */
inline MeshObjectData(std::vector<unsigned int> children, const Matrix4& transformation, unsigned int instance, unsigned int material): ObjectData(children, transformation, InstanceType::Mesh, instance), _material(material) {} inline MeshObjectData(const std::string& name, const std::vector<unsigned int>& children, const Matrix4& transformation, unsigned int instance, unsigned int material): ObjectData(name, children, transformation, InstanceType::Mesh, instance), _material(material) {}
/** @brief Material ID */ /** @brief Material ID */
inline unsigned int material() const { return _material; } inline unsigned int material() const { return _material; }

7
src/Trade/ObjectData.h

@ -45,16 +45,20 @@ class ObjectData {
/** /**
* @brief Constructor * @brief Constructor
* @param name Object name
* @param children Child objects * @param children Child objects
* @param transformation Transformation (relative to parent) * @param transformation Transformation (relative to parent)
* @param instanceType Instance type * @param instanceType Instance type
* @param instanceId Instance ID * @param instanceId Instance ID
*/ */
inline ObjectData(std::vector<unsigned int> children, const Matrix4& transformation, InstanceType instanceType, unsigned int instanceId): _children(children), _transformation(transformation), _instanceType(instanceType), _instanceId(instanceId) {} inline ObjectData(const std::string& name, std::vector<unsigned int> children, const Matrix4& transformation, InstanceType instanceType, unsigned int instanceId): _name(name), _children(children), _transformation(transformation), _instanceType(instanceType), _instanceId(instanceId) {}
/** @brief Destructor */ /** @brief Destructor */
inline virtual ~ObjectData() {} inline virtual ~ObjectData() {}
/** @brief %Object name */
inline std::string name() const { return _name; }
/** @brief Child objects */ /** @brief Child objects */
inline std::vector<unsigned int>& children() { return _children; } inline std::vector<unsigned int>& children() { return _children; }
@ -78,6 +82,7 @@ class ObjectData {
inline unsigned int instanceId() const { return _instanceId; } inline unsigned int instanceId() const { return _instanceId; }
private: private:
std::string _name;
std::vector<unsigned int> _children; std::vector<unsigned int> _children;
Matrix4 _transformation; Matrix4 _transformation;
InstanceType _instanceType; InstanceType _instanceType;

3
src/Trade/PhongMaterialData.h

@ -31,12 +31,13 @@ class PhongMaterialData: public AbstractMaterialData {
public: public:
/** /**
* @brief Constructor * @brief Constructor
* @param name Material name
* @param ambientColor Ambient color * @param ambientColor Ambient color
* @param diffuseColor Diffuse color * @param diffuseColor Diffuse color
* @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 std::string& name, const Vector3& ambientColor, const Vector3& diffuseColor, const Vector3& specularColor, GLfloat shininess): AbstractMaterialData(name, 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; }

8
src/Trade/SceneData.h

@ -19,6 +19,7 @@
* @brief Class Magnum::Trade::SceneData * @brief Class Magnum::Trade::SceneData
*/ */
#include <string>
#include <vector> #include <vector>
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
@ -35,14 +36,19 @@ class MAGNUM_EXPORT SceneData {
public: public:
/** /**
* @brief Constructor * @brief Constructor
* @param name %Scene name
* @param children Child objects * @param children Child objects
*/ */
inline SceneData(const std::vector<unsigned int>& children): _children(children) {} inline SceneData(const std::string& name, const std::vector<unsigned int>& children): _name(name), _children(children) {}
/** @brief %Scene name */
inline std::string name() const { return _name; }
/** @brief Child objects */ /** @brief Child objects */
inline const std::vector<unsigned int>& children() const { return _children; } inline const std::vector<unsigned int>& children() const { return _children; }
private: private:
std::string _name;
std::vector<unsigned int> _children; std::vector<unsigned int> _children;
}; };

15
src/Trade/TextureData.h

@ -19,6 +19,8 @@
* @brief Class Magnum::Trade::TextureData * @brief Class Magnum::Trade::TextureData
*/ */
#include <string>
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
/** /**
@ -29,6 +31,19 @@ class MAGNUM_EXPORT TextureData {
TextureData(TextureData&& other) = delete; TextureData(TextureData&& other) = delete;
TextureData& operator=(const TextureData& other) = delete; TextureData& operator=(const TextureData& other) = delete;
TextureData& operator=(TextureData&& other) = delete; TextureData& operator=(TextureData&& other) = delete;
public:
/**
* @brief Constructor
* @param name %Texture name
*/
inline TextureData(const std::string& name): _name(name) {}
/** @brief %Texture name */
inline std::string name() const { return _name; }
private:
std::string _name;
}; };
}} }}

Loading…
Cancel
Save