void removeLightSource(std::size_t & index) { if (index < lightCount()) { lights.erase(lights.begin() + index); } }
void Scene::write( std::ostream &out ) const { out << "Input scene file: " << _inputSceneFile << std::endl; out << *_camera << std::endl; out << _viewPlane << std::endl; out << "Number of Lights: " << lightCount( ) << std::endl; out << "Lights:" << std::endl; for(unsigned int i = 0; i < lightCount( ); i++ ){ out << _lights[i]; } out << "Background Color: "; _backgroundColor.write_row(out) << std::endl; out << "Number of Materials: " << materialCount( ) << std::endl; out << "Materials:" << std::endl; for(unsigned int i = 0; i < materialCount( ); i++){ out << _materials[i]; } out << "Group:" << std::endl; for(unsigned int i = 0; i < objectCount( ); i++){ _objects[i]->write(out); } }
Light* Scene::lightAtIndex(size_t i){ if( i >= lightCount( ) ){ throw std::range_error("Light index out of range"); } return _lights[i]; }