BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleCoreShellView.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/ParticleCoreShellView.cpp
6 //! @brief Implements class ParticleCoreShellView
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
19 
21 {
22  setName("ParticleCoreShell");
26  ->setToolTip("Connect to the ParticleLayout");
28  ->setToolTip("Connect particle which will play the role of core.");
30  ->setToolTip("Connect particle which will play the role of shell.");
32  ->setToolTip("Connect particle rotation to this port, if necessary");
33 
34  m_label_vspace = StyleUtils::SizeOfLetterM().height() * 3.0;
35 }
36 
37 void ParticleCoreShellView::addView(IView* childView, int /* row */)
38 {
39  int index = 0;
40  if (this->getItem()->tagFromItem(childView->getItem()) == ParticleCoreShellItem::T_CORE) {
41  index = 0;
42  } else if (this->getItem()->tagFromItem(childView->getItem())
44  index = 1;
45  } else {
46  index = 2;
47  }
48  connectInputPort(dynamic_cast<ConnectableView*>(childView), index);
49 }
Defines class DesignerHelper.
Defines class ParticleCoreShellItem.
Defines class ParticleCoreShellView.
DefinesStyleUtils namespace.
view of ISampleNode's with rectangular shape and node functionality
void connectInputPort(ConnectableView *other, int port_number)
connects input port with given index with output port of other view
virtual void setColor(const QColor &color)
virtual void setRectangle(QRectF rect)
virtual NodeEditorPort * addPort(const QString &name, NodeEditorPort::EPortDirection direction, NodeEditorPort::EPortType port_type)
adds port to view
virtual void setName(const QString &name)
static QRectF getDefaultBoundingRect(const QString &name)
returns default bounding rectangle for given IvView name
static QColor getDefaultParticleColor()
parent class for graphic representation of all ISampleNode's
Definition: IView.h:25
virtual SessionItem * getItem()
Definition: IView.h:59
static const QString T_CORE
static const QString T_SHELL
void addView(IView *childView, int row=0)
ParticleCoreShellView(QGraphicsItem *parent=0)
QSize SizeOfLetterM(const QWidget *widget=nullptr)
Returns size of largest letter of default system font.
Definition: StyleUtils.cpp:110