BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
This is a View of polygon mask (represented by PolygonItem) on GraphicsScene.
Definition at line 26 of file PolygonView.h.
Public Slots | |
bool | closePolygonIfNecessary () |
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. More... | |
void | onClosePolygonRequest (bool value) |
Public Member Functions | |
PolygonView (PolygonItem *item) | |
~PolygonView () override | |
void | addView (IShape2DView *childView, int row) override |
QRectF | boundingRect () const override |
bool | isClosedPolygon () |
QPointF | lastAddedPoint () const |
Returns last added poligon point in scene coordinates. More... | |
SessionItem * | parameterizedItem () const override |
void | setSceneAdaptor (const ISceneAdaptor *adaptor) |
QPainterPath | shape () const override |
int | type () const override |
Protected Slots | |
virtual void | onChangedX () |
virtual void | onChangedY () |
virtual void | onPropertyChange () |
void | update_view () override |
Protected Member Functions | |
bool | blockOnProperty () const |
void | disconnectFromItem (SessionItem *item) |
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) override |
QPainterPath | maskedShape () const |
Returns the shape with all masking already applied. More... | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override |
void | setBlockOnProperty (bool value) |
qreal | toSceneX (qreal value) const |
qreal | toSceneY (qreal value) const |
Protected Attributes | |
const ISceneAdaptor * | m_adaptor |
bool | m_block_on_property_change |
QRectF | m_bounding_rect |
Private Member Functions | |
bool | makePolygonClosed () |
void | onItemDestroyed () override |
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. Determines position of the rectangle in scene. Calculates position of PolygonPointView in local polygon coordinates. More... | |
Private Attributes | |
bool | m_block_on_point_update |
bool | m_close_polygon_request |
PolygonItem * | m_item |
QPolygonF | m_polygon |
|
explicit |
Definition at line 26 of file PolygonView.cpp.
|
override |
Definition at line 37 of file PolygonView.cpp.
References IShape2DView::disconnectFromItem(), and m_item.
|
overridevirtual |
Reimplemented from IShape2DView.
Definition at line 47 of file PolygonView.cpp.
References PolygonPointView::closePolygonRequest(), isClosedPolygon(), onClosePolygonRequest(), PolygonPointView::propertyChanged(), update_polygon(), and update_view().
|
protectedinherited |
Definition at line 140 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change.
|
overrideinherited |
|
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 87 of file PolygonView.cpp.
References isClosedPolygon(), m_close_polygon_request, m_item, and PolygonItem::setIsClosed().
|
protectedinherited |
Definition at line 145 of file IShape2DView.cpp.
References SessionItem::mapper(), and ModelMapper::unsubscribe().
Referenced by EllipseView::~EllipseView(), HorizontalLineView::~HorizontalLineView(), MaskAllView::~MaskAllView(), MaskContainerView::~MaskContainerView(), PolygonPointView::~PolygonPointView(), ~PolygonView(), RectangleView::~RectangleView(), and VerticalLineView::~VerticalLineView().
|
protectedinherited |
convert scene coordinates to ColorMap plot coordinates
Definition at line 119 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 124 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 107 of file PolygonView.cpp.
References PolygonItem::isClosed(), and m_item.
Referenced by addView(), closePolygonIfNecessary(), and paint().
|
overrideprotected |
Definition at line 125 of file PolygonView.cpp.
References setChildrenVisible().
QPointF PolygonView::lastAddedPoint | ( | ) | const |
Returns last added poligon point in scene coordinates.
Definition at line 72 of file PolygonView.cpp.
|
private |
|
protectedinherited |
Returns the shape with all masking already applied.
Definition at line 79 of file IShape2DView.cpp.
References MaskEditorHelper::ELLIPSE, MaskEditorHelper::HORIZONTALLINE, MaskEditorHelper::POLYGON, MaskEditorHelper::RECTANGLE, and MaskEditorHelper::VERTICALLINE.
Referenced by IShape2DView::paint().
|
overrideprotected |
Definition at line 133 of file PolygonView.cpp.
References update_points().
|
inlineprotectedvirtualslotinherited |
|
inlineprotectedvirtualslotinherited |
|
slot |
Definition at line 102 of file PolygonView.cpp.
References m_close_polygon_request.
Referenced by addView().
|
overrideprivatevirtual |
|
privateinherited |
Definition at line 151 of file IShape2DView.cpp.
References MaskItem::isIsVisiblePropertyName(), MaskItem::isMaskValuePropertyName(), IShape2DView::m_block_on_property_change, IShape2DView::onPropertyChange(), and IShape2DView::parameterizedItem().
Referenced by IShape2DView::IShape2DView().
|
inlineprotectedvirtualslotinherited |
Definition at line 46 of file IShape2DView.h.
Referenced by IShape2DView::onItemPropertyChange().
|
overrideprotected |
Definition at line 112 of file PolygonView.cpp.
References MaskEditorHelper::getMaskPen(), isClosedPolygon(), m_item, m_polygon, and IShape2DView::paint().
|
overridevirtual |
|
protectedinherited |
Definition at line 135 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 196 of file PolygonView.cpp.
Referenced by itemChange().
|
inherited |
Definition at line 55 of file IShape2DView.cpp.
References IShape2DView::m_adaptor, ISceneAdaptor::update_request(), and IShape2DView::update_view().
Referenced by MaskViewFactory::createMaskView().
|
override |
|
protectedinherited |
Definition at line 109 of file IShape2DView.cpp.
References IShape2DView::m_adaptor, and ISceneAdaptor::toSceneX().
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 114 of file IShape2DView.cpp.
References IShape2DView::m_adaptor, and ISceneAdaptor::toSceneY().
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().
|
inlineoverride |
|
private |
When polygon moves as a whole thing across the scene, given method updates coordinates of PolygonPointItem's.
Definition at line 182 of file PolygonView.cpp.
References m_block_on_point_update, PolygonPointView::propertyChanged(), and update_view().
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 148 of file PolygonView.cpp.
References m_block_on_point_update, IShape2DView::m_bounding_rect, m_item, m_polygon, PolygonItem::points(), IShape2DView::toSceneX(), and IShape2DView::toSceneY().
Referenced by addView(), and update_view().
|
overrideprotectedslot |
Definition at line 139 of file PolygonView.cpp.
References update_polygon().
Referenced by addView(), and update_points().
|
protectedinherited |
Definition at line 67 of file IShape2DView.h.
Referenced by RegionOfInterestView::boundingRect(), IShape2DView::fromSceneX(), IShape2DView::fromSceneY(), IShape2DView::setSceneAdaptor(), IShape2DView::toSceneX(), IShape2DView::toSceneY(), VerticalLineView::update_view(), HorizontalLineView::update_view(), MaskAllView::update_view(), MaskContainerView::update_view(), and RegionOfInterestView::update_view().
|
private |
Definition at line 64 of file PolygonView.h.
Referenced by update_points(), and update_polygon().
|
protectedinherited |
Definition at line 69 of file IShape2DView.h.
Referenced by IShape2DView::blockOnProperty(), IShape2DView::onItemPropertyChange(), and IShape2DView::setBlockOnProperty().
|
protectedinherited |
Definition at line 68 of file IShape2DView.h.
Referenced by IShape2DView::boundingRect(), VerticalLineView::paint(), HorizontalLineView::paint(), MaskAllView::paint(), VerticalLineView::shape(), HorizontalLineView::shape(), RectangleBaseView::update_bounding_rect(), update_polygon(), VerticalLineView::update_view(), HorizontalLineView::update_view(), MaskAllView::update_view(), MaskContainerView::update_view(), and RegionOfInterestView::update_view().
|
private |
Definition at line 65 of file PolygonView.h.
Referenced by closePolygonIfNecessary(), and onClosePolygonRequest().
|
private |
Definition at line 62 of file PolygonView.h.
Referenced by ~PolygonView(), closePolygonIfNecessary(), isClosedPolygon(), onItemDestroyed(), paint(), parameterizedItem(), and update_polygon().
|
private |
Definition at line 63 of file PolygonView.h.
Referenced by paint(), shape(), and update_polygon().