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

Description

Definition at line 26 of file ItemWithMaterial.h.

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

Public Member Functions

 ItemWithMaterial (const MaterialItems *materials)
 Overhand the material list where the current material has to be searched for. More...
 
QColor materialColor () const
 
QString materialIdentifier () const
 
MaterialItemmaterialItem () const
 Returns the material item this item links to. More...
 
QString materialName () const
 
void setMaterial (const MaterialItem *materialItem)
 Set the material this item shall use. Stores the identifier, not the pointer! More...
 
void setMaterial (const QString &materialIdentifier)
 Set the material this item shall use. Stores the given identifier, not a pointer to the material! More...
 
void setMaterialUndefined ()
 Set "no material defined". More...
 

Protected Attributes

QString m_materialIdentifier
 
const MaterialItemsm_materialItems
 

Constructor & Destructor Documentation

◆ ItemWithMaterial()

ItemWithMaterial::ItemWithMaterial ( const MaterialItems materials)
explicit

Overhand the material list where the current material has to be searched for.

Definition at line 31 of file ItemWithMaterial.cpp.

32  : m_materialItems(materials)
33 {
34  ASSERT(m_materialItems);
35 }
const MaterialItems * m_materialItems

References m_materialItems.

Member Function Documentation

◆ materialColor()

QColor ItemWithMaterial::materialColor ( ) const

Definition at line 42 of file ItemWithMaterial.cpp.

43 {
44  ASSERT(materialItem());
45  return materialItem()->color();
46 }
MaterialItem * materialItem() const
Returns the material item this item links to.
QColor color() const

References MaterialItem::color(), and materialItem().

Referenced by GUI::View::TransformTo3D::createLayer().

Here is the call graph for this function:

◆ materialIdentifier()

QString ItemWithMaterial::materialIdentifier ( ) const

◆ materialItem()

MaterialItem * ItemWithMaterial::materialItem ( ) const

Returns the material item this item links to.

Definition at line 59 of file ItemWithMaterial.cpp.

60 {
61  if (materialIdentifier().isEmpty())
62  return nullptr;
63 
65 }
QString materialIdentifier() const
MaterialItem * materialFromIdentifier(const QString &identifier) const

References m_materialItems, MaterialItems::materialFromIdentifier(), and materialIdentifier().

Referenced by ParticleItem::createParticle(), MaterialInplaceForm::createWidgets(), materialColor(), materialName(), MaterialInplaceForm::selectMaterial(), and setMaterial().

Here is the call graph for this function:

◆ materialName()

QString ItemWithMaterial::materialName ( ) const

Definition at line 48 of file ItemWithMaterial.cpp.

49 {
50  ASSERT(materialItem());
51  return materialItem()->matItemName();
52 }
QString matItemName() const

References materialItem(), and MaterialItem::matItemName().

Referenced by LayerForm::updateTitle().

Here is the call graph for this function:

◆ setMaterial() [1/2]

void ItemWithMaterial::setMaterial ( const MaterialItem materialItem)

Set the material this item shall use. Stores the identifier, not the pointer!

Definition at line 20 of file ItemWithMaterial.cpp.

21 {
23 }
QString identifier() const

References MaterialItem::identifier(), m_materialIdentifier, and materialItem().

Referenced by SampleEditorController::addLayerFromUndo(), GUI::Transform::FromCore::itemizeSample(), and SampleEditorController::selectMaterial().

Here is the call graph for this function:

◆ setMaterial() [2/2]

void ItemWithMaterial::setMaterial ( const QString &  materialIdentifier)

Set the material this item shall use. Stores the given identifier, not a pointer to the material!

Definition at line 25 of file ItemWithMaterial.cpp.

References m_materialIdentifier, and materialIdentifier().

Here is the call graph for this function:

◆ setMaterialUndefined()

void ItemWithMaterial::setMaterialUndefined ( )

Set "no material defined".

Definition at line 37 of file ItemWithMaterial.cpp.

38 {
39  m_materialIdentifier.clear();
40 }

References m_materialIdentifier.

Member Data Documentation

◆ m_materialIdentifier

QString ItemWithMaterial::m_materialIdentifier
protected

◆ m_materialItems

const MaterialItems* ItemWithMaterial::m_materialItems
protected

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