VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkPiecewiseFunction Class Reference

Defines a 1D piecewise function. More...

#include <vtkPiecewiseFunction.h>

Inheritance diagram for vtkPiecewiseFunction:
Inheritance graph
[legend]
Collaboration diagram for vtkPiecewiseFunction:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkDataObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkPiecewiseFunctionNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void DeepCopy (vtkDataObject *f)
void ShallowCopy (vtkDataObject *f)
int GetDataObjectType ()
int GetSize ()
void RemoveAllPoints ()
void AddSegment (double x1, double y1, double x2, double y2)
double GetValue (double x)
int AdjustRange (double range[2])
const char * GetType ()
double GetFirstNonZeroValue ()
void Initialize ()
int AddPoint (double x, double y)
int AddPoint (double x, double y, double midpoint, double sharpness)
int RemovePoint (double x)
int GetNodeValue (int index, double val[4])
int SetNodeValue (int index, double val[4])
doubleGetDataPointer ()
void FillFromDataPointer (int, double *)
virtual doubleGetRange ()
virtual void GetRange (double &, double &)
virtual void GetRange (double[2])
void GetTable (double x1, double x2, int size, float *table, int stride=1)
void GetTable (double x1, double x2, int size, double *table, int stride=1)
void BuildFunctionFromTable (double x1, double x2, int size, double *table, int stride=1)
virtual void SetClamping (int)
virtual int GetClamping ()
virtual void ClampingOn ()
virtual void ClampingOff ()
virtual void SetAllowDuplicateScalars (int)
virtual int GetAllowDuplicateScalars ()
virtual void AllowDuplicateScalarsOn ()
virtual void AllowDuplicateScalarsOff ()

Static Public Member Functions

static vtkPiecewiseFunctionNew ()
static int IsTypeOf (const char *type)
static vtkPiecewiseFunctionSafeDownCast (vtkObjectBase *o)
static vtkPiecewiseFunctionGetData (vtkInformation *info)
static vtkPiecewiseFunctionGetData (vtkInformationVector *v, int i=0)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkPiecewiseFunction ()
 ~vtkPiecewiseFunction ()
void SortAndUpdateRange ()
bool UpdateRange ()

Protected Attributes

vtkPiecewiseFunctionInternals * Internal
int Clamping
doubleFunction
double Range [2]
int AllowDuplicateScalars

Detailed Description

Defines a 1D piecewise function.

