15 #ifndef BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_AXISITEMS_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_STANDARDITEMS_AXISITEMS_H
31 static inline const std::string P_MIN =
"P_MIN";
32 static inline const std::string P_MAX =
"P_MAX";
37 void register_min_max();
45 static inline const std::string P_TITLE =
"P_TITLE";
46 static inline const std::string P_IS_LOG =
"P_IS_LOG";
49 std::pair<double, double> range()
const;
51 void set_range(
double lower,
double upper);
53 bool is_in_log()
const;
65 virtual std::pair<double, double>
range()
const = 0;
67 virtual int size()
const = 0;
77 static inline const std::string P_NBINS =
"P_NBINS";
80 void setParameters(
int nbins,
double xmin,
double xmax);
82 static std::unique_ptr<FixedBinAxisItem> create(
int nbins,
double xmin,
double xmax);
84 std::pair<double, double> range()
const override;
86 int size()
const override;
88 std::vector<double>
binCenters()
const override;
98 void setParameters(
const std::vector<double>& data);
100 static std::unique_ptr<PointwiseAxisItem> create(
const std::vector<double>& data);
102 std::pair<double, double> range()
const override;
104 int size()
const override;
106 std::vector<double>
binCenters()
const override;
Base class for all axes items. Has min, max defined, but nothing else.
Item to represent an axis with arbitrary binning.
virtual int size() const =0
virtual std::vector< double > binCenters() const =0
virtual std::pair< double, double > range() const =0
Complex item holding mixed SessionItem types (single properties and other CompountItems).
Item to represent fixed bin axis.
Item to represent pointwise axis.
Item to represent viewport axis.
const model_type FixedBinAxisItemType
const model_type ViewportAxisItemType
const model_type PointwiseAxisItemType
materialitems.h Collection of materials to populate MaterialModel.
std::vector< double > binCenters(const QCPGraph *graph)
Returns vector representing bin centers on QCPgraph.