BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Base view for all rectangular-like masks.
Definition at line 24 of file RectangleBaseView.h.
Public Member Functions | |
RectangleBaseView (SessionItem *item) | |
virtual void | addView (IShape2DView *childView, int row=0) |
QRectF | boundingRect () const override |
virtual SessionItem * | parameterizedItem () const =0 |
void | setSceneAdaptor (const ISceneAdaptor *adaptor) |
int | type () const override |
Protected Slots | |
virtual void | onChangedX () |
virtual void | onChangedY () |
virtual void | onPropertyChange () |
Protected Member Functions | |
bool | blockOnProperty () const |
virtual qreal | bottom () const =0 |
void | create_size_handle_elements () |
void | disconnectFromItem (SessionItem *item) |
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) override |
Track if item selected/deselected and show/hide size handles. More... | |
virtual qreal | left () const =0 |
virtual QRectF | mask_rectangle ()=0 |
QPainterPath | maskedShape () const |
Returns the shape with all masking already applied. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override |
virtual qreal | right () const =0 |
void | setBlockOnProperty (bool value) |
virtual qreal | top () const =0 |
qreal | toSceneX (qreal value) const |
qreal | toSceneY (qreal value) const |
virtual void | update_bounding_rect () |
updates view's bounding rectangle using item properties More... | |
virtual void | update_position ()=0 |
void | update_view () override |
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 |
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 | |
virtual void | onItemDestroyed ()=0 |
void | onItemPropertyChange (const QString &propertyName) |
|
explicit |
Definition at line 23 of file RectangleBaseView.cpp.
References create_size_handle_elements().
|
virtualinherited |
Reimplemented in PolygonView.
Definition at line 129 of file IShape2DView.cpp.
Referenced by MaskGraphicsScene::updateViews().
|
protectedinherited |
Definition at line 140 of file IShape2DView.cpp.
References IShape2DView::m_block_on_property_change.
|
protectedpure virtual |
Implemented in RectangleView, and EllipseView.
Referenced by height().
|
overrideinherited |
|
protected |
Definition at line 103 of file RectangleBaseView.cpp.
References SizeHandleElement::BOTTOMLEFT, SizeHandleElement::BOTTOMMIDLE, SizeHandleElement::BOTTOMRIGHT, m_resize_handles, SizeHandleElement::MIDDLELEFT, SizeHandleElement::MIDDLERIGHT, onSizeHandleElementRequest(), SizeHandleElement::resize_request(), SizeHandleElement::TOPLEFT, SizeHandleElement::TOPMIDDLE, and SizeHandleElement::TOPRIGHT.
Referenced by RectangleBaseView().
|
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::~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().
|
protected |
Definition at line 98 of file RectangleBaseView.cpp.
References bottom(), and top().
Referenced by EllipseView::mask_rectangle(), RectangleView::mask_rectangle(), and EllipseView::mouseMoveEvent().
|
overrideprotected |
Track if item selected/deselected and show/hide size handles.
Definition at line 51 of file RectangleBaseView.cpp.
References m_resize_handles.
|
protectedpure virtual |
Implemented in RectangleView, and EllipseView.
Referenced by width().
|
protectedpure virtual |
Implemented in RectangleView, and EllipseView.
Referenced by update_bounding_rect().
|
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 61 of file RectangleBaseView.cpp.
References onSizeHandleElementRequest().
|
inlineprotectedvirtualslotinherited |
|
inlineprotectedvirtualslotinherited |
|
privatepure virtualinherited |
Implemented in RectangleView, PolygonView, PolygonPointView, MaskContainerView, MaskAllView, HorizontalLineView, VerticalLineView, and EllipseView.
Referenced by IShape2DView::IShape2DView().
|
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().
|
privateslot |
triggered by SizeHandleElement
Definition at line 35 of file RectangleBaseView.cpp.
References SizeHandleElement::getOppositeHandleLocation(), m_activeHandleElement, m_resize_handles, and m_resize_opposite_origin.
Referenced by create_size_handle_elements(), and mouseReleaseEvent().
|
overrideprotectedinherited |
Definition at line 70 of file IShape2DView.cpp.
References MaskEditorHelper::getMaskBrush(), MaskEditorHelper::getMaskPen(), IShape2DView::maskedShape(), and IShape2DView::parameterizedItem().
Referenced by PolygonView::paint().
|
pure virtualinherited |
Implemented in RectangleView, PolygonView, PolygonPointView, MaskContainerView, MaskAllView, HorizontalLineView, VerticalLineView, and EllipseView.
Referenced by IShape2DView::onItemPropertyChange(), IShape2DView::paint(), and update_bounding_rect().
|
protectedpure virtual |
Implemented in RectangleView, and EllipseView.
Referenced by width().
|
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().
|
inherited |
Definition at line 55 of file IShape2DView.cpp.
References IShape2DView::m_adaptor, ISceneAdaptor::update_request(), and IShape2DView::update_view().
Referenced by MaskViewFactory::createMaskView().
|
protectedpure virtual |
Implemented in RectangleView, and EllipseView.
Referenced by height().
|
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(), PolygonView::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(), PolygonView::update_polygon(), EllipseView::update_position(), RectangleView::update_position(), and HorizontalLineView::update_view().
|
inlineoverride |
Definition at line 28 of file RectangleBaseView.h.
References MaskEditorHelper::RECTANGLEBASE.
Referenced by update_bounding_rect().
|
protectedvirtual |
updates view's bounding rectangle using item properties
Definition at line 76 of file RectangleBaseView.cpp.
References IShape2DView::m_bounding_rect, m_mask_rect, m_resize_handles, mask_rectangle(), IShape2DView::parameterizedItem(), MaskEditorHelper::REGIONOFINTEREST, and type().
Referenced by update_view().
|
protectedpure virtual |
Implemented in RectangleView, and EllipseView.
Referenced by update_view().
|
overrideprotectedvirtual |
update visual appearance of view (triggered by ISceneAdaptor)
Implements IShape2DView.
Definition at line 67 of file RectangleBaseView.cpp.
References update_bounding_rect(), and update_position().
Referenced by RectangleView::mouseMoveEvent(), EllipseView::onPropertyChange(), RectangleView::onPropertyChange(), and RegionOfInterestView::update_view().
|
protected |
Returns width of the rectangle.
Definition at line 93 of file RectangleBaseView.cpp.
References left(), and right().
Referenced by EllipseView::mask_rectangle(), RectangleView::mask_rectangle(), and EllipseView::mouseMoveEvent().
|
protected |
Definition at line 57 of file RectangleBaseView.h.
Referenced by EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), and onSizeHandleElementRequest().
|
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().
|
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(), update_bounding_rect(), PolygonView::update_polygon(), VerticalLineView::update_view(), HorizontalLineView::update_view(), MaskAllView::update_view(), MaskContainerView::update_view(), and RegionOfInterestView::update_view().
|
protected |
mask rectangle in scene coordinates
Definition at line 52 of file RectangleBaseView.h.
Referenced by RectangleView::onChangedX(), RectangleView::onChangedY(), RegionOfInterestView::paint(), EllipseView::shape(), RectangleView::shape(), and update_bounding_rect().
|
protected |
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 create_size_handle_elements(), itemChange(), onSizeHandleElementRequest(), and update_bounding_rect().
|
protected |
Definition at line 56 of file RectangleBaseView.h.
Referenced by EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), and onSizeHandleElementRequest().