23 const std::pair<double, double> default_axis_range{0.0, 1.0};
31 addProperty<ViewportAxisItem>(
P_ZAXIS)->setDisplayName(
"color-axis");
38 return item<ViewportAxisItem>(
P_ZAXIS);
52 return dataItem && dataItem->xAxis() ? dataItem->xAxis()->range() : default_axis_range;
60 return dataItem && dataItem->yAxis() ? dataItem->yAxis()->range() : default_axis_range;
67 auto colormap_item = item<ColorMapItem>(
T_ITEMS);
68 return colormap_item ? colormap_item->dataItem() :
nullptr;
75 if (
auto dataItem =
data_item(); dataItem) {
76 auto values = dataItem->content();
77 auto [lower, upper] = std::minmax_element(std::begin(values), std::end(values));
void update_data_range()
Updates zAxis to lower, upper values over all data points.
virtual std::pair< double, double > data_yaxis_range() const override
Returns range of y-axis as defined in underlying Data2DItem.
Data2DItem * data_item() const
Returns Data2DItem if exists.
virtual std::pair< double, double > data_xaxis_range() const override
Returns range of x-axis as defined in underlying Data2DItem.
ViewportAxisItem * zAxis() const
void setViewportToContent() override
Sets range of x,y window to show all data.
static const std::string P_ZAXIS
Represents two-dimensional data (axes definition and 2d array of values).
void registerTag(const TagInfo &tagInfo, bool set_as_default=false)
Registers tag to hold items under given name.
Holds info about single tag for SessionItem.
Item to represent viewport axis.
void set_range(double lower, double upper)
Sets lower, upper range of axis to given values.
Base class to represent 2D viewport.
virtual void setViewportToContent()
Sets range of x,y window to show all data.
static const std::string T_ITEMS
const model_type ColorMapItemType
const model_type ColorMapViewportItemType
materialitems.h Collection of materials to populate MaterialModel.