00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00039
#ifndef __vtkSampleFunction_h
00040
#define __vtkSampleFunction_h
00041
00042
#include "vtkImageSource.h"
00043
00044
class vtkImplicitFunction;
00045
class vtkDataArray;
00046
00047 class VTK_IMAGING_EXPORT vtkSampleFunction :
public vtkImageSource
00048 {
00049
public:
00050 vtkTypeRevisionMacro(vtkSampleFunction,
vtkImageSource);
00051
void PrintSelf(ostream& os,
vtkIndent indent);
00052
00056
static vtkSampleFunction *
New();
00057
00059
00060
virtual void SetImplicitFunction(
vtkImplicitFunction*);
00061 vtkGetObjectMacro(ImplicitFunction,
vtkImplicitFunction);
00063
00065
00066 vtkSetMacro(OutputScalarType,
int);
00067 vtkGetMacro(OutputScalarType,
int);
00068 void SetOutputScalarTypeToDouble()
00069 {this->SetOutputScalarType(
VTK_DOUBLE);}
00070 void SetOutputScalarTypeToFloat()
00071 {this->SetOutputScalarType(
VTK_FLOAT);}
00072 void SetOutputScalarTypeToLong()
00073 {this->SetOutputScalarType(
VTK_LONG);}
00074 void SetOutputScalarTypeToUnsignedLong()
00075 {this->SetOutputScalarType(
VTK_UNSIGNED_LONG);};
00076 void SetOutputScalarTypeToInt()
00077 {this->SetOutputScalarType(
VTK_INT);}
00078 void SetOutputScalarTypeToUnsignedInt()
00079 {this->SetOutputScalarType(
VTK_UNSIGNED_INT);}
00080 void SetOutputScalarTypeToShort()
00081 {this->SetOutputScalarType(
VTK_SHORT);}
00082 void SetOutputScalarTypeToUnsignedShort()
00083 {this->SetOutputScalarType(
VTK_UNSIGNED_SHORT);}
00084 void SetOutputScalarTypeToChar()
00085 {this->SetOutputScalarType(
VTK_CHAR);}
00086 void SetOutputScalarTypeToUnsignedChar()
00087 {this->SetOutputScalarType(
VTK_UNSIGNED_CHAR);}
00089
00093
virtual void SetScalars(
vtkDataArray *da);
00094
00096
void SetSampleDimensions(
int i,
int j,
int k);
00097
00099
00100
void SetSampleDimensions(
int dim[3]);
00101 vtkGetVectorMacro(SampleDimensions,
int,3);
00103
00105
00106 vtkSetVector6Macro(ModelBounds,
float);
00107 vtkGetVectorMacro(ModelBounds,
float,6);
00109
00111
00114 vtkSetMacro(Capping,
int);
00115 vtkGetMacro(Capping,
int);
00116 vtkBooleanMacro(Capping,
int);
00118
00120
00121 vtkSetMacro(CapValue,
float);
00122 vtkGetMacro(CapValue,
float);
00124
00126
00127 vtkSetMacro(ComputeNormals,
int);
00128 vtkGetMacro(ComputeNormals,
int);
00129 vtkBooleanMacro(ComputeNormals,
int);
00131
00133
unsigned long GetMTime();
00134
00135
protected:
00136 vtkSampleFunction();
00137 ~vtkSampleFunction();
00138
00139
void ExecuteData(
vtkDataObject *);
00140
void ExecuteInformation();
00141
void Cap(
vtkDataArray *s);
00142
00143 int OutputScalarType;
00144 int SampleDimensions[3];
00145 float ModelBounds[6];
00146 int Capping;
00147 float CapValue;
00148 vtkImplicitFunction *ImplicitFunction;
00149 int ComputeNormals;
00150
private:
00151 vtkSampleFunction(
const vtkSampleFunction&);
00152
void operator=(
const vtkSampleFunction&);
00153 };
00154
00155
#endif
00156
00157