BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleCompositionView.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/ParticleCompositionView.cpp
6 //! @brief Implements class ParticleCompositionView
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("ParticleComposition");
26  ->setToolTip("Connect to the ParticleLayout");
28  ->setToolTip("Connect particles");
30  ->setToolTip("Connect rotation to this port, if necessary");
31  m_label_vspace = StyleUtils::SizeOfLetterM().height() * 3.0;
32 }
33 
34 void ParticleCompositionView::addView(IView* childView, int /* row */)
35 {
36  int index = 0;
37  if (this->getItem()->tagFromItem(childView->getItem()) == ParticleItem::T_TRANSFORMATION)
38  index = 1;
39  connectInputPort(dynamic_cast<ConnectableView*>(childView), index);
40 }
Defines class DesignerHelper.
Defines class ParticleCompositionView.
Defines class ParticleItem.
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
void addView(IView *childView, int row=0)
ParticleCompositionView(QGraphicsItem *parent=0)
static const QString T_TRANSFORMATION
Definition: ParticleItem.h:29
QSize SizeOfLetterM(const QWidget *widget=nullptr)
Returns size of largest letter of default system font.
Definition: StyleUtils.cpp:110