8 #include "../casters.h"
10 #include <pybind11/pybind11.h>
11 #include <pybind11/stl.h>
12 #include <pybind11/stl_bind.h>
17 using namespace pybind11::literals;
21 py::class_<ccMaterial, ccSerializableObject>(m,
"ccMaterial")
22 .def(py::init<const QString &>(), py::arg(
"name") = QString(
"default"))
49 py::arg(
"absoluteFilename") = QString(),
50 py::arg(
"mirrorImage") =
false)
void define_ccMaterial(py::module &m)
bool isSerializable() const override
Returns whether object is serializable of not.
static void AddTexture(const QImage &image, const QString &absoluteFilename)
Adds a texture to the global texture DB.
QString getUniqueIdentifier() const
Returns unique identifier (UUID)
bool compare(const ccMaterial &mtl) const
Compares this material with another one.
short minimumFileVersion() const override
Returns the minimum file version required to save this instance.
bool hasTexture() const
Returns whether the material has an associated texture or not.
GLuint getTextureID() const
Returns the texture ID (if any)
static QImage GetTexture(const QString &absoluteFilename)
Returns the texture image associated to a given name.
void setShininess(float val)
Sets shininess (both front - 100% - and back - 80%)
bool toFile(QFile &out, short dataVersion) const override
void setDiffuseFront(const ecvColor::Rgbaf &color)
Sets diffuse color (front)
float getShininessFront() const
Returns front shininess.
void releaseTexture()
Release the texture.
void setName(QString name)
Sets the material name.
void setIllum(int illum)
Sets illum mode.
const ecvColor::Rgbaf & getEmission() const
Returns emission color.
void setEmission(const ecvColor::Rgbaf &color)
Sets emission color.
int getIllum() const
Returns illum mode.
void setDiffuseBack(const ecvColor::Rgbaf &color)
Sets diffuse color (back)
const ecvColor::Rgbaf & getSpecular() const
Returns specular color.
void setAmbient(const ecvColor::Rgbaf &color)
Sets ambient color.
void setTexture(const QImage &image, const QString &absoluteFilename=QString(), bool mirrorImage=false)
Sets texture.
void setShininessFront(float val)
Sets shininess (front)
const ecvColor::Rgbaf & getDiffuseFront() const
Returns front diffuse color.
bool fromFile(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads data from binary stream.
const QImage & getTexture() const
Returns the texture (if any)
void setShininessBack(float val)
Sets shininess (back)
void setDiffuse(const ecvColor::Rgbaf &color)
Sets diffuse color (both front and back)
float getShininessBack() const
Returns back shininess.
const QString & getTextureFilename() const
Returns the texture filename (if any)
void setSpecular(const ecvColor::Rgbaf &color)
Sets specular color.
const ecvColor::Rgbaf & getAmbient() const
Returns ambient color.
bool loadAndSetTexture(const QString &absoluteFilename)
Loads texture from file (and set it if successful)
void setTransparency(float val)
Sets transparency (all colors)
const QString & getName() const
Returns the material name.
static void ReleaseTextures()
Release all texture objects.
const ecvColor::Rgbaf & getDiffuseBack() const
Returns back diffuse color.