BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
IntensityDataItem Class Reference

Description

Definition at line 26 of file IntensityDataItem.h.

Inheritance diagram for IntensityDataItem:
[legend]
Collaboration diagram for IntensityDataItem:
[legend]

Public Slots

void setInterpolated (bool interp)
 
void setLogz (bool logz)
 
void setLowerAndUpperZ (double zmin, double zmax)
 
void setLowerX (double value)
 
void setLowerY (double value)
 
void setLowerZ (double zmin)
 
void setUpperX (double value)
 
void setUpperY (double value)
 
void setUpperZ (double zmax)
 

Signals

void axesUnitsChanged (const ComboProperty &units)
 
void datafieldChanged (Datafield *data)
 
void fileNameChanged (const QString &filename)
 
void rawDataVectorChanged (const std::vector< double > &data)
 

Public Member Functions

 IntensityDataItem ()
 
QVector< QString > acceptableDefaultItemTypes () const
 Returns vector of acceptable default tag types. More...
 
bool acceptsAsDefaultItem (const QString &item_name) const
 Returns true if model type can be added to default tag. More...
 
SessionItemaddGroupProperty (const QString &groupTag, const GroupInfo &groupInfo)
 
template<typename T >
T * addProperty (const QString &name)
 
SessionItemaddProperty (const QString &name, const QVariant &variant)
 Add new property item and register new tag. name is the tag name and the display name. The property's value will be set to variant. More...
 
virtual bool allowWritingChildToXml (SessionItem *child) const
 
SelectionDescriptor< QString > axesUnits () const
 
SessionItemchildAt (int row) const
 Returns the child at the given row. More...
 
QVector< SessionItem * > children () const
 Returns vector of all children. More...
 
template<typename T >
QVector< T * > childrenOfType () const
 
QVector< SessionItem * > childrenOfType (const QString &model_type) const
 Returns a vector of all children of the given type. More...
 
void computeDataRange ()
 
bool containsNonXMLData () const override
 Checks if object owns non-XML data. More...
 
QPair< double, double > dataRange () const
 Init zmin, zmax to match the intensity values range. More...
 
int decimals () const
 
QString defaultTag () const
 Get default tag. More...
 
virtual void deserializeBinaryData (const QByteArray &data)
 
QString displayName () const
 Get display name of item, append index if ambigue. More...
 
void emitDataChanged (int role=Qt::DisplayRole)
 Notify model about data changes. More...
 
QString fileName () const override
 Reports file name to save/load non-XML data. More...
 
virtual QString fileName () const=0
 Reports file name to save/load non-XML data. More...
 
QString fileName (const QString &projectDir) const
 Reports file name to save/load non-XML data with directory name attached. More...
 
QString fileName (const QString &projectDir) const
 Reports file name to save/load non-XML data with directory name attached. More...
 
template<typename T >
T * firstChildOfType () const
 
SessionItemgetAxesUnitsItem () const
 
SessionItemgetChildOfType (const QString &type) const
 Returns the first child of the given type. More...
 
Datafield * getDatafield ()
 
const Datafield * getDatafield () const
 
ComboProperty getGradient () const
 
QString getGradientValue () const
 
SessionItemgetGroupItem (const QString &groupName) const
 Access subitem of group item. More...
 
SessionItemgetItem (const QString &tag="", int row=0) const
 Returns item in given row of given tag. More...
 
QVector< SessionItem * > getItems (const QString &tag="") const
 Returns vector of all items of given tag. More...
 
QVariant getItemValue (const QString &tag) const
 Directly access value of item under given tag. More...
 
double getLowerX () const
 Returns lower and upper zoom ranges of x-axis. More...
 
double getLowerY () const
 Returns lower and upper zoom ranges of y-axis. More...
 
double getLowerZ () const
 Returns lower and upper zoom ranges of z-axis. More...
 
MaskContainerItemgetOrCreateMaskContainerItem ()
 
ProjectionContainerItemgetOrCreateProjectionContainerItem ()
 
QVector< int > getRoles () const
 Returns vector of all present roles. More...
 
double getUpperX () const
 
double getUpperY () const
 
double getUpperZ () const
 
QString getXaxisTitle () const
 
QString getYaxisTitle () const
 
SelectionDescriptor< QString > gradient () const
 
template<typename T >
T & groupItem (const QString &groupName) const
 
bool hasChildren () const
 Indicates whether this SessionItem has any child items. More...
 
bool hasMasks () const
 
template<typename T >
bool hasModelType () const
 
bool hasProjections () const
 
QModelIndex index () const
 Returns model index of this item. More...
 
void insertChild (int row, SessionItem *item, const QString &tag="")
 Insert item into given tag into given row. More...
 
bool isEditable () const
 
bool isEnabled () const
 
bool isInterpolated () const
 
bool isLogz () const
 
bool isTag (const QString &name) const
 Returns true if tag is available. More...
 
bool isZAxisLocked () const
 Returns true if min, max range of Z-axis is locked (change not allowed) More...
 
template<typename T >
T * item (const QString &tag) const
 
QString itemName () const
 Get item name, return display name if no name is set. More...
 
template<typename T >
QVector< T * > items (const QString &tag="") const
 
QDateTime lastModified () const override
 Indicates last modification timepoint. More...
 
RealLimits limits () const
 
bool loadData (const QString &projectDir) override
 Loads non-XML data from projectDir and returns success flag. More...
 
ModelMappermapper ()
 Returns the current model mapper of this item. Creates new one if necessary. More...
 
MaskContainerItemmaskContainerItem ()
 
const MaskContainerItemmaskContainerItem () const
 
SessionModelmodel () const
 Returns model of this item. More...
 
QString modelType () const
 Get model type. More...
 
int numberOfChildren () const
 Returns total number of children. More...
 
SessionItemparentItem () const
 Returns parent of this item. More...
 
int parentRow ()
 Returns the index of the given item within its parent. Returns -1 when no parent is set. More...
 
ProjectionContainerItemprojectionContainerItem ()
 
const ProjectionContainerItemprojectionContainerItem () const
 
virtual void readNonSessionItems (QXmlStreamReader *reader)
 
bool registerTag (const QString &name, int min=0, int max=-1, QStringList modelTypes={})
 Add new tag to this item with given name, min, max and types. max = -1 -> unlimited, modelTypes empty -> all types allowed. More...
 
void reset (ImportDataInfo data) override
 Returns data to the state defined by user (imported) data. More...
 
void resetView ()
 Set axes viewport to original data. More...
 
QVariant roleProperty (int role) const
 Returns corresponding variant under given role, invalid variant when role is not present. More...
 
int rowOfChild (SessionItem *child) const
 Returns row index of given child. More...
 
bool saveData (const QString &projectDir) override
 Saves non-XML data in projectDir and returns success flag. More...
 
QString selectedCoords () const
 
virtual QByteArray serializeBinaryData () const
 
const SessionItemTagssessionItemTags () const
 
void setAxesRangeToData () override
 set zoom range of x,y axes to axes of input data More...
 
void setAxesUnits (const ComboProperty &units)
 
void setDatafield (Datafield *data) override
 The given pointer becomes owned by this class!! More...
 
SessionItemsetDecimals (int n)
 
void setDefaultTag (const QString &tag)
 Set default tag. More...
 
void setDisplayName (const QString &display_name)
 Set display name. More...
 
void setEditable (bool enabled)
 
void setEnabled (bool enabled)
 Flags accessors. More...
 
void setFileName (const QString &filename)
 
void setGradient (const ComboProperty &gradient)
 
SessionItemsetGroupProperty (const QString &groupTag, const QString &modelType) const
 Set the current type of group item. More...
 
template<typename T >
T * setGroupPropertyType (const QString &groupTag)
 
void setItemName (const QString &name)
 Set item name, add property if necessary. More...
 
void setItemValue (const QString &tag, const QVariant &variant) const
 Directly set value of item under given tag. More...
 
void setLastModified (const QDateTime &dtime)
 
SessionItemsetLimits (const RealLimits &value)
 
void setRawDataVector (const std::vector< double > &data)
 Sets the raw data vector from external source. Checks only the equality of data size; no dimension checks are applied. More...
 
bool setRoleProperty (int role, const QVariant &value)
 Set the contained role property to the given value. See also setTranslatorForRolePropertySetter. More...
 
SessionItemsetToolTip (const QString &tooltip)
 
bool setValue (QVariant value)
 Set value, ensure that variant types match. More...
 
void setXaxisTitle (const QString &title) override
 
void setYaxisTitle (const QString &title) override
 
void setZAxisLocked (bool state)
 
std::vector< int > shape () const override
 
QString tagFromItem (const SessionItem *item) const
 Returns the tag name of given item when existing. More...
 
SessionItemtakeItem (int row, const QString &tag)
 Remove item from given row from given tag. More...
 
SessionItemtakeRow (int row)
 Removes row from item and returns the item. More...
 
QString toolTip () const
 
void updateCoords (const InstrumentItem *instrument) override
 
void updateDataRange ()
 Sets min,max values for z-axis, if axes is not locked, and ranges are not yet set. More...
 
QVariant value () const
 Get value. More...
 
virtual void writeNonSessionItems (QXmlStreamWriter *writer) const
 
BasicAxisItemxAxisItem ()
 
const BasicAxisItemxAxisItem () const
 
double xMax () const
 
double xMin () const
 Returns min and max range of x-axis as given by IntensityData. More...
 
int xSize () const
 
BasicAxisItemyAxisItem ()
 
const BasicAxisItemyAxisItem () const
 
double yMax () const
 
double yMin () const
 Returns min and max range of y-axis as given by IntensityData. More...
 
int ySize () const
 
AmplitudeAxisItemzAxisItem ()
 
const AmplitudeAxisItemzAxisItem () const
 

Static Public Member Functions

static bool isAxesUnitsPropertyName (const QString &name)
 
static bool isGradientPropertyName (const QString &name)
 
static bool isInterpolatedPropertyName (const QString &name)
 
static bool isItemNamePropertyName (const QString &name)
 
static bool isXaxisPropertyName (const QString &name)
 
static bool isYaxisPropertyName (const QString &name)
 
static bool isZaxisPropertyName (const QString &name)
 
static void updateAxesUnits (SessionItem *item, const QString &name, InstrumentItem *instrumentItem)
 

Static Public Attributes

static constexpr auto M_TYPE {"IntensityData"}
 

Protected Attributes

std::unique_ptr< Datafield > m_data
 simulation results More...
 
QDateTime m_last_modified
 
std::mutex m_update_data_mutex
 

Private Member Functions

void changeFlags (bool enabled, int flag)
 internal More...
 
void childDeleted (SessionItem *child)
 
int flags () const
 
int getCopyNumberOfChild (const SessionItem *item) const
 internal More...
 
void setModel (SessionModel *model)
 
void setParentAndModel (SessionItem *parent, SessionModel *model)
 
void updateAxesLabels ()
 Init axes labels, if it was not done already. More...
 
void updateAxesZoomLevel ()
 Sets zoom range of X,Y axes, if it was not yet defined. More...
 

Private Attributes

QVector< SessionItem * > m_children
 
std::unique_ptr< ModelMapperm_mapper
 
SessionModelm_model
 
SessionItemm_parent
 
std::unique_ptr< SessionItemDatam_properties
 
std::unique_ptr< SessionItemTagsm_tags
 

Static Private Attributes

static constexpr auto P_AXES_UNITS {"Axes Units"}
 
static constexpr auto P_FILE_NAME {"FileName"}
 
static constexpr auto P_GRADIENT {"Gradient"}
 
static constexpr auto P_IS_INTERPOLATED {"Interpolation"}
 
static constexpr auto P_NAME {"Name"}
 
static constexpr auto P_PROJECTIONS {"Projections"}
 
static constexpr auto P_TITLE {"Title"}
 
static constexpr auto P_XAXIS {"x-axis"}
 
static constexpr auto P_YAXIS {"y-axis"}
 
static constexpr auto P_ZAXIS {"color-axis"}
 
static constexpr auto T_MASKS {"Mask tag"}
 
static constexpr auto T_PROJECTIONS {"Projection tag"}
 

Constructor & Destructor Documentation

◆ IntensityDataItem()

IntensityDataItem::IntensityDataItem ( )

Definition at line 51 of file IntensityDataItem.cpp.

52  : DataItem(M_TYPE)
53 {
54  addProperty(P_TITLE, QString());
55 
56  addProperty(P_PROJECTIONS, false);
58  addProperty(P_GRADIENT, gradientCombo().variant());
59  addProperty<BasicAxisItem>(P_XAXIS);
60  addProperty<BasicAxisItem>(P_YAXIS);
61  addProperty<AmplitudeAxisItem>(P_ZAXIS);
62 
65 
68 
70 }
const QString y_axis_default_name
const QString x_axis_default_name
DataItem(const QString &modelType)
Definition: DataItem.cpp:127
static constexpr auto P_ZAXIS
void setXaxisTitle(const QString &title) override
void setYaxisTitle(const QString &title) override
static constexpr auto M_TYPE
static constexpr auto P_YAXIS
static constexpr auto P_PROJECTIONS
static constexpr auto P_IS_INTERPOLATED
static constexpr auto P_XAXIS
static constexpr auto T_PROJECTIONS
static constexpr auto P_TITLE
static constexpr auto T_MASKS
static constexpr auto P_GRADIENT
static constexpr auto M_TYPE
Definition: MaskItems.h:204
static constexpr auto M_TYPE
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag. name is the tag name and the display name....
bool registerTag(const QString &name, int min=0, int max=-1, QStringList modelTypes={})
Add new tag to this item with given name, min, max and types. max = -1 -> unlimited,...
void setDefaultTag(const QString &tag)
Set default tag.

