Skip to content

Commit

Permalink
ENH: Add python wrapping to functions in ctkVTKScalarsToColorsView an…
Browse files Browse the repository at this point in the history
…d ctkVTKScalarsToColorsWidget
  • Loading branch information
Sunderlandkyl committed Jan 8, 2019
1 parent 6cd82aa commit 6db6fde
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
52 changes: 26 additions & 26 deletions Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<vtkPlot*> plots()const;
Q_INVOKABLE QList<vtkPlot*> plots()const;
template<class T>
QList<T*> plots()const;
QList<vtkControlPointsItem*> controlPointsItems()const;
QList<vtkPlot*> lookupTablePlots()const;
QList<vtkPlot*> lookupTablePlots(vtkLookupTable* lut)const;
QList<vtkPlot*> colorTransferFunctionPlots()const;
QList<vtkPlot*> colorTransferFunctionPlots(vtkColorTransferFunction* colorTF)const;
QList<vtkPlot*> opacityFunctionPlots()const;
QList<vtkPlot*> opacityFunctionPlots(vtkPiecewiseFunction* opacityTF)const;

void setLookuptTableToPlots(vtkLookupTable* lut);
void setColorTransferFunctionToPlots(vtkColorTransferFunction* colorTF);
void setOpacityFunctionToPlots(vtkPiecewiseFunction* opacityTF);
void setPiecewiseFunctionToPlots(vtkPiecewiseFunction* piecewiseTF);
Q_INVOKABLE QList<vtkControlPointsItem*> controlPointsItems()const;
Q_INVOKABLE QList<vtkPlot*> lookupTablePlots()const;
Q_INVOKABLE QList<vtkPlot*> lookupTablePlots(vtkLookupTable* lut)const;
Q_INVOKABLE QList<vtkPlot*> colorTransferFunctionPlots()const;
Q_INVOKABLE QList<vtkPlot*> colorTransferFunctionPlots(vtkColorTransferFunction* colorTF)const;
Q_INVOKABLE QList<vtkPlot*> opacityFunctionPlots()const;
Q_INVOKABLE QList<vtkPlot*> 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
Expand Down
12 changes: 6 additions & 6 deletions Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
///
Expand All @@ -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);
Expand Down

0 comments on commit 6db6fde

Please sign in to comment.