vtkPiecewiseFunction.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00034 #ifndef __vtkPiecewiseFunction_h
00035 #define __vtkPiecewiseFunction_h
00036
00037 #include "vtkDataObject.h"
00038
00039 class VTK_FILTERING_EXPORT vtkPiecewiseFunction : public vtkDataObject
00040 {
00041 public:
00042 static vtkPiecewiseFunction *New();
00043 vtkTypeRevisionMacro(vtkPiecewiseFunction,vtkDataObject);
00044 void PrintSelf(ostream& os, vtkIndent indent);
00045
00046 void Initialize();
00047 void DeepCopy( vtkDataObject *f );
00048 void ShallowCopy( vtkDataObject *f );
00049
00051 int GetDataObjectType() {return VTK_PIECEWISE_FUNCTION;};
00052
00054 int GetSize();
00055
00057
00059 void AddPoint( float x, float val );
00060 void RemovePoint( float x );
00062
00064 void RemoveAllPoints();
00065
00068 void AddSegment( float x1, float val1, float x2, float val2 );
00069
00073 float GetValue( float x );
00074
00076
00078 float *GetDataPointer() {return this->Function;};
00079 void FillFromDataPointer(int, float*);
00081
00083 float *GetRange();
00084
00089 void GetTable( float x1, float x2, int size, float *table, int stride=1 );
00090
00092
00097 void BuildFunctionFromTable( float x1, float x2, int size,
00098 float *table, int stride=1 );
00100
00102
00108 vtkSetMacro( Clamping, int );
00109 vtkGetMacro( Clamping, int );
00110 vtkBooleanMacro( Clamping, int );
00112
00118 const char *GetType();
00119
00122 unsigned long GetMTime();
00123
00126 float GetFirstNonZeroValue();
00127
00128 protected:
00129 vtkPiecewiseFunction();
00130 ~vtkPiecewiseFunction();
00131
00132
00133 int ArraySize;
00134
00135
00136
00137
00138
00139 int Clamping;
00140
00141
00142 float *Function;
00143
00144
00145 int FunctionSize;
00146
00147
00148 float FunctionRange[2];
00149
00150
00151
00152 void IncreaseArraySize();
00153
00154
00155
00156 int InsertPoint( float x, float val );
00157
00158
00159
00160 void MovePoints( int index, int down );
00161 private:
00162 vtkPiecewiseFunction(const vtkPiecewiseFunction&);
00163 void operator=(const vtkPiecewiseFunction&);
00164 };
00165
00166 #endif
00167