#include <vtkKWParameterValueFunctionInterface.h>
Inheritance diagram for vtkKWParameterValueFunctionInterface:
Public Types | |
enum | { MaxFunctionPointDimensionality = 20 } |
Public Member Functions | |
vtkTypeRevisionMacro (vtkKWParameterValueFunctionInterface, vtkKWWidgetWithLabel) | |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | Create (vtkKWApplication *app) |
virtual int | HasFunction ()=0 |
virtual int | GetFunctionSize ()=0 |
virtual unsigned long | GetFunctionMTime ()=0 |
virtual int | GetFunctionPointParameter (int id, double *parameter)=0 |
virtual int | GetFunctionPointDimensionality ()=0 |
virtual int | GetFunctionPointId (double parameter, int *id) |
virtual int | FunctionPointCanBeAdded ()=0 |
virtual int | FunctionPointCanBeRemoved (int id)=0 |
virtual int | FunctionPointParameterIsLocked (int id)=0 |
virtual int | FunctionPointValueIsLocked (int id)=0 |
virtual int | FunctionPointCanBeMovedToParameter (int id, double parameter)=0 |
Protected Member Functions | |
virtual int | InterpolateFunctionPointValues (double parameter, double *values)=0 |
virtual int | GetFunctionPointValues (int id, double *values)=0 |
virtual int | SetFunctionPointValues (int id, const double *values)=0 |
virtual int | AddFunctionPoint (double parameter, const double *values, int *id)=0 |
virtual int | SetFunctionPoint (int id, double parameter, const double *values)=0 |
virtual int | RemoveFunctionPoint (int id)=0 |
virtual int | FunctionLineIsSampledBetweenPoints (int id1, int id2) |
vtkKWParameterValueFunctionInterface () | |
~vtkKWParameterValueFunctionInterface () |
A widget that allows the user to edit a parameter/value function interactively. This abstract class is the first abstract stage of vtkKWParameterValueFunctionEditor, which in turns provides most of the user-interface functionality. This class was created to take into account the amount of code and the complexity of vtkKWParameterValueFunctionEditor, most of which should not be a concern for developpers. As a superclass it emphasizes and tries to document which pure virtual methods *needs* to be implemented in order to create an editor tailored for a specific kind of parameter/value function. It only describes the low-level methods that are required to manipulate a function in a user-interface independent way. For example, given the id (rank) of a point in the function, how to retrieve its corresponding parameter and/or value(s) ; how to retrieve the dimensionality of a point ; how to interpolate the value of a point over the parameter range, etc. Its subclass vtkKWParameterValueFunctionEditor uses those methods to create and manage a graphical editor, without concrete knowledge of what specific class the function relates to. The subclasses of vtkKWParameterValueFunctionEditor provide a concrete implementation of vtkKWParameterValueFunctionEditor by tying up a specific class of function to the methods below. For example, the class vtkKWPiecewiseFunctionEditor manipulates instances of vtkPiecewiseFunction internally as functions: the methods below are implemented as proxy to the vtkPiecewiseFunction methods. Same goes vtkKWColorTransferFunctionEditor, which manipulates instances of vtkColorTransferFunction internally.
Definition at line 58 of file vtkKWParameterValueFunctionInterface.h.
|
This probably should not be hard-coded, but will make our life easier. It specificies the maximum dimensionality of a point (not the number* of points). For example, for a RGB color transfer function editor, each point has a dimensionality of 3 (see GetFunctionPointDimensionality). BTX Definition at line 81 of file vtkKWParameterValueFunctionInterface.h. |
|
Definition at line 218 of file vtkKWParameterValueFunctionInterface.h. |
|
Definition at line 219 of file vtkKWParameterValueFunctionInterface.h. |
|
|
|
Reimplemented from vtkKWWidgetWithLabel. Reimplemented in vtkKWColorTransferFunctionEditor, vtkKWParameterValueFunctionEditor, vtkKWParameterValueHermiteFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Create the widget. Reimplemented from vtkKWWidgetWithLabel. Reimplemented in vtkKWColorTransferFunctionEditor, vtkKWParameterValueFunctionEditor, vtkKWParameterValueHermiteFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Return 1 if there is a function associated to the editor. It is used, among *other* things, to disable the UI automatically if there is nothing to edit at the moment. Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Return the number of points/elements in the function Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Return the modification time of the function (a monotonically increasing value changing each time the function is modified) Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Get the 'parameter' at point 'id' Ex: a scalar range, or a instant in a timeline. Return 1 on success, 0 otherwise Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Get the dimensionality of the points in the function (Ex: 3 for a RGB point, 1 for a boolean value or an opacity value) Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Interpolate and get the 'n-tuple' value at a given 'parameter' (where 'n' is the dimensionality of the point). In other words, compute the value of a point as if it was located at a given parameter over the parameter range of the function). Note that 'values' has to be allocated with enough room. The interpolation method is function dependent (linear in the vtkKWPiecewiseFunctionEditor class for example). Return 1 on success, 0 otherwise Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Description: Get the 'n-tuple' value at point 'id' (where 'n' is the dimensionality of the point). Note that 'values' has to be allocated with enough room. Return 1 on success, 0 otherwise Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Set the 'n-tuple' value at point 'id' (where 'n' is the dimensionality of the point). Note that the point has to exist. Return 1 on success, 0 otherwise Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Set the 'parameter' *and* 'n-tuple' value at point 'id' (where 'n' is the dimensionality of the point). Note that the point has to exist. It basically *moves* the point to a new location over the parameter range and change its value simultaneously. Note that doing so should really *not* change the rank/id of the point in the function, otherwise things might go wrong (untested). Basically it means that points can not be moved "over" other points, i.e. when you drag a point in the editor, you can not move it "before" or "past" its neighbors, which makes sense anyway (I guess), but make sure the constraint is enforced :) Return 1 on success, 0 otherwise Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Remove a function point 'id'. Note: do not use FunctionPointCanBeRemoved() inside that function, it has been done for you already in higher-level methods. Return 1 on success, 0 otherwise Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Get the 'id' of the point at parameter 'parameter', if *any*. The current implementation is probably not too efficient as it loops over all points, call GetFunctionPointParameter and return the corresponding id if the parameter that was retrieved matches. Return 1 on success, 0 otherwise |
|
Return 1 if a point can be added to the function, 0 otherwise. Ex: there might be many reasons why a function could be "locked", it depends on your implementation, but here is the hook. Implemented in vtkKWParameterValueFunctionEditor, and vtkKWPiecewiseFunctionEditor. |
|
Return 1 if the point 'id' can be removed from the function, 0 otherwise. Implemented in vtkKWParameterValueFunctionEditor, and vtkKWPiecewiseFunctionEditor. |
|
Return 1 if the 'parameter' of the point 'id' is locked (can/should not be changed/edited), 0 otherwise. Implemented in vtkKWParameterValueFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine. |
|
Return 1 if the 'n-tuple' value of the point 'id' is locked (can/should not be changed/edited), 0 otherwise. Note that by default point with dimensionality > 1 will be placed in the center of the editor, as the is no way to edit a n-dimensional point in a 2D editor. Still, some editors (see vtkKWColorTransferFunctionEditor will provide 3 text entries to allow the point value(s) to be edited). Implemented in vtkKWParameterValueFunctionEditor, and vtkKWPiecewiseFunctionEditor. |
|
Return 1 if the point 'id' can be moved over the parameter range to a new 'parameter', 0 otherwise. vtkKWParameterValueFunctionEditor provides a default implementation preventing the point to be moved outside the parameter range, or if the parameter is locked, or if it is passing over or before its neighbors. Implemented in vtkKWParameterValueFunctionEditor, and vtkPVTimeLine. |
|
Return 1 if the function line joining point 'id1' and point 'id2' needs to be sampled at regular interval (instead of a straight line). If the interpolation function InterpolateFunctionPointValues is not linear, it is likely that this function should return 1 so that the line that is drawn between the two points is not a straight line but a set of segments computed by sampling between each end-points. Yet, it does not have to be *always* resampled, given the property of the interpolant, some cases may end up requiring just a straight line, which can be drawn much more efficiently. Reimplemented in vtkKWPiecewiseFunctionEditor. |