message: use utility::ArrayView for loading AMR files
diff: /*! \file sg/AMRVolume.cpp node for reading and rendering amr files */
  #include "AMRVolume.h"
  +// ospcommon
  +#include "ospcommon/utility/ArrayView.h"
  // sg
  #include "sg/importer/Importer.h"
  @@ -68,19 +70,22 @@ namespace ospray {
  BrickInfo bi;
  auto bounds = child("bounds").valueAs<box3f>();
  + auto numCells = BS * BS * BS;
  while (fread(&bi, sizeof(bi), 1, infoFile)) {
  - float *bd = new float[BS * BS * BS];
  - int nr = fread(bd, sizeof(float), BS * BS * BS, dataFile);
  + utility::ArrayView<float> bd(new float[numCells], numCells);
  +
  + int nr = fread(bd.data(), sizeof(float), numCells, dataFile);
  +
  if (bi.level > maxLevel) {
  - delete [] bd;
  + delete [] bd.data();
  continue;
  }
  brickInfo.push_back(bi);
  bounds.extend((vec3f(bi.box.upper) + vec3f(1.f)) * bi.dt);
  - assert(nr == BS * BS * BS);
  - for (int i = 0; i < BS * BS * BS; i++)
  - valueRange.extend(bd[i]);
  + assert(nr == numCells);
  + for (const auto &c : bd)
  + valueRange.extend(c);
  brickPtrs.push_back(bd);
  }
  