BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Class representing view of MultiLayer. More...
Public Slots | |
virtual void | onChangedX () |
virtual void | onChangedY () |
void | onLayerAboutToBeDeleted () |
void | onPropertyChange (const QString &propertyName) |
Propagates change of 'Thickness' dynamic property to screen thickness of ILayerView. More... | |
void | updateGeometry () |
Updates geometry of MultiLayerView from current childs geometries. More... | |
void | updateHeight () |
Updates MultiLayer height, sets y-positions of children, defines new drop areas. More... | |
void | updateWidth () |
Updates MultiLayerView width, sets x-positions of children. More... | |
Signals | |
void | aboutToBeDeleted () |
Public Member Functions | |
MultiLayerView (QGraphicsItem *parent=0) | |
~MultiLayerView () | |
virtual void | addNewLayer (ILayerView *layer, int row) |
virtual NodeEditorPort * | addPort (const QString &name, NodeEditorPort::EPortDirection direction, NodeEditorPort::EPortType port_type) |
adds port to view More... | |
void | addView (IView *childView, int row=0) override |
QRectF | boundingRect () const override |
void | connectInputPort (ConnectableView *other, int port_number) |
connects input port with given index with output port of other view More... | |
virtual QColor | getColor () const |
int | getDropArea (QPointF pos) |
Returns index of drop area for given coordinate. More... | |
QRectF | getDropAreaRectangle (int row) |
Returns drop area rectangle corresponding to given row. More... | |
int | getInputPortIndex (NodeEditorPort *port) |
QList< NodeEditorPort * > | getInputPorts () |
QLineF | getInterfaceLine (int row) |
Returns line representing interface. More... | |
virtual SessionItem * | getItem () |
virtual QString | getLabel () const |
virtual QString | getName () const |
QList< NodeEditorPort * > | getOutputPorts () |
virtual QRectF | getRectangle () const |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
virtual void | removeLayer (ILayerView *layer) |
virtual void | setColor (const QColor &color) |
virtual void | setLabel (const QString &name) |
virtual void | setName (const QString &name) |
virtual void | setParameterizedItem (SessionItem *item) |
virtual void | setRectangle (QRectF rect) |
int | type () const override |
void | updateLabel () |
Protected Member Functions | |
const DesignerMimeData * | checkDragEvent (QGraphicsSceneDragDropEvent *event) |
void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) override |
void | dropEvent (QGraphicsSceneDragDropEvent *event) override |
virtual int | getNumberOfInputPorts () |
virtual int | getNumberOfOutputPorts () |
virtual int | getNumberOfPorts () |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
Detects possible MultiLayerView's to drop given ILayerView and propagate request to SessionModel. More... | |
virtual void | onSiblingsChange () |
virtual void | setPortCoordinates () |
void | update_appearance () |
updates visual appearance of the item (color, icons, size etc) More... | |
Protected Attributes | |
QColor | m_color |
QList< NodeEditorPort * > | m_input_ports |
SessionItem * | m_item |
QString | m_label |
double | m_label_vspace |
QString | m_name |
QList< NodeEditorPort * > | m_output_ports |
QRectF | m_rect |
int | m_roundpar |
Private Member Functions | |
MultiLayerCandidate | getMultiLayerCandidate () |
Finds candidate (another MultiLayer) into which we will move our ILayerView. More... | |
QString | hyphenate (const QString &name) const |
void | updateColor () |
Private Attributes | |
QPointF | m_drag_start_position |
QList< QRectF > | m_drop_areas |
QList< QLineF > | m_interfaces |
QList< ILayerView * > | m_layers |
Class representing view of MultiLayer.
Handles drop of other MultiLayer and Layer views on top of it
Definition at line 25 of file MultiLayerView.h.
MultiLayerView::MultiLayerView | ( | QGraphicsItem * | parent = 0 | ) |
Definition at line 25 of file MultiLayerView.cpp.
References DesignerHelper::getDefaultBoundingRect(), ConnectableView::setColor(), ConnectableView::setRectangle(), updateGeometry(), and updateHeight().
MultiLayerView::~MultiLayerView | ( | ) |
Definition at line 36 of file MultiLayerView.cpp.
References updateHeight().
|
signalinherited |
Referenced by addNewLayer(), DesignerScene::removeItemViewFromScene(), and removeLayer().
|
virtual |
Definition at line 86 of file MultiLayerView.cpp.
References IView::aboutToBeDeleted(), m_layers, onLayerAboutToBeDeleted(), and updateHeight().
Referenced by addView().
|
virtualinherited |
adds port to view
Definition at line 68 of file ConnectableView.cpp.
References NodeEditorPort::INPUT, ConnectableView::m_input_ports, ConnectableView::m_output_ports, RealSpace::Particles::name(), NodeEditorPort::OUTPUT, and ConnectableView::setPortCoordinates().
Referenced by InterferenceFunction1DLatticeView::InterferenceFunction1DLatticeView(), InterferenceFunction2DLatticeView::InterferenceFunction2DLatticeView(), InterferenceFunction2DParaCrystalView::InterferenceFunction2DParaCrystalView(), InterferenceFunctionFinite2DLatticeView::InterferenceFunctionFinite2DLatticeView(), InterferenceFunctionHardDiskView::InterferenceFunctionHardDiskView(), InterferenceFunctionRadialParaCrystalView::InterferenceFunctionRadialParaCrystalView(), LayerView::LayerView(), MesoCrystalView::MesoCrystalView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleLayoutView::ParticleLayoutView(), ParticleView::ParticleView(), and TransformationView::TransformationView().
|
overridevirtual |
Reimplemented from IView.
Definition at line 66 of file MultiLayerView.cpp.
References addNewLayer(), ASSERT, m_layers, and updateGeometry().
|
overridevirtual |
Reimplemented from ConnectableView.
Definition at line 42 of file MultiLayerView.cpp.
References m_layers, and ConnectableView::m_rect.
Referenced by ILayerView::getMultiLayerCandidate(), updateHeight(), and updateWidth().
|
protected |
Definition at line 233 of file MultiLayerView.cpp.
References DesignerMimeData::getClassName(), getDropArea(), and IView::getItem().
Referenced by dragMoveEvent(), and dropEvent().
|
inherited |
connects input port with given index with output port of other view
Definition at line 90 of file ConnectableView.cpp.
References ASSERT, ConnectableView::getOutputPorts(), NodeEditorPort::isConnected(), ConnectableView::m_input_ports, NodeEditorConnection::setPort1(), NodeEditorConnection::setPort2(), and NodeEditorConnection::updatePath().
Referenced by LayerView::addView(), MesoCrystalView::addView(), ParticleCompositionView::addView(), ParticleCoreShellView::addView(), ParticleDistributionView::addView(), ParticleLayoutView::addView(), and ParticleView::addView().
|
overrideprotected |
Definition at line 213 of file MultiLayerView.cpp.
References checkDragEvent().
|
overrideprotected |
Definition at line 219 of file MultiLayerView.cpp.
References checkDragEvent(), DesignerMimeData::getClassName(), getDropArea(), IView::getItem(), DesignerScene::getSampleModel(), and SessionModel::insertNewItem().
|
inlinevirtualinherited |
int MultiLayerView::getDropArea | ( | QPointF | pos | ) |
Returns index of drop area for given coordinate.
Definition at line 181 of file MultiLayerView.cpp.
References m_drop_areas.
Referenced by checkDragEvent(), dropEvent(), and ILayerView::getMultiLayerCandidate().
QRectF MultiLayerView::getDropAreaRectangle | ( | int | row | ) |
Returns drop area rectangle corresponding to given row.
Definition at line 194 of file MultiLayerView.cpp.
References m_drop_areas.
Referenced by ILayerView::getMultiLayerCandidate().
|
inherited |
Definition at line 114 of file ConnectableView.cpp.
References ConnectableView::m_input_ports.
Referenced by DesignerScene::onEstablishedConnection().
|
inlineinherited |
Definition at line 51 of file ConnectableView.h.
References ConnectableView::m_input_ports.
Referenced by ILayerView::updateLabel().
QLineF MultiLayerView::getInterfaceLine | ( | int | row | ) |
Returns line representing interface.
Definition at line 204 of file MultiLayerView.cpp.
References m_interfaces.
Referenced by MultiLayerCandidate::getInterfaceToScene().
|
inlinevirtualinherited |
Definition at line 59 of file IView.h.
References IView::m_item.
Referenced by MesoCrystalView::addView(), ParticleCompositionView::addView(), ParticleCoreShellView::addView(), checkDragEvent(), dropEvent(), SampleViewAligner::getConnectedViews(), ILayerView::mouseReleaseEvent(), DesignerScene::onEstablishedConnection(), DesignerScene::onSceneSelectionChanged(), DesignerScene::removeConnection(), ParticleView::updatePixmap(), and ParticleView::updateToolTip().
|
inlinevirtualinherited |
|
privateinherited |
Finds candidate (another MultiLayer) into which we will move our ILayerView.
To become the candidate, the bounding rectangles of MultiLayerView and given ILayerView should intersects and ILayerView center should be near appropriate drop area. If more than one candidate is found, they will be sorted according to the distance between drop area and ILayerVIew center
Definition at line 222 of file ILayerView.cpp.
References ConnectableView::boundingRect(), boundingRect(), MultiLayerCandidate::distance, getDropArea(), getDropAreaRectangle(), MultiLayerCandidate::multilayer, ViewTypes::MULTILAYER, and MultiLayerCandidate::row.
Referenced by ILayerView::itemChange(), and ILayerView::mouseReleaseEvent().
|
inlinevirtualinherited |
|
protectedvirtualinherited |
Definition at line 168 of file ConnectableView.cpp.
References ConnectableView::m_input_ports.
|
protectedvirtualinherited |
Definition at line 163 of file ConnectableView.cpp.
References ConnectableView::m_output_ports.
Referenced by ConnectableView::setPortCoordinates().
|
protectedvirtualinherited |
Definition at line 158 of file ConnectableView.cpp.
References ConnectableView::m_input_ports, and ConnectableView::m_output_ports.
Referenced by ConnectableView::setPortCoordinates().
|
inlineinherited |
Definition at line 52 of file ConnectableView.h.
References ConnectableView::m_output_ports.
Referenced by ConnectableView::connectInputPort().
|
inlinevirtualinherited |
Definition at line 39 of file ConnectableView.h.
References ConnectableView::m_rect.
Referenced by ConnectableView::boundingRect(), ConnectableView::paint(), LayerView::paint(), ParticleView::paint(), paint(), and ConnectableView::setPortCoordinates().
|
privateinherited |
Definition at line 179 of file ConnectableView.cpp.
References RealSpace::Particles::name().
Referenced by ConnectableView::update_appearance().
|
overrideprotected |
Definition at line 251 of file MultiLayerView.cpp.
|
protectedinherited |
|
protectedinherited |
Detects possible MultiLayerView's to drop given ILayerView and propagate request to SessionModel.
Definition at line 145 of file ILayerView.cpp.
References ASSERT, IView::getItem(), ILayerView::getMultiLayerCandidate(), DesignerScene::getSampleModel(), ILayerView::m_drag_start_position, SessionModel::moveItem(), MultiLayerCandidate::multilayer, SessionGraphicsItem::P_XPOS, SessionGraphicsItem::P_YPOS, MultiLayerCandidate::row, SessionItem::setItemValue(), and DesignerScene::setLayerInterfaceLine().
|
virtualslotinherited |
Definition at line 55 of file IView.cpp.
References IView::m_item, SessionGraphicsItem::P_XPOS, and SessionItem::setItemValue().
Referenced by IView::IView().
|
virtualslotinherited |
Definition at line 62 of file IView.cpp.
References IView::m_item, SessionGraphicsItem::P_YPOS, and SessionItem::setItemValue().
Referenced by IView::IView().
|
slot |
Definition at line 96 of file MultiLayerView.cpp.
References ASSERT, and removeLayer().
Referenced by addNewLayer(), and removeLayer().
|
slotinherited |
Propagates change of 'Thickness' dynamic property to screen thickness of ILayerView.
Definition at line 51 of file ILayerView.cpp.
References IView::onPropertyChange(), LayerItem::P_MATERIAL, LayerItem::P_THICKNESS, ILayerView::updateColor(), ILayerView::updateHeight(), and ILayerView::updateLabel().
|
protectedvirtualinherited |
Definition at line 85 of file IView.cpp.
References IView::update_appearance().
Referenced by IView::setParameterizedItem().
|
overridevirtual |
Reimplemented from ConnectableView.
Definition at line 54 of file MultiLayerView.cpp.
References DesignerHelper::getLayerGradient(), ConnectableView::getRectangle(), and ConnectableView::m_color.
|
virtual |
Definition at line 103 of file MultiLayerView.cpp.
References IView::aboutToBeDeleted(), ASSERT, m_layers, onLayerAboutToBeDeleted(), updateGeometry(), and updateHeight().
Referenced by onLayerAboutToBeDeleted().
|
inlinevirtualinherited |
Definition at line 57 of file ConnectableView.h.
References ConnectableView::m_color.
Referenced by InterferenceFunction1DLatticeView::InterferenceFunction1DLatticeView(), InterferenceFunction2DLatticeView::InterferenceFunction2DLatticeView(), InterferenceFunction2DParaCrystalView::InterferenceFunction2DParaCrystalView(), InterferenceFunctionFinite2DLatticeView::InterferenceFunctionFinite2DLatticeView(), InterferenceFunctionHardDiskView::InterferenceFunctionHardDiskView(), InterferenceFunctionRadialParaCrystalView::InterferenceFunctionRadialParaCrystalView(), LayerView::LayerView(), MesoCrystalView::MesoCrystalView(), MultiLayerView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleLayoutView::ParticleLayoutView(), ParticleView::ParticleView(), TransformationView::TransformationView(), and ILayerView::updateColor().
|
virtualinherited |
Definition at line 84 of file ConnectableView.cpp.
References ConnectableView::m_label, RealSpace::Particles::name(), and ConnectableView::setPortCoordinates().
Referenced by ConnectableView::update_appearance().
|
inlinevirtualinherited |
Definition at line 56 of file ConnectableView.h.
References ConnectableView::m_name, and RealSpace::Particles::name().
Referenced by InterferenceFunction1DLatticeView::InterferenceFunction1DLatticeView(), InterferenceFunction2DLatticeView::InterferenceFunction2DLatticeView(), InterferenceFunction2DParaCrystalView::InterferenceFunction2DParaCrystalView(), InterferenceFunctionFinite2DLatticeView::InterferenceFunctionFinite2DLatticeView(), InterferenceFunctionHardDiskView::InterferenceFunctionHardDiskView(), InterferenceFunctionRadialParaCrystalView::InterferenceFunctionRadialParaCrystalView(), LayerView::LayerView(), MesoCrystalView::MesoCrystalView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleLayoutView::ParticleLayoutView(), ParticleView::ParticleView(), and TransformationView::TransformationView().
|
virtualinherited |
Definition at line 31 of file IView.cpp.
References ASSERT, SessionItem::getItemValue(), IView::m_item, SessionItem::mapper(), RealSpace::Particles::name(), IView::onPropertyChange(), IView::onSiblingsChange(), SessionGraphicsItem::P_XPOS, SessionGraphicsItem::P_YPOS, ModelMapper::setOnItemDestroy(), ModelMapper::setOnPropertyChange(), ModelMapper::setOnSiblingsChange(), SessionItem::toolTip(), and IView::update_appearance().
Referenced by DesignerScene::addViewForItem().
|
protectedvirtualinherited |
Definition at line 120 of file ConnectableView.cpp.
References ConnectableView::getLabel(), ConnectableView::getNumberOfOutputPorts(), ConnectableView::getNumberOfPorts(), ConnectableView::getRectangle(), NodeEditorPort::isOutput(), and ConnectableView::m_label_vspace.
Referenced by ConnectableView::addPort(), ConnectableView::setLabel(), and ILayerView::updateHeight().
|
inlinevirtualinherited |
Definition at line 40 of file ConnectableView.h.
References ConnectableView::m_rect.
Referenced by InterferenceFunction1DLatticeView::InterferenceFunction1DLatticeView(), InterferenceFunction2DLatticeView::InterferenceFunction2DLatticeView(), InterferenceFunction2DParaCrystalView::InterferenceFunction2DParaCrystalView(), InterferenceFunctionFinite2DLatticeView::InterferenceFunctionFinite2DLatticeView(), InterferenceFunctionHardDiskView::InterferenceFunctionHardDiskView(), InterferenceFunctionRadialParaCrystalView::InterferenceFunctionRadialParaCrystalView(), LayerView::LayerView(), MesoCrystalView::MesoCrystalView(), MultiLayerView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleLayoutView::ParticleLayoutView(), ParticleView::ParticleView(), and TransformationView::TransformationView().
|
inlineoverride |
|
protectedvirtualinherited |
updates visual appearance of the item (color, icons, size etc)
Reimplemented from ConnectableView.
Definition at line 208 of file ILayerView.cpp.
References ConnectableView::update_appearance(), ILayerView::updateColor(), ILayerView::updateHeight(), and ILayerView::updateLabel().
|
privateinherited |
Definition at line 74 of file ILayerView.cpp.
References ASSERT, ExternalProperty::color(), SessionItem::getItemValue(), SessionItem::isTag(), IView::m_item, LayerItem::P_MATERIAL, and ConnectableView::setColor().
Referenced by ILayerView::onPropertyChange(), and ILayerView::update_appearance().
|
slot |
Updates geometry of MultiLayerView from current childs geometries.
Definition at line 114 of file MultiLayerView.cpp.
References updateHeight(), and updateWidth().
Referenced by MultiLayerView(), addView(), and removeLayer().
|
slot |
Updates MultiLayer height, sets y-positions of children, defines new drop areas.
Definition at line 121 of file MultiLayerView.cpp.
References boundingRect(), DesignerHelper::getDefaultMultiLayerRect(), m_drop_areas, m_interfaces, m_layers, and ConnectableView::m_rect.
Referenced by MultiLayerView(), ~MultiLayerView(), addNewLayer(), removeLayer(), and updateGeometry().
|
inherited |
Definition at line 88 of file ILayerView.cpp.
References ConnectableView::getInputPorts(), SessionItem::getItemValue(), SessionItem::isTag(), IView::m_item, LayerItem::P_MATERIAL, NodeEditorPort::setLabel(), and ExternalProperty::text().
Referenced by ILayerView::onPropertyChange(), and ILayerView::update_appearance().
|
slot |
Updates MultiLayerView width, sets x-positions of children.
If list of children contains another MultiLayer, then width of given MultiLayer will be increased by 12%
Definition at line 157 of file MultiLayerView.cpp.
References boundingRect(), DesignerHelper::getDefaultMultiLayerRect(), m_layers, and ConnectableView::m_rect.
Referenced by updateGeometry().
|
protectedinherited |
Definition at line 67 of file ConnectableView.h.
Referenced by ConnectableView::getColor(), ConnectableView::paint(), LayerView::paint(), ParticleView::paint(), paint(), and ConnectableView::setColor().
|
privateinherited |
Definition at line 51 of file ILayerView.h.
Referenced by ILayerView::mousePressEvent(), and ILayerView::mouseReleaseEvent().
|
private |
Definition at line 61 of file MultiLayerView.h.
Referenced by getDropArea(), getDropAreaRectangle(), and updateHeight().
|
protectedinherited |
Definition at line 72 of file ConnectableView.h.
Referenced by ConnectableView::addPort(), ConnectableView::connectInputPort(), ConnectableView::getInputPortIndex(), ConnectableView::getInputPorts(), ConnectableView::getNumberOfInputPorts(), and ConnectableView::getNumberOfPorts().
|
private |
Definition at line 62 of file MultiLayerView.h.
Referenced by getInterfaceLine(), and updateHeight().
|
protectedinherited |
Definition at line 51 of file IView.h.
Referenced by IView::~IView(), IView::getItem(), IView::onChangedX(), IView::onChangedY(), IView::onPropertyChange(), IView::setParameterizedItem(), ConnectableView::update_appearance(), ILayerView::updateColor(), ILayerView::updateHeight(), and ILayerView::updateLabel().
|
protectedinherited |
Definition at line 71 of file ConnectableView.h.
Referenced by ConnectableView::getLabel(), ConnectableView::paint(), ParticleView::paint(), and ConnectableView::setLabel().
|
protectedinherited |
Definition at line 70 of file ConnectableView.h.
Referenced by ConnectableView::ConnectableView(), MesoCrystalView::MesoCrystalView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleView::ParticleView(), ConnectableView::paint(), and ConnectableView::setPortCoordinates().
|
private |
Definition at line 60 of file MultiLayerView.h.
Referenced by addNewLayer(), addView(), boundingRect(), removeLayer(), updateHeight(), and updateWidth().
|
protectedinherited |
Definition at line 66 of file ConnectableView.h.
Referenced by ConnectableView::getName(), and ConnectableView::setName().
|
protectedinherited |
Definition at line 73 of file ConnectableView.h.
Referenced by ConnectableView::addPort(), ConnectableView::getNumberOfOutputPorts(), ConnectableView::getNumberOfPorts(), and ConnectableView::getOutputPorts().
|
protectedinherited |
Definition at line 68 of file ConnectableView.h.
Referenced by boundingRect(), ConnectableView::getRectangle(), ConnectableView::setRectangle(), ILayerView::updateHeight(), updateHeight(), and updateWidth().
|
protectedinherited |
Definition at line 69 of file ConnectableView.h.
Referenced by ConnectableView::ConnectableView(), InterferenceFunction1DLatticeView::InterferenceFunction1DLatticeView(), InterferenceFunction2DLatticeView::InterferenceFunction2DLatticeView(), InterferenceFunction2DParaCrystalView::InterferenceFunction2DParaCrystalView(), InterferenceFunctionFinite2DLatticeView::InterferenceFunctionFinite2DLatticeView(), InterferenceFunctionHardDiskView::InterferenceFunctionHardDiskView(), InterferenceFunctionRadialParaCrystalView::InterferenceFunctionRadialParaCrystalView(), TransformationView::TransformationView(), ConnectableView::paint(), and ParticleView::paint().