Filtering/vtkPiecewiseFunction.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00030 #ifndef __vtkPiecewiseFunction_h
00031 #define __vtkPiecewiseFunction_h
00032
00033 #include "vtkDataObject.h"
00034
00035 class VTK_FILTERING_EXPORT vtkPiecewiseFunction : public vtkDataObject
00036 {
00037 public:
00038 static vtkPiecewiseFunction *New();
00039 vtkTypeRevisionMacro(vtkPiecewiseFunction,vtkDataObject);
00040 void PrintSelf(ostream& os, vtkIndent indent);
00041
00042 void Initialize();
00043 void DeepCopy( vtkDataObject *f );
00044 void ShallowCopy( vtkDataObject *f );
00045
00047 int GetDataObjectType() {return VTK_PIECEWISE_FUNCTION;};
00048
00050 int GetSize();
00051
00053
00056 int AddPoint( double x, double val );
00057 int RemovePoint( double x );
00059
00061 void RemoveAllPoints();
00062
00065 void AddSegment( double x1, double val1, double x2, double val2 );
00066
00070 double GetValue( double x );
00071
00073
00075 double *GetDataPointer() {return this->Function;};
00076 void FillFromDataPointer(int, double*);
00078
00080 double *GetRange();
00081
00083
00087 void GetTable( double x1, double x2, int size, float *table, int stride=1 );
00088 void GetTable( double x1, double x2, int size, double *table, int stride=1 );
00090
00092
00097 void BuildFunctionFromTable( double x1, double x2, int size,
00098 double *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 double GetFirstNonZeroValue();
00127
00128 protected:
00129 vtkPiecewiseFunction();
00130 ~vtkPiecewiseFunction();
00131
00132
00133 int ArraySize;
00134
00135
00136
00137
00138
00139 int Clamping;
00140
00141
00142 double *Function;
00143
00144
00145 int FunctionSize;
00146
00147
00148 double FunctionRange[2];
00149
00150
00151
00152 void IncreaseArraySize();
00153
00154
00155
00156 int InsertPoint( double x, double 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