VisualizationZoneWidget.h
60 lines
| 1.7 KiB
| text/x-c
|
CLexer
r58 | #ifndef SCIQLOP_VISUALIZATIONZONEWIDGET_H | |||
#define SCIQLOP_VISUALIZATIONZONEWIDGET_H | ||||
r111 | #include "Visualization/IVisualizationWidget.h" | |||
Alexandre Leroux
|
r204 | #include <QLoggingCategory> | ||
r58 | #include <QWidget> | |||
r510 | #include <memory> | |||
#include <Common/spimpl.h> | ||||
Alexandre Leroux
|
r204 | Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationZoneWidget) | ||
r58 | namespace Ui { | |||
class VisualizationZoneWidget; | ||||
} // Ui | ||||
Alexandre Leroux
|
r189 | class Variable; | ||
Alexandre Leroux
|
r183 | class VisualizationGraphWidget; | ||
r111 | class VisualizationZoneWidget : public QWidget, public IVisualizationWidget { | |||
r58 | Q_OBJECT | |||
public: | ||||
Alexandre Leroux
|
r183 | explicit VisualizationZoneWidget(const QString &name = {}, QWidget *parent = 0); | ||
r58 | virtual ~VisualizationZoneWidget(); | |||
r111 | /// Add a graph widget | |||
void addGraph(VisualizationGraphWidget *graphWidget); | ||||
Alexandre Leroux
|
r186 | /** | ||
* Creates a graph using a variable. The variable will be displayed in the new graph. | ||||
* @param variable the variable for which to create the graph | ||||
* @return the pointer to the created graph | ||||
*/ | ||||
VisualizationGraphWidget *createGraph(std::shared_ptr<Variable> variable); | ||||
r111 | ||||
// IVisualizationWidget interface | ||||
Alexandre Leroux
|
r192 | void accept(IVisualizationWidgetVisitor *visitor) override; | ||
Alexandre Leroux
|
r194 | bool canDrop(const Variable &variable) const override; | ||
Alexandre Leroux
|
r301 | bool contains(const Variable &variable) const override; | ||
r112 | QString name() const override; | |||
r111 | ||||
Alexandre Leroux
|
r677 | protected: | ||
void closeEvent(QCloseEvent *event) override; | ||||
r58 | private: | |||
Ui::VisualizationZoneWidget *ui; | ||||
r510 | ||||
class VisualizationZoneWidgetPrivate; | ||||
spimpl::unique_impl_ptr<VisualizationZoneWidgetPrivate> impl; | ||||
Alexandre Leroux
|
r614 | |||
private slots: | ||||
void onVariableAdded(std::shared_ptr<Variable> variable); | ||||
Alexandre Leroux
|
r676 | /// Slot called when a variable is about to be removed from a graph contained in the zone | ||
void onVariableAboutToBeRemoved(std::shared_ptr<Variable> variable); | ||||
r58 | }; | |||
#endif // SCIQLOP_VISUALIZATIONZONEWIDGET_H | ||||