Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkKWParameterValueFunctionInterface Class Reference

a parameter/value function editor/interface More...

#include <vtkKWParameterValueFunctionInterface.h>

Inheritance diagram for vtkKWParameterValueFunctionInterface:

Inheritance graph
[legend]
Collaboration diagram for vtkKWParameterValueFunctionInterface:

Collaboration graph
[legend]
List of all members.

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 ()

Detailed Description

a parameter/value function editor/interface

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.

Thanks:
This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://nihroadmap.nih.gov/bioinformatics.
See also:
vtkKWParameterValueFunctionEditor vtkKWPiecewiseFunctionEditor vtkKWColorTransferFunctionEditor

Definition at line 58 of file vtkKWParameterValueFunctionInterface.h.


Member Enumeration Documentation

anonymous enum
 

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

Enumeration values:
MaxFunctionPointDimensionality 

Definition at line 81 of file vtkKWParameterValueFunctionInterface.h.


Constructor & Destructor Documentation

vtkKWParameterValueFunctionInterface::vtkKWParameterValueFunctionInterface  )  [inline, protected]
 

Definition at line 218 of file vtkKWParameterValueFunctionInterface.h.

vtkKWParameterValueFunctionInterface::~vtkKWParameterValueFunctionInterface  )  [inline, protected]
 

Definition at line 219 of file vtkKWParameterValueFunctionInterface.h.


Member Function Documentation

vtkKWParameterValueFunctionInterface::vtkTypeRevisionMacro vtkKWParameterValueFunctionInterface  ,
vtkKWWidgetWithLabel 
 

void vtkKWParameterValueFunctionInterface::PrintSelf ostream &  os,
vtkIndent  indent
 

Reimplemented from vtkKWWidgetWithLabel.

Reimplemented in vtkKWColorTransferFunctionEditor, vtkKWParameterValueFunctionEditor, vtkKWParameterValueHermiteFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine.

virtual void vtkKWParameterValueFunctionInterface::Create vtkKWApplication app  )  [virtual]
 

Create the widget.

Reimplemented from vtkKWWidgetWithLabel.

Reimplemented in vtkKWColorTransferFunctionEditor, vtkKWParameterValueFunctionEditor, vtkKWParameterValueHermiteFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine.

virtual int vtkKWParameterValueFunctionInterface::HasFunction  )  [pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::GetFunctionSize  )  [pure virtual]
 

Return the number of points/elements in the function

Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine.

virtual unsigned long vtkKWParameterValueFunctionInterface::GetFunctionMTime  )  [pure virtual]
 

Return the modification time of the function (a monotonically increasing value changing each time the function is modified)

Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine.

virtual int vtkKWParameterValueFunctionInterface::GetFunctionPointParameter int  id,
double *  parameter
[pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::GetFunctionPointDimensionality  )  [pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::InterpolateFunctionPointValues double  parameter,
double *  values
[protected, pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::GetFunctionPointValues int  id,
double *  values
[protected, pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::SetFunctionPointValues int  id,
const double *  values
[protected, pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::AddFunctionPoint double  parameter,
const double *  values,
int *  id
[protected, pure virtual]
 

Implemented in vtkKWColorTransferFunctionEditor, vtkKWPiecewiseFunctionEditor, and vtkPVTimeLine.

virtual int vtkKWParameterValueFunctionInterface::SetFunctionPoint int  id,
double  parameter,
const double *  values
[protected, pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::RemoveFunctionPoint int  id  )  [protected, pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::GetFunctionPointId double  parameter,
int *  id
[virtual]
 

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

virtual int vtkKWParameterValueFunctionInterface::FunctionPointCanBeAdded  )  [pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::FunctionPointCanBeRemoved int  id  )  [pure virtual]
 

Return 1 if the point 'id' can be removed from the function, 0 otherwise.

Implemented in vtkKWParameterValueFunctionEditor, and vtkKWPiecewiseFunctionEditor.

virtual int vtkKWParameterValueFunctionInterface::FunctionPointParameterIsLocked int  id  )  [pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::FunctionPointValueIsLocked int  id  )  [pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::FunctionPointCanBeMovedToParameter int  id,
double  parameter
[pure virtual]
 

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.

virtual int vtkKWParameterValueFunctionInterface::FunctionLineIsSampledBetweenPoints int  id1,
int  id2
[protected, virtual]
 

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.


The documentation for this class was generated from the following file:
Generated on Tue May 30 12:41:05 2006 for ParaView by doxygen 1.3.5