References SessionItem::addProperty(), ProjectionContainerItem::M_TYPE, MaskContainerItem::M_TYPE, P_GRADIENT, P_IS_INTERPOLATED, P_PROJECTIONS, P_TITLE, P_XAXIS, P_YAXIS, P_ZAXIS, SessionItem::registerTag(), SessionItem::setDefaultTag(), setXaxisTitle(), setYaxisTitle(), T_MASKS, T_PROJECTIONS, x_axis_default_name, and y_axis_default_name.

Here is the call graph for this function:

Member Function Documentation

◆ acceptableDefaultItemTypes()

QVector< QString > SessionItem::acceptableDefaultItemTypes ( ) const
inherited

Returns vector of acceptable default tag types.

Definition at line 193 of file SessionItem.cpp.

194 {
195  return m_tags->modelTypesForTag(defaultTag()).toVector();
196 }
QString defaultTag() const
Get default tag.
std::unique_ptr< SessionItemTags > m_tags
Definition: SessionItem.h:334

References SessionItem::defaultTag(), and SessionItem::m_tags.

Here is the call graph for this function:

◆ acceptsAsDefaultItem()

bool SessionItem::acceptsAsDefaultItem ( const QString &  item_name) const
inherited

Returns true if model type can be added to default tag.

Definition at line 186 of file SessionItem.cpp.

187 {
188  return m_tags->isValid(defaultTag(), item_name);
189 }

References SessionItem::defaultTag(), and SessionItem::m_tags.

Here is the call graph for this function:

◆ addGroupProperty()

SessionItem * SessionItem::addGroupProperty ( const QString &  groupTag,
const GroupInfo groupInfo 
)
inherited

Definition at line 306 of file SessionItem.cpp.

307 {
310  ASSERT(groupItem);
311  groupItem->setGroupInfo(groupInfo);
312  registerTag(groupTag, 1, 1, {GroupItem::M_TYPE});
313  groupItem->setDisplayName(groupTag);
314  insertChild(0, groupItem, groupTag);
315  return groupItem;
316 }
static constexpr auto M_TYPE
Definition: GroupItem.h:30
T & groupItem(const QString &groupName) const
Definition: SessionItem.h:413
void insertChild(int row, SessionItem *item, const QString &tag="")
Insert item into given tag into given row.
SessionItem * CreateItem(const QString &model_name, SessionItem *parent=nullptr)
create SessionItem of specific type and parent
Definition: ItemFactory.cpp:19

References GUI::Model::ItemFactory::CreateItem(), SessionItem::groupItem(), SessionItem::insertChild(), GroupItem::M_TYPE, and SessionItem::registerTag().

Referenced by MinimizerContainerItem::MinimizerContainerItem().

Here is the call graph for this function:

◆ addProperty() [1/2]

template<typename T >
T * SessionItem::addProperty ( const QString &  name)
inherited

Definition at line 394 of file SessionItem.h.

395 {
396  auto property = new T;
397  property->setDisplayName(tagname);
398  registerTag(tagname, 1, 1, QStringList() << property->modelType());
399  insertChild(0, property, tagname);
400  return property;
401 }

References SessionItem::insertChild(), SessionItem::registerTag(), and SessionItem::setDisplayName().

Here is the call graph for this function:

◆ addProperty() [2/2]

SessionItem * SessionItem::addProperty ( const QString &  name,
const QVariant &  variant 
)
inherited

Add new property item and register new tag. name is the tag name and the display name. The property's value will be set to variant.

Definition at line 278 of file SessionItem.cpp.

279 {
280  ASSERT(!isTag(name));
281 
283  property->setDisplayName(name);
285  insertChild(0, property, name);
286  property->setValue(variant);
287  return property;
288 }
static constexpr auto M_TYPE
Definition: PropertyItem.h:22
Base class for a GUI data item.
Definition: SessionItem.h:204
bool isTag(const QString &name) const
Returns true if tag is available.
QString const & name(EShape k)
Definition: particles.cpp:20

References GUI::Model::ItemFactory::CreateItem(), SessionItem::insertChild(), SessionItem::isTag(), PropertyItem::M_TYPE, GUI::RealSpace::Particles::name(), and SessionItem::registerTag().

Referenced by AmplitudeAxisItem::AmplitudeAxisItem(), BasicAxisItem::BasicAxisItem(), Data1DProperties::Data1DProperties(), Data1DViewItem::Data1DViewItem(), DataItem::DataItem(), DataProperties::DataProperties(), EllipseItem::EllipseItem(), FitParameterItem::FitParameterItem(), FitParameterLinkItem::FitParameterLinkItem(), FitSuiteItem::FitSuiteItem(), GeneticMinimizerItem::GeneticMinimizerItem(), GSLLMAMinimizerItem::GSLLMAMinimizerItem(), GSLMultiMinimizerItem::GSLMultiMinimizerItem(), HorizontalLineItem::HorizontalLineItem(), IntensityDataItem(), JobItem::JobItem(), MaskItem::MaskItem(), MinimizerContainerItem::MinimizerContainerItem(), MinuitMinimizerItem::MinuitMinimizerItem(), PointwiseAxisItem::PointwiseAxisItem(), PolygonItem::PolygonItem(), PolygonPointItem::PolygonPointItem(), RealDataItem::RealDataItem(), RectangleItem::RectangleItem(), SimAnMinimizerItem::SimAnMinimizerItem(), SpecularDataItem::SpecularDataItem(), VerticalLineItem::VerticalLineItem(), and SessionItem::setItemName().

Here is the call graph for this function:

◆ allowWritingChildToXml()

bool SessionItem::allowWritingChildToXml ( SessionItem child) const
virtualinherited

Definition at line 528 of file SessionItem.cpp.

529 {
530  return true;
531 }

Referenced by GUI::Session::XML::writeItemAndChildItems().

◆ axesUnits()

SelectionDescriptor< QString > DataItem::axesUnits ( ) const
inherited

Definition at line 108 of file DataItem.cpp.

109 {
111 }
static constexpr auto P_AXES_UNITS
Definition: DataItem.h:38
Describes a selection (various possibilities and the current one).
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.

References SessionItem::getItem(), and DataItem::P_AXES_UNITS.

Referenced by IntensityDataPropertyWidget::setItem().

Here is the call graph for this function:

◆ axesUnitsChanged

void DataItem::axesUnitsChanged ( const ComboProperty units)
signalinherited

◆ changeFlags()

void SessionItem::changeFlags ( bool  enabled,
int  flag 
)
privateinherited

internal

Definition at line 568 of file SessionItem.cpp.

569 {
570  int flags = this->flags();
571  if (enabled)
572  flags |= flag;
573  else
574  flags &= ~flag;
575 
577 }
int flags() const
bool setRoleProperty(int role, const QVariant &value)
Set the contained role property to the given value. See also setTranslatorForRolePropertySetter.

References SessionFlags::FlagRole, SessionItem::flags(), and SessionItem::setRoleProperty().

Referenced by SessionItem::setEditable(), and SessionItem::setEnabled().

Here is the call graph for this function:

◆ childAt()

SessionItem * SessionItem::childAt ( int  row) const
inherited

Returns the child at the given row.

Definition at line 102 of file SessionItem.cpp.

103 {
104  return m_children.value(row, nullptr);
105 }
QVector< SessionItem * > m_children
Definition: SessionItem.h:332

References SessionItem::m_children.

Referenced by SessionModel::index(), and SessionItem::takeRow().

◆ childDeleted()

void SessionItem::childDeleted ( SessionItem child)
privateinherited

Definition at line 533 of file SessionItem.cpp.

534 {
535  int index = rowOfChild(child);
536  ASSERT(index != -1);
537  m_children.replace(index, nullptr);
538 }
int rowOfChild(SessionItem *child) const
Returns row index of given child.
QModelIndex index() const
Returns model index of this item.
Definition: SessionItem.cpp:74

References SessionItem::index(), SessionItem::m_children, and SessionItem::rowOfChild().

Referenced by SessionItem::~SessionItem().

Here is the call graph for this function:

◆ children()

QVector< SessionItem * > SessionItem::children ( ) const
inherited

Returns vector of all children.

Definition at line 95 of file SessionItem.cpp.

96 {
97  return m_children;
98 }

References SessionItem::m_children.

Referenced by MaskContainerItem::maskItems(), DataPropertyContainer::propertyItem(), and GUI::Session::XML::writeItemAndChildItems().

◆ childrenOfType() [1/2]

template<typename T >
QVector< T * > SessionItem::childrenOfType
inherited

Definition at line 372 of file SessionItem.h.

373 {
374  QVector<T*> result;
375  for (auto* child : m_children)
376  if (child->modelType() == T::M_TYPE)
377  result.append(dynamic_cast<T*>(child));
378 
379  return result;
380 }

References SessionItem::m_children.

◆ childrenOfType() [2/2]

QVector< SessionItem * > SessionItem::childrenOfType ( const QString &  model_type) const
inherited

Returns a vector of all children of the given type.

Definition at line 127 of file SessionItem.cpp.

128 {
129  QVector<SessionItem*> result;
130  for (auto* child : m_children)
131  if (child->modelType() == model_type)
132  result.append(child);
133 
134  return result;
135 }

References SessionItem::m_children.

Referenced by ProjectionsPlot::projectionItems(), and SaveProjectionsAssistant::projectionItems().

◆ computeDataRange()

void IntensityDataItem::computeDataRange ( )

Definition at line 365 of file IntensityDataItem.cpp.

366 {
367  QPair<double, double> minmax = dataRange();
368  setLowerAndUpperZ(minmax.first, minmax.second);
369 }
QPair< double, double > dataRange() const
Init zmin, zmax to match the intensity values range.
void setLowerAndUpperZ(double zmin, double zmax)

References dataRange(), and setLowerAndUpperZ().

Referenced by resetView(), and updateDataRange().

Here is the call graph for this function:

◆ containsNonXMLData()

bool DataItem::containsNonXMLData ( ) const
overridevirtualinherited

Checks if object owns non-XML data.

Implements SaveLoadInterface.

Definition at line 59 of file DataItem.cpp.

60 {
61  return static_cast<bool>(m_data);
62 }
std::unique_ptr< Datafield > m_data
simulation results
Definition: DataItem.h:88

References DataItem::m_data.

Referenced by DataItem::saveData().

◆ datafieldChanged

void DataItem::datafieldChanged ( Datafield *  data)
signalinherited

◆ dataRange()

QPair< double, double > IntensityDataItem::dataRange ( ) const

Init zmin, zmax to match the intensity values range.

Definition at line 372 of file IntensityDataItem.cpp.

373 {
374  const Datafield* data = getDatafield();
375 
376  const auto vec = data->flatVector();
377  double min(*std::min_element(vec.cbegin(), vec.cend()));
378  double max(*std::max_element(vec.cbegin(), vec.cend()));
379  if (isLogz()) {
380  if (max > 10000) {
381  min = 1.0;
382  max = max * 1.1;
383  } else {
384  min = max / 10000;
385  max = max * 1.1;
386  }
387  } else {
388  max = max * 1.1;
389  }
390 
391  return QPair<double, double>(min, max);
392 }
Datafield * getDatafield()
Definition: DataItem.h:41

References DataItem::getDatafield(), and isLogz().

Referenced by computeDataRange(), and GUI::View::RangeUtils::itemDataRange().

Here is the call graph for this function:

◆ decimals()

int SessionItem::decimals ( ) const
inherited

Definition at line 484 of file SessionItem.cpp.

485 {
486  return roleProperty(SessionFlags::DecimalRole).toInt();
487 }
QVariant roleProperty(int role) const
Returns corresponding variant under given role, invalid variant when role is not present.

References SessionFlags::DecimalRole, and SessionItem::roleProperty().

Referenced by GUI::View::PropertyEditorFactory::CreateEditor().

Here is the call graph for this function:

◆ defaultTag()

QString SessionItem::defaultTag ( ) const
inherited

Get default tag.

Definition at line 390 of file SessionItem.cpp.

391 {
392  return roleProperty(SessionFlags::DefaultTagRole).toString();
393 }

References SessionFlags::DefaultTagRole, and SessionItem::roleProperty().

Referenced by SessionItem::acceptableDefaultItemTypes(), SessionItem::acceptsAsDefaultItem(), SessionModel::copy(), SessionItem::getItem(), SessionItem::getItems(), SessionItem::insertChild(), SessionModel::insertNewItem(), SessionModel::moveItem(), and SessionItem::takeItem().

Here is the call graph for this function:

