Ejemplo n.º 1
0
NORI_NAMESPACE_BEGIN

void NoriObject::addChild(NoriObject *) {
    throw NoriException(
        "NoriObject::addChild() is not implemented for objects of type '%s'!",
        classTypeName(getClassType()));
}
Ejemplo n.º 2
0
NORI_NAMESPACE_BEGIN

void NoriObject::addChild(NoriObject *) {
	throw NoriException(QString("NoriObject::addChild() is not "
		"implemented for objects of type '%1'!").arg(
			classTypeName(getClassType())));
}
Ejemplo n.º 3
0
void Mesh::addChild(NoriObject *obj) {
    switch (obj->getClassType()) {
        case EBSDF:
            if (m_bsdf)
                throw NoriException(
                    "Mesh: tried to register multiple BSDF instances!");
            m_bsdf = static_cast<BSDF *>(obj);
            break;
        case ETEXTURE:
            if (m_texture)
                throw NoriException(
                    "Mesh: tried to register multiple texture instances!");
            m_texture = static_cast<Texture *>(obj);
        break;
        case EBUMPMAP:
            if (m_bumpmap)
                throw NoriException(
                    "Mesh: tried to register multiple bumpmap instances!");
            m_bumpmap = static_cast<BumpTexture *>(obj);
        break;
        case EMIXTEXTURE:
            if (m_texture)
                throw NoriException(
                    "Mesh: tried to register multiple texture instances!");
            m_texture = static_cast<Texture *>(obj);

        break;
        case EMIXBUMPMAP:
            if (m_bumpmap)
                throw NoriException(
                    "Mesh: tried to register multiple bumpmap instances!");
            m_bumpmap = static_cast<BumpTexture *>(obj);
        break;
        case EEmitter: {
                Emitter *emitter = static_cast<Emitter *>(obj);
                if (m_emitter)
                    throw NoriException(
                        "Mesh: tried to register multiple Emitter instances!");
                m_emitter = emitter;
            }
            break;
        case EMedium: {

            Medium *media = static_cast<Medium *>(obj);
            if (m_medium)
                throw NoriException(
                    "Mesh: tried to register multiple medium instances!");
            m_medium = media;

        }
        break;

        default:
            throw NoriException("Mesh::addChild(<%s>) is not supported!",
                                classTypeName(obj->getClassType()));
    }
}
Ejemplo n.º 4
0
Archivo: mesh.cpp Proyecto: UIKit0/nori
void Mesh::addChild(NoriObject *obj) {
	switch (obj->getClassType()) {
		case EBSDF:
			if (m_bsdf)
				throw NoriException("Mesh: tried to register multiple BSDF instances!");
			m_bsdf = static_cast<BSDF *>(obj);
			break;

		default:
			throw NoriException(QString("Mesh::addChild(<%1>) is not supported!").arg(
				classTypeName(obj->getClassType())));
	}
}
Ejemplo n.º 5
0
void PerlinTexture::addChild(NoriObject *obj) {
    switch (obj->getClassType()) {
    case ESampler:
        if (m_sampler)
            throw NoriException("There can only be one sampler per scene!");
        m_sampler = static_cast<Sampler *>(obj);
        createTexture();
        break;

    default:
        throw NoriException("Scene::addChild(<%s>) is not supported!",
                            classTypeName(obj->getClassType()));
    }
}
Ejemplo n.º 6
0
    void addChild(NoriObject *obj) {
        switch (obj->getClassType()) {
            case EBSDF:
                m_bsdfs.push_back(static_cast<BSDF *>(obj));
                break;

            case EScene:
                m_scenes.push_back(static_cast<Scene *>(obj));
                break;

            default:
                throw NoriException("StudentsTTest::addChild(<%s>) is not supported!",
                    classTypeName(obj->getClassType()));
        }
    }
Ejemplo n.º 7
0
void Mesh::addChild(NoriObject *obj) {
	switch (obj->getClassType()) {
		case EBSDF:
			if (m_bsdf)
				throw NoriException("Mesh: tried to register multiple BSDF instances!");
			m_bsdf = static_cast<BSDF *>(obj);
			break;
		case ELuminaire:
			if (m_luminaire)
				throw NoriException("Mesh: tried to register multiple luminaire instances!");
			m_luminaire = static_cast<Luminaire*>(obj);
			m_luminaire -> setMesh(this);
			break;
		case ETEXTURE:
			if (m_texture)
				throw NoriException("Mesh: tried to register multiple texture instances!");
			m_texture = static_cast<Texture*>(obj);
			break;
		default:
			throw NoriException(QString("Mesh::addChild(<%1>) is not supported!").arg(
				classTypeName(obj->getClassType())));
	}
}