00001 00002 /* 00003 pbrt source code Copyright(c) 1998-2010 Matt Pharr and Greg Humphreys. 00004 00005 This file is part of pbrt. 00006 00007 pbrt is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. Note that the text contents of 00011 the book "Physically Based Rendering" are *not* licensed under the 00012 GNU GPL. 00013 00014 pbrt is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 00025 // core/scene.cpp* 00026 #include "stdafx.h" 00027 #include "scene.h" 00028 #include "camera.h" 00029 #include "film.h" 00030 #include "sampler.h" 00031 #include "volume.h" 00032 #include "parallel.h" 00033 #include "progressreporter.h" 00034 #include "renderer.h" 00035 00036 // Scene Method Definitions 00037 Scene::~Scene() { 00038 delete aggregate; 00039 delete volumeRegion; 00040 for (uint32_t i = 0; i < lights.size(); ++i) 00041 delete lights[i]; 00042 } 00043 00044 00045 Scene::Scene(Primitive *accel, const vector<Light *> <s, 00046 VolumeRegion *vr) { 00047 lights = lts; 00048 aggregate = accel; 00049 volumeRegion = vr; 00050 // Scene Constructor Implementation 00051 bound = aggregate->WorldBound(); 00052 if (volumeRegion) bound = Union(bound, volumeRegion->WorldBound()); 00053 } 00054 00055 00056 const BBox &Scene::WorldBound() const { 00057 return bound; 00058 } 00059 00060