BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
This is a View of polygon mask (represented by PolygonItem) on GraphicsScene. More...
Public Slots | |
bool | closePolygonIfNecessary () |
Returns true if there was a request to close polygon (emitted by its start point), and then closes a polygon. More... | |
void | onClosePolygonRequest (bool value) |
Public Member Functions | |
PolygonView () | |
void | addView (IShape2DView *childView, int row) |
QRectF | boundingRect () const |
bool | isClosedPolygon () |
QPointF | lastAddedPoint () const |
returns last added poligon point in scene coordinates More... | |
virtual SessionItem * | parameterizedItem () |
virtual void | setParameterizedItem (SessionItem *item) |
void | setSceneAdaptor (const ISceneAdaptor *adaptor) |
int | type () const |
Protected Slots | |
virtual void | onChangedX () |
virtual void | onChangedY () |
virtual void | onPropertyChange (const QString &) |
void | update_view () |
Protected Member Functions | |
bool | blockOnProperty () const |
qreal | fromSceneX (qreal value) const |
convert scene coordinates to ColorMap plot coordinates More... | |
qreal | fromSceneY (qreal value) const |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) |
double | par (const QString &property_name) const |
void | setBlockOnProperty (bool value) |
qreal | toSceneX (const QString &property_name) const |
qreal | toSceneX (qreal value) const |
qreal | toSceneY (const QString &property_name) const |
qreal | toSceneY (qreal value) const |
Protected Attributes | |
const ISceneAdaptor * | m_adaptor |
bool | m_block_on_property_change |
QRectF | m_bounding_rect |
SessionItem * | m_item |
Private Member Functions | |
bool | makePolygonClosed () |
void | onItemPropertyChange (const QString &propertyName) |
void | setChildrenVisible (bool value) |
void | update_points () |
When polygon moves as a whole thing across the scene, given method updates coordinates of PolygonPointItem's. More... | |
void | update_polygon () |
Runs through all PolygonPointItem and calculate bounding rectangle. More... | |
Private Attributes | |
bool | m_block_on_point_update |
bool | m_close_polygon_request |
QPolygonF | m_polygon |
This is a View of polygon mask (represented by PolygonItem) on GraphicsScene.
Definition at line 23 of file PolygonView.h.
PolygonView::PolygonView | ( | ) |
Definition at line 25 of file PolygonView.cpp.
|
virtual |
Reimplemented from IShape2DView.
Definition at line 32 of file PolygonView.cpp.
References ASSERT, PolygonPointView::closePolygonRequest(), isClosedPolygon(), onClosePolygonRequest(), PolygonPointView::propertyChanged(), update_polygon(), and update_view().
|
protectedinherited |
Definition at line 127 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change.
|
inherited |
|
slot |
Returns true if there was a request to close polygon (emitted by its start point), and then closes a polygon.
Returns true if polygon was closed.
Definition at line 64 of file PolygonView.cpp.
References isClosedPolygon(), m_close_polygon_request, IShape2DView::m_item, PolygonItem::P_ISCLOSED, and SessionItem::setItemValue().
|
protectedinherited |
convert scene coordinates to ColorMap plot coordinates
Definition at line 106 of file IShape2DView.cpp.
References ISceneAdaptor::fromSceneX(), and IShape2DView::m_adaptor.
Referenced by EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), EllipseView::onChangedX(), VerticalLineView::onChangedX(), RectangleView::onChangedX(), and PolygonPointView::updateParameterizedItem().
|
protectedinherited |
Definition at line 111 of file IShape2DView.cpp.
References ISceneAdaptor::fromSceneY(), and IShape2DView::m_adaptor.
Referenced by EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), EllipseView::onChangedY(), HorizontalLineView::onChangedY(), RectangleView::onChangedY(), and PolygonPointView::updateParameterizedItem().
bool PolygonView::isClosedPolygon | ( | ) |
Definition at line 84 of file PolygonView.cpp.
References SessionItem::getItemValue(), IShape2DView::m_item, and PolygonItem::P_ISCLOSED.
Referenced by addView(), closePolygonIfNecessary(), and paint().
|
protected |
Definition at line 106 of file PolygonView.cpp.
References setChildrenVisible().
QPointF PolygonView::lastAddedPoint | ( | ) | const |
returns last added poligon point in scene coordinates
Definition at line 57 of file PolygonView.cpp.
|
private |
|
protected |
Definition at line 114 of file PolygonView.cpp.
References update_points().
|
inlineprotectedvirtualslotinherited |
|
inlineprotectedvirtualslotinherited |
|
slot |
Definition at line 79 of file PolygonView.cpp.
References m_close_polygon_request.
Referenced by addView().
|
privateinherited |
Definition at line 132 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change, IShape2DView::onPropertyChange(), MaskItem::P_IS_VISIBLE, MaskItem::P_MASK_VALUE, and IShape2DView::parameterizedItem().
Referenced by IShape2DView::setParameterizedItem().
|
inlineprotectedvirtualslotinherited |
Definition at line 50 of file IShape2DView.h.
Referenced by IShape2DView::onItemPropertyChange().
|
protected |
Definition at line 89 of file PolygonView.cpp.
References ASSERT, SessionItem::getItemValue(), MaskEditorHelper::getMaskBrush(), MaskEditorHelper::getMaskPen(), isClosedPolygon(), IShape2DView::m_item, m_polygon, and MaskItem::P_MASK_VALUE.
|
protectedinherited |
Definition at line 81 of file IShape2DView.cpp.
References SessionItem::getItemValue(), and IShape2DView::m_item.
Referenced by EllipseView::bottom(), RectangleView::bottom(), EllipseView::left(), RectangleView::left(), EllipseView::onPropertyChange(), EllipseView::right(), RectangleView::right(), EllipseView::top(), RectangleView::top(), and EllipseView::update_position().
|
virtualinherited |
Definition at line 61 of file IShape2DView.cpp.
References IShape2DView::m_item.
Referenced by IShape2DView::onItemPropertyChange().
|
protectedinherited |
Definition at line 122 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change.
Referenced by EllipseView::onChangedX(), VerticalLineView::onChangedX(), RectangleView::onChangedX(), EllipseView::onChangedY(), HorizontalLineView::onChangedY(), and RectangleView::onChangedY().
|
private |
Definition at line 184 of file PolygonView.cpp.
Referenced by itemChange().
|
virtualinherited |
Definition at line 41 of file IShape2DView.cpp.
References IShape2DView::m_item, SessionItem::mapper(), RealSpace::Particles::name(), IShape2DView::onItemPropertyChange(), ModelMapper::setOnItemDestroy(), ModelMapper::setOnPropertyChange(), and ModelMapper::unsubscribe().
Referenced by MaskViewFactory::createMaskView().
|
inherited |
Definition at line 66 of file IShape2DView.cpp.
References ASSERT, IShape2DView::m_adaptor, ISceneAdaptor::update_request(), and IShape2DView::update_view().
Referenced by MaskViewFactory::createMaskView().
|
protectedinherited |
Definition at line 86 of file IShape2DView.cpp.
References SessionItem::getItemValue(), and IShape2DView::m_item.
Referenced by EllipseView::left(), RectangleView::left(), EllipseView::onPropertyChange(), VerticalLineView::onPropertyChange(), EllipseView::right(), RectangleView::right(), update_polygon(), EllipseView::update_position(), RectangleView::update_position(), and VerticalLineView::update_view().
|
protectedinherited |
Definition at line 91 of file IShape2DView.cpp.
References IShape2DView::m_adaptor, and ISceneAdaptor::toSceneX().
|
protectedinherited |
Definition at line 96 of file IShape2DView.cpp.
References SessionItem::getItemValue(), and IShape2DView::m_item.
Referenced by EllipseView::bottom(), RectangleView::bottom(), EllipseView::onPropertyChange(), HorizontalLineView::onPropertyChange(), EllipseView::top(), RectangleView::top(), update_polygon(), EllipseView::update_position(), RectangleView::update_position(), and HorizontalLineView::update_view().
|
protectedinherited |
Definition at line 101 of file IShape2DView.cpp.
References IShape2DView::m_adaptor, and ISceneAdaptor::toSceneY().
|
inlinevirtual |
Reimplemented from IShape2DView.
Definition at line 27 of file PolygonView.h.
References MaskEditorHelper::POLYGON.
|
private |
When polygon moves as a whole thing across the scene, given method updates coordinates of PolygonPointItem's.
Definition at line 170 of file PolygonView.cpp.
References m_block_on_point_update, PolygonPointView::propertyChanged(), update_view(), and PolygonPointView::updateParameterizedItem().
Referenced by mouseMoveEvent().
|
private |
Runs through all PolygonPointItem and calculate bounding rectangle.
Determines position of the rectangle in scene. Calculates position of PolygonPointView in local polygon coordinates
Definition at line 129 of file PolygonView.cpp.
References SessionItem::getChildrenOfType(), m_block_on_point_update, IShape2DView::m_bounding_rect, IShape2DView::m_item, m_polygon, SessionItem::numberOfChildren(), PolygonPointItem::P_POSX, PolygonPointItem::P_POSY, IShape2DView::toSceneX(), and IShape2DView::toSceneY().
Referenced by addView(), and update_view().
|
protectedslot |
Definition at line 120 of file PolygonView.cpp.
References update_polygon().
Referenced by addView(), and update_points().
|
protectedinherited |
Definition at line 66 of file IShape2DView.h.
Referenced by IShape2DView::fromSceneX(), IShape2DView::fromSceneY(), IShape2DView::setSceneAdaptor(), IShape2DView::toSceneX(), IShape2DView::toSceneY(), IntensityDataView::update_view(), VerticalLineView::update_view(), HorizontalLineView::update_view(), MaskAllView::update_view(), and MaskContainerView::update_view().
|
private |
Definition at line 54 of file PolygonView.h.
Referenced by update_points(), and update_polygon().
|
protectedinherited |
Definition at line 68 of file IShape2DView.h.
Referenced by IShape2DView::blockOnProperty(), IShape2DView::onItemPropertyChange(), and IShape2DView::setBlockOnProperty().
|
protectedinherited |
Definition at line 67 of file IShape2DView.h.
Referenced by IShape2DView::boundingRect(), VerticalLineView::paint(), HorizontalLineView::paint(), MaskAllView::paint(), RectangleBaseView::update_bounding_rect(), update_polygon(), IntensityDataView::update_view(), VerticalLineView::update_view(), HorizontalLineView::update_view(), MaskAllView::update_view(), and MaskContainerView::update_view().
|
private |
Definition at line 55 of file PolygonView.h.
Referenced by closePolygonIfNecessary(), and onClosePolygonRequest().
|
protectedinherited |
Definition at line 65 of file IShape2DView.h.
Referenced by IShape2DView::~IShape2DView(), closePolygonIfNecessary(), isClosedPolygon(), EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), EllipseView::onChangedX(), VerticalLineView::onChangedX(), RectangleView::onChangedX(), EllipseView::onChangedY(), HorizontalLineView::onChangedY(), RectangleView::onChangedY(), EllipseView::paint(), VerticalLineView::paint(), HorizontalLineView::paint(), paint(), RectangleView::paint(), IShape2DView::par(), IShape2DView::parameterizedItem(), IShape2DView::setParameterizedItem(), IShape2DView::toSceneX(), IShape2DView::toSceneY(), RectangleBaseView::update_bounding_rect(), update_polygon(), and PolygonPointView::updateParameterizedItem().
|
private |
Definition at line 53 of file PolygonView.h.
Referenced by paint(), and update_polygon().