...
 
Commits (2)
......@@ -95,10 +95,19 @@ option(DTKVISUALIZATION_USE_UPCOMING_VTK "" FALSE)
find_package(VTK COMPONENTS
vtkChartsCore
vtkCommonCore
vtkCommonDataModel
vtkFiltersFlowPaths
vtkGUISupportQtOpenGL
vtkInteractionImage
vtkRenderingContext2D
vtkRenderingContextOpenGL2
vtkRenderingCore
vtkRenderingFreeType
vtkRenderingGL2PSOpenGL2
vtkRenderingOpenGL2
vtkRenderingVolumeOpenGL2
vtkViewsContext2D
REQUIRED)
if(NOT DTKVISUALIZATION_USE_UPCOMING_VTK)
......
......@@ -167,24 +167,6 @@ void dtkVisualizationViewerPrivate::createPlot2DData(dtkVisualizationPlot2D *plo
plot->addFieldY(field_2, true, vtkChart::LINE, vtkPlotPoints::NONE);
plot->addFieldY(field_3);
// insert in menu
dtkWidgetsMenuBar *menu_bar = dtkApp->window()->menubar();
dtkWidgetsMenu *plot_menu = menu_bar->menu("View " + plot->objectName());
if(!plot_menu) {
plot_menu = menu_bar->addMenu(0, "View " + plot->objectName());
}
dtkWidgetsMenu *plot_group = plot_menu->addMenu(0, "Views");
for(auto inspector : plot->inspectors()) {
inspector->setVisible(true);
dtkWidgetsMenuItemDIY *item = new dtkWidgetsMenuItemDIY(inspector->objectName(), inspector);
plot_group->addItem(item);
}
menu_bar->touch();
plot_is_init = true;
}
......
......@@ -58,10 +58,13 @@ dtkWidgetsWidget *dtkVisualizationViewerStack::create(const QString& type)
dtkWidgetsMenuBar *menu_bar = dtkApp->window()->menubar();
dtkWidgetsMenu *menu = menu_bar->menu("View " + view->objectName());
dtkWidgetsMenu *menu = nullptr;
menu = menu_bar->menu("View " + view->objectName());
if( menu) {
menu->clear();
if(type != "Plot2D") {
menu->clear(); // dont clear plot 2d menu
}
menu_bar->touch();
} else {
menu_bar->addMenu(fa::desktop, "View " + view->objectName());
......
......@@ -16,20 +16,15 @@
#include <dtkVisualizationExport>
#include <dtkWidgets/dtkWidgetsWidget>
#include "dtkVisualizationCanvas.h"
#include <vtkChartXY.h>
#include <vtkPlotPoints.h>
template <typename T> class vtkSmartPointer;
class vtkAbstractArray;
class vtkRenderer;
class dtkWidgetsHUD;
class dtkWidgetsOverlayPane;
class DTKVISUALIZATION_EXPORT dtkVisualizationPlot2D : public dtkWidgetsWidget
class DTKVISUALIZATION_EXPORT dtkVisualizationPlot2D : public dtkVisualizationCanvas
{
Q_OBJECT
......@@ -37,16 +32,6 @@ public:
dtkVisualizationPlot2D(QWidget *parent = nullptr);
~dtkVisualizationPlot2D(void);
public:
QWidget *widget(void) override;
public slots:
void render(void);
public:
const QList<QWidget *> inspectors(void) const;
dtkWidgetsHUD *hud(void);
public:
void setGridVisible(bool visible);
QStringList fields(void);
......@@ -58,14 +43,18 @@ public:
int type = vtkChart::POINTS,
int marker_style = vtkPlotPoints::PLUS,
QColor color = Qt::transparent,
int width = 1);
int width = 3);
void removeField(vtkSmartPointer<vtkAbstractArray>);
void removeField(const QString&);
void setShowLegend(bool);
public:
vtkRenderer *renderer(void);
private slots:
void exportAsCSV(const QString &);
void exportAsPNG(const QString &);
protected:
void render(void);
private:
class dtkVisualizationPlot2DPrivate *d;
......