34 std::unique_ptr<ItemCatalogue> CreateItemCatalogue()
36 auto result = std::make_unique<ModelView::ItemCatalogue>();
47 ExperimentalDataModel::ExperimentalDataModel(std::shared_ptr<ItemPool> pool)
58 return topItem<CanvasContainerItem>();
65 return topItem<ExperimentalDataContainerItem>();
80 auto result = insertItem<GraphItem>(&target_canvas);
85 result->setDataItem(
data);
99 removeItem(dataItem->parent(), dataItem->tagRow());
117 if (canvases.size() <= 1)
121 for (
auto it = std::next(canvases.begin()); it < canvases.end(); ++it) {
133 insertItem<ExperimentalDataContainerItem>(
rootItem());
134 insertItem<CanvasContainerItem>(
rootItem());
One-dimensional graph representation of Data1DItem.
Data1DItem * dataItem() const
Returns data item linked to the given GraphItem.
std::vector< GraphItem * > graphItems() const
Returns the selected graph items.
Item to represent pointwise axis.
SessionItem * parent() const
Returns parent item. Will return nullptr if item doesn't have a parent.
TagRow tagRow() const
Returns TagRow of this item under which it is accessible through its parent.
Main class to hold hierarchy of SessionItem objects.
void setUndoRedoEnabled(bool value)
Sets undo/redo either enabled or disabled. By default undo/redo is disabled.
void moveItem(SessionItem *item, SessionItem *new_parent, const TagRow &tagrow)
Move item from it's current parent to a new parent under given tag and row.
void setItemCatalogue(std::unique_ptr< ItemCatalogue > catalogue)
Sets brand new catalog of user-defined items.
SessionItem * rootItem() const
Returns root item of the model.
Variant data(SessionItem *item, int role) const
Returns the data for given item and role.
void removeItem(SessionItem *parent, const TagRow &tagrow)
Removes given row from parent.
Holds a collection of CanvasItem.
Holds a collection of GraphItem's for simultaneous plotting, as well as all information related to pl...
Holds a collection of Data1DItem's with raw data as imported by the user.
CanvasContainerItem * canvasContainer() const
Returns the canvas container of the model.
void removeCanvas(CanvasItem &canvas)
Remove canvas with all its graphs.
void mergeCanvases(const std::vector< CanvasItem * > &canvases)
Merge canvas from the vector.
void removeGraph(ModelView::GraphItem &graph)
Remove graph from the model. Underlying DataItem will be removed too.
ModelView::GraphItem * addGraph(const GraphImportData &graph_data, CanvasItem &target_canvas)
Adds graph to 'target_canvas' and returns the result.
ExperimentalDataContainerItem * dataContainer() const
Returns the data container of the model.
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Raw data to construct GraphItem and Data1DItem's.
std::vector< double > bin_centers
std::vector< double > bin_values
std::string graph_description