BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The interface of any QGraphicsViewItem on GraphicsScene to the Sceneadapter. More...
Public Member Functions | |
ElementView () | |
The constructor. More... | |
~ElementView () | |
void | adaptH (bool choice) |
Adapt the height. More... | |
void | adaptW (bool choice) |
Adapt the width. More... | |
void | adaptX (bool choice) |
Adapt the x position. More... | |
void | adaptY (bool choice) |
Adapt the y position. More... | |
void | advance (int phase) override |
Advance method used by the scene adapter. More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
paint override More... | |
ModelView::SceneAdapterInterface * | sceneAdapter () const |
Get the conversion axes. More... | |
void | setCenterBased (bool choice) |
Adapt the dimensions according to the center. More... | |
void | stretchLeft (bool choice) |
Stretch the rectangle to the left limit of the viewport. More... | |
void | stretchRight (bool choice) |
Stretch the rectangle to the right limit of the viewport. More... | |
Protected Member Functions | |
QPainterPath | displayPath (QPainterPath real_path) const |
modify the path for display according to the scene adapter More... | |
QRectF | displayRect (const QRectF &real_rect) const |
modify the rectangle for display according to the scene adapter More... | |
void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) override |
The hoover enter event. More... | |
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override |
The hoover exit event. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
The mouse press event. More... | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
The mouse release event. More... | |
QPointF | scenePos (QPointF pixel_pos) const |
modify the rectangle for display according to the scene adapter More... | |
Private Member Functions | |
QRectF | displayRectCenterBased (const QRectF &real_rect) const |
Helper function for displayRect based on the center of real_rect. More... | |
QRectF | displayRectEdgeBased (const QRectF &real_rect) const |
Helper function for displayRect based on the edge of real_rect. More... | |
QRectF | stretchRectLeft (const QRectF &real_rect) const |
Stretch the rectangle to the left limit of the viewport. More... | |
QRectF | stretchRectRight (const QRectF &real_rect) const |
Stretch the rectangle to the right limit of the viewport. More... | |
Private Attributes | |
bool | m_adapt_height = true |
bool | m_adapt_width = true |
bool | m_adapt_x = true |
bool | m_adapt_y = true |
bool | m_center_based = true |
bool | m_stretch_left = false |
bool | m_stretch_right = false |
The interface of any QGraphicsViewItem on GraphicsScene to the Sceneadapter.
Definition at line 26 of file elementview.h.
gui2::ElementView::ElementView | ( | ) |
The constructor.
Definition at line 26 of file elementview.cpp.
|
default |
void gui2::ElementView::adaptH | ( | bool | choice | ) |
Adapt the height.
Definition at line 217 of file elementview.cpp.
References m_adapt_height.
Referenced by gui2::HandleElementView::HandleElementView().
void gui2::ElementView::adaptW | ( | bool | choice | ) |
Adapt the width.
Definition at line 211 of file elementview.cpp.
References m_adapt_width.
Referenced by gui2::HandleElementView::HandleElementView().
void gui2::ElementView::adaptX | ( | bool | choice | ) |
void gui2::ElementView::adaptY | ( | bool | choice | ) |
|
override |
Advance method used by the scene adapter.
Definition at line 44 of file elementview.cpp.
|
protected |
modify the path for display according to the scene adapter
Definition at line 168 of file elementview.cpp.
References sceneAdapter().
Referenced by gui2::RoughnessElementView::boundingRect(), gui2::RoughnessElementView::paint(), and gui2::RoughnessElementView::shape().
|
protected |
modify the rectangle for display according to the scene adapter
Definition at line 60 of file elementview.cpp.
References displayRectCenterBased(), displayRectEdgeBased(), m_center_based, m_stretch_left, m_stretch_right, sceneAdapter(), stretchRectLeft(), and stretchRectRight().
Referenced by gui2::HandleElementView::boundingRect(), gui2::SegmentElementView::boundingRect(), gui2::HandleElementView::paint(), gui2::SegmentElementView::paint(), gui2::HandleElementView::shape(), and gui2::SegmentElementView::shape().
|
private |
Helper function for displayRect based on the center of real_rect.
Definition at line 84 of file elementview.cpp.
References m_adapt_height, m_adapt_width, m_adapt_x, m_adapt_y, and sceneAdapter().
Referenced by displayRect().
|
private |
Helper function for displayRect based on the edge of real_rect.
Definition at line 115 of file elementview.cpp.
References m_adapt_height, m_adapt_width, m_adapt_x, m_adapt_y, and sceneAdapter().
Referenced by displayRect().
|
overrideprotected |
The hoover enter event.
Definition at line 235 of file elementview.cpp.
|
overrideprotected |
The hoover exit event.
Definition at line 243 of file elementview.cpp.
|
overrideprotected |
The mouse press event.
Definition at line 250 of file elementview.cpp.
|
overrideprotected |
The mouse release event.
Definition at line 258 of file elementview.cpp.
|
override |
paint override
Definition at line 53 of file elementview.cpp.
References sceneAdapter().
ModelView::SceneAdapterInterface * gui2::ElementView::sceneAdapter | ( | ) | const |
Get the conversion axes.
Definition at line 34 of file elementview.cpp.
References gui2::GraphicsScene::sceneAdapter().
Referenced by displayPath(), displayRect(), displayRectCenterBased(), displayRectEdgeBased(), paint(), gui2::HandleElementView::paint(), gui2::RoughnessElementView::paint(), gui2::SegmentElementView::paint(), scenePos(), stretchRectLeft(), and stretchRectRight().
|
protected |
modify the rectangle for display according to the scene adapter
Definition at line 183 of file elementview.cpp.
References sceneAdapter().
Referenced by gui2::HandleElementView::mouseMoveEvent(), and gui2::SegmentElementView::mouseMoveEvent().
void gui2::ElementView::setCenterBased | ( | bool | choice | ) |
Adapt the dimensions according to the center.
Definition at line 193 of file elementview.cpp.
References m_center_based.
void gui2::ElementView::stretchLeft | ( | bool | choice | ) |
Stretch the rectangle to the left limit of the viewport.
Definition at line 223 of file elementview.cpp.
References m_stretch_left.
|
private |
Stretch the rectangle to the left limit of the viewport.
Definition at line 140 of file elementview.cpp.
References sceneAdapter(), and ModelView::SceneAdapterInterface::viewportRectangle().
Referenced by displayRect().
|
private |
Stretch the rectangle to the right limit of the viewport.
Definition at line 154 of file elementview.cpp.
References sceneAdapter(), and ModelView::SceneAdapterInterface::viewportRectangle().
Referenced by displayRect().
void gui2::ElementView::stretchRight | ( | bool | choice | ) |
Stretch the rectangle to the right limit of the viewport.
Definition at line 229 of file elementview.cpp.
References m_stretch_right.
|
private |
Definition at line 67 of file elementview.h.
Referenced by adaptH(), displayRectCenterBased(), and displayRectEdgeBased().
|
private |
Definition at line 66 of file elementview.h.
Referenced by adaptW(), displayRectCenterBased(), and displayRectEdgeBased().
|
private |
Definition at line 64 of file elementview.h.
Referenced by adaptX(), displayRectCenterBased(), and displayRectEdgeBased().
|
private |
Definition at line 65 of file elementview.h.
Referenced by adaptY(), displayRectCenterBased(), and displayRectEdgeBased().
|
private |
Definition at line 63 of file elementview.h.
Referenced by displayRect(), and setCenterBased().
|
private |
Definition at line 68 of file elementview.h.
Referenced by displayRect(), and stretchLeft().
|
private |
Definition at line 69 of file elementview.h.
Referenced by displayRect(), and stretchRight().