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

# vtkPiecewiseFunction Class Reference

`#include <vtkPiecewiseFunction.h>`

Inheritance diagram for vtkPiecewiseFunction:

[legend]
Collaboration diagram for vtkPiecewiseFunction:

[legend]
List of all members.

## Detailed Description

Defines a 1D piecewise function.

Date:
  2003/01/17 18:22:28

Revision:
  1.32

Defines a piecewise linear function mapping. Used for transfer functions in volume rendering.

Created by:
  - Lorensen, Bill

CVS contributions (if > 5%):
  - Lorensen, Bill (54%)
  - Avila, Lisa (13%)
  - Miller, Jim (13%)
  - Martin, Ken (7%)

CVS logs (CVSweb):
  - .`cxx` (`/Filtering/vtkPiecewiseFunction.cxx)`
  - .`h` (`/Filtering/vtkPiecewiseFunction.h)`

Examples:
  vtkPiecewiseFunction (Examples)

Tests:
  vtkPiecewiseFunction (Tests)

Definition at line 52 of file vtkPiecewiseFunction.h.

## Public Types

typedef vtkDataObject | Superclass

## Public Methods

virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
void | Initialize ()
void | DeepCopy (vtkDataObject *f)
void | ShallowCopy (vtkDataObject *f)
int | GetDataObjectType ()
int | GetSize ()
void | RemoveAllPoints ()
void | AddSegment (float x1, float val1, float x2, float val2)
float | GetValue (float x)
float * | GetRange ()
void | GetTable (float x1, float x2, int size, float *table, int stride=1)
const char * | GetType ()
unsigned long | GetMTime ()
float | GetFirstNonZeroValue ()
void | AddPoint (float x, float val)
void | RemovePoint (float x)
float * | GetDataPointer ()
void | FillFromDataPointer (int, float *)
void | BuildFunctionFromTable (float x1, float x2, int size, float *table, int stride=1)
virtual void | SetClamping (int)
virtual int | GetClamping ()
virtual void | ClampingOn ()
virtual void | ClampingOff ()

## Static Public Methods

vtkPiecewiseFunction * | New ()
int | IsTypeOf (const char *type)
vtkPiecewiseFunction * | SafeDownCast (vtkObject *o)

## Protected Methods

| vtkPiecewiseFunction ()
| ~vtkPiecewiseFunction ()
void | IncreaseArraySize ()
int | InsertPoint (float x, float val)
void | MovePoints (int index, int down)

## Protected Attributes

int | ArraySize
int | Clamping
float * | Function
int | FunctionSize
float | FunctionRange [2]

## Member Typedef Documentation

typedef vtkDataObject vtkPiecewiseFunction::Superclass

| Reimplemented from vtkDataObject. Definition at line 56 of file vtkPiecewiseFunction.h.

## Constructor & Destructor Documentation

vtkPiecewiseFunction::vtkPiecewiseFunction | ( |  | ) | `[protected]`

vtkPiecewiseFunction::~vtkPiecewiseFunction | ( |  | ) | `[protected]`

## Member Function Documentation

vtkPiecewiseFunction* vtkPiecewiseFunction::New | ( |  | ) | `[static]`

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

virtual const char* vtkPiecewiseFunction::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkDataObject.

int vtkPiecewiseFunction::IsTypeOf | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkDataObject.

virtual int vtkPiecewiseFunction::IsA | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkDataObject.

vtkPiecewiseFunction* vtkPiecewiseFunction::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| 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::Initialize | ( |  | ) | `[virtual]`

| Reimplemented from vtkDataObject.

void vtkPiecewiseFunction::DeepCopy | ( | vtkDataObject * | f | ) | `[virtual]`

| Shallow and Deep copy. These copy the data, but not any of the pipeline connections. Reimplemented from vtkDataObject.

void vtkPiecewiseFunction::ShallowCopy | ( | vtkDataObject * | f | ) | `[virtual]`

| Shallow and Deep copy. These copy the data, but not any of the pipeline connections. Reimplemented from vtkDataObject.

int vtkPiecewiseFunction::GetDataObjectType | ( |  | ) | `[inline, virtual]`

| Return what type of dataset this is. Reimplemented from vtkDataObject. Definition at line 64 of file vtkPiecewiseFunction.h. References VTK_PIECEWISE_FUNCTION.

int vtkPiecewiseFunction::GetSize | ( |  | ) |

| Get the number of points used to specify the function

void vtkPiecewiseFunction::AddPoint | ( | float | x,
|  | float | val
| ) |

| Add/Remove points to/from the function. If a duplicate point is added then the function value is changed at that location.

void vtkPiecewiseFunction::RemovePoint | ( | float | x | ) |

| Add/Remove points to/from the function. If a duplicate point is added then the function value is changed at that location.

void vtkPiecewiseFunction::RemoveAllPoints | ( |  | ) |

| Removes all points from the function.

void vtkPiecewiseFunction::AddSegment | ( | float | x1,
|  | float | val1,
|  | float | x2,
|  | float | val2
| ) |

| Add a line segment to the function. All points defined between the two points specified are removed from the function.

float vtkPiecewiseFunction::GetValue | ( | float | x | ) |

| Returns the value of the function at the specified location using the specified interpolation. Returns zero if the specified location is outside the min and max points of the function.

float* vtkPiecewiseFunction::GetDataPointer | ( |  | ) | `[inline]`

| Returns a pointer to the data stored in the table. Fills from a pointer to data stored in a similar table. Definition at line 91 of file vtkPiecewiseFunction.h.

void vtkPiecewiseFunction::FillFromDataPointer | ( | int | ,
|  | float * |
| ) |

| Returns a pointer to the data stored in the table. Fills from a pointer to data stored in a similar table.

float* vtkPiecewiseFunction::GetRange | ( |  | ) |

| Returns the min and max point locations of the function.

void vtkPiecewiseFunction::GetTable | ( | float | x1,
|  | float | 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". It is used by vtkColorTransferFunction to fill in an rgb table using three separate piecewise functions and three separate calls to GetTable().

void vtkPiecewiseFunction::BuildFunctionFromTable | ( | float | x1,
|  | float | x2,
|  | int | size,
|  | float * | 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. It is used by vtkColorTransferFunction to construct 3 piecewise functions from an rgb 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.

const char* vtkPiecewiseFunction::GetType | ( |  | ) |

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

unsigned long vtkPiecewiseFunction::GetMTime | ( |  | ) | `[virtual]`

| Get the mtime of this object - override to consider the mtime of the source as well. Reimplemented from vtkDataObject.

float vtkPiecewiseFunction::GetFirstNonZeroValue | ( |  | ) |

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

void vtkPiecewiseFunction::IncreaseArraySize | ( |  | ) | `[protected]`

int vtkPiecewiseFunction::InsertPoint | ( | float | x,
|  | float | val
| ) | `[protected]`

void vtkPiecewiseFunction::MovePoints | ( | int | index,
|  | int | down
| ) | `[protected]`

## Member Data Documentation

int vtkPiecewiseFunction::ArraySize`[protected]`

| Definition at line 146 of file vtkPiecewiseFunction.h.

int vtkPiecewiseFunction::Clamping`[protected]`

| Definition at line 152 of file vtkPiecewiseFunction.h.

float* vtkPiecewiseFunction::Function`[protected]`

| Definition at line 155 of file vtkPiecewiseFunction.h.

int vtkPiecewiseFunction::FunctionSize`[protected]`

| Definition at line 158 of file vtkPiecewiseFunction.h.

float vtkPiecewiseFunction::FunctionRange[2]`[protected]`

| Definition at line 161 of file vtkPiecewiseFunction.h.

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

- Filtering/vtkPiecewiseFunction.h