NORI_NAMESPACE_BEGIN void NoriObject::addChild(NoriObject *) { throw NoriException( "NoriObject::addChild() is not implemented for objects of type '%s'!", classTypeName(getClassType())); }
NORI_NAMESPACE_BEGIN void NoriObject::addChild(NoriObject *) { throw NoriException(QString("NoriObject::addChild() is not " "implemented for objects of type '%1'!").arg( classTypeName(getClassType()))); }
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())); } }
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()))); } }
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())); } }
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())); } }
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()))); } }