mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-08-14 01:28:02 +00:00
parse scenes
This commit is contained in:
parent
2f4d439e97
commit
03b6bbbb8e
2 changed files with 20 additions and 4 deletions
|
@ -1,9 +1,17 @@
|
||||||
#include "RayTracer.h"
|
#include "RayTracer.h"
|
||||||
#include "../external/simpleppm.h"
|
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
#include "Scene.h"
|
|
||||||
|
void RayTracer::parse() {
|
||||||
|
for (auto i = json["output"].begin(); i != json["output"].end(); ++i)
|
||||||
|
scenes.push_back(Parser::getScene(*i));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RayTracer::render() {}
|
||||||
|
|
||||||
|
void RayTracer::output() {}
|
||||||
|
|
||||||
void RayTracer::run() {
|
void RayTracer::run() {
|
||||||
nlohmann::json sceneJson = this->json["output"][0];
|
parse();
|
||||||
Scene *sc = Parser::getScene(sceneJson);
|
render();
|
||||||
|
output();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#define RAY_TRACER_H_
|
#define RAY_TRACER_H_
|
||||||
|
|
||||||
#include "../external/json.hpp"
|
#include "../external/json.hpp"
|
||||||
|
#include "Scene.h"
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class RayTracer {
|
class RayTracer {
|
||||||
public:
|
public:
|
||||||
|
@ -10,6 +13,11 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nlohmann::json json;
|
nlohmann::json json;
|
||||||
|
std::vector<Scene *> scenes;
|
||||||
|
|
||||||
|
void parse();
|
||||||
|
void render();
|
||||||
|
void output();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !RAY_TRACER_H_
|
#endif // !RAY_TRACER_H_
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue