BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MesoCrystalView.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/MesoCrystalView.cpp
6 //! @brief Implements class MesoCrystalView
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 
20 
21 MesoCrystalView::MesoCrystalView(QGraphicsItem* parent) : ConnectableView(parent)
22 {
23  setName("MesoCrystal");
27  ->setToolTip("Connect to the ParticleLayout");
29  ->setToolTip("Connect basis particles");
31  ->setToolTip("Connect rotation to this port, if necessary");
32  m_label_vspace = StyleUtils::SizeOfLetterM().height() * 2.5;
33 }
34 
35 void MesoCrystalView::addView(IView* childView, int /* row */)
36 {
37  int index = 0;
38  if (this->getItem()->tagFromItem(childView->getItem()) == ParticleItem::T_TRANSFORMATION)
39  index = 1;
40  connectInputPort(dynamic_cast<ConnectableView*>(childView), index);
41 }
Defines class DesignerHelper.
Defines class MesoCrystalItem.
Defines class MesoCrystalView.
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
MesoCrystalView(QGraphicsItem *parent=0)
void addView(IView *childView, int row=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