BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Base class for LayerView and MultiLayerView Provides functionality for moving view on top of MultiLayer. More...
Public Slots | |
virtual void | onChangedX () |
virtual void | onChangedY () |
void | onPropertyChange (const QString &propertyName) |
Propagates change of 'Thickness' dynamic property to screen thickness of ILayerView. More... | |
Signals | |
void | aboutToBeDeleted () |
Public Member Functions | |
ILayerView (QGraphicsItem *parent=0) | |
virtual NodeEditorPort * | addPort (const QString &name, NodeEditorPort::EPortDirection direction, NodeEditorPort::EPortType port_type) |
adds port to view More... | |
virtual void | addView (IView *childView, int row=0) |
virtual QRectF | boundingRect () const |
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 | getInputPortIndex (NodeEditorPort *port) |
QList< NodeEditorPort * > | getInputPorts () |
virtual SessionItem * | getItem () |
virtual QString | getLabel () const |
virtual QString | getName () const |
QList< NodeEditorPort * > | getOutputPorts () |
virtual QRectF | getRectangle () const |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
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 |
void | updateLabel () |
Protected Member Functions | |
virtual int | getNumberOfInputPorts () |
virtual int | getNumberOfOutputPorts () |
virtual int | getNumberOfPorts () |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Detects movement of the ILayerView and sends possible drop areas to GraphicsScene for visualization. More... | |
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 () |
void | updateHeight () |
Private Attributes | |
QPointF | m_drag_start_position |
Base class for LayerView and MultiLayerView Provides functionality for moving view on top of MultiLayer.
Definition at line 25 of file ILayerView.h.
ILayerView::ILayerView | ( | QGraphicsItem * | parent = 0 | ) |
Definition at line 43 of file ILayerView.cpp.
|
signalinherited |
|
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().
|
virtualinherited |
Reimplemented in MultiLayerView, ParticleView, ParticleLayoutView, ParticleDistributionView, ParticleCoreShellView, ParticleCompositionView, MesoCrystalView, and LayerView.
Definition at line 53 of file IView.cpp.
Referenced by DesignerScene::updateViews().
|
inlinevirtualinherited |
Reimplemented in MultiLayerView.
Definition at line 34 of file ConnectableView.h.
References ConnectableView::getRectangle().
Referenced by getMultiLayerCandidate().
|
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().
|
inlinevirtualinherited |
|
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 updateLabel().
|
inlinevirtualinherited |
Definition at line 59 of file IView.h.
References IView::m_item.
Referenced by MesoCrystalView::addView(), ParticleCompositionView::addView(), ParticleCoreShellView::addView(), MultiLayerView::checkDragEvent(), MultiLayerView::dropEvent(), SampleViewAligner::getConnectedViews(), mouseReleaseEvent(), DesignerScene::onEstablishedConnection(), DesignerScene::onSceneSelectionChanged(), DesignerScene::removeConnection(), ParticleView::updatePixmap(), and ParticleView::updateToolTip().
|
inlinevirtual |
|
private |
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(), MultiLayerView::boundingRect(), MultiLayerCandidate::distance, MultiLayerView::getDropArea(), MultiLayerView::getDropAreaRectangle(), MultiLayerCandidate::multilayer, ViewTypes::MULTILAYER, and MultiLayerCandidate::row.
Referenced by itemChange(), and 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(), MultiLayerView::paint(), and ConnectableView::setPortCoordinates().
|
privateinherited |
Definition at line 179 of file ConnectableView.cpp.
References RealSpace::Particles::name().
Referenced by ConnectableView::update_appearance().
|
protected |
Detects movement of the ILayerView and sends possible drop areas to GraphicsScene for visualization.
Definition at line 122 of file ILayerView.cpp.
References MultiLayerCandidate::getInterfaceToScene(), getMultiLayerCandidate(), and DesignerScene::setLayerInterfaceLine().
|
protected |
|
protected |
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(), getMultiLayerCandidate(), DesignerScene::getSampleModel(), 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 |
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, updateColor(), updateHeight(), and updateLabel().
|
protectedvirtualinherited |
Definition at line 85 of file IView.cpp.
References IView::update_appearance().
Referenced by IView::setParameterizedItem().
|
virtualinherited |
Reimplemented in MultiLayerView, ParticleView, and LayerView.
Definition at line 41 of file ConnectableView.cpp.
References DesignerHelper::getDecorationGradient(), DesignerHelper::getLabelFontSize(), ConnectableView::getRectangle(), ConnectableView::m_color, ConnectableView::m_label, ConnectableView::m_label_vspace, ConnectableView::m_roundpar, and StyleUtils::SizeOfLetterM().
|
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::MultiLayerView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleLayoutView::ParticleLayoutView(), ParticleView::ParticleView(), TransformationView::TransformationView(), and 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 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::MultiLayerView(), ParticleCompositionView::ParticleCompositionView(), ParticleCoreShellView::ParticleCoreShellView(), ParticleDistributionView::ParticleDistributionView(), ParticleLayoutView::ParticleLayoutView(), ParticleView::ParticleView(), and TransformationView::TransformationView().
|
inline |
|
protectedvirtual |
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(), updateColor(), updateHeight(), and updateLabel().
|
private |
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 onPropertyChange(), and update_appearance().
|
private |
Definition at line 63 of file ILayerView.cpp.
References SessionItem::getItemValue(), SessionItem::isTag(), IView::m_item, ConnectableView::m_rect, DesignerHelper::nanometerToScreen(), LayerItem::P_THICKNESS, and ConnectableView::setPortCoordinates().
Referenced by onPropertyChange(), and update_appearance().
void ILayerView::updateLabel | ( | ) |
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 onPropertyChange(), and update_appearance().
|
protectedinherited |
Definition at line 67 of file ConnectableView.h.
Referenced by ConnectableView::getColor(), ConnectableView::paint(), LayerView::paint(), ParticleView::paint(), MultiLayerView::paint(), and ConnectableView::setColor().
|
private |
Definition at line 51 of file ILayerView.h.
Referenced by mousePressEvent(), and mouseReleaseEvent().
|
protectedinherited |
Definition at line 72 of file ConnectableView.h.
Referenced by ConnectableView::addPort(), ConnectableView::connectInputPort(), ConnectableView::getInputPortIndex(), ConnectableView::getInputPorts(), ConnectableView::getNumberOfInputPorts(), and ConnectableView::getNumberOfPorts().
|
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(), updateColor(), updateHeight(), and 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().
|
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 MultiLayerView::boundingRect(), ConnectableView::getRectangle(), ConnectableView::setRectangle(), updateHeight(), MultiLayerView::updateHeight(), and MultiLayerView::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().