Fix use of get_map<IdData> within plot.cpp and failing properties test

This commit is contained in:
Paul Romano 2021-06-24 17:05:10 +07:00
parent 6190ff8ff3
commit 803f17500c
2 changed files with 4 additions and 2 deletions

View file

@ -157,7 +157,8 @@ void create_ppm(Plot const& pl)
// assign colors
for (size_t y = 0; y < height; y++) {
for (size_t x = 0; x < width; x++) {
auto id = ids.data_(y, x, pl.color_by_);
int idx = pl.color_by_ == PlotColorBy::cells ? 0 : 2;
auto id = ids.data_(y, x, idx);
// no setting needed if not found
if (id == NOT_FOUND) { continue; }
if (id == OVERLAP) {
@ -840,7 +841,7 @@ void create_voxel(Plot const& pl)
IdData ids = pltbase.get_map<IdData>();
// select only cell/material ID data and flip the y-axis
int idx = pl.color_by_ == PlotColorBy::cells ? 0 : 1;
int idx = pl.color_by_ == PlotColorBy::cells ? 0 : 2;
xt::xtensor<int32_t, 2> data_slice = xt::view(ids.data_, xt::all(), xt::all(), idx);
xt::xtensor<int32_t, 2> data_flipped = xt::flip(data_slice, 0);