From a0fbecf4836b9d924893ac9a784789bd9d3f74d4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 3 Aug 2014 17:25:25 -0700 Subject: [PATCH] Log all objects before starting the render --- src/scene.cc | 16 ++++++++++++++++ src/scene.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/scene.cc b/src/scene.cc index 8288a8a..5beefc7 100644 --- a/src/scene.cc +++ b/src/scene.cc @@ -150,6 +150,8 @@ Scene::render() { LOG_INFO << "Rendering scene with " << shapes.size() << " objects."; printf("Rendering scene with %lu objects.\n", shapes.size()); + LogObjects(); + std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -326,3 +328,17 @@ Scene::trace_ray(const Ray &ray, return out_color; } + + +void +Scene::LogObjects() + const +{ + LOG_DEBUG << "BEGIN SCENE OBJECTS"; + + for (Object::Ptr obj : shapes) { + LOG_DEBUG << *obj; + } + + LOG_DEBUG << "END SCENE OBJECTS"; +} diff --git a/src/scene.h b/src/scene.h index 93ae813..0dbeb6a 100644 --- a/src/scene.h +++ b/src/scene.h @@ -53,6 +53,8 @@ public: private: Color trace_ray(const Ray &ray, const int depth = 0, const float weight = 1.0); + void LogObjects() const; + // Pixel dimensions of the image. int width, height;