BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
This is a View of rectangular mask (represented by RectangleItem) on GraphicsScene. More...
Public Member Functions | |
RectangleView () | |
virtual void | addView (IShape2DView *childView, int row=0) |
QRectF | boundingRect () const |
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 &propertyName) |
Protected Member Functions | |
bool | blockOnProperty () const |
qreal | bottom () const |
Returns the y-coordinate of the rectangle's bottom edge. More... | |
void | create_size_handle_elements () |
qreal | fromSceneX (qreal value) const |
convert scene coordinates to ColorMap plot coordinates More... | |
qreal | fromSceneY (qreal value) const |
qreal | height () const |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Track if item selected/deselected and show/hide size handles. More... | |
qreal | left () const |
returns the x-coordinate of the rectangle's left edge More... | |
QRectF | mask_rectangle () |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) |
double | par (const QString &property_name) const |
qreal | right () const |
returns the x-coordinate of the rectangle's right edge More... | |
void | setBlockOnProperty (bool value) |
qreal | top () const |
Returns the y-coordinate of the rectangle's top edge. More... | |
qreal | toSceneX (const QString &property_name) const |
qreal | toSceneX (qreal value) const |
qreal | toSceneY (const QString &property_name) const |
qreal | toSceneY (qreal value) const |
virtual void | update_bounding_rect () |
updates view's bounding rectangle using item properties More... | |
void | update_position () |
updates position of view using item properties More... | |
void | update_view () |
update visual appearance of view (triggered by ISceneAdaptor) More... | |
qreal | width () const |
returns width of the rectangle More... | |
Protected Attributes | |
SizeHandleElement * | m_activeHandleElement |
const ISceneAdaptor * | m_adaptor |
bool | m_block_on_property_change |
QRectF | m_bounding_rect |
SessionItem * | m_item |
QRectF | m_mask_rect |
mask rectangle in scene coordinates More... | |
QMap< SizeHandleElement::EHandleLocation, SizeHandleElement * > | m_resize_handles |
coordinates of corner opposite to the grip corner at the moment it first clicked in scene coordinates More... | |
QPointF | m_resize_opposite_origin |
Private Slots | |
void | onSizeHandleElementRequest (bool going_to_resize) |
triggered by SizeHandleElement More... | |
Private Member Functions | |
void | onItemPropertyChange (const QString &propertyName) |
This is a View of rectangular mask (represented by RectangleItem) on GraphicsScene.
Given view follows standard QGraphicsScene notations: (x,y) is top left corner.
Definition at line 23 of file RectangleView.h.
|
default |
|
virtualinherited |
Reimplemented in PolygonView.
Definition at line 116 of file IShape2DView.cpp.
Referenced by MaskGraphicsScene::updateViews().
|
protectedinherited |
Definition at line 127 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change.
|
protectedvirtual |
Returns the y-coordinate of the rectangle's bottom edge.
Implements RectangleBaseView.
Definition at line 118 of file RectangleView.cpp.
References RectangleItem::P_YLOW, IShape2DView::par(), and IShape2DView::toSceneY().
|
inherited |
|
protectedinherited |
Definition at line 100 of file RectangleBaseView.cpp.
References SizeHandleElement::BOTTOMLEFT, SizeHandleElement::BOTTOMMIDLE, SizeHandleElement::BOTTOMRIGHT, RectangleBaseView::m_resize_handles, SizeHandleElement::MIDDLELEFT, SizeHandleElement::MIDDLERIGHT, RectangleBaseView::onSizeHandleElementRequest(), SizeHandleElement::resize_request(), SizeHandleElement::TOPLEFT, SizeHandleElement::TOPMIDDLE, and SizeHandleElement::TOPRIGHT.
Referenced by RectangleBaseView::RectangleBaseView().
|
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(), mouseMoveEvent(), EllipseView::onChangedX(), VerticalLineView::onChangedX(), onChangedX(), and PolygonPointView::updateParameterizedItem().
|
protectedinherited |
Definition at line 111 of file IShape2DView.cpp.
References ISceneAdaptor::fromSceneY(), and IShape2DView::m_adaptor.
Referenced by EllipseView::mouseMoveEvent(), mouseMoveEvent(), EllipseView::onChangedY(), HorizontalLineView::onChangedY(), onChangedY(), and PolygonPointView::updateParameterizedItem().
|
protectedinherited |
Definition at line 95 of file RectangleBaseView.cpp.
References RectangleBaseView::bottom(), and RectangleBaseView::top().
Referenced by EllipseView::mask_rectangle(), mask_rectangle(), and EllipseView::mouseMoveEvent().
|
protectedinherited |
Track if item selected/deselected and show/hide size handles.
Definition at line 48 of file RectangleBaseView.cpp.
References RectangleBaseView::m_resize_handles.
|
protectedvirtual |
returns the x-coordinate of the rectangle's left edge
Implements RectangleBaseView.
Definition at line 97 of file RectangleView.cpp.
References RectangleItem::P_XLOW, IShape2DView::par(), and IShape2DView::toSceneX().
|
protectedvirtual |
Implements RectangleBaseView.
Definition at line 90 of file RectangleView.cpp.
References RectangleBaseView::height(), and RectangleBaseView::width().
|
protected |
Definition at line 52 of file RectangleView.cpp.
References IShape2DView::fromSceneX(), IShape2DView::fromSceneY(), SizeHandleElement::getHandleType(), RectangleBaseView::m_activeHandleElement, IShape2DView::m_item, RectangleBaseView::m_resize_opposite_origin, RectangleItem::P_XLOW, RectangleItem::P_XUP, RectangleItem::P_YLOW, RectangleItem::P_YUP, SizeHandleElement::RESIZE, SizeHandleElement::RESIZE_HEIGHT, SizeHandleElement::RESIZE_WIDTH, SessionItem::setItemValue(), and RectangleBaseView::update_view().
|
protectedinherited |
Definition at line 59 of file RectangleBaseView.cpp.
References RectangleBaseView::onSizeHandleElementRequest().
|
protectedvirtualslot |
Definition at line 22 of file RectangleView.cpp.
References IShape2DView::fromSceneX(), IShape2DView::m_item, RectangleBaseView::m_mask_rect, RectangleItem::P_XLOW, RectangleItem::P_XUP, IShape2DView::setBlockOnProperty(), and SessionItem::setItemValue().
|
protectedvirtualslot |
Definition at line 30 of file RectangleView.cpp.
References IShape2DView::fromSceneY(), IShape2DView::m_item, RectangleBaseView::m_mask_rect, RectangleItem::P_YLOW, RectangleItem::P_YUP, IShape2DView::setBlockOnProperty(), and SessionItem::setItemValue().
|
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().
|
protectedvirtualslot |
Definition at line 38 of file RectangleView.cpp.
References MaskItem::P_MASK_VALUE, and RectangleBaseView::update_view().
|
privateslotinherited |
triggered by SizeHandleElement
Definition at line 32 of file RectangleBaseView.cpp.
References ASSERT, SizeHandleElement::getOppositeHandleLocation(), RectangleBaseView::m_activeHandleElement, RectangleBaseView::m_resize_handles, and RectangleBaseView::m_resize_opposite_origin.
Referenced by RectangleBaseView::create_size_handle_elements(), and RectangleBaseView::mouseReleaseEvent().
|
protected |
Definition at line 44 of file RectangleView.cpp.
References SessionItem::getItemValue(), MaskEditorHelper::getMaskBrush(), MaskEditorHelper::getMaskPen(), IShape2DView::m_item, RectangleBaseView::m_mask_rect, 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(), bottom(), EllipseView::left(), left(), EllipseView::onPropertyChange(), EllipseView::right(), right(), EllipseView::top(), top(), and EllipseView::update_position().
|
virtualinherited |
Definition at line 61 of file IShape2DView.cpp.
References IShape2DView::m_item.
Referenced by IShape2DView::onItemPropertyChange().
|
protectedvirtual |
returns the x-coordinate of the rectangle's right edge
Implements RectangleBaseView.
Definition at line 104 of file RectangleView.cpp.
References RectangleItem::P_XUP, IShape2DView::par(), and IShape2DView::toSceneX().
|
protectedinherited |
Definition at line 122 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change.
Referenced by EllipseView::onChangedX(), VerticalLineView::onChangedX(), onChangedX(), EllipseView::onChangedY(), HorizontalLineView::onChangedY(), and onChangedY().
|
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().
|
protectedvirtual |
Returns the y-coordinate of the rectangle's top edge.
Implements RectangleBaseView.
Definition at line 111 of file RectangleView.cpp.
References RectangleItem::P_YUP, IShape2DView::par(), and IShape2DView::toSceneY().
|
protectedinherited |
Definition at line 86 of file IShape2DView.cpp.
References SessionItem::getItemValue(), and IShape2DView::m_item.
Referenced by EllipseView::left(), left(), EllipseView::onPropertyChange(), VerticalLineView::onPropertyChange(), EllipseView::right(), right(), PolygonView::update_polygon(), EllipseView::update_position(), 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(), bottom(), EllipseView::onPropertyChange(), HorizontalLineView::onPropertyChange(), EllipseView::top(), top(), PolygonView::update_polygon(), EllipseView::update_position(), 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 RectangleBaseView.
Reimplemented in RegionOfInterestView.
Definition at line 27 of file RectangleView.h.
References MaskEditorHelper::RECTANGLE.
|
protectedvirtualinherited |
updates view's bounding rectangle using item properties
Definition at line 74 of file RectangleBaseView.cpp.
References IShape2DView::m_bounding_rect, IShape2DView::m_item, RectangleBaseView::m_mask_rect, RectangleBaseView::m_resize_handles, and RectangleBaseView::mask_rectangle().
Referenced by RectangleBaseView::update_view().
|
protectedvirtual |
updates position of view using item properties
Implements RectangleBaseView.
Definition at line 84 of file RectangleView.cpp.
References RectangleItem::P_XLOW, RectangleItem::P_YUP, IShape2DView::toSceneX(), and IShape2DView::toSceneY().
|
protectedvirtualinherited |
update visual appearance of view (triggered by ISceneAdaptor)
Implements IShape2DView.
Definition at line 65 of file RectangleBaseView.cpp.
References RectangleBaseView::update_bounding_rect(), and RectangleBaseView::update_position().
Referenced by mouseMoveEvent(), EllipseView::onPropertyChange(), and onPropertyChange().
|
protectedinherited |
returns width of the rectangle
Definition at line 90 of file RectangleBaseView.cpp.
References RectangleBaseView::left(), and RectangleBaseView::right().
Referenced by EllipseView::mask_rectangle(), mask_rectangle(), and EllipseView::mouseMoveEvent().
|
protectedinherited |
Definition at line 57 of file RectangleBaseView.h.
Referenced by EllipseView::mouseMoveEvent(), mouseMoveEvent(), and RectangleBaseView::onSizeHandleElementRequest().
|
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().
|
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(), PolygonView::update_polygon(), IntensityDataView::update_view(), VerticalLineView::update_view(), HorizontalLineView::update_view(), MaskAllView::update_view(), and MaskContainerView::update_view().
|
protectedinherited |
Definition at line 65 of file IShape2DView.h.
Referenced by IShape2DView::~IShape2DView(), PolygonView::closePolygonIfNecessary(), PolygonView::isClosedPolygon(), EllipseView::mouseMoveEvent(), mouseMoveEvent(), EllipseView::onChangedX(), VerticalLineView::onChangedX(), onChangedX(), EllipseView::onChangedY(), HorizontalLineView::onChangedY(), onChangedY(), EllipseView::paint(), VerticalLineView::paint(), HorizontalLineView::paint(), PolygonView::paint(), paint(), IShape2DView::par(), IShape2DView::parameterizedItem(), IShape2DView::setParameterizedItem(), IShape2DView::toSceneX(), IShape2DView::toSceneY(), RectangleBaseView::update_bounding_rect(), PolygonView::update_polygon(), and PolygonPointView::updateParameterizedItem().
|
protectedinherited |
mask rectangle in scene coordinates
Definition at line 52 of file RectangleBaseView.h.
Referenced by onChangedX(), onChangedY(), EllipseView::paint(), paint(), RegionOfInterestView::paint(), and RectangleBaseView::update_bounding_rect().
|
protectedinherited |
coordinates of corner opposite to the grip corner at the moment it first clicked in scene coordinates
Definition at line 53 of file RectangleBaseView.h.
Referenced by RectangleBaseView::create_size_handle_elements(), RectangleBaseView::itemChange(), RectangleBaseView::onSizeHandleElementRequest(), and RectangleBaseView::update_bounding_rect().
|
protectedinherited |
Definition at line 56 of file RectangleBaseView.h.
Referenced by EllipseView::mouseMoveEvent(), mouseMoveEvent(), and RectangleBaseView::onSizeHandleElementRequest().