From 7637db6774350c466fb83bb74b97edea0f995dbc Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sun, 7 Oct 2018 19:55:45 -0500 Subject: [PATCH] Adding a skeleton function for plotting. --- include/openmc/plot.h | 4 +++- src/plot.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 128374779..67f1cc092 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -4,6 +4,7 @@ #include "hdf5.h" #include "position.h" #include +#include namespace openmc { @@ -38,6 +39,7 @@ namespace openmc { //=============================================================================== class ObjectColor { + public: int rgb_[3]; }; @@ -46,7 +48,7 @@ namespace openmc { //=============================================================================== class ObjectPlot { - + public: int id_; std::string path_plot_; int type_; diff --git a/src/plot.cpp b/src/plot.cpp index 79f04c47f..925fbea05 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -1,7 +1,40 @@ #include "openmc/plot.h" +#include "openmc/constants.h" +#include "openmc/settings.h" +#include "openmc/error.h" namespace openmc { +const int RED = 1; +const int GREEN = 2; +const int BLUE = 3; + + int openmc_plot_geometry() { + int err; + + for(auto i : n_plots) { + ObjectPlot* pl = plots[i]; + + std::stringstream ss; + ss << "Processing plot " << pl->id_ << ": " + << pl->path_plot_ << "..."; + write_message(ss.str(), 5); + + if (pl->type_ == PLOT_TYPE::SLICE) { + // create 2D image + // create_ppm(pl); + continue; + } else if (pl->type_ == PLOT_TYPE::VOXEL) { + // create voxel file for 3D viewing + // create_voxel(pl); + continue; + } + + } + + return 0; + } + void voxel_init(hid_t file_id, const hsize_t* dims, hid_t* dspace, hid_t* dset, hid_t* memspace)