◆ deserializeBinaryData()

void SessionItem::deserializeBinaryData ( const QByteArray &  data)
virtualinherited

Reimplemented in PointwiseAxisItem, and RealDataItem.

Definition at line 522 of file SessionItem.cpp.

522 {}

Referenced by GUI::Session::XML::readItems().

◆ displayName()

QString SessionItem::displayName ( ) const
inherited

Get display name of item, append index if ambigue.

Definition at line 404 of file SessionItem.cpp.

405 {
406  QString result = roleProperty(SessionFlags::DisplayNameRole).toString();
407 
408  if (hasModelType<PropertyItem>() || hasModelType<GroupItem>())
409  return result;
410 
411  if (m_parent) {
412  QString tag = m_parent->tagFromItem(this);
413  // if only one child of this type is allowed, return name without change
415  return result;
416 
417  int index = m_parent->getCopyNumberOfChild(this);
418  if (index >= 0)
419  return result + QString::number(index);
420  }
421  return result;
422 }
bool isSingleItemTag(const QString &tagName) const
const SessionItemTags * sessionItemTags() const
int getCopyNumberOfChild(const SessionItem *item) const
internal
QString tagFromItem(const SessionItem *item) const
Returns the tag name of given item when existing.
SessionItem * m_parent
Definition: SessionItem.h:330

References SessionFlags::DisplayNameRole, SessionItem::getCopyNumberOfChild(), SessionItem::index(), SessionItemTags::isSingleItemTag(), SessionItem::m_parent, SessionItem::roleProperty(), SessionItem::sessionItemTags(), and SessionItem::tagFromItem().

Referenced by SelectionDescriptor< T >::SelectionDescriptor(), and SessionItem::itemName().

Here is the call graph for this function:

◆ emitDataChanged()

void SessionItem::emitDataChanged ( int  role = Qt::DisplayRole)
inherited

Notify model about data changes.

Definition at line 358 of file SessionItem.cpp.

359 {
360  if (m_model) {
361  QModelIndex index = m_model->indexOfItem(this);
362  m_model->dataChanged(index, index.sibling(index.row(), 1), QVector<int>() << role);
363  }
364 }
SessionModel * m_model
Definition: SessionItem.h:331
QModelIndex indexOfItem(SessionItem *item) const

References SessionItem::index(), SessionModel::indexOfItem(), and SessionItem::m_model.

Referenced by GroupItem::onValueChange(), setDatafield(), SpecularDataItem::setDatafield(), SessionItem::setRoleProperty(), and PointwiseAxisItem::updateIndicators().

Here is the call graph for this function:

◆ fileName() [1/4]

QString DataItem::fileName ( ) const
overridevirtualinherited

Reports file name to save/load non-XML data.

Implements SaveLoadInterface.

Definition at line 41 of file DataItem.cpp.

42 {
43  return getItemValue(P_FILE_NAME).toString();
44 }
static constexpr auto P_FILE_NAME
Definition: DataItem.h:37
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.

References SessionItem::getItemValue(), and DataItem::P_FILE_NAME.

Referenced by DataItem::loadData(), and DataItem::saveData().

Here is the call graph for this function:

◆ fileName() [2/4]

virtual QString SaveLoadInterface::fileName
inherited

Reports file name to save/load non-XML data.

◆ fileName() [3/4]

QString SaveLoadInterface::fileName
inherited

Reports file name to save/load non-XML data with directory name attached.

Definition at line 45 of file SaveLoadInterface.cpp.

19 {
20  return QString::fromStdString(
21  BaseUtils::Filesystem::jointPath(projectDir.toStdString(), fileName().toStdString()));
22 }
QString fileName() const override
Reports file name to save/load non-XML data.
Definition: DataItem.cpp:41
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.

◆ fileName() [4/4]

QString SaveLoadInterface::fileName ( const QString &  projectDir) const
inherited

Reports file name to save/load non-XML data with directory name attached.

Definition at line 18 of file SaveLoadInterface.cpp.

19 {
20  return QString::fromStdString(
21  BaseUtils::Filesystem::jointPath(projectDir.toStdString(), fileName().toStdString()));
22 }
virtual QString fileName() const =0
Reports file name to save/load non-XML data.

References SaveLoadInterface::fileName(), and GUI::Project::Utils::projectDir().

Here is the call graph for this function:

◆ fileNameChanged

void DataItem::fileNameChanged ( const QString &  filename)
signalinherited

Referenced by DataItem::setFileName().

◆ firstChildOfType()

template<typename T >
T * SessionItem::firstChildOfType
inherited

Definition at line 384 of file SessionItem.h.

385 {
386  for (auto* child : m_children)
387  if (child->modelType() == T::M_TYPE)
388  return dynamic_cast<T*>(child);
389 
390  return nullptr;
391 }

References SessionItem::m_children.

◆ flags()

int SessionItem::flags ( ) const
privateinherited

Definition at line 557 of file SessionItem.cpp.

558 {
560 
561  if (!flags.isValid())
563 
564  return flags.toInt();
565 }

References SessionFlags::EDITABLE, SessionFlags::ENABLED, SessionFlags::FlagRole, SessionItem::roleProperty(), and SessionFlags::VISIBLE.

Referenced by SessionItem::changeFlags(), SessionItem::isEditable(), and SessionItem::isEnabled().

Here is the call graph for this function:

◆ getAxesUnitsItem()

SessionItem * DataItem::getAxesUnitsItem ( ) const
inherited

Definition at line 103 of file DataItem.cpp.

104 {
105  return getItem(P_AXES_UNITS);
106 }

References SessionItem::getItem(), and DataItem::P_AXES_UNITS.

Here is the call graph for this function:

◆ getChildOfType()

SessionItem * SessionItem::getChildOfType ( const QString &  type) const
inherited

Returns the first child of the given type.

Definition at line 116 of file SessionItem.cpp.

117 {
118  for (auto* child : m_children)
119  if (child->modelType() == type)
120  return child;
121 
122  return nullptr;
123 }

References SessionItem::m_children.

Referenced by GroupItemController::currentItem(), GroupItemController::getItemOfType(), and GroupItemController::setCurrentType().

◆ getCopyNumberOfChild()

int SessionItem::getCopyNumberOfChild ( const SessionItem item) const
privateinherited

internal

Definition at line 580 of file SessionItem.cpp.

581 {
582  if (!item)
583  return -1;
584  int result = -1;
585  int count = 0;
586  QString model_type = item->modelType();
587  // check child items:
588  for (auto* p_child_item : m_children) {
589  QString child_type = p_child_item->modelType();
590  if (p_child_item == item)
591  result = count;
592  if (child_type == model_type && !p_child_item->isTag(P_NAME))
593  ++count;
594  }
595  if (count > 1)
596  return result;
597  return -1;
598 }
T * item(const QString &tag) const
Definition: SessionItem.h:353
static constexpr auto P_NAME
Definition: SessionItem.h:208

References SessionItem::item(), SessionItem::m_children, and SessionItem::P_NAME.

Referenced by SessionItem::displayName().

Here is the call graph for this function:

◆ getDatafield() [1/2]

◆ getDatafield() [2/2]

const Datafield* DataItem::getDatafield ( ) const
inlineinherited

Definition at line 42 of file DataItem.h.

42 { return m_data.get(); }

◆ getGradient()

ComboProperty IntensityDataItem::getGradient ( ) const

Definition at line 155 of file IntensityDataItem.cpp.

156 {
157  return getItemValue(P_GRADIENT).value<ComboProperty>();
158 }
Custom property to define list of string values with multiple selections. Intended for QVariant.
Definition: ComboProperty.h:25

References SessionItem::getItemValue(), and P_GRADIENT.

Referenced by IntensityDataCanvas::applyPersistentSettings(), and getGradientValue().

Here is the call graph for this function:

◆ getGradientValue()

QString IntensityDataItem::getGradientValue ( ) const

Definition at line 150 of file IntensityDataItem.cpp.

151 {
152  return getGradient().getValue();
153 }
QString getValue() const
ComboProperty getGradient() const

References getGradient(), and ComboProperty::getValue().

Referenced by GUI::View::RangeUtils::itemGradient().

Here is the call graph for this function:

◆ getGroupItem()

SessionItem * SessionItem::getGroupItem ( const QString &  groupName) const
inherited

Access subitem of group item.

Definition at line 327 of file SessionItem.cpp.

328 {
329  return item<GroupItem>(groupName)->currentItem();
330 }

Referenced by SessionItem::groupItem(), and SessionItem::setGroupPropertyType().

◆ getItem()

SessionItem * SessionItem::getItem ( const QString &  tag = "",
int  row = 0 
) const
inherited

Returns item in given row of given tag.

Definition at line 200 of file SessionItem.cpp.

201 {
202  const QString tagName = tag.isEmpty() ? defaultTag() : tag;
203 
204  if (!m_tags->isValid(tagName))
205  return nullptr;
206 
207  if (m_tags->childCount(tagName) == 0)
208  return nullptr;
209 
210  if (row < 0 || row >= m_tags->childCount(tagName))
211  return nullptr;
212 
213  int index = m_tags->indexFromTagRow(tagName, row);
214  ASSERT(index >= 0);
215  ASSERT(index < m_children.size());
216  return m_children[index];
217 }

References SessionItem::defaultTag(), SessionItem::index(), SessionItem::m_children, and SessionItem::m_tags.

Referenced by FitParameterItem::FitParameterItem(), EllipseItem::angle(), DataItem::axesUnits(), Data1DViewItem::axesUnitsDescriptor(), BasicAxisItem::binsItem(), FitSuiteItem::createFitParametersContainer(), JobItem::createFitSuiteItem(), FitSuiteItem::createMinimizerContainer(), JobItem::dataItem(), RealDataItem::dataItem(), JobItem::dataItemView(), JobItem::fitSuiteItem(), DataItem::getAxesUnitsItem(), SessionItem::getItemValue(), gradient(), RealDataItem::initDataItem(), FitParameterItem::initMinMaxValues(), JobItem::intensityDataItem(), JobItem::isValidForFitting(), SessionItem::item(), FitParameterLinkItem::linkItem(), AmplitudeAxisItem::logScaleItem(), maskContainerItem(), MaskItem::maskValueItem(), BasicAxisItem::max(), FitParameterItem::maximumItem(), BasicAxisItem::maxItem(), BasicAxisItem::min(), FitParameterItem::minimumItem(), BasicAxisItem::minItem(), RealDataItem::nativeData(), MinimizerContainerItem::normFunction(), MinimizerContainerItem::objectiveMetric(), VerticalLineItem::posX(), HorizontalLineItem::posY(), projectionContainerItem(), JobItem::realDataItem(), BasicAxisItem::serialize(), PolygonPointItem::serialize(), AmplitudeAxisItem::serialize(), RectangleItem::serialize(), PolygonItem::serialize(), VerticalLineItem::serialize(), HorizontalLineItem::serialize(), EllipseItem::serialize(), MaskAllItem::serialize(), PointwiseAxisItem::serialize(), SessionItem::setItemValue(), FitParameterItem::setLimitEnabled(), RealDataItem::setNativeDataUnits(), FitParameterItem::startValueItem(), BasicAxisItem::titleItem(), FitParameterItem::typeItem(), MinuitMinimizerItem::valueDescriptorsForUI(), GSLMultiMinimizerItem::valueDescriptorsForUI(), GeneticMinimizerItem::valueDescriptorsForUI(), SimAnMinimizerItem::valueDescriptorsForUI(), GSLLMAMinimizerItem::valueDescriptorsForUI(), BasicAxisItem::visibilityItem(), EllipseItem::xCenter(), RectangleItem::xLow(), EllipseItem::xRadius(), RectangleItem::xUp(), EllipseItem::yCenter(), RectangleItem::yLow(), EllipseItem::yRadius(), and RectangleItem::yUp().

Here is the call graph for this function:

◆ getItems()

QVector< SessionItem * > SessionItem::getItems ( const QString &  tag = "") const
inherited

Returns vector of all items of given tag.

Definition at line 221 of file SessionItem.cpp.

222 {
223  const QString tagName = tag.isEmpty() ? defaultTag() : tag;
224  if (!m_tags->isValid(tagName))
225  return QVector<SessionItem*>();
226 
227  int index = m_tags->tagStartIndex(tagName);
228  ASSERT(index >= 0 && index <= m_children.size());
229  return m_children.mid(index, m_tags->childCount(tagName));
230 }

References SessionItem::defaultTag(), SessionItem::index(), SessionItem::m_children, and SessionItem::m_tags.

Referenced by MaskUnitsConverter::convertIntensityDataItem(), SessionModel::copy(), GroupItem::groupItems(), SessionItem::items(), SessionModel::moveItem(), DataPropertyContainer::propertyItem(), DataPropertyContainer::propertyItems(), and SessionItem::takeRow().

Here is the call graph for this function:

◆ getItemValue()

QVariant SessionItem::getItemValue ( const QString &  tag) const
inherited

Directly access value of item under given tag.

Definition at line 292 of file SessionItem.cpp.

293 {
294  ASSERT(isTag(tag));
295  return getItem(tag)->value();
296 }
QVariant value() const
Get value.

