Canvas widget for editing a vtkPiecewiseFunction (opacity transfer function).
More...
|
| | QmitkPiecewiseFunctionCanvas (QWidget *parent=nullptr, Qt::WindowFlags f={}) |
| | Construct the piecewise function canvas. More...
|
| |
| void | paintEvent (QPaintEvent *e) override |
| | Paint the histogram, function lines, handles, title, and range labels. More...
|
| |
| void | SetTitle (const QString &title) |
| | Set the title text displayed on the canvas. More...
|
| |
| int | GetNearHandle (int x, int y, unsigned int maxSquaredDistance=100) override |
| | Find a handle near the given canvas position. More...
|
| |
| void | SetPiecewiseFunction (vtkPiecewiseFunction *piecewiseFunction) |
| | Set the vtkPiecewiseFunction to edit. More...
|
| |
| int | AddFunctionPoint (double x, double val) override |
| | Add a function point at position (x, val). More...
|
| |
| void | RemoveFunctionPoint (double x) override |
| | Remove the function point at position x. More...
|
| |
| double | GetFunctionX (int index) override |
| | Get the x (scalar) value of a function point by index. More...
|
| |
| double | GetFunctionY (int index) override |
| | Get the y (opacity) value of a function point by index. More...
|
| |
| int | GetFunctionSize () override |
| | Get the number of points in the piecewise function. More...
|
| |
| void | DoubleClickOnHandle (int) override |
| | No-op for piecewise functions (double-click does not change values). More...
|
| |
| void | MoveFunctionPoint (int index, std::pair< double, double > pos) override |
| | Move a function point to a new position. More...
|
| |
| double | GetFunctionMax () |
| | Get the maximum scalar value of the function range. More...
|
| |
| double | GetFunctionMin () |
| | Get the minimum scalar value of the function range. More...
|
| |
| double | GetFunctionRange () |
| | Get the span of the function range. More...
|
| |
| void | RemoveAllFunctionPoints () |
| | Reset the function to a default ramp from 0 to 1 with a zero-point at origin. More...
|
| |
| void | ResetGO () |
| | Reset the function to a default gradient opacity configuration. More...
|
| |
| | QmitkTransferFunctionCanvas (QWidget *parent=nullptr, Qt::WindowFlags f={}) |
| | Construct the transfer function canvas. More...
|
| |
| mitk::SimpleHistogram * | GetHistogram () |
| | Get the associated histogram. More...
|
| |
| void | SetHistogram (mitk::SimpleHistogram *histogram) |
| | Set the histogram to display as background. More...
|
| |
| double | GetMin () |
| | Get the minimum scalar value of the data range. More...
|
| |
| void | SetMin (double min) |
| | Set the minimum scalar value and update the lower display bound. More...
|
| |
| double | GetMax () |
| | Get the maximum scalar value of the data range. More...
|
| |
| void | SetMax (double max) |
| | Set the maximum scalar value and update the upper display bound. More...
|
| |
| double | GetLower () |
| | Get the lower display bound. More...
|
| |
| void | SetLower (double lower) |
| | Set the lower display bound (visible range start). More...
|
| |
| double | GetUpper () |
| | Get the upper display bound. More...
|
| |
| void | SetUpper (double upper) |
| | Set the upper display bound (visible range end). More...
|
| |
| void | mousePressEvent (QMouseEvent *mouseEvent) override |
| | Handle mouse press: add or remove function points, select handles. More...
|
| |
| void | paintEvent (QPaintEvent *e) override |
| | Default paint event handler. More...
|
| |
| void | mouseMoveEvent (QMouseEvent *mouseEvent) override |
| | Handle mouse move: drag the grabbed handle. More...
|
| |
| void | mouseReleaseEvent (QMouseEvent *mouseEvent) override |
| | Handle mouse release: trigger repaint. More...
|
| |
| void | mouseDoubleClickEvent (QMouseEvent *mouseEvent) override |
| | Handle double-click on a handle. More...
|
| |
| void | PaintHistogram (QPainter &p) |
| | Paint the histogram as a background overlay. More...
|
| |
| std::pair< int, int > | FunctionToCanvas (std::pair< double, double > functionPoint) |
| | Convert function coordinates to canvas pixel coordinates. More...
|
| |
| std::pair< double, double > | CanvasToFunction (std::pair< int, int > canvasPoint) |
| | Convert canvas pixel coordinates to function coordinates. More...
|
| |
| void | keyPressEvent (QKeyEvent *e) override |
| | Handle keyboard input for point manipulation (Delete, arrow keys). More...
|
| |
| void | SetImmediateUpdate (bool state) |
| | Enable or disable immediate rendering updates during interaction. More...
|
| |
| std::pair< double, double > | ValidateCoord (std::pair< double, double > x) |
| | Clamp coordinates to valid histogram range and [0, 1] for y. More...
|
| |
| void | SetX (float x) |
| | Set the x coordinate of the currently grabbed handle. More...
|
| |
| void | SetY (float y) |
| | Set the y coordinate of the currently grabbed handle. More...
|
| |
| void | SetQLineEdits (QLineEdit *xEdit, QLineEdit *yEdit) |
| | Connect QLineEdit widgets for displaying/editing the selected handle coordinates. More...
|
| |
Canvas widget for editing a vtkPiecewiseFunction (opacity transfer function).
Renders a piecewise linear function as connected line segments with draggable control point handles. Supports adding, removing, and moving function points interactively. A histogram is drawn in the background if one is set.
- See also
- QmitkTransferFunctionCanvas, QmitkColorTransferFunctionCanvas, QmitkTransferFunctionWidget
Definition at line 30 of file QmitkPiecewiseFunctionCanvas.h.