From bfceaade5df3177a3e213fe20bc3811b2f78ac98 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Fri, 24 Feb 2017 11:53:04 +0200 Subject: [PATCH] forgot to add the new files --- src/exman.cc | 42 ++++++++++++++++++++++++++++++++++++++++++ src/exman.h | 22 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 src/exman.cc create mode 100644 src/exman.h diff --git a/src/exman.cc b/src/exman.cc new file mode 100644 index 0000000..e0ededc --- /dev/null +++ b/src/exman.cc @@ -0,0 +1,42 @@ +#include "exman.h" +#include "exhibit.h" +#include "blob_exhibit.h" + +static Exhibit *create_exhibit(const char *type); + +ExhibitManager::ExhibitManager() +{ +} + +ExhibitManager::~ExhibitManager() +{ + int num = (int)items.size(); + for(int i=0; iname, "exhibits") != 0) { + ts_free_tree(root); + error_log("failed to load exhibits\n"); + return false; + } + + ts_free_tree(root); + return true; +} + + +static Exhibit *create_exhibit(const char *type) +{ + if(strcmp(type, "static") == 0) { + return new Exhibit; + } else if(strcmp(type, "blobs") == 0) { + return new BlobExhibit; + } + return 0; +} diff --git a/src/exman.h b/src/exman.h new file mode 100644 index 0000000..5c627e6 --- /dev/null +++ b/src/exman.h @@ -0,0 +1,22 @@ +#ifndef EXMAN_H_ +#define EXMAN_H_ + +#include +#include "exhibit.h" +#include "metascene.h" + +class ExhibitManager { +private: + std::vector items; + +public: + ExhibitManager(); + ~ExhibitManager(); + + bool load(const MetaScene *mscn, const char *fname); + + ExSelection select(const Ray &ray) const; + ExSelection select(const Sphere &sph) const; +}; + +#endif // EXMAN_H_ -- 1.7.10.4