References SessionItem::getItem(), SessionItem::isTag(), and SessionItem::value().

Referenced by FitParameterItem::attLimits(), Data1DViewItem::axesUnits(), JobItem::beginTime(), BasicAxisItem::binCount(), FitSuiteItem::chi2(), Data1DProperties::color(), Data1DProperties::colorName(), MaskUnitsConverter::convertCoordinate(), MinimizerContainerItem::createMetric(), MinuitMinimizerItem::createMinimizer(), GSLMultiMinimizerItem::createMinimizer(), GeneticMinimizerItem::createMinimizer(), SimAnMinimizerItem::createMinimizer(), GSLLMAMinimizerItem::createMinimizer(), RectangleItem::createShape(), VerticalLineItem::createShape(), HorizontalLineItem::createShape(), EllipseItem::createShape(), DataProperties::dataItem(), JobItem::endTime(), DataItem::fileName(), JobItem::getComments(), getGradient(), JobItem::getIdentifier(), JobItem::getProgress(), JobItem::getStatus(), PointwiseAxisItem::getUnitsLabel(), FitParameterItem::initMinMaxValues(), RealDataItem::instrumentId(), JobItem::instrumentName(), PolygonItem::isClosed(), isInterpolated(), AmplitudeAxisItem::isLocked(), AmplitudeAxisItem::isLogScale(), BasicAxisItem::isTitleVisible(), FitParameterItem::isValid(), MaskItem::isVisibleValue(), SessionItem::itemName(), FitSuiteItem::iterationCount(), Data1DProperties::line(), FitParameterLinkItem::link(), MaskItem::maskValue(), FitParameterItem::maximum(), FitParameterItem::minimum(), RealDataItem::nativeDataUnits(), Data1DProperties::nextColorName(), PropertyRepeater::onPropertyChanged(), FitParameterItem::parameterType(), PolygonPointItem::posX(), PolygonPointItem::posY(), JobItem::presentationType(), Data1DProperties::scatter(), DataItem::selectedCoords(), PropertyRepeater::setOnChildPropertyChange(), FitParameterItem::startValue(), BasicAxisItem::title(), FitParameterLinkItem::title(), and FitSuiteItem::updateInterval().

Here is the call graph for this function:

◆ getLowerX()

double IntensityDataItem::getLowerX ( ) const

Returns lower and upper zoom ranges of x-axis.

Definition at line 96 of file IntensityDataItem.cpp.

97 {
98  return xAxisItem()->min();
99 }
DoubleDescriptor min(const QString &unit=QString()) const
Definition: AxesItems.cpp:41
const BasicAxisItem * xAxisItem() const

References BasicAxisItem::min(), and xAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemZoomX(), ColorMap::setAxesZoomFromItem(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ getLowerY()

double IntensityDataItem::getLowerY ( ) const

Returns lower and upper zoom ranges of y-axis.

Definition at line 118 of file IntensityDataItem.cpp.

119 {
120  return yAxisItem()->min();
121 }
const BasicAxisItem * yAxisItem() const

References BasicAxisItem::min(), and yAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemZoomY(), ColorMap::setAxesZoomFromItem(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ getLowerZ()

double IntensityDataItem::getLowerZ ( ) const

Returns lower and upper zoom ranges of z-axis.

Definition at line 140 of file IntensityDataItem.cpp.

141 {
142  return zAxisItem()->min();
143 }
const AmplitudeAxisItem * zAxisItem() const

References BasicAxisItem::min(), and zAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), GUI::View::RangeUtils::itemDataZoom(), FitComparisonController2D::setItem(), and setLowerAndUpperZ().

Here is the call graph for this function:

◆ getOrCreateMaskContainerItem()

MaskContainerItem * IntensityDataItem::getOrCreateMaskContainerItem ( )

Definition at line 446 of file IntensityDataItem.cpp.

447 {
449  if (!result)
450  result = model()->insertItem<MaskContainerItem>(this, -1, T_MASKS);
451  return result;
452 }
MaskContainerItem * maskContainerItem()
Container holding various masks as children.
Definition: MaskItems.h:202
SessionModel * model() const
Returns model of this item.
Definition: SessionItem.cpp:60
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
Definition: SessionModel.h:137

References SessionModel::insertItem(), maskContainerItem(), SessionItem::model(), and T_MASKS.

Referenced by RealDataMaskWidget::maskContainer().

Here is the call graph for this function:

◆ getOrCreateProjectionContainerItem()

ProjectionContainerItem * IntensityDataItem::getOrCreateProjectionContainerItem ( )

Definition at line 464 of file IntensityDataItem.cpp.

465 {
467  if (!result)
468  result = model()->insertItem<ProjectionContainerItem>(this, -1, T_PROJECTIONS);
469  return result;
470 }
ProjectionContainerItem * projectionContainerItem()
A container to hold ProjectionItems, intended to store projections of color map on X,...

References SessionModel::insertItem(), SessionItem::model(), projectionContainerItem(), and T_PROJECTIONS.

Referenced by IntensityDataProjectionsWidget::projectionContainer().

Here is the call graph for this function:

◆ getRoles()

QVector< int > SessionItem::getRoles ( ) const
inherited

Returns vector of all present roles.

Definition at line 351 of file SessionItem.cpp.

352 {
353  return m_properties->roles();
354 }
std::unique_ptr< SessionItemData > m_properties
Definition: SessionItem.h:333

References SessionItem::m_properties.

Referenced by GUI::Session::XML::writeItemAndChildItems().

◆ getUpperX()

double IntensityDataItem::getUpperX ( ) const

Definition at line 101 of file IntensityDataItem.cpp.

102 {
103  return xAxisItem()->max();
104 }
DoubleDescriptor max(const QString &unit=QString()) const
Definition: AxesItems.cpp:58

References BasicAxisItem::max(), and xAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemZoomX(), ColorMap::setAxesZoomFromItem(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ getUpperY()

double IntensityDataItem::getUpperY ( ) const

Definition at line 123 of file IntensityDataItem.cpp.

124 {
125  return yAxisItem()->max();
126 }

References BasicAxisItem::max(), and yAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemZoomY(), ColorMap::setAxesZoomFromItem(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ getUpperZ()

double IntensityDataItem::getUpperZ ( ) const

Definition at line 145 of file IntensityDataItem.cpp.

146 {
147  return zAxisItem()->max();
148 }

References BasicAxisItem::max(), and zAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), GUI::View::RangeUtils::itemDataZoom(), and setLowerAndUpperZ().

Here is the call graph for this function:

◆ getXaxisTitle()

QString IntensityDataItem::getXaxisTitle ( ) const

Definition at line 180 of file IntensityDataItem.cpp.

181 {
182  return xAxisItem()->title();
183 }
QString title() const
Definition: AxesItems.cpp:80

References BasicAxisItem::title(), and xAxisItem().

Referenced by ColorMap::setAxesLabelsFromItem(), and updateAxesLabels().

Here is the call graph for this function:

◆ getYaxisTitle()

QString IntensityDataItem::getYaxisTitle ( ) const

Definition at line 185 of file IntensityDataItem.cpp.

186 {
187  return yAxisItem()->title();
188 }

References BasicAxisItem::title(), and yAxisItem().

Referenced by ColorMap::setAxesLabelsFromItem(), and updateAxesLabels().

Here is the call graph for this function:

◆ gradient()

SelectionDescriptor< QString > IntensityDataItem::gradient ( ) const

Definition at line 165 of file IntensityDataItem.cpp.

166 {
168 }

References SessionItem::getItem(), and P_GRADIENT.

Referenced by setGradient(), and IntensityDataPropertyWidget::setItem().

Here is the call graph for this function:

◆ groupItem()

template<typename T >
T & SessionItem::groupItem ( const QString &  groupName) const
inherited

Definition at line 413 of file SessionItem.h.

414 {
415  auto* t = dynamic_cast<T*>(getGroupItem(groupName));
416  ASSERT(t);
417  return *t;
418 }
SessionItem * getGroupItem(const QString &groupName) const
Access subitem of group item.

References SessionItem::getGroupItem().

Referenced by SessionItem::addGroupProperty().

Here is the call graph for this function:

◆ hasChildren()

bool SessionItem::hasChildren ( ) const
inherited

Indicates whether this SessionItem has any child items.

Definition at line 81 of file SessionItem.cpp.

82 {
83  return numberOfChildren() > 0;
84 }
int numberOfChildren() const
Returns total number of children.
Definition: SessionItem.cpp:88

References SessionItem::numberOfChildren().

Referenced by hasProjections().

Here is the call graph for this function:

◆ hasMasks()

bool IntensityDataItem::hasMasks ( ) const

Definition at line 472 of file IntensityDataItem.cpp.

473 {
474  return (maskContainerItem() && !maskContainerItem()->maskItems().isEmpty());
475 }

References maskContainerItem().

Here is the call graph for this function:

◆ hasModelType()

template<typename T >
bool SessionItem::hasModelType
inherited

Definition at line 421 of file SessionItem.h.

422 {
423  return modelType() == T::M_TYPE;
424 }
QString modelType() const
Get model type.

References SessionItem::modelType().

Referenced by MaskViewFactory::createMaskView(), FitParameterModel::flags(), FitParameterModel::index(), FitParameterModel::indexOfItem(), FitParameterWidget::onFitParametersSelectionChanged(), FitParameterModel::rowCount(), and MaskGraphicsScene::updateViews().

Here is the call graph for this function:

◆ hasProjections()

bool IntensityDataItem::hasProjections ( ) const

Definition at line 477 of file IntensityDataItem.cpp.

478 {
480 }
bool hasChildren() const
Indicates whether this SessionItem has any child items.
Definition: SessionItem.cpp:81

References SessionItem::hasChildren(), and projectionContainerItem().

Here is the call graph for this function:

◆ index()

QModelIndex SessionItem::index ( ) const
inherited

◆ insertChild()

void SessionItem::insertChild ( int  row,
SessionItem item,
const QString &  tag = "" 
)
inherited

Insert item into given tag into given row.

Definition at line 233 of file SessionItem.cpp.

234 {
235  ASSERT(item);
236  ASSERT(!item->parentItem());
237 
238  const QString tagName = tag.isEmpty() ? defaultTag() : tag;
239  ASSERT(m_tags->isValid(tagName, item->modelType()));
240 
241  int index = m_tags->insertIndexFromTagRow(tagName, row);
242  ASSERT(index >= 0);
243  ASSERT(index <= m_children.size());
244 
245  if (m_model)
246  m_model->beginInsertRows(this->index(), index, index);
247 
248  item->setParentAndModel(this, m_model);
249  m_children.insert(index, item);
250 
251  m_tags->addChild(tagName);
252  if (m_model)
253  m_model->endInsertRows();
254 }

References SessionItem::defaultTag(), SessionItem::index(), SessionItem::item(), SessionItem::m_children, SessionItem::m_model, and SessionItem::m_tags.

Referenced by GroupItemController::GroupItemController(), JobItem::addDataViewItem(), SessionItem::addGroupProperty(), DataPropertyContainer::addItem(), MaskContainerItem::addMask(), PolygonItem::addPoint(), SessionItem::addProperty(), GUI::Model::ItemFactory::CreateItem(), GroupItemController::getItemOfType(), MaskItems::insertMask(), MaskContainerItem::insertMask(), SessionModel::insertNewItem(), SessionModel::moveItem(), and GroupItemController::setCurrentType().

Here is the call graph for this function:

◆ isAxesUnitsPropertyName()

bool DataItem::isAxesUnitsPropertyName ( const QString &  name)
staticinherited

Definition at line 113 of file DataItem.cpp.

114 {
115  return name == P_AXES_UNITS;
116 }

References GUI::RealSpace::Particles::name(), and DataItem::P_AXES_UNITS.

Referenced by SpecularPlot::onPropertyChanged(), ColorMap::onPropertyChanged(), and DataItem::updateAxesUnits().

Here is the call graph for this function:

◆ isEditable()

bool SessionItem::isEditable ( ) const
inherited

Definition at line 468 of file SessionItem.cpp.

469 {
470  return flags() & SessionFlags::EDITABLE;
471 }

References SessionFlags::EDITABLE, and SessionItem::flags().

Referenced by SessionModel::flags().

Here is the call graph for this function:

◆ isEnabled()

bool SessionItem::isEnabled ( ) const
inherited

Definition at line 463 of file SessionItem.cpp.

464 {
465  return flags() & SessionFlags::ENABLED;
466 }

References SessionFlags::ENABLED, and SessionItem::flags().

Referenced by SessionModel::flags().

Here is the call graph for this function:

◆ isGradientPropertyName()

bool IntensityDataItem::isGradientPropertyName ( const QString &  name)
static

Definition at line 253 of file IntensityDataItem.cpp.

254 {
255  return name == P_GRADIENT;
256 }

References GUI::RealSpace::Particles::name(), and P_GRADIENT.

Referenced by IntensityDataCanvas::onPropertyChanged(), and ColorMap::onPropertyChanged().

Here is the call graph for this function:

◆ isInterpolated()

bool IntensityDataItem::isInterpolated ( ) const

Definition at line 175 of file IntensityDataItem.cpp.

176 {
177  return getItemValue(P_IS_INTERPOLATED).toBool();
178 }

References SessionItem::getItemValue(), and P_IS_INTERPOLATED.

Referenced by MaskResultsPresenter::backup_data(), and IntensityDataPropertyWidget::setItem().

Here is the call graph for this function:

◆ isInterpolatedPropertyName()

bool IntensityDataItem::isInterpolatedPropertyName ( const QString &  name)
static

Definition at line 248 of file IntensityDataItem.cpp.

249 {
250  return name == P_IS_INTERPOLATED;
251 }

References GUI::RealSpace::Particles::name(), and P_IS_INTERPOLATED.

Referenced by ProjectionsPlot::onIntensityItemPropertyChanged(), IntensityDataCanvas::onPropertyChanged(), and ColorMap::onPropertyChanged().

Here is the call graph for this function:

◆ isItemNamePropertyName()

bool SessionItem::isItemNamePropertyName ( const QString &  name)
staticinherited

Definition at line 446 of file SessionItem.cpp.

447 {
448  return P_NAME == name;
449 }

References GUI::RealSpace::Particles::name(), and SessionItem::P_NAME.

Here is the call graph for this function:

◆ isLogz()

bool IntensityDataItem::isLogz ( ) const

Definition at line 170 of file IntensityDataItem.cpp.

171 {
172  return zAxisItem()->isLogScale();
173 }
bool isLogScale() const
Definition: AxesItems.cpp:178

References AmplitudeAxisItem::isLogScale(), and zAxisItem().

Referenced by dataRange(), and ColorMap::setDataRangeFromItem().

Here is the call graph for this function:

◆ isTag()

bool SessionItem::isTag ( const QString &  name) const
inherited

Returns true if tag is available.

Definition at line 166 of file SessionItem.cpp.

167 {
168  return m_tags->isValid(name);
169 }

References SessionItem::m_tags, and GUI::RealSpace::Particles::name().

Referenced by SessionItem::addProperty(), MaskUnitsConverter::convertCoordinate(), SessionItem::getItemValue(), JobItem::isValidForFitting(), SessionItem::itemName(), SessionItem::setItemName(), SessionItem::setItemValue(), and FitParameterItem::setLimitEnabled().

Here is the call graph for this function:

◆ isXaxisPropertyName()

bool IntensityDataItem::isXaxisPropertyName ( const QString &  name)
static

Definition at line 258 of file IntensityDataItem.cpp.

259 {
260  return name == P_XAXIS;
261 }

References GUI::RealSpace::Particles::name(), and P_XAXIS.

Referenced by ColorMap::onAxisPropertyChanged().

Here is the call graph for this function:

◆ isYaxisPropertyName()

bool IntensityDataItem::isYaxisPropertyName ( const QString &  name)
static

Definition at line 263 of file IntensityDataItem.cpp.

264 {
265  return name == P_YAXIS;
266 }

References GUI::RealSpace::Particles::name(), and P_YAXIS.

Referenced by ColorMap::onAxisPropertyChanged().

Here is the call graph for this function:

◆ isZAxisLocked()

bool IntensityDataItem::isZAxisLocked ( ) const

Returns true if min, max range of Z-axis is locked (change not allowed)

Definition at line 190 of file IntensityDataItem.cpp.

191 {
192  return item<AmplitudeAxisItem>(P_ZAXIS)->isLocked();
193 }

References P_ZAXIS.

Referenced by resetView(), and updateDataRange().

◆ isZaxisPropertyName()

bool IntensityDataItem::isZaxisPropertyName ( const QString &  name)
static

Definition at line 268 of file IntensityDataItem.cpp.

269 {
270  return name == P_ZAXIS;
271 }

References GUI::RealSpace::Particles::name(), and P_ZAXIS.

Referenced by ColorMap::onAxisPropertyChanged().

Here is the call graph for this function:

◆ item()

◆ itemName()

QString SessionItem::itemName ( ) const
inherited

Get item name, return display name if no name is set.

Definition at line 432 of file SessionItem.cpp.

433 {
434  return isTag(P_NAME) ? getItemValue(P_NAME).toString() : displayName();
435 }
QString displayName() const
Get display name of item, append index if ambigue.

References SessionItem::displayName(), SessionItem::getItemValue(), SessionItem::isTag(), and SessionItem::P_NAME.

Referenced by SessionModel::data(), RealDataItem::dataName(), JobItem::jobName(), MaskItem::maskName(), GUI::Session::XML::readItems(), MaskGraphicsScene::setItemName(), Plot1D::subscribeToItem(), SpecularPlot::subscribeToItem(), ColorMap::subscribeToItem(), ProjectionsPlot::subscribeToItem(), and JobItem::updateIntensityDataFileName().

Here is the call graph for this function:

◆ items()

template<typename T >
QVector< T * > SessionItem::items ( const QString &  tag = "") const
inherited

Definition at line 361 of file SessionItem.h.

362 {
363  QVector<T*> result;
364 
365  for (SessionItem* item : getItems(tag))
366  if (auto* titem = dynamic_cast<T*>(item))
367  result.push_back(titem);
368  return result;
369 }
QVector< SessionItem * > getItems(const QString &tag="") const
Returns vector of all items of given tag.

References SessionItem::getItems(), and SessionItem::item().

Referenced by DataPropertyContainer::dataItems(), SessionItem::takeRow(), and SessionModel::topItem().

Here is the call graph for this function:

◆ lastModified()

QDateTime DataItem::lastModified ( ) const
overridevirtualinherited

Indicates last modification timepoint.

Implements SaveLoadInterface.

Definition at line 54 of file DataItem.cpp.

55 {
56  return m_last_modified;
57 }
QDateTime m_last_modified
Definition: DataItem.h:89

References DataItem::m_last_modified.

◆ limits()

RealLimits SessionItem::limits ( ) const
inherited

Definition at line 473 of file SessionItem.cpp.

474 {
475  return roleProperty(SessionFlags::LimitsRole).value<RealLimits>();
476 }

References SessionFlags::LimitsRole, and SessionItem::roleProperty().

Referenced by GUI::View::PropertyEditorFactory::CreateEditor(), FitParameterContainerItem::createParameters(), and FitParameterItem::initMinMaxValues().

Here is the call graph for this function:

◆ loadData()

bool DataItem::loadData ( const QString &  projectDir)
overridevirtualinherited

Loads non-XML data from projectDir and returns success flag.

Implements SaveLoadInterface.

Definition at line 64 of file DataItem.cpp.

65 {
66  const QString filename = fileName(projectDir);
67  auto* data = IOFactory::readDatafield(filename.toStdString());
68  if (!data)
69  return false;
70  setDatafield(data);
71  return true;
72 }
virtual void setDatafield(Datafield *data)=0
The given pointer becomes owned by this class!!
Definition: DataItem.cpp:20

References DataItem::fileName(), GUI::Project::Utils::projectDir(), and DataItem::setDatafield().

Here is the call graph for this function:

◆ mapper()

ModelMapper * SessionItem::mapper ( )
inherited

◆ maskContainerItem() [1/2]

MaskContainerItem * IntensityDataItem::maskContainerItem ( )

Definition at line 436 of file IntensityDataItem.cpp.

437 {
438  return dynamic_cast<MaskContainerItem*>(getItem(T_MASKS));
439 }

References SessionItem::getItem(), and T_MASKS.

Referenced by MaskUnitsConverter::convertIntensityDataItem(), getOrCreateMaskContainerItem(), hasMasks(), MaskEditorCanvas::onPresentationTypeRequest(), and MaskEditorCanvas::setZoomToROI().

Here is the call graph for this function:

◆ maskContainerItem() [2/2]

const MaskContainerItem * IntensityDataItem::maskContainerItem ( ) const

Definition at line 441 of file IntensityDataItem.cpp.

442 {
443  return dynamic_cast<MaskContainerItem*>(getItem(T_MASKS));
444 }

References SessionItem::getItem(), and T_MASKS.

Here is the call graph for this function:

◆ model()

◆ modelType()

◆ numberOfChildren()

int SessionItem::numberOfChildren ( ) const
inherited

◆ parentItem()

◆ parentRow()

int SessionItem::parentRow ( )
inherited

Returns the index of the given item within its parent. Returns -1 when no parent is set.

Definition at line 148 of file SessionItem.cpp.

149 {
150  if (parentItem())
151  return parentItem()->rowOfChild(this);
152  return -1;
153 }
SessionItem * parentItem() const
Returns parent of this item.
Definition: SessionItem.cpp:67

References SessionItem::parentItem(), and SessionItem::rowOfChild().

Referenced by FitParameterModel::indexOfItem(), and FitParameterModel::parent().

Here is the call graph for this function:

◆ projectionContainerItem() [1/2]

ProjectionContainerItem * IntensityDataItem::projectionContainerItem ( )

Definition at line 454 of file IntensityDataItem.cpp.

455 {
456  return dynamic_cast<ProjectionContainerItem*>(getItem(T_PROJECTIONS));
457 }

References SessionItem::getItem(), and T_PROJECTIONS.

Referenced by MaskUnitsConverter::convertIntensityDataItem(), getOrCreateProjectionContainerItem(), hasProjections(), ProjectionsPlot::projectionContainerItem(), and SaveProjectionsAssistant::projectionItems().

Here is the call graph for this function:

◆ projectionContainerItem() [2/2]

const ProjectionContainerItem * IntensityDataItem::projectionContainerItem ( ) const

Definition at line 459 of file IntensityDataItem.cpp.

460 {
461  return dynamic_cast<ProjectionContainerItem*>(getItem(T_PROJECTIONS));
462 }

References SessionItem::getItem(), and T_PROJECTIONS.

Here is the call graph for this function:

◆ rawDataVectorChanged

void DataItem::rawDataVectorChanged ( const std::vector< double > &  data)
signalinherited

◆ readNonSessionItems()

void SessionItem::readNonSessionItems ( QXmlStreamReader *  reader)
virtualinherited

Reimplemented in JobItem.

Definition at line 526 of file SessionItem.cpp.

526 {}

Referenced by GUI::Session::XML::readItems().

◆ registerTag()

bool SessionItem::registerTag ( const QString &  name,
int  min = 0,
int  max = -1,
QStringList  modelTypes = {} 
)
inherited

Add new tag to this item with given name, min, max and types. max = -1 -> unlimited, modelTypes empty -> all types allowed.

Definition at line 159 of file SessionItem.cpp.

160 {
161  return m_tags->registerTag(name, min, max, modelTypes);
162 }

References SessionItem::m_tags, and GUI::RealSpace::Particles::name().

Referenced by Data1DViewItem::Data1DViewItem(), DataPropertyContainer::DataPropertyContainer(), FitParameterContainerItem::FitParameterContainerItem(), FitParameterItem::FitParameterItem(), FitSuiteItem::FitSuiteItem(), GroupItem::GroupItem(), IntensityDataItem(), JobItem::JobItem(), MaskContainerItem::MaskContainerItem(), PolygonItem::PolygonItem(), ProjectionContainerItem::ProjectionContainerItem(), RealDataItem::RealDataItem(), SessionItem::addGroupProperty(), SessionItem::addProperty(), and SessionModel::createRootItem().

Here is the call graph for this function:

◆ reset()

void IntensityDataItem::reset ( ImportDataInfo  data)
overridevirtual

Returns data to the state defined by user (imported) data.

Implements DataItem.

Definition at line 234 of file IntensityDataItem.cpp.

235 {
236  ASSERT(data.unitsLabel() == "nbins");
237  ComboProperty combo = ComboProperty() << data.unitsLabel();
238  setAxesUnits(combo);
239  setXaxisTitle(data.axisLabel(0));
240  setYaxisTitle(data.axisLabel(1));
241  MaskUnitsConverter converter;
242  converter.convertToNbins(this);
243  setDatafield(std::move(data).intensityData().release());
245  converter.convertFromNbins(this);
246 }
void setAxesUnits(const ComboProperty &units)
Definition: DataItem.cpp:96
QString unitsLabel() const
QString axisLabel(size_t axis_index) const
void setAxesRangeToData() override
set zoom range of x,y axes to axes of input data
void setDatafield(Datafield *data) override
The given pointer becomes owned by this class!!
The MaskUnitsConverter converts coordinates of all masks from one units to anoter....
void convertToNbins(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem into bin-fraction coordinates.
void convertFromNbins(IntensityDataItem *intensityData)
Converts all masks on board of IntensityDataItem from bin-fraction coordinates to coordinates of axes...

References ImportDataInfo::axisLabel(), MaskUnitsConverter::convertFromNbins(), MaskUnitsConverter::convertToNbins(), setAxesRangeToData(), DataItem::setAxesUnits(), setDatafield(), setXaxisTitle(), setYaxisTitle(), and ImportDataInfo::unitsLabel().

Here is the call graph for this function:

◆ resetView()

void IntensityDataItem::resetView ( )

Set axes viewport to original data.

Definition at line 426 of file IntensityDataItem.cpp.

427 {
428  if (!m_data)
429  return;
430 
432  if (!isZAxisLocked())
434 }
bool isZAxisLocked() const
Returns true if min, max range of Z-axis is locked (change not allowed)

References computeDataRange(), isZAxisLocked(), DataItem::m_data, and setAxesRangeToData().

Referenced by IntensityDataCanvas::onResetViewAction(), MaskEditorCanvas::onResetViewRequest(), ProjectionsEditorCanvas::onResetViewRequest(), FitComparisonController2D::resetDiffItem(), and ColorMap::resetView().

Here is the call graph for this function:

◆ roleProperty()

QVariant SessionItem::roleProperty ( int  role) const
inherited

◆ rowOfChild()

int SessionItem::rowOfChild ( SessionItem child) const
inherited

Returns row index of given child.

Definition at line 109 of file SessionItem.cpp.

110 {
111  return m_children.indexOf(child);
112 }

Referenced by SessionItem::childDeleted(), SessionModel::indexOfItem(), SessionModel::moveItem(), ProjectionsEditorCanvas::onLeavingColorMap(), and SessionItem::parentRow().

◆ saveData()

bool DataItem::saveData ( const QString &  projectDir)
overridevirtualinherited

Saves non-XML data in projectDir and returns success flag.

Implements SaveLoadInterface.

Definition at line 74 of file DataItem.cpp.

75 {
76  if (!containsNonXMLData())
77  return false;
78 
79  std::unique_lock<std::mutex> lock(m_update_data_mutex);
80  std::unique_ptr<Datafield> clone(getDatafield()->clone());
81  lock.unlock();
82  IOFactory::writeDatafield(*clone, fileName(projectDir).toStdString());
83  return true;
84 }
bool containsNonXMLData() const override
Checks if object owns non-XML data.
Definition: DataItem.cpp:59
std::mutex m_update_data_mutex
Definition: DataItem.h:90

References DataItem::containsNonXMLData(), DataItem::fileName(), DataItem::getDatafield(), DataItem::m_update_data_mutex, and GUI::Project::Utils::projectDir().

Here is the call graph for this function:

◆ selectedCoords()

QString DataItem::selectedCoords ( ) const
inherited

Definition at line 91 of file DataItem.cpp.

92 {
93  return getItemValue(P_AXES_UNITS).value<ComboProperty>().getValue();
94 }

References SessionItem::getItemValue(), and DataItem::P_AXES_UNITS.

Referenced by GUI::Model::JobItemUtils::setResults(), and GUI::Model::JobItemUtils::updateDataAxes().

Here is the call graph for this function:

◆ serializeBinaryData()

QByteArray SessionItem::serializeBinaryData ( ) const
virtualinherited

Reimplemented in PointwiseAxisItem, and RealDataItem.

Definition at line 517 of file SessionItem.cpp.

518 {
519  return QByteArray();
520 }

Referenced by GUI::Session::XML::writeItemAndChildItems().

◆ sessionItemTags()

const SessionItemTags * SessionItem::sessionItemTags ( ) const
inherited

Definition at line 171 of file SessionItem.cpp.

172 {
173  return m_tags.get();
174 }

References SessionItem::m_tags.

Referenced by SessionItem::displayName(), SessionModel::insertNewItem(), and SessionModel::moveItem().

◆ setAxesRangeToData()

void IntensityDataItem::setAxesRangeToData ( )
overridevirtual

set zoom range of x,y axes to axes of input data

Implements DataItem.

Definition at line 211 of file IntensityDataItem.cpp.

212 {
213  setLowerX(xMin());
214  setUpperX(xMax());
215  setLowerY(yMin());
216  setUpperY(yMax());
217 }
void setLowerX(double value)
double xMin() const
Returns min and max range of x-axis as given by IntensityData.
void setLowerY(double value)
void setUpperX(double value)
void setUpperY(double value)
double yMin() const
Returns min and max range of y-axis as given by IntensityData.

References setLowerX(), setLowerY(), setUpperX(), setUpperY(), xMax(), xMin(), yMax(), and yMin().

Referenced by reset(), resetView(), RealDataItem::rotateData(), and FitComparisonController2D::setItem().

Here is the call graph for this function:

◆ setAxesUnits()

void DataItem::setAxesUnits ( const ComboProperty units)
inherited

Definition at line 96 of file DataItem.cpp.

97 {
99 
100  emit axesUnitsChanged(units);
101 }
QVariant variant() const
Constructs variant enclosing given ComboProperty.
void axesUnitsChanged(const ComboProperty &units)
void setItemValue(const QString &tag, const QVariant &variant) const
Directly set value of item under given tag.

References DataItem::axesUnitsChanged(), DataItem::P_AXES_UNITS, SessionItem::setItemValue(), and ComboProperty::variant().

Referenced by QREDataLoader::datafieldFromParsingResult(), reset(), SpecularDataItem::reset(), and GUI::Model::JobItemUtils::setIntensityItemCoords().

Here is the call graph for this function:

◆ setDatafield()

void IntensityDataItem::setDatafield ( Datafield *  data)
overridevirtual

The given pointer becomes owned by this class!!

Implements DataItem.

Definition at line 72 of file IntensityDataItem.cpp.

73 {
74  ASSERT(data && "Assertion failed in IntensityDataItem::setDatafield: nullptr data passed");
75  if (data->rank() != 2)
76  throw Error("Error in IntensityDataItem::setDatafield: cannot handle non-2D data");
78 
82 
84 }
void updateAxesZoomLevel()
Sets zoom range of X,Y axes, if it was not yet defined.
void updateDataRange()
Sets min,max values for z-axis, if axes is not locked, and ranges are not yet set.
void updateAxesLabels()
Init axes labels, if it was not done already.
void emitDataChanged(int role=Qt::DisplayRole)
Notify model about data changes.

References SessionItem::emitDataChanged(), Error, DataItem::setDatafield(), updateAxesLabels(), updateAxesZoomLevel(), and updateDataRange().

Referenced by IntensityDataFFTPresenter::fftItem(), reset(), RealDataItem::rotateData(), MaskResultsPresenter::setOriginalMode(), and MaskResultsPresenter::setShowMaskMode().

Here is the call graph for this function:

◆ setDecimals()

SessionItem & SessionItem::setDecimals ( int  n)
inherited

Definition at line 489 of file SessionItem.cpp.

490 {
492  return *this;
493 }

References SessionFlags::DecimalRole, and SessionItem::setRoleProperty().

Referenced by BasicAxisItem::BasicAxisItem(), and SessionItem::SessionItem().

Here is the call graph for this function:

◆ setDefaultTag()

void SessionItem::setDefaultTag ( const QString &  tag)
inherited

◆ setDisplayName()

void SessionItem::setDisplayName ( const QString &  display_name)
inherited

Set display name.

Definition at line 426 of file SessionItem.cpp.

427 {
429 }

References SessionFlags::DisplayNameRole, and SessionItem::setRoleProperty().

Referenced by SessionItem::SessionItem(), SessionItem::addProperty(), FitParameterContainerItem::createFitParameter(), and GUI::Session::XML::readItems().

Here is the call graph for this function:

◆ setEditable()

void SessionItem::setEditable ( bool  enabled)
inherited

Definition at line 458 of file SessionItem.cpp.

459 {
461 }
void changeFlags(bool enabled, int flag)
internal

References SessionItem::changeFlags(), and SessionFlags::EDITABLE.

Referenced by JobItem::JobItem(), and FitParameterItem::setLimitEnabled().

Here is the call graph for this function:

◆ setEnabled()

void SessionItem::setEnabled ( bool  enabled)
inherited

Flags accessors.

Definition at line 453 of file SessionItem.cpp.

454 {
456 }

References SessionItem::changeFlags(), and SessionFlags::ENABLED.

Referenced by FitParameterItem::FitParameterItem(), MaskAllItem::MaskAllItem(), PointwiseAxisItem::PointwiseAxisItem(), GroupItemController::getItemOfType(), and FitParameterItem::setLimitEnabled().

Here is the call graph for this function:

◆ setFileName()

void DataItem::setFileName ( const QString &  filename)
inherited

Definition at line 46 of file DataItem.cpp.

47 {
48  setItemValue(P_FILE_NAME, filename);
49 
50  setLastModified(QDateTime::currentDateTime());
51  emit fileNameChanged(filename);
52 }
void setLastModified(const QDateTime &dtime)
Definition: DataItem.cpp:86
void fileNameChanged(const QString &filename)

References DataItem::fileNameChanged(), DataItem::P_FILE_NAME, SessionItem::setItemValue(), and DataItem::setLastModified().

Referenced by GUI::Model::JobFunctions::copyRealDataItem().

Here is the call graph for this function:

◆ setGradient()

void IntensityDataItem::setGradient ( const ComboProperty gradient)

Definition at line 160 of file IntensityDataItem.cpp.

161 {
162  setItemValue(P_GRADIENT, gradient.variant());
163 }
SelectionDescriptor< QString > gradient() const

References gradient(), P_GRADIENT, and SessionItem::setItemValue().

Referenced by IntensityDataCanvas::applyPersistentSettings().

Here is the call graph for this function:

◆ setGroupProperty()

SessionItem * SessionItem::setGroupProperty ( const QString &  groupTag,
const QString &  modelType 
) const
inherited

Set the current type of group item.

Definition at line 320 of file SessionItem.cpp.

321 {
322  return item<GroupItem>(groupTag)->setCurrentType(modelType);
323 }

References SessionItem::modelType().

Referenced by SessionItem::setGroupPropertyType().

Here is the call graph for this function:

◆ setGroupPropertyType()

template<typename T >
T * SessionItem::setGroupPropertyType ( const QString &  groupTag)
inherited

Definition at line 404 of file SessionItem.h.

405 {
406  SessionItem* item = getGroupItem(groupTag);
407  if (!item->hasModelType<T>())
408  return dynamic_cast<T*>(setGroupProperty(groupTag, T::M_TYPE));
409  return dynamic_cast<T*>(item);
410 }
SessionItem * setGroupProperty(const QString &groupTag, const QString &modelType) const
Set the current type of group item.

References SessionItem::getGroupItem(), SessionItem::item(), and SessionItem::setGroupProperty().

Here is the call graph for this function:

◆ setInterpolated

void IntensityDataItem::setInterpolated ( bool  interp)
slot

Definition at line 317 of file IntensityDataItem.cpp.

318 {
320 }

References P_IS_INTERPOLATED, and SessionItem::setItemValue().

Referenced by IntensityDataCanvas::applyPersistentSettings(), IntensityDataPropertyWidget::setItem(), MaskResultsPresenter::setOriginalMode(), and MaskResultsPresenter::setShowMaskMode().

Here is the call graph for this function:

◆ setItemName()

void SessionItem::setItemName ( const QString &  name)
inherited

◆ setItemValue()

void SessionItem::setItemValue ( const QString &  tag,
const QVariant &  variant 
) const
inherited

Directly set value of item under given tag.

Definition at line 300 of file SessionItem.cpp.

301 {
302  ASSERT(isTag(tag));
303  getItem(tag)->setValue(variant);
304 }
bool setValue(QVariant value)
Set value, ensure that variant types match.

References SessionItem::getItem(), SessionItem::isTag(), and SessionItem::setValue().

Referenced by MaskUnitsConverter::convertCoordinate(), PointwiseAxisItem::init(), FitParameterItem::initMinMaxValues(), RealDataItem::linkToInstrument(), EllipseItem::setAngle(), Data1DViewItem::setAxesUnits(), DataItem::setAxesUnits(), JobItem::setBeginTime(), BasicAxisItem::setBinCount(), FitSuiteItem::setChi2(), Data1DProperties::setColorProperty(), JobItem::setComments(), DataProperties::setDataItem(), JobItem::setEndTime(), DataItem::setFileName(), setGradient(), JobItem::setIdentifier(), JobItem::setInstrumentName(), setInterpolated(), PolygonItem::setIsClosed(), MaskItem::setIsVisibleValue(), SessionItem::setItemName(), FitSuiteItem::setIterationCount(), Data1DProperties::setLineProperty(), FitParameterLinkItem::setLink(), AmplitudeAxisItem::setLocked(), AmplitudeAxisItem::setLogScale(), BasicAxisItem::setLowerBound(), MaskItem::setMaskValue(), FitParameterItem::setMaximum(), FitParameterItem::setMinimum(), PolygonPointItem::setPosX(), VerticalLineItem::setPosX(), PolygonPointItem::setPosY(), HorizontalLineItem::setPosY(), JobItem::setPresentationType(), JobItem::setProgress(), Data1DProperties::setScatterProperty(), FitParameterItem::setStartValue(), JobItem::setStatus(), BasicAxisItem::setTitle(), FitParameterLinkItem::setTitle(), FitSuiteItem::setUpdateInterval(), BasicAxisItem::setUpperBound(), BasicAxisItem::setVisibilityValue(), EllipseItem::setXCenter(), RectangleItem::setXLow(), EllipseItem::setXRadius(), RectangleItem::setXUp(), EllipseItem::setYCenter(), RectangleItem::setYLow(), EllipseItem::setYRadius(), RectangleItem::setYUp(), and RealDataItem::unlinkFromInstrument().

Here is the call graph for this function:

◆ setLastModified()

void DataItem::setLastModified ( const QDateTime &  dtime)
inherited

Definition at line 86 of file DataItem.cpp.

87 {
88  m_last_modified = dtime;
89 }

References DataItem::m_last_modified.

Referenced by DataItem::setDatafield(), DataItem::setFileName(), and DataItem::setRawDataVector().

◆ setLimits()

SessionItem & SessionItem::setLimits ( const RealLimits &  value)
inherited

Definition at line 478 of file SessionItem.cpp.

479 {
480  setRoleProperty(SessionFlags::LimitsRole, QVariant::fromValue<RealLimits>(value));
481  return *this;
482 }

References SessionFlags::LimitsRole, SessionItem::setRoleProperty(), and SessionItem::value().

Referenced by BasicAxisItem::BasicAxisItem(), EllipseItem::EllipseItem(), FitParameterItem::FitParameterItem(), HorizontalLineItem::HorizontalLineItem(), PolygonPointItem::PolygonPointItem(), RectangleItem::RectangleItem(), SessionItem::SessionItem(), VerticalLineItem::VerticalLineItem(), and FitParameterItem::initMinMaxValues().

Here is the call graph for this function:

◆ setLogz

void IntensityDataItem::setLogz ( bool  logz)
slot

Definition at line 312 of file IntensityDataItem.cpp.

313 {
314  zAxisItem()->setLogScale(logz);
315 }
void setLogScale(bool value)
Definition: AxesItems.cpp:183

References AmplitudeAxisItem::setLogScale(), and zAxisItem().

Here is the call graph for this function:

◆ setLowerAndUpperZ

void IntensityDataItem::setLowerAndUpperZ ( double  zmin,
double  zmax 
)
slot

Definition at line 293 of file IntensityDataItem.cpp.

294 {
295  if (getLowerZ() != zmin)
296  setLowerZ(zmin);
297 
298  if (getUpperZ() != zmax)
299  setUpperZ(zmax);
300 }
double getLowerZ() const
Returns lower and upper zoom ranges of z-axis.
void setUpperZ(double zmax)
void setLowerZ(double zmin)
double getUpperZ() const

References getLowerZ(), getUpperZ(), setLowerZ(), and setUpperZ().

Referenced by computeDataRange(), ColorMap::onDataRangeChanged(), FitComparisonController2D::resetDiffItem(), and FitComparisonController2D::setItem().

Here is the call graph for this function:

◆ setLowerX

void IntensityDataItem::setLowerX ( double  value)
slot

Definition at line 273 of file IntensityDataItem.cpp.

274 {
276 }
void setLowerBound(double value)
Definition: AxesItems.cpp:48

References BasicAxisItem::setLowerBound(), SessionItem::value(), and xAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), ColorMap::onXaxisRangeChanged(), setAxesRangeToData(), MaskEditorCanvas::setZoomToROI(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ setLowerY

void IntensityDataItem::setLowerY ( double  value)
slot

Definition at line 283 of file IntensityDataItem.cpp.

284 {
286 }

References BasicAxisItem::setLowerBound(), SessionItem::value(), and yAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), ColorMap::onYaxisRangeChanged(), setAxesRangeToData(), MaskEditorCanvas::setZoomToROI(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ setLowerZ

void IntensityDataItem::setLowerZ ( double  zmin)
slot

Definition at line 302 of file IntensityDataItem.cpp.

303 {
304  zAxisItem()->setLowerBound(zmin);
305 }

References BasicAxisItem::setLowerBound(), and zAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), and setLowerAndUpperZ().

Here is the call graph for this function:

◆ setModel()

void SessionItem::setModel ( SessionModel model)
privateinherited

Definition at line 546 of file SessionItem.cpp.

547 {
548  m_model = model;
549 
550  if (m_mapper)
551  m_mapper->setItem(this);
552 
553  for (auto& child : m_children)
554  child->setModel(model);
555 }

References SessionItem::m_children, SessionItem::m_mapper, SessionItem::m_model, and SessionItem::model().

Referenced by SessionItem::~SessionItem(), SessionModel::createRootItem(), and SessionItem::setParentAndModel().

Here is the call graph for this function:

◆ setParentAndModel()

void SessionItem::setParentAndModel ( SessionItem parent,
SessionModel model 
)
privateinherited

Definition at line 540 of file SessionItem.cpp.

541 {
542  setModel(model);
543  m_parent = parent;
544 }
void setModel(SessionModel *model)

References SessionItem::m_parent, SessionItem::model(), and SessionItem::setModel().

Referenced by SessionItem::takeItem().

Here is the call graph for this function:

◆ setRawDataVector()

void DataItem::setRawDataVector ( const std::vector< double > &  data)
inherited

Sets the raw data vector from external source. Checks only the equality of data size; no dimension checks are applied.

Definition at line 29 of file DataItem.cpp.

30 {
31  if (m_data->size() != data.size())
32  throw Error("DataItem::setVector() -> Error. "
33  "Different data size.");
34  std::unique_lock<std::mutex> lock(m_update_data_mutex);
35  m_data->setVector(data);
36 
37  setLastModified(QDateTime::currentDateTime());
38  emit rawDataVectorChanged(data);
39 }
void rawDataVectorChanged(const std::vector< double > &data)

References Error, DataItem::m_data, DataItem::m_update_data_mutex, DataItem::rawDataVectorChanged(), and DataItem::setLastModified().

Referenced by FitSessionController::onObserverUpdate().

Here is the call graph for this function:

◆ setRoleProperty()

bool SessionItem::setRoleProperty ( int  role,
const QVariant &  value 
)
inherited

Set the contained role property to the given value. See also setTranslatorForRolePropertySetter.

Set variant to role, create role if not present yet.

Definition at line 341 of file SessionItem.cpp.

342 {
343  bool result = m_properties->setData(role, value);
344  if (result)
345  emitDataChanged(role);
346  return result;
347 }

References SessionItem::emitDataChanged(), SessionItem::m_properties, and SessionItem::value().

Referenced by SessionItem::SessionItem(), SessionItem::changeFlags(), GUI::Session::XML::readProperty(), SessionModel::setData(), SessionItem::setDecimals(), SessionItem::setDefaultTag(), SessionItem::setDisplayName(), SessionItem::setLimits(), SessionItem::setToolTip(), and SessionItem::setValue().

Here is the call graph for this function:

◆ setToolTip()

SessionItem & SessionItem::setToolTip ( const QString &  tooltip)
inherited

Definition at line 500 of file SessionItem.cpp.

501 {
502  setRoleProperty(Qt::ToolTipRole, tooltip);
503  return *this;
504 }

References SessionItem::setRoleProperty().

Referenced by GeneticMinimizerItem::GeneticMinimizerItem(), GSLLMAMinimizerItem::GSLLMAMinimizerItem(), GSLMultiMinimizerItem::GSLMultiMinimizerItem(), MinimizerContainerItem::MinimizerContainerItem(), MinuitMinimizerItem::MinuitMinimizerItem(), and SimAnMinimizerItem::SimAnMinimizerItem().

Here is the call graph for this function:

◆ setUpperX

void IntensityDataItem::setUpperX ( double  value)
slot

Definition at line 278 of file IntensityDataItem.cpp.

279 {
281 }
void setUpperBound(double value)
Definition: AxesItems.cpp:65

References BasicAxisItem::setUpperBound(), SessionItem::value(), and xAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), ColorMap::onXaxisRangeChanged(), setAxesRangeToData(), MaskEditorCanvas::setZoomToROI(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ setUpperY

void IntensityDataItem::setUpperY ( double  value)
slot

Definition at line 288 of file IntensityDataItem.cpp.

289 {
291 }

References BasicAxisItem::setUpperBound(), SessionItem::value(), and yAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), ColorMap::onYaxisRangeChanged(), setAxesRangeToData(), MaskEditorCanvas::setZoomToROI(), and updateAxesZoomLevel().

Here is the call graph for this function:

◆ setUpperZ

void IntensityDataItem::setUpperZ ( double  zmax)
slot

Definition at line 307 of file IntensityDataItem.cpp.

308 {
309  zAxisItem()->setUpperBound(zmax);
310 }

References BasicAxisItem::setUpperBound(), and zAxisItem().

Referenced by JobListView::equalizeSelectedToJob(), and setLowerAndUpperZ().

Here is the call graph for this function:

◆ setValue()

bool SessionItem::setValue ( QVariant  value)
inherited

Set value, ensure that variant types match.

Definition at line 382 of file SessionItem.cpp.

383 {
385  return setRoleProperty(Qt::DisplayRole, value);
386 }
bool CompatibleVariantTypes(const QVariant &oldValue, const QVariant &newValue)
Returns true if variants has compatible types.
Definition: VariantUtil.cpp:25

References GUI::Util::Variant::CompatibleVariantTypes(), SessionItem::setRoleProperty(), and SessionItem::value().

Referenced by DoubleDescriptor::DoubleDescriptor(), SelectionDescriptor< T >::SelectionDescriptor(), UIntDescriptor::UIntDescriptor(), IntensityDataPropertyWidget::createCheckBox(), SpecularDataPropertyWidget::createCheckBox(), IntensityDataPropertyWidget::createTextEdit(), SpecularDataPropertyWidget::createTextEdit(), SessionItem::setItemValue(), RealDataItem::setNativeDataUnits(), and GroupItem::updateComboValue().

Here is the call graph for this function:

◆ setXaxisTitle()

void IntensityDataItem::setXaxisTitle ( const QString &  title)
overridevirtual

Implements DataItem.

Definition at line 200 of file IntensityDataItem.cpp.

201 {
202  xAxisItem()->setTitle(title);
203 }
void setTitle(const QString &title)
Definition: AxesItems.cpp:85

References BasicAxisItem::setTitle(), and xAxisItem().

Referenced by IntensityDataItem(), reset(), and updateAxesLabels().

Here is the call graph for this function:

◆ setYaxisTitle()

void IntensityDataItem::setYaxisTitle ( const QString &  title)
overridevirtual

Implements DataItem.

Definition at line 205 of file IntensityDataItem.cpp.

206 {
207  yAxisItem()->setTitle(title);
208 }

References BasicAxisItem::setTitle(), and yAxisItem().

Referenced by IntensityDataItem(), reset(), and updateAxesLabels().

Here is the call graph for this function:

◆ setZAxisLocked()

void IntensityDataItem::setZAxisLocked ( bool  state)

Definition at line 195 of file IntensityDataItem.cpp.

196 {
197  item<AmplitudeAxisItem>(P_ZAXIS)->setLocked(state);
198 }

References P_ZAXIS.

Referenced by ParameterTuningWidget::onLockZValueChanged().

◆ shape()

std::vector< int > IntensityDataItem::shape ( ) const
overridevirtual

Implements DataItem.

Definition at line 229 of file IntensityDataItem.cpp.

230 {
231  return {xSize(), ySize()};
232 }

References xSize(), and ySize().

Here is the call graph for this function:

◆ tagFromItem()

QString SessionItem::tagFromItem ( const SessionItem item) const
inherited

Returns the tag name of given item when existing.

Definition at line 178 of file SessionItem.cpp.

179 {
180  int index = m_children.indexOf(const_cast<SessionItem*>(item));
181  return m_tags->tagFromIndex(index);
182 }

References SessionItem::index(), SessionItem::item(), SessionItem::m_children, and SessionItem::m_tags.

Referenced by SessionItem::displayName(), ModelMapper::onDataChanged(), PropertyRepeater::setOnChildPropertyChange(), SessionItem::takeRow(), and GUI::Session::XML::writeItemAndChildItems().

Here is the call graph for this function:

◆ takeItem()

SessionItem * SessionItem::takeItem ( int  row,
const QString &  tag 
)
inherited

Remove item from given row from given tag.

Definition at line 258 of file SessionItem.cpp.

259 {
260  const QString tagName = tag.isEmpty() ? defaultTag() : tag;
261  ASSERT(m_tags->isValid(tagName));
262  ASSERT(!m_tags->isSingleItemTag(tagName));
263 
264  int index = m_tags->indexFromTagRow(tagName, row);
265  ASSERT(index >= 0 && index <= m_children.size());
266 
267  if (m_model)
268  m_model->beginRemoveRows(this->index(), index, index);
269  SessionItem* result = m_children.takeAt(index);
270  result->setParentAndModel(nullptr, nullptr);
271 
272  m_tags->removeChild(tagName);
273  if (m_model)
274  m_model->endRemoveRows();
275  return result;
276 }
void setParentAndModel(SessionItem *parent, SessionModel *model)

References SessionItem::defaultTag(), SessionItem::index(), SessionItem::m_children, SessionItem::m_model, SessionItem::m_tags, and SessionItem::setParentAndModel().

Referenced by SessionModel::moveItem(), and SessionItem::takeRow().

Here is the call graph for this function:

◆ takeRow()

SessionItem * SessionItem::takeRow ( int  row)
inherited

Removes row from item and returns the item.

Definition at line 139 of file SessionItem.cpp.

140 {
141  SessionItem* item = childAt(row);
142  QString tag = tagFromItem(item);
143  auto items = getItems(tag);
144  return takeItem(items.indexOf(item), tag);
145 }
SessionItem * takeItem(int row, const QString &tag)
Remove item from given row from given tag.
QVector< T * > items(const QString &tag="") const
Definition: SessionItem.h:361
SessionItem * childAt(int row) const
Returns the child at the given row.

References SessionItem::childAt(), SessionItem::getItems(), SessionItem::item(), SessionItem::items(), SessionItem::tagFromItem(), and SessionItem::takeItem().

Referenced by FitComparison1DViewController::deleteDiffViewItem(), SessionModel::moveItem(), ProjectionsEditorCanvas::onLeavingColorMap(), and SessionModel::removeRows().

Here is the call graph for this function:

◆ toolTip()

QString SessionItem::toolTip ( ) const
inherited

Definition at line 495 of file SessionItem.cpp.

496 {
497  return roleProperty(Qt::ToolTipRole).toString();
498 }

References SessionItem::roleProperty().

Referenced by SelectionDescriptor< T >::SelectionDescriptor().

Here is the call graph for this function:

◆ updateAxesLabels()

void IntensityDataItem::updateAxesLabels ( )
private

Init axes labels, if it was not done already.

Definition at line 346 of file IntensityDataItem.cpp.

347 {
348  if (getXaxisTitle().isEmpty())
349  setXaxisTitle(QString::fromStdString(m_data->axis(0).axisName()));
350 
351  if (getYaxisTitle().isEmpty())
352  setYaxisTitle(QString::fromStdString(m_data->axis(1).axisName()));
353 }
QString getXaxisTitle() const
QString getYaxisTitle() const

References getXaxisTitle(), getYaxisTitle(), DataItem::m_data, setXaxisTitle(), and setYaxisTitle().

Referenced by setDatafield().

Here is the call graph for this function:

◆ updateAxesUnits()

void DataItem::updateAxesUnits ( SessionItem item,
const QString &  name,
InstrumentItem instrumentItem 
)
staticinherited

Definition at line 118 of file DataItem.cpp.

120 {
121  DataItem* dataItem = dynamic_cast<DataItem*>(item);
122  if (dataItem && isAxesUnitsPropertyName(name)) {
123  dataItem->updateCoords(instrumentItem);
124  }
125 }
Abstract base class for IntensityDataItem and SpecularDataItem. Owns one simulated data set of type D...
Definition: DataItem.h:34
static bool isAxesUnitsPropertyName(const QString &name)
Definition: DataItem.cpp:113
virtual void updateCoords(const InstrumentItem *instrument)=0

References DataItem::isAxesUnitsPropertyName(), SessionItem::item(), GUI::RealSpace::Particles::name(), and DataItem::updateCoords().

Referenced by SpecularDataPropertyWidget::setCurrentItem(), and IntensityDataPropertyWidget::setItem().

Here is the call graph for this function:

◆ updateAxesZoomLevel()

void IntensityDataItem::updateAxesZoomLevel ( )
private

Sets zoom range of X,Y axes, if it was not yet defined.

Definition at line 324 of file IntensityDataItem.cpp.

325 {
326  // set zoom range of x-axis to min, max values if it was not set already
327  if (getUpperX() < getLowerX()) {
328  setLowerX(xMin());
329  setUpperX(xMax());
330  }
331 
332  // set zoom range of y-axis to min, max values if it was not set already
333  if (getUpperY() < getLowerY()) {
334  setLowerY(yMin());
335  setUpperY(yMax());
336  }
337 
338  const int nx = static_cast<int>(m_data->axis(0).size());
339  xAxisItem()->setBinCount(nx);
340  const int ny = static_cast<int>(m_data->axis(1).size());
341  yAxisItem()->setBinCount(ny);
342 }
void setBinCount(size_t value)
Definition: AxesItems.cpp:31
double getLowerY() const
Returns lower and upper zoom ranges of y-axis.
double getUpperY() const
double getUpperX() const
double getLowerX() const
Returns lower and upper zoom ranges of x-axis.

References getLowerX(), getLowerY(), getUpperX(), getUpperY(), DataItem::m_data, BasicAxisItem::setBinCount(), setLowerX(), setLowerY(), setUpperX(), setUpperY(), xAxisItem(), xMax(), xMin(), yAxisItem(), yMax(), and yMin().

Referenced by setDatafield().

Here is the call graph for this function:

◆ updateCoords()

void IntensityDataItem::updateCoords ( const InstrumentItem instrument)
overridevirtual

Implements DataItem.

Definition at line 219 of file IntensityDataItem.cpp.

220 {
221  MaskUnitsConverter converter;
222  converter.convertToNbins(this);
223 
225 
226  converter.convertFromNbins(this);
227 }
void updateDataAxes(DataItem *intensityItem, const InstrumentItem *instrumentItem)
updates axes of Datafield in IntensityData item

References MaskUnitsConverter::convertFromNbins(), MaskUnitsConverter::convertToNbins(), and GUI::Model::JobItemUtils::updateDataAxes().

Here is the call graph for this function:

◆ updateDataRange()

void IntensityDataItem::updateDataRange ( )

Sets min,max values for z-axis, if axes is not locked, and ranges are not yet set.

Definition at line 357 of file IntensityDataItem.cpp.

358 {
359  if (isZAxisLocked())
360  return;
361 
363 }

References computeDataRange(), and isZAxisLocked().

Referenced by setDatafield().

Here is the call graph for this function:

◆ value()

◆ writeNonSessionItems()

void SessionItem::writeNonSessionItems ( QXmlStreamWriter *  writer) const
virtualinherited

Reimplemented in JobItem.

Definition at line 524 of file SessionItem.cpp.

524 {}

Referenced by GUI::Session::XML::writeItemAndChildItems().

◆ xAxisItem() [1/2]

BasicAxisItem * IntensityDataItem::xAxisItem ( )

Definition at line 399 of file IntensityDataItem.cpp.

400 {
401  return item<BasicAxisItem>(P_XAXIS);
402 }

References P_XAXIS.

◆ xAxisItem() [2/2]

const BasicAxisItem * IntensityDataItem::xAxisItem ( ) const

◆ xMax()

double IntensityDataItem::xMax ( ) const

Definition at line 112 of file IntensityDataItem.cpp.

113 {
114  const double defaultXmax(1.0);
115  return m_data ? m_data->axis(0).max() : defaultXmax;
116 }

References DataItem::m_data.

Referenced by MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemXrange(), setAxesRangeToData(), and updateAxesZoomLevel().

◆ xMin()

double IntensityDataItem::xMin ( ) const

Returns min and max range of x-axis as given by IntensityData.

Definition at line 106 of file IntensityDataItem.cpp.

107 {
108  const double defaultXmin(0.0);
109  return m_data ? m_data->axis(0).min() : defaultXmin;
110 }

References DataItem::m_data.

Referenced by MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemXrange(), setAxesRangeToData(), and updateAxesZoomLevel().

◆ xSize()

int IntensityDataItem::xSize ( ) const

Definition at line 86 of file IntensityDataItem.cpp.

87 {
88  return xAxisItem()->binCount();
89 }
int binCount() const
Definition: AxesItems.cpp:26

References BasicAxisItem::binCount(), and xAxisItem().

Referenced by GUI::View::RangeUtils::itemXrange(), ColorMap::setAxesRangeFromItem(), ColorMap::setDataFromItem(), and shape().

Here is the call graph for this function:

◆ yAxisItem() [1/2]

BasicAxisItem * IntensityDataItem::yAxisItem ( )

Definition at line 409 of file IntensityDataItem.cpp.

410 {
411  return item<BasicAxisItem>(P_YAXIS);
412 }

References P_YAXIS.

◆ yAxisItem() [2/2]

const BasicAxisItem * IntensityDataItem::yAxisItem ( ) const

◆ yMax()

double IntensityDataItem::yMax ( ) const

Definition at line 134 of file IntensityDataItem.cpp.

135 {
136  const double defaultYmax(1.0);
137  return m_data ? m_data->axis(1).max() : defaultYmax;
138 }

References DataItem::m_data.

Referenced by MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemYrange(), setAxesRangeToData(), and updateAxesZoomLevel().

◆ yMin()

double IntensityDataItem::yMin ( ) const

Returns min and max range of y-axis as given by IntensityData.

Definition at line 128 of file IntensityDataItem.cpp.

129 {
130  const double defaultYmin(0.0);
131  return m_data ? m_data->axis(1).min() : defaultYmin;
132 }

References DataItem::m_data.

Referenced by MaskEditorCanvas::isAxisRangeMatchData(), GUI::View::RangeUtils::itemYrange(), setAxesRangeToData(), and updateAxesZoomLevel().

◆ ySize()

int IntensityDataItem::ySize ( ) const

Definition at line 91 of file IntensityDataItem.cpp.

92 {
93  return yAxisItem()->binCount();
94 }

References BasicAxisItem::binCount(), and yAxisItem().

Referenced by GUI::View::RangeUtils::itemYrange(), ColorMap::setAxesRangeFromItem(), ColorMap::setDataFromItem(), and shape().

Here is the call graph for this function:

◆ zAxisItem() [1/2]

AmplitudeAxisItem * IntensityDataItem::zAxisItem ( )

Definition at line 419 of file IntensityDataItem.cpp.

420 {
421  return item<AmplitudeAxisItem>(P_ZAXIS);
422 }

References P_ZAXIS.

◆ zAxisItem() [2/2]

const AmplitudeAxisItem * IntensityDataItem::zAxisItem ( ) const

Definition at line 414 of file IntensityDataItem.cpp.

415 {
416  return item<AmplitudeAxisItem>(P_ZAXIS);
417 }

References P_ZAXIS.

Referenced by getLowerZ(), getUpperZ(), isLogz(), ColorMap::setColorScaleAppearanceFromItem(), IntensityDataPropertyWidget::setItem(), setLogz(), setLowerZ(), and setUpperZ().

Member Data Documentation

◆ m_children

◆ m_data

◆ m_last_modified

QDateTime DataItem::m_last_modified
protectedinherited

Definition at line 89 of file DataItem.h.

Referenced by DataItem::lastModified(), and DataItem::setLastModified().

◆ m_mapper

std::unique_ptr<ModelMapper> SessionItem::m_mapper
privateinherited

◆ m_model

◆ m_parent

SessionItem* SessionItem::m_parent
privateinherited

◆ m_properties

std::unique_ptr<SessionItemData> SessionItem::m_properties
privateinherited

◆ m_tags

◆ M_TYPE

constexpr auto IntensityDataItem::M_TYPE {"IntensityData"}
staticconstexpr

Definition at line 39 of file IntensityDataItem.h.

Referenced by JobItem::JobItem(), and RealDataItem::RealDataItem().

◆ m_update_data_mutex

std::mutex DataItem::m_update_data_mutex
protectedinherited

◆ P_AXES_UNITS

constexpr auto DataItem::P_AXES_UNITS {"Axes Units"}
staticconstexprprivateinherited

◆ P_FILE_NAME

constexpr auto DataItem::P_FILE_NAME {"FileName"}
staticconstexprprivateinherited

Definition at line 37 of file DataItem.h.

Referenced by DataItem::DataItem(), DataItem::fileName(), and DataItem::setFileName().

◆ P_GRADIENT

constexpr auto IntensityDataItem::P_GRADIENT {"Gradient"}
staticconstexprprivate

◆ P_IS_INTERPOLATED

constexpr auto IntensityDataItem::P_IS_INTERPOLATED {"Interpolation"}
staticconstexprprivate

◆ P_NAME

constexpr auto SessionItem::P_NAME {"Name"}
staticconstexprprivateinherited

◆ P_PROJECTIONS

constexpr auto IntensityDataItem::P_PROJECTIONS {"Projections"}
staticconstexprprivate

Definition at line 28 of file IntensityDataItem.h.

Referenced by IntensityDataItem().

◆ P_TITLE

constexpr auto IntensityDataItem::P_TITLE {"Title"}
staticconstexprprivate

Definition at line 29 of file IntensityDataItem.h.

Referenced by IntensityDataItem().

◆ P_XAXIS

constexpr auto IntensityDataItem::P_XAXIS {"x-axis"}
staticconstexprprivate

Definition at line 32 of file IntensityDataItem.h.

Referenced by IntensityDataItem(), isXaxisPropertyName(), and xAxisItem().

◆ P_YAXIS

constexpr auto IntensityDataItem::P_YAXIS {"y-axis"}
staticconstexprprivate

Definition at line 33 of file IntensityDataItem.h.

Referenced by IntensityDataItem(), isYaxisPropertyName(), and yAxisItem().

◆ P_ZAXIS

constexpr auto IntensityDataItem::P_ZAXIS {"color-axis"}
staticconstexprprivate

◆ T_MASKS

constexpr auto IntensityDataItem::T_MASKS {"Mask tag"}
staticconstexprprivate

◆ T_PROJECTIONS

constexpr auto IntensityDataItem::T_PROJECTIONS {"Projection tag"}
staticconstexprprivate

The documentation for this class was generated from the following files: