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:
[legend]
Collaboration diagram for vtkPiecewiseFunction:
[legend]

List of all members.

Public Types

typedef vtkDataObject Superclass
- Public Types inherited from vtkDataObject
enum  FieldAssociations {
  FIELD_ASSOCIATION_POINTS, FIELD_ASSOCIATION_CELLS, FIELD_ASSOCIATION_NONE, FIELD_ASSOCIATION_POINTS_THEN_CELLS,
  FIELD_ASSOCIATION_VERTICES, FIELD_ASSOCIATION_EDGES, FIELD_ASSOCIATION_ROWS, NUMBER_OF_ASSOCIATIONS
}
enum  AttributeTypes {
  POINT, CELL, FIELD, POINT_THEN_CELL,
  VERTEX, EDGE, ROW, NUMBER_OF_ATTRIBUTE_TYPES
}
enum  FieldOperations { FIELD_OPERATION_PRESERVED, FIELD_OPERATION_REINTERPOLATED, FIELD_OPERATION_MODIFIED, FIELD_OPERATION_REMOVED }
- Public Types inherited from vtkObject

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
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])
double * GetDataPointer ()
void FillFromDataPointer (int, double *)
virtual double * GetRange ()
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 ()
- Public Member Functions inherited from vtkDataObject
virtual vtkAlgorithmOutput * GetProducerPort ()
unsigned long int GetMTime ()
void ReleaseData ()
int ShouldIReleaseData ()
virtual void Register (vtkObjectBase *o)
virtual void UnRegister (vtkObjectBase *o)
virtual void Update ()
virtual void UpdateInformation ()
virtual void PropagateUpdateExtent ()
virtual void TriggerAsynchronousUpdate ()
virtual void UpdateData ()
virtual unsigned long GetEstimatedMemorySize ()
unsigned long GetUpdateTime ()
void SetUpdateExtentToWholeExtent ()
unsigned long GetPipelineMTime ()
virtual unsigned long GetActualMemorySize ()
void CopyInformation (vtkDataObject *data)
virtual void CopyInformationFromPipeline (vtkInformation *request)
void DataHasBeenGenerated ()
virtual void PrepareForNewData ()
virtual int GetExtentType ()
virtual void Crop ()
virtual vtkDataSetAttributes * GetAttributes (int type)
virtual vtkFieldData * GetAttributesAsFieldData (int type)
virtual int GetAttributeTypeForArray (vtkAbstractArray *arr)
virtual vtkIdType GetNumberOfElements (int type)
virtual vtkSource * GetSource ()
void SetSource (vtkSource *s)
virtual vtkInformation * GetInformation ()
virtual void SetInformation (vtkInformation *)
virtual vtkInformation * GetPipelineInformation ()
virtual void SetPipelineInformation (vtkInformation *)
virtual int GetDataReleased ()
void SetReleaseDataFlag (int)
int GetReleaseDataFlag ()
virtual void ReleaseDataFlagOn ()
virtual void ReleaseDataFlagOff ()
virtual void SetFieldData (vtkFieldData *)
virtual vtkFieldData * GetFieldData ()
virtual void SetUpdateExtent (int piece, int numPieces, int ghostLevel)
void SetUpdateExtent (int piece, int numPieces)
virtual void SetUpdateExtent (int x0, int x1, int y0, int y1, int z0, int z1)
virtual void SetUpdateExtent (int extent[6])
virtual int * GetUpdateExtent ()
virtual void GetUpdateExtent (int &x0, int &x1, int &y0, int &y1, int &z0, int &z1)
virtual void GetUpdateExtent (int extent[6])
virtual void CopyTypeSpecificInformation (vtkDataObject *data)
void SetUpdatePiece (int piece)
void SetUpdateNumberOfPieces (int num)
virtual int GetUpdatePiece ()
virtual int GetUpdateNumberOfPieces ()
void SetUpdateGhostLevel (int level)
virtual int GetUpdateGhostLevel ()
virtual void SetRequestExactExtent (int flag)
virtual int GetRequestExactExtent ()
virtual void RequestExactExtentOn ()
virtual void RequestExactExtentOff ()
virtual void SetWholeExtent (int x0, int x1, int y0, int y1, int z0, int z1)
virtual void SetWholeExtent (int extent[6])
virtual int * GetWholeExtent ()
virtual void GetWholeExtent (int &x0, int &x1, int &y0, int &y1, int &z0, int &z1)
virtual void GetWholeExtent (int extent[6])
virtual void SetWholeBoundingBox (double x0, double x1, double y0, double y1, double z0, double z1)
virtual void SetWholeBoundingBox (double bb[6])
virtual double * GetWholeBoundingBox ()
virtual void GetWholeBoundingBox (double &x0, double &x1, double &y0, double &y1, double &z0, double &z1)
virtual void GetWholeBoundingBox (double extent[6])
virtual void SetMaximumNumberOfPieces (int)
virtual int GetMaximumNumberOfPieces ()
virtual void CopyInformationToPipeline (vtkInformation *request, vtkInformation *input, vtkInformation *output, int forceCopy)
void CopyInformationToPipeline (vtkInformation *request, vtkInformation *input)
void SetExtentTranslator (vtkExtentTranslator *translator)
vtkExtentTranslator * GetExtentTranslator ()
void GlobalReleaseDataFlagOn ()
void GlobalReleaseDataFlagOff ()
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
virtual void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char debugFlag)
virtual void Modified ()
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
vtkCommand * GetCommand (unsigned long tag)
void RemoveObserver (vtkCommand *)
void RemoveObservers (unsigned long event, vtkCommand *)
void RemoveObservers (const char *event, vtkCommand *)
int HasObserver (unsigned long event, vtkCommand *)
int HasObserver (const char *event, vtkCommand *)
void RemoveObserver (unsigned long tag)
void RemoveObservers (unsigned long event)
void RemoveObservers (const char *event)
void RemoveAllObservers ()
int HasObserver (unsigned long event)
int HasObserver (const char *event)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
int InvokeEvent (unsigned long event, void *callData)
int InvokeEvent (const char *event, void *callData)
int InvokeEvent (unsigned long event)
int InvokeEvent (const char *event)
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
virtual void Delete ()
virtual void FastDelete ()
void Print (ostream &os)
void SetReferenceCount (int)
void PrintRevisions (ostream &os)
virtual void PrintHeader (ostream &os, vtkIndent indent)
virtual void PrintTrailer (ostream &os, vtkIndent indent)
int GetReferenceCount ()

Static Public Member Functions

static vtkPiecewiseFunction * New ()
static int IsTypeOf (const char *type)
static vtkPiecewiseFunction * SafeDownCast (vtkObject *o)
static vtkPiecewiseFunction * GetData (vtkInformation *info)
static vtkPiecewiseFunction * GetData (vtkInformationVector *v, int i=0)
- Static Public Member Functions inherited from vtkDataObject
static const char * GetAssociationTypeAsString (int associationType)
static vtkInformationStringKey * DATA_TYPE_NAME ()
static
vtkInformationDataObjectKey * 
DATA_OBJECT ()
static vtkInformationIntegerKey * DATA_EXTENT_TYPE ()
static
vtkInformationIntegerPointerKey * 
DATA_EXTENT ()
static vtkInformationIntegerKey * DATA_PIECE_NUMBER ()
static vtkInformationIntegerKey * DATA_NUMBER_OF_PIECES ()
static vtkInformationIntegerKey * DATA_NUMBER_OF_GHOST_LEVELS ()
static vtkInformationDoubleKey * DATA_RESOLUTION ()
static
vtkInformationDoubleVectorKey * 
DATA_TIME_STEPS ()
static
vtkInformationInformationVectorKey * 
POINT_DATA_VECTOR ()
static
vtkInformationInformationVectorKey * 
CELL_DATA_VECTOR ()
static
vtkInformationInformationVectorKey * 
VERTEX_DATA_VECTOR ()
static
vtkInformationInformationVectorKey * 
EDGE_DATA_VECTOR ()
static vtkInformationIntegerKey * FIELD_ARRAY_TYPE ()
static vtkInformationIntegerKey * FIELD_ASSOCIATION ()
static vtkInformationIntegerKey * FIELD_ATTRIBUTE_TYPE ()
static vtkInformationIntegerKey * FIELD_ACTIVE_ATTRIBUTE ()
static vtkInformationIntegerKey * FIELD_NUMBER_OF_COMPONENTS ()
static vtkInformationIntegerKey * FIELD_NUMBER_OF_TUPLES ()
static vtkInformationIntegerKey * FIELD_OPERATION ()
static
vtkInformationDoubleVectorKey * 
FIELD_RANGE ()
static
vtkInformationDoubleVectorKey * 
PIECE_FIELD_RANGE ()
static vtkInformationStringKey * FIELD_ARRAY_NAME ()
static
vtkInformationIntegerVectorKey * 
PIECE_EXTENT ()
static vtkInformationStringKey * FIELD_NAME ()
static
vtkInformationDoubleVectorKey * 
ORIGIN ()
static
vtkInformationDoubleVectorKey * 
SPACING ()
static vtkInformationIntegerKey * DATA_GEOMETRY_UNMODIFIED ()
static
vtkInformationDataObjectKey * 
SIL ()
static vtkInformation * GetActiveFieldInformation (vtkInformation *info, int fieldAssociation, int attributeType)
static vtkInformation * GetNamedFieldInformation (vtkInformation *info, int fieldAssociation, const char *name)
static void RemoveNamedFieldInformation (vtkInformation *info, int fieldAssociation, const char *name)
static vtkInformation * SetActiveAttribute (vtkInformation *info, int fieldAssociation, const char *attributeName, int attributeType)
static void SetActiveAttributeInfo (vtkInformation *info, int fieldAssociation, int attributeType, const char *name, int arrayType, int numComponents, int numTuples)
static void SetPointDataActiveScalarInfo (vtkInformation *info, int arrayType, int numComponents)
static void SetGlobalReleaseDataFlag (int val)
static int GetGlobalReleaseDataFlag ()
- Static Public Member Functions inherited from vtkObject
static void BreakOnError ()
static void SetGlobalWarningDisplay (int val)
static void GlobalWarningDisplayOn ()
static void GlobalWarningDisplayOff ()
static int GetGlobalWarningDisplay ()

Protected Member Functions

 vtkPiecewiseFunction ()
 ~vtkPiecewiseFunction ()
void SortAndUpdateRange ()
- Protected Member Functions inherited from vtkDataObject
 vtkDataObject ()
 ~vtkDataObject ()
vtkExecutive * GetExecutive ()
int GetPortNumber ()
virtual void ReportReferences (vtkGarbageCollector *)
vtkStreamingDemandDrivenPipeline * TrySDDP (const char *method)
- Protected Member Functions inherited from vtkObject
 vtkObject ()
virtual ~vtkObject ()
virtual void RegisterInternal (vtkObjectBase *, int check)
virtual void UnRegisterInternal (vtkObjectBase *, int check)
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
void InternalReleaseFocus ()
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
virtual ~vtkObjectBase ()
virtual void CollectRevisions (ostream &os)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)

Protected Attributes

vtkPiecewiseFunctionInternals * Internal
int Clamping
double * Function
double Range [2]
int AllowDuplicateScalars
- Protected Attributes inherited from vtkDataObject
vtkFieldData * FieldData
vtkSource * Source
int DataReleased
vtkTimeStamp UpdateTime
vtkInformation * Information
vtkInformation * PipelineInformation
- Protected Attributes inherited from vtkObject
unsigned char Debug
vtkTimeStamp MTime
vtkSubjectHelper * SubjectHelper
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
vtkWeakPointerBase ** WeakPointers

Additional Inherited Members

- Protected Types inherited from vtkDataObject
typedef
vtkStreamingDemandDrivenPipeline 
SDDP
- Static Protected Attributes inherited from vtkDataObject
static const char AssociationNames [NUMBER_OF_ASSOCIATIONS][55]

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 49 of file vtkPiecewiseFunction.h.


Member Typedef Documentation

Reimplemented from vtkDataObject.

Definition at line 53 of file vtkPiecewiseFunction.h.


Constructor & Destructor Documentation

vtkPiecewiseFunction::vtkPiecewiseFunction ( )
protected
vtkPiecewiseFunction::~vtkPiecewiseFunction ( )
protected

Member Function Documentation

static 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.

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.

static 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::DeepCopy ( vtkDataObject *  src)
virtual

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

Reimplemented from vtkDataObject.

void vtkPiecewiseFunction::ShallowCopy ( vtkDataObject *  src)
virtual

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

Reimplemented from vtkDataObject.

int vtkPiecewiseFunction::GetDataObjectType ( )
inlinevirtual

Return what type of dataset this is.

Reimplemented from vtkDataObject.

Definition at line 60 of file vtkPiecewiseFunction.h.

int vtkPiecewiseFunction::GetSize ( )

Get the number of points used to specify the function

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

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.

int vtkPiecewiseFunction::RemovePoint ( double  x)

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.

void vtkPiecewiseFunction::RemoveAllPoints ( )

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.

double vtkPiecewiseFunction::GetValue ( double  x)

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

int vtkPiecewiseFunction::GetNodeValue ( int  index,
double  val[4] 
)

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

int vtkPiecewiseFunction::SetNodeValue ( int  index,
double  val[4] 
)

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

double* vtkPiecewiseFunction::GetDataPointer ( )

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.

void vtkPiecewiseFunction::FillFromDataPointer ( int  ,
double *   
)

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.

int vtkPiecewiseFunction::AdjustRange ( double  range[2])

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.

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)

double 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::Initialize ( )
virtual

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.

static vtkPiecewiseFunction* vtkPiecewiseFunction::GetData ( vtkInformation *  info)
static

Retrieve an instance of this class from an information object.

Reimplemented from vtkDataObject.

static vtkPiecewiseFunction* vtkPiecewiseFunction::GetData ( vtkInformationVector *  v,
int  i = 0 
)
static

Retrieve an instance of this class from an information object.

Reimplemented from vtkDataObject.

virtual void vtkPiecewiseFunction::SetAllowDuplicateScalars ( int  )
virtual

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

virtual int vtkPiecewiseFunction::GetAllowDuplicateScalars ( )
virtual

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

virtual void vtkPiecewiseFunction::AllowDuplicateScalarsOn ( )
virtual

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

virtual void vtkPiecewiseFunction::AllowDuplicateScalarsOff ( )
virtual

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

void vtkPiecewiseFunction::SortAndUpdateRange ( )
protected

Member Data Documentation

vtkPiecewiseFunctionInternals* vtkPiecewiseFunction::Internal
protected

Definition at line 178 of file vtkPiecewiseFunction.h.

int vtkPiecewiseFunction::Clamping
protected

Definition at line 184 of file vtkPiecewiseFunction.h.

double* vtkPiecewiseFunction::Function
protected

Definition at line 187 of file vtkPiecewiseFunction.h.

double vtkPiecewiseFunction::Range[2]
protected

Definition at line 190 of file vtkPiecewiseFunction.h.

int vtkPiecewiseFunction::AllowDuplicateScalars
protected

Definition at line 196 of file vtkPiecewiseFunction.h.


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