BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom graphics scene to show QCustomPlot with additional elements on top. More...
Public Member Functions | |
GraphicsScene (QObject *parent=nullptr) | |
The contructor. More... | |
~GraphicsScene () override | |
The destructor. More... | |
ModelView::GraphCanvas * | graphCanvas () const |
Set te graph canvas item. More... | |
ModelView::SceneAdapterInterface * | sceneAdapter () const |
Return the pointer of the scene adapter on request. More... | |
void | setContext () |
Initialise the GraphicsScene with its elements. More... | |
void | setItem (ModelView::GraphViewportItem *viewport_item) |
Set te graph canvas item. More... | |
void | update_size (const QSize &newSize) |
Adjust size of scene and color map proxy. More... | |
Private Member Functions | |
void | createPlotProxy (ModelView::GraphCanvas *plot_canvas) |
Create the Proxy item. More... | |
Private Attributes | |
ModelView::GraphCanvas * | graph_canvas {nullptr} |
ModelView::CustomPlotProxyWidget * | plot_proxy {nullptr} |
std::unique_ptr< ModelView::SceneAdapterInterface > | scene_adapter |
Custom graphics scene to show QCustomPlot with additional elements on top.
Definition at line 34 of file graphicsscene.h.
gui2::GraphicsScene::GraphicsScene | ( | QObject * | parent = nullptr | ) |
The contructor.
Definition at line 32 of file graphicsscene.cpp.
References setContext().
|
overridedefault |
The destructor.
|
private |
Create the Proxy item.
Definition at line 74 of file graphicsscene.cpp.
References ModelView::GraphCanvas::createSceneAdapter(), plot_proxy, and scene_adapter.
Referenced by setContext().
ModelView::GraphCanvas * gui2::GraphicsScene::graphCanvas | ( | ) | const |
Set te graph canvas item.
Definition at line 56 of file graphicsscene.cpp.
References graph_canvas.
Referenced by gui2::SLDEditor::SLDEditor().
ModelView::SceneAdapterInterface * gui2::GraphicsScene::sceneAdapter | ( | ) | const |
Return the pointer of the scene adapter on request.
Definition at line 82 of file graphicsscene.cpp.
References scene_adapter.
Referenced by gui2::ElementView::sceneAdapter(), and gui2::LayerElementController::sceneAdapter().
void gui2::GraphicsScene::setContext | ( | ) |
Initialise the GraphicsScene with its elements.
Definition at line 43 of file graphicsscene.cpp.
References createPlotProxy(), and graph_canvas.
Referenced by GraphicsScene().
void gui2::GraphicsScene::setItem | ( | ModelView::GraphViewportItem * | viewport_item | ) |
Set te graph canvas item.
Definition at line 50 of file graphicsscene.cpp.
References graph_canvas, and ModelView::GraphCanvas::setItem().
void gui2::GraphicsScene::update_size | ( | const QSize & | newSize | ) |
Adjust size of scene and color map proxy.
Definition at line 62 of file graphicsscene.cpp.
References plot_proxy.
Referenced by gui2::SLDViewWidget::resizeEvent().
|
private |
Definition at line 51 of file graphicsscene.h.
Referenced by graphCanvas(), setContext(), and setItem().
|
private |
Definition at line 49 of file graphicsscene.h.
Referenced by createPlotProxy(), and update_size().
|
private |
Definition at line 50 of file graphicsscene.h.
Referenced by createPlotProxy(), and sceneAdapter().