Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
pqTransferFunctionWidget Class Reference

pqTransferFunctionWidget provides a widget that can edit the control points in a vtkPiecewiseFunction or a vtkScalarsToColors (or subclass) or both. More...

#include <pqTransferFunctionWidget.h>

Inherits QWidget.

Public Slots

void setCurrentPoint (vtkIdType index)
 Set the current point. More...
 
void setCurrentPointPosition (double xpos)
 Set the X-position for the current point (without changing the Y position, if applicable. More...
 
void render ()
 re-renders the transfer function view. More...
 
void setHistogramTable (vtkTable *table)
 Set the histogram table to display as a plot bar. More...
 

Signals

void currentPointChanged (vtkIdType index)
 signal fired when the current selected control point changes. More...
 
void controlPointsModified ()
 signal fired to indicate that the control points changed i.e. More...
 
void chartRangeModified ()
 signal fired when the chart range is modified. More...
 
void rangeHandlesRangeChanged (double rangeMin, double rangeMax)
 signal fired when the range handles changed the range. More...
 
void rangeHandlesDoubleClicked ()
 signal fired when the range handles are double clicked. More...
 

Public Member Functions

 pqTransferFunctionWidget (QWidget *parent=nullptr)
 
 ~pqTransferFunctionWidget () override
 
void initialize (vtkScalarsToColors *stc, bool stc_editable, vtkPiecewiseFunction *pwf, bool pwf_editable)
 Initialize the pqTransferFunctionWidget with the given color-transfer-function and piecewise-function (either of which can be null). More...
 
vtkIdType currentPoint () const
 Returns the current point index. More...
 
vtkIdType numberOfControlPoints () const
 Returns the number of control points in the editor widget. More...
 
void SetLogScaleXAxis (bool logScale)
 Switches the chart to use a log scaled X axis. More...
 
bool GetLogScaleXAxis () const
 Switches the chart to use a log scaled X axis. More...
 
vtkScalarsToColorsscalarsToColors () const
 Provides access to vtkScalarsToColors and vtkPiecewiseFunction passed to initialize. More...
 
vtkPiecewiseFunctionpiecewiseFunction () const
 Provides access to vtkScalarsToColors and vtkPiecewiseFunction passed to initialize. More...
 
void SetControlPointsFreehandDrawing (bool use)
 Set/Get the use of freehand drawing for the control points. More...
 
bool GetControlPointsFreehandDrawing () const
 Set/Get the use of freehand drawing for the control points. More...
 

Protected Slots

void onCurrentChangedEvent ()
 slot called when the internal vtkControlPointsItem fires vtkControlPointsItem::CurrentPointChangedEvent More...
 
void onRangeHandlesRangeChanged ()
 slot called when the internal vtkRangeHandlesItem fires a vtkRangeHandlesItem::RangeHandlesRangeChanged More...
 
void showUsageStatus ()
 Show usage info in the application status bar. More...
 
void editColorAtCurrentControlPoint ()
 Show color dialog to edit color for a specific control point. More...
 

Protected Member Functions

void onCurrentPointEditEvent ()
 callback called when vtkControlPointsItem fires vtkControlPointsItem::CurrentPointEditEvent. More...
 

Detailed Description

pqTransferFunctionWidget provides a widget that can edit the control points in a vtkPiecewiseFunction or a vtkScalarsToColors (or subclass) or both.

It is used by pqColorOpacityEditorWidget, for example, to show transfer function editors for color and opacity for a PVLookupTable proxy.

Definition at line 21 of file pqTransferFunctionWidget.h.

Constructor & Destructor Documentation

◆ pqTransferFunctionWidget()

pqTransferFunctionWidget::pqTransferFunctionWidget ( QWidget *  parent = nullptr)

◆ ~pqTransferFunctionWidget()

pqTransferFunctionWidget::~pqTransferFunctionWidget ( )
override

Member Function Documentation

◆ initialize()

void pqTransferFunctionWidget::initialize ( vtkScalarsToColors stc,
bool  stc_editable,
vtkPiecewiseFunction pwf,
bool  pwf_editable 
)

Initialize the pqTransferFunctionWidget with the given color-transfer-function and piecewise-function (either of which can be null).

The editable flags are used to control if the users should be allowed to edit/change the particular transfer function.

◆ currentPoint()

vtkIdType pqTransferFunctionWidget::currentPoint ( ) const

Returns the current point index.

-1 is none is selected.

◆ numberOfControlPoints()

vtkIdType pqTransferFunctionWidget::numberOfControlPoints ( ) const

Returns the number of control points in the editor widget.

◆ SetLogScaleXAxis()

void pqTransferFunctionWidget::SetLogScaleXAxis ( bool  logScale)

Switches the chart to use a log scaled X axis.

◆ GetLogScaleXAxis()

bool pqTransferFunctionWidget::GetLogScaleXAxis ( ) const

Switches the chart to use a log scaled X axis.

◆ scalarsToColors()

vtkScalarsToColors* pqTransferFunctionWidget::scalarsToColors ( ) const

Provides access to vtkScalarsToColors and vtkPiecewiseFunction passed to initialize.

◆ piecewiseFunction()

vtkPiecewiseFunction* pqTransferFunctionWidget::piecewiseFunction ( ) const

Provides access to vtkScalarsToColors and vtkPiecewiseFunction passed to initialize.

◆ SetControlPointsFreehandDrawing()

void pqTransferFunctionWidget::SetControlPointsFreehandDrawing ( bool  use)

Set/Get the use of freehand drawing for the control points.

◆ GetControlPointsFreehandDrawing()

bool pqTransferFunctionWidget::GetControlPointsFreehandDrawing ( ) const

Set/Get the use of freehand drawing for the control points.

◆ setCurrentPoint

void pqTransferFunctionWidget::setCurrentPoint ( vtkIdType  index)
slot

Set the current point.

Set to -1 clear the current point.

◆ setCurrentPointPosition

void pqTransferFunctionWidget::setCurrentPointPosition ( double  xpos)
slot

Set the X-position for the current point (without changing the Y position, if applicable.

We ensure that the point doesn't move past neighbouring points. Note this will not change the end points i.e. start and end points.

◆ render

void pqTransferFunctionWidget::render ( )
slot

re-renders the transfer function view.

This doesn't render immediately, schedules a render.

◆ setHistogramTable

void pqTransferFunctionWidget::setHistogramTable ( vtkTable table)
slot

Set the histogram table to display as a plot bar.

If set to nullptr, a simple color texture is used, the default.

◆ currentPointChanged

void pqTransferFunctionWidget::currentPointChanged ( vtkIdType  index)
signal

signal fired when the current selected control point changes.

◆ controlPointsModified

void pqTransferFunctionWidget::controlPointsModified ( )
signal

signal fired to indicate that the control points changed i.e.

either they were moved, orone was added/deleted, or edited to change color, etc.

◆ chartRangeModified

void pqTransferFunctionWidget::chartRangeModified ( )
signal

signal fired when the chart range is modified.

◆ rangeHandlesRangeChanged

void pqTransferFunctionWidget::rangeHandlesRangeChanged ( double  rangeMin,
double  rangeMax 
)
signal

signal fired when the range handles changed the range.

◆ rangeHandlesDoubleClicked

void pqTransferFunctionWidget::rangeHandlesDoubleClicked ( )
signal

signal fired when the range handles are double clicked.

◆ onCurrentChangedEvent

void pqTransferFunctionWidget::onCurrentChangedEvent ( )
protectedslot

◆ onRangeHandlesRangeChanged

void pqTransferFunctionWidget::onRangeHandlesRangeChanged ( )
protectedslot

slot called when the internal vtkRangeHandlesItem fires a vtkRangeHandlesItem::RangeHandlesRangeChanged

◆ showUsageStatus

void pqTransferFunctionWidget::showUsageStatus ( )
protectedslot

Show usage info in the application status bar.

◆ editColorAtCurrentControlPoint

void pqTransferFunctionWidget::editColorAtCurrentControlPoint ( )
protectedslot

Show color dialog to edit color for a specific control point.

◆ onCurrentPointEditEvent()

void pqTransferFunctionWidget::onCurrentPointEditEvent ( )
protected

The documentation for this class was generated from the following file: