From 6db6fde49c4de9907a4b3616f0ae93bdeecd05f1 Mon Sep 17 00:00:00 2001 From: Kyle Sunderland Date: Thu, 20 Dec 2018 20:15:25 -0500 Subject: [PATCH] ENH: Add python wrapping to functions in ctkVTKScalarsToColorsView and ctkVTKScalarsToColorsWidget --- .../VTK/Widgets/ctkVTKScalarsToColorsView.h | 52 +++++++++---------- .../VTK/Widgets/ctkVTKScalarsToColorsWidget.h | 12 ++--- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsView.h b/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsView.h index 35d8dca5dd..884e390721 100644 --- a/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsView.h +++ b/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsView.h @@ -49,49 +49,49 @@ class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsView ctkVTKScalarsToColorsView(QWidget* parent = 0); virtual ~ctkVTKScalarsToColorsView(); - virtual void addPlot(vtkPlot* plot); + Q_INVOKABLE virtual void addPlot(vtkPlot* plot); - vtkPlot* addLookupTable(vtkLookupTable* lut); + Q_INVOKABLE vtkPlot* addLookupTable(vtkLookupTable* lut); Q_INVOKABLE vtkPlot* addColorTransferFunction(vtkColorTransferFunction* colorTF, bool editable = true); - vtkPlot* addOpacityFunction(vtkPiecewiseFunction* opacityTF, bool editable = true); - vtkPlot* addCompositeFunction(vtkColorTransferFunction* colorTF, + Q_INVOKABLE vtkPlot* addOpacityFunction(vtkPiecewiseFunction* opacityTF, bool editable = true); + Q_INVOKABLE vtkPlot* addCompositeFunction(vtkColorTransferFunction* colorTF, vtkPiecewiseFunction* opacityTF, bool colorTFEditable = true, bool opacityTFEditable = true); - vtkPlot* addPiecewiseFunction(vtkPiecewiseFunction* piecewiseTF, bool editable = true); + Q_INVOKABLE vtkPlot* addPiecewiseFunction(vtkPiecewiseFunction* piecewiseTF, bool editable = true); - vtkPlot* addColorTransferFunctionControlPoints(vtkColorTransferFunction* colorTF); - vtkPlot* addOpacityFunctionControlPoints(vtkPiecewiseFunction* opacityTF); - vtkPlot* addCompositeFunctionControlPoints(vtkColorTransferFunction* colorTF, + Q_INVOKABLE vtkPlot* addColorTransferFunctionControlPoints(vtkColorTransferFunction* colorTF); + Q_INVOKABLE vtkPlot* addOpacityFunctionControlPoints(vtkPiecewiseFunction* opacityTF); + Q_INVOKABLE vtkPlot* addCompositeFunctionControlPoints(vtkColorTransferFunction* colorTF, vtkPiecewiseFunction* opacityTF); - vtkPlot* addPiecewiseFunctionControlPoints(vtkPiecewiseFunction* piecewiseTF); + Q_INVOKABLE vtkPlot* addPiecewiseFunctionControlPoints(vtkPiecewiseFunction* piecewiseTF); - QList plots()const; + Q_INVOKABLE QList plots()const; template QList plots()const; - QList controlPointsItems()const; - QList lookupTablePlots()const; - QList lookupTablePlots(vtkLookupTable* lut)const; - QList colorTransferFunctionPlots()const; - QList colorTransferFunctionPlots(vtkColorTransferFunction* colorTF)const; - QList opacityFunctionPlots()const; - QList opacityFunctionPlots(vtkPiecewiseFunction* opacityTF)const; - - void setLookuptTableToPlots(vtkLookupTable* lut); - void setColorTransferFunctionToPlots(vtkColorTransferFunction* colorTF); - void setOpacityFunctionToPlots(vtkPiecewiseFunction* opacityTF); - void setPiecewiseFunctionToPlots(vtkPiecewiseFunction* piecewiseTF); + Q_INVOKABLE QList controlPointsItems()const; + Q_INVOKABLE QList lookupTablePlots()const; + Q_INVOKABLE QList lookupTablePlots(vtkLookupTable* lut)const; + Q_INVOKABLE QList colorTransferFunctionPlots()const; + Q_INVOKABLE QList colorTransferFunctionPlots(vtkColorTransferFunction* colorTF)const; + Q_INVOKABLE QList opacityFunctionPlots()const; + Q_INVOKABLE QList opacityFunctionPlots(vtkPiecewiseFunction* opacityTF)const; + + Q_INVOKABLE void setLookuptTableToPlots(vtkLookupTable* lut); + Q_INVOKABLE void setColorTransferFunctionToPlots(vtkColorTransferFunction* colorTF); + Q_INVOKABLE void setOpacityFunctionToPlots(vtkPiecewiseFunction* opacityTF); + Q_INVOKABLE void setPiecewiseFunctionToPlots(vtkPiecewiseFunction* piecewiseTF); bool areBordersVisible()const; void setBordersVisible(bool show); - void validBounds(double bounds[4])const; - void setValidBounds(double bounds[4]); + Q_INVOKABLE void validBounds(double bounds[4])const; + Q_INVOKABLE void setValidBounds(double bounds[4]); - void setPlotsUserBounds(double* bounds); + Q_INVOKABLE void setPlotsUserBounds(double* bounds); /// Reimplemented to set the bounds to the plots as well - virtual void boundAxesToChartBounds(); + Q_INVOKABLE virtual void boundAxesToChartBounds(); Q_SIGNALS: /// Emitted when a new function is set to the view diff --git a/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h b/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h index ad35a74e5a..44219df95c 100644 --- a/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h +++ b/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h @@ -65,8 +65,8 @@ class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsWidget : public ctkVTKScalarsToColorsWidget(QWidget* parent = 0); virtual ~ctkVTKScalarsToColorsWidget(); - ctkVTKScalarsToColorsView* view()const; - vtkControlPointsItem* currentControlPointsItem()const; + Q_INVOKABLE ctkVTKScalarsToColorsView* view()const; + Q_INVOKABLE vtkControlPointsItem* currentControlPointsItem()const; bool isHorizontalSliderVisible()const; void setHorizontalSliderVisible(bool visible); @@ -77,8 +77,8 @@ class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsWidget : public bool editColors()const; void setEditColors(bool edit); - void xRange(double* range)const; - void yRange(double* range)const; + Q_INVOKABLE void xRange(double* range)const; + Q_INVOKABLE void yRange(double* range)const; /// Hide all widgets displayed above the color view. /// @@ -93,14 +93,14 @@ class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKScalarsToColorsWidget : public /// Return the top-left corner widget if any. /// /// \sa addExtraWidget() - QWidgetList extraWidgets()const; + Q_INVOKABLE QWidgetList extraWidgets()const; /// Add a widget in the top-left corner. /// /// ctkVTKScalarsToColorsWidget takes ownership of the widget. /// /// \sa extraWidgets() - void addExtraWidget(QWidget* extraWidget); + Q_INVOKABLE void addExtraWidget(QWidget* extraWidget); public Q_SLOTS: void setCurrentControlPointsItem(vtkControlPointsItem* item);