44#include "DenseFieldIO.h"
68const int DenseFieldIO::k_versionNumber(1);
69const std::string DenseFieldIO::k_versionAttrName(
"version");
70const std::string DenseFieldIO::k_extentsStr(
"extents");
71const std::string DenseFieldIO::k_extentsMinStr(
"extents_min");
72const std::string DenseFieldIO::k_extentsMaxStr(
"extents_max");
73const std::string DenseFieldIO::k_dataWindowStr(
"data_window");
74const std::string DenseFieldIO::k_dataWindowMinStr(
"data_window_min");
75const std::string DenseFieldIO::k_dataWindowMaxStr(
"data_window_max");
76const std::string DenseFieldIO::k_componentsStr(
"components");
77const std::string DenseFieldIO::k_bitsPerComponentStr(
"bits_per_component");
78const std::string DenseFieldIO::k_dataStr(
"data");
168DenseFieldIO::read(
const OgIGroup &
lg,
const std::string &,
311 "DenseField template parameter");
362 "DenseField template parameter");
373template <
class Data_T>
389 totalSize[0] = size[0] * size[1] * size[2] * components;
409 {
dw.min.x,
dw.min.y,
dw.min.z,
dw.max.x,
dw.max.y,
dw.max.z };
435 "DenseFieldIO::writeInternal");
463 "DenseFieldIO::writeInternal");
477template <
class Data_T>
509 const size_t length = memSize[0] * memSize[1] * memSize[2];
519template <
class Data_T>
532 throw Exc::WriteLayerException(
"Error writing layer in "
533 "DenseFieldIO::writeData");
541template <
class Data_T>
551 std::string
typeName =
"DenseField<" +
553 throw Exc::Hdf5DataReadException(
"Couldn't read " +
typeName +
" data");
561template <
class Data_T>
571 if (!data.isValid()) {
572 throw Exc::ReadDataException(
"DenseFieldIO::readData() couldn't open "
578 throw Exc::ReadDataException(
"DenseFieldIO::readData() couldn't read "
OgDataType
Enumerates the various uses for Ogawa-level groups.
This subclass of Field stores data in a contiguous std::vector.
const FIELD3D_VEC3_T< size_t > & internalMemSize() const
Returns the internal memory size in each dimension. This is used for example in LinearInterpolator,...
iterator begin()
Iterator to first element.
boost::intrusive_ptr< DenseField > Ptr
boost::intrusive_ptr< FieldBase > Ptr
const Box3i & extents() const
Returns the extents of the data. This signifies the relevant area that the data exists over....
const Box3i & dataWindow() const
Returns the data window. Any coordinate inside this window is safe to pass to value() in the Field su...
Scoped object - creates a dataset on creation and closes it on destruction.
Scoped object - opens a dataset on creation and closes it on destruction.
Scoped object - opens a dataset on creation and closes it on destruction.
Scoped object - opens a dataset on creation and closes it on destruction.
Scoped object - creates a dataspace on creation and closes it on destruction.
void setSize(const V3i &size)
Resizes the object.
FIELD3D_API bool readAttribute(hid_t location, const std::string &attrName, std::string &value)
Reads a string attribute.
FIELD3D_API bool writeAttribute(hid_t location, const std::string &attrName, const std::string &value)
Writes a string attribute.
FIELD3D_API bool checkHdf5Gzip()
Checks whether gzip is available in the current hdf5 library.
Namespace for Exception objects.
Contains utility functions and classes for Hdf5 files.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity.
#define FIELD3D_NAMESPACE_SOURCE_CLOSE
static std::string name()