25 return axis ?
static_cast<size_t>(axis->size()) : 0;
59 auto axis = item<BinnedAxisItem>(
T_AXIS);
60 return axis ? axis->binCenters() : std::vector<double>{};
68 if (total_bin_count(
this) !=
data.size())
69 throw std::runtime_error(
"Data1DItem::setValues() -> Data doesn't match size of axis");
78 return property<std::vector<double>>(
P_VALUES);
85 if (total_bin_count(
this) != errors.size())
86 throw std::runtime_error(
"Data1DItem::setErrors() -> Data doesn't match size of axis");
95 return property<std::vector<double>>(
P_ERRORS);
Item to represent an axis with arbitrary binning.
Complex item holding mixed SessionItem types (single properties and other CompountItems).
T * addProperty(const std::string &name)
Adds property item of given type.
Represents one-dimensional data (axis and values).
static const std::string T_AXIS
std::vector< double > binValues() const
Returns values stored in bins.
void setValues(const std::vector< double > &data)
Sets internal data buffer to given data.
std::vector< double > binCenters() const
Sets axis. Bin content will be set to zero.
static const std::string P_VALUES
void setErrors(const std::vector< double > &errors)
Sets errors on values in bins.
std::vector< double > binErrors() const
Returns value errors stored in bins.
static const std::string P_ERRORS
void registerTag(const TagInfo &tagInfo, bool set_as_default=false)
Registers tag to hold items under given name.
T data(int role=ItemDataRole::DATA) const
Returns data of given type T for given role.
T * item(const std::string &tag) const
Returns first item under given tag casted to a specified type.
void setProperty(const std::string &tag, const T &value)
Sets value to property item.
Holds info about single tag for SessionItem.
const model_type Data1DItemType
const model_type FixedBinAxisItemType
const model_type PointwiseAxisItemType
materialitems.h Collection of materials to populate MaterialModel.