Defines a piecewise function mapping. This mapping allows the addition of control points, and allows the user to control the function between the control points. A piecewise hermite curve is used between control points, based on the sharpness and midpoint parameters. A sharpness of 0 yields a piecewise linear function and a sharpness of 1 yields a piecewise constant function. The midpoint is the normalized distance between control points at which the curve reaches the median Y value. The midpoint and sharpness values specified when adding a node are used to control the transition to the next node (the last node's values are ignored) Outside the range of nodes, the values are 0 if Clamping is off, or the nearest node point if Clamping is on. Using the legacy methods for adding points (which do not have Sharpness and Midpoint parameters) will default to Midpoint = 0.5 (halfway between the control points) and Sharpness = 0.0 (linear).

Examples:
vtkPiecewiseFunction (Examples)
Tests:
vtkPiecewiseFunction (Tests)

Definition at line 50 of file vtkPiecewiseFunction.h.


Member Typedef Documentation

Reimplemented from vtkDataObject.

Definition at line 54 of file vtkPiecewiseFunction.h.


Constructor & Destructor Documentation


Member Function Documentation

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkDataObject.

static int vtkPiecewiseFunction::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkDataObject.

virtual int vtkPiecewiseFunction::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkDataObject.

Reimplemented from vtkDataObject.

virtual vtkObjectBase* vtkPiecewiseFunction::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkDataObject.

Reimplemented from vtkDataObject.

void vtkPiecewiseFunction::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkDataObject.

void vtkPiecewiseFunction::DeepCopy ( vtkDataObject src) [virtual]

Shallow and Deep copy. These copy the data, but not any of the pipeline connections.

Reimplemented from vtkDataObject.

Shallow and Deep copy. These copy the data, but not any of the pipeline connections.

Reimplemented from vtkDataObject.

Return what type of dataset this is.

Reimplemented from vtkDataObject.

Definition at line 61 of file vtkPiecewiseFunction.h.

Get the number of points used to specify the function

Add/Remove points to/from the function. If a duplicate point is added then the function value is changed at that location. Return the index of the point (0 based), or -1 on error.

int vtkPiecewiseFunction::AddPoint ( double  x,
double  y,
double  midpoint,
double  sharpness 
)

Add/Remove points to/from the function. If a duplicate point is added then the function value is changed at that location. Return the index of the point (0 based), or -1 on error.

Add/Remove points to/from the function. If a duplicate point is added then the function value is changed at that location. Return the index of the point (0 based), or -1 on error.

Removes all points from the function.

void vtkPiecewiseFunction::AddSegment ( double  x1,
double  y1,
double  x2,
double  y2 
)

Add a line segment to the function. All points defined between the two points specified are removed from the function. This is a legacy method that does not allow the specification of the sharpness and midpoint values for the two nodes.

Returns the value of the function at the specified location using the specified interpolation.

For the node specified by index, set/get the location (X), value (Y), midpoint, and sharpness values at the node.

For the node specified by index, set/get the location (X), value (Y), midpoint, and sharpness values at the node.

Returns a pointer to the data stored in the table. Fills from a pointer to data stored in a similar table. These are legacy methods which will be maintained for compatibility - however, note that the vtkPiecewiseFunction no longer stores the nodes in a double array internally.

Returns a pointer to the data stored in the table. Fills from a pointer to data stored in a similar table. These are legacy methods which will be maintained for compatibility - however, note that the vtkPiecewiseFunction no longer stores the nodes in a double array internally.

virtual double* vtkPiecewiseFunction::GetRange ( ) [virtual]

Returns the min and max node locations of the function.

virtual void vtkPiecewiseFunction::GetRange ( double ,
double  
) [virtual]

Returns the min and max node locations of the function.

virtual void vtkPiecewiseFunction::GetRange ( double  [2]) [virtual]

Returns the min and max node locations of the function.

Remove all points out of the new range, and make sure there is a point at each end of that range. Return 1 on success, 0 otherwise.

void vtkPiecewiseFunction::GetTable ( double  x1,
double  x2,
int  size,
float table,
int  stride = 1 
)

Fills in an array of function values evaluated at regular intervals. Parameter "stride" is used to step through the output "table".

void vtkPiecewiseFunction::GetTable ( double  x1,
double  x2,
int  size,
double table,
int  stride = 1 
)

Fills in an array of function values evaluated at regular intervals. Parameter "stride" is used to step through the output "table".

void vtkPiecewiseFunction::BuildFunctionFromTable ( double  x1,
double  x2,
int  size,
double table,
int  stride = 1 
)

Constructs a piecewise function from a table. Function range is is set to [x1, x2], function size is set to size, and function points are regularly spaced between x1 and x2. Parameter "stride" is is step through the input table.

virtual void vtkPiecewiseFunction::SetClamping ( int  ) [virtual]

When zero range clamping is Off, GetValue() returns 0.0 when a value is requested outside of the points specified. When zero range clamping is On, GetValue() returns the value at the value at the lowest point for a request below all points specified and returns the value at the highest point for a request above all points specified. On is the default.

virtual int vtkPiecewiseFunction::GetClamping ( ) [virtual]

When zero range clamping is Off, GetValue() returns 0.0 when a value is requested outside of the points specified. When zero range clamping is On, GetValue() returns the value at the value at the lowest point for a request below all points specified and returns the value at the highest point for a request above all points specified. On is the default.

virtual void vtkPiecewiseFunction::ClampingOn ( ) [virtual]

When zero range clamping is Off, GetValue() returns 0.0 when a value is requested outside of the points specified. When zero range clamping is On, GetValue() returns the value at the value at the lowest point for a request below all points specified and returns the value at the highest point for a request above all points specified. On is the default.

virtual void vtkPiecewiseFunction::ClampingOff ( ) [virtual]

When zero range clamping is Off, GetValue() returns 0.0 when a value is requested outside of the points specified. When zero range clamping is On, GetValue() returns the value at the value at the lowest point for a request below all points specified and returns the value at the highest point for a request above all points specified. On is the default.

Return the type of function: Function Types: 0 : Constant (No change in slope between end points) 1 : NonDecreasing (Always increasing or zero slope) 2 : NonIncreasing (Always decreasing or zero slope) 3 : Varied (Contains both decreasing and increasing slopes)

Returns the first point location which precedes a non-zero segment of the function. Note that the value at this point may be zero.

Clears out the current function. A newly created vtkPiecewiseFunction is alreay initialized, so there is no need to call this method which in turn simply calls RemoveAllPoints()

Reimplemented from vtkDataObject.

Retrieve an instance of this class from an information object.

Reimplemented from vtkDataObject.

Retrieve an instance of this class from an information object.

Reimplemented from vtkDataObject.

Toggle whether to allow duplicate scalar values in the piecewise function (off by default).

Toggle whether to allow duplicate scalar values in the piecewise function (off by default).

Toggle whether to allow duplicate scalar values in the piecewise function (off by default).

Toggle whether to allow duplicate scalar values in the piecewise function (off by default).

bool vtkPiecewiseFunction::UpdateRange ( ) [protected]

Member Data Documentation

vtkPiecewiseFunctionInternals* vtkPiecewiseFunction::Internal [protected]

Definition at line 179 of file vtkPiecewiseFunction.h.

Definition at line 185 of file vtkPiecewiseFunction.h.

Definition at line 188 of file vtkPiecewiseFunction.h.

Definition at line 191 of file vtkPiecewiseFunction.h.

Definition at line 200 of file vtkPiecewiseFunction.h.


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