|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The handle QGraphicsViewItem on GraphicsScene. More...
Public Member Functions | |
| HandleElementView () | |
| The constructor. More... | |
| 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... | |
| QRectF | boundingRect () const override |
| The bounding rectangle of the handle. More... | |
| QPointF | getLastPos () const |
| Get the last position of the item. More... | |
| void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
| On move update the model. More... | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
| The overriden paint method. More... | |
| ModelView::SceneAdapterInterface * | sceneAdapter () const |
| Get the conversion axes. More... | |
| void | setBrush (QBrush brush) |
| Set the brush. More... | |
| void | setCenterBased (bool choice) |
| Adapt the dimensions according to the center. More... | |
| void | setLayerElementController (LayerElementController *controller) |
| Set the controller to report back the move. More... | |
| void | setPen (QPen pen) |
| Set the pen. More... | |
| void | setRectangle (QRectF rectangle) |
| Set the draw rectangle. More... | |
| QPainterPath | shape () const override |
| The shape. 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... | |
Protected Attributes | |
| QBrush | m_brush |
| QPen | m_pen |
| QPointF | m_pos |
| QRectF | m_rectangle |
| LayerElementController * | p_controller |
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 handle QGraphicsViewItem on GraphicsScene.
Definition at line 30 of file handleelementview.h.
| gui2::HandleElementView::HandleElementView | ( | ) |
The constructor.
Definition at line 25 of file handleelementview.cpp.
References gui2::ElementView::adaptH(), and gui2::ElementView::adaptW().
|
inherited |
Adapt the height.
Definition at line 217 of file elementview.cpp.
References gui2::ElementView::m_adapt_height.
Referenced by HandleElementView().
|
inherited |
Adapt the width.
Definition at line 211 of file elementview.cpp.
References gui2::ElementView::m_adapt_width.
Referenced by HandleElementView().
|
inherited |
Adapt the x position.
Definition at line 199 of file elementview.cpp.
References gui2::ElementView::m_adapt_x.
|
inherited |
Adapt the y position.
Definition at line 205 of file elementview.cpp.
References gui2::ElementView::m_adapt_y.
|
overrideinherited |
Advance method used by the scene adapter.
Definition at line 44 of file elementview.cpp.
|
override |
The bounding rectangle of the handle.
Definition at line 55 of file handleelementview.cpp.
References gui2::ElementView::displayRect(), and m_rectangle.
|
protectedinherited |
modify the path for display according to the scene adapter
Definition at line 168 of file elementview.cpp.
References gui2::ElementView::sceneAdapter().
Referenced by gui2::RoughnessElementView::boundingRect(), gui2::RoughnessElementView::paint(), and gui2::RoughnessElementView::shape().
|
protectedinherited |
modify the rectangle for display according to the scene adapter
Definition at line 60 of file elementview.cpp.
References gui2::ElementView::displayRectCenterBased(), gui2::ElementView::displayRectEdgeBased(), gui2::ElementView::m_center_based, gui2::ElementView::m_stretch_left, gui2::ElementView::m_stretch_right, gui2::ElementView::sceneAdapter(), gui2::ElementView::stretchRectLeft(), and gui2::ElementView::stretchRectRight().
Referenced by boundingRect(), gui2::SegmentElementView::boundingRect(), paint(), gui2::SegmentElementView::paint(), shape(), and gui2::SegmentElementView::shape().
|
privateinherited |
Helper function for displayRect based on the center of real_rect.
Definition at line 84 of file elementview.cpp.
References gui2::ElementView::m_adapt_height, gui2::ElementView::m_adapt_width, gui2::ElementView::m_adapt_x, gui2::ElementView::m_adapt_y, and gui2::ElementView::sceneAdapter().
Referenced by gui2::ElementView::displayRect().
|
privateinherited |
Helper function for displayRect based on the edge of real_rect.
Definition at line 115 of file elementview.cpp.
References gui2::ElementView::m_adapt_height, gui2::ElementView::m_adapt_width, gui2::ElementView::m_adapt_x, gui2::ElementView::m_adapt_y, and gui2::ElementView::sceneAdapter().
Referenced by gui2::ElementView::displayRect().
| QPointF gui2::HandleElementView::getLastPos | ( | ) | const |
Get the last position of the item.
Definition at line 93 of file handleelementview.cpp.
References m_pos.
Referenced by gui2::LayerElementController::leftHandleMoved(), and gui2::LayerElementController::rightHandleMoved().
|
overrideprotectedinherited |
The hoover enter event.
Definition at line 235 of file elementview.cpp.
|
overrideprotectedinherited |
The hoover exit event.
Definition at line 243 of file elementview.cpp.
|
override |
On move update the model.
Definition at line 61 of file handleelementview.cpp.
References gui2::LayerElementController::handleViewMoved(), m_pos, p_controller, and gui2::ElementView::scenePos().
|
overrideprotectedinherited |
The mouse press event.
Definition at line 250 of file elementview.cpp.
|
overrideprotectedinherited |
The mouse release event.
Definition at line 258 of file elementview.cpp.
|
override |
The overriden paint method.
Definition at line 38 of file handleelementview.cpp.
References gui2::ElementView::displayRect(), m_brush, m_pen, m_rectangle, and gui2::ElementView::sceneAdapter().
|
inherited |
Get the conversion axes.
Definition at line 34 of file elementview.cpp.
References gui2::GraphicsScene::sceneAdapter().
Referenced by gui2::ElementView::displayPath(), gui2::ElementView::displayRect(), gui2::ElementView::displayRectCenterBased(), gui2::ElementView::displayRectEdgeBased(), gui2::ElementView::paint(), paint(), gui2::RoughnessElementView::paint(), gui2::SegmentElementView::paint(), gui2::ElementView::scenePos(), gui2::ElementView::stretchRectLeft(), and gui2::ElementView::stretchRectRight().
|
protectedinherited |
modify the rectangle for display according to the scene adapter
Definition at line 183 of file elementview.cpp.
References gui2::ElementView::sceneAdapter().
Referenced by mouseMoveEvent(), and gui2::SegmentElementView::mouseMoveEvent().
| void gui2::HandleElementView::setBrush | ( | QBrush | brush | ) |
|
inherited |
Adapt the dimensions according to the center.
Definition at line 193 of file elementview.cpp.
References gui2::ElementView::m_center_based.
| void gui2::HandleElementView::setLayerElementController | ( | LayerElementController * | controller | ) |
Set the controller to report back the move.
Definition at line 68 of file handleelementview.cpp.
References p_controller.
| void gui2::HandleElementView::setPen | ( | QPen | pen | ) |
| void gui2::HandleElementView::setRectangle | ( | QRectF | rectangle | ) |
Set the draw rectangle.
Definition at line 74 of file handleelementview.cpp.
References m_rectangle.
|
override |
The shape.
Definition at line 47 of file handleelementview.cpp.
References gui2::ElementView::displayRect(), and m_rectangle.
|
inherited |
Stretch the rectangle to the left limit of the viewport.
Definition at line 223 of file elementview.cpp.
References gui2::ElementView::m_stretch_left.
|
privateinherited |
Stretch the rectangle to the left limit of the viewport.
Definition at line 140 of file elementview.cpp.
References gui2::ElementView::sceneAdapter(), and ModelView::SceneAdapterInterface::viewportRectangle().
Referenced by gui2::ElementView::displayRect().
|
privateinherited |
Stretch the rectangle to the right limit of the viewport.
Definition at line 154 of file elementview.cpp.
References gui2::ElementView::sceneAdapter(), and ModelView::SceneAdapterInterface::viewportRectangle().
Referenced by gui2::ElementView::displayRect().
|
inherited |
Stretch the rectangle to the right limit of the viewport.
Definition at line 229 of file elementview.cpp.
References gui2::ElementView::m_stretch_right.
|
privateinherited |
Definition at line 67 of file elementview.h.
Referenced by gui2::ElementView::adaptH(), gui2::ElementView::displayRectCenterBased(), and gui2::ElementView::displayRectEdgeBased().
|
privateinherited |
Definition at line 66 of file elementview.h.
Referenced by gui2::ElementView::adaptW(), gui2::ElementView::displayRectCenterBased(), and gui2::ElementView::displayRectEdgeBased().
|
privateinherited |
Definition at line 64 of file elementview.h.
Referenced by gui2::ElementView::adaptX(), gui2::ElementView::displayRectCenterBased(), and gui2::ElementView::displayRectEdgeBased().
|
privateinherited |
Definition at line 65 of file elementview.h.
Referenced by gui2::ElementView::adaptY(), gui2::ElementView::displayRectCenterBased(), and gui2::ElementView::displayRectEdgeBased().
|
protected |
Definition at line 50 of file handleelementview.h.
Referenced by paint(), and setBrush().
|
privateinherited |
Definition at line 63 of file elementview.h.
Referenced by gui2::ElementView::displayRect(), and gui2::ElementView::setCenterBased().
|
protected |
Definition at line 51 of file handleelementview.h.
|
protected |
Definition at line 48 of file handleelementview.h.
Referenced by getLastPos(), and mouseMoveEvent().
|
protected |
Definition at line 49 of file handleelementview.h.
Referenced by boundingRect(), paint(), setRectangle(), and shape().
|
privateinherited |
Definition at line 68 of file elementview.h.
Referenced by gui2::ElementView::displayRect(), and gui2::ElementView::stretchLeft().
|
privateinherited |
Definition at line 69 of file elementview.h.
Referenced by gui2::ElementView::displayRect(), and gui2::ElementView::stretchRight().
|
protected |
Definition at line 47 of file handleelementview.h.
Referenced by mouseMoveEvent(), and setLayerElementController().