VTK
dox/Imaging/vtkSampleFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSampleFunction.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00035 #ifndef __vtkSampleFunction_h
00036 #define __vtkSampleFunction_h
00037 
00038 #include "vtkImageAlgorithm.h"
00039 
00040 class vtkImplicitFunction;
00041 class vtkDataArray;
00042 
00043 class VTK_IMAGING_EXPORT vtkSampleFunction : public vtkImageAlgorithm
00044 {
00045 public:
00046   vtkTypeMacro(vtkSampleFunction,vtkImageAlgorithm);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048 
00052   static vtkSampleFunction *New();
00053 
00055 
00056   virtual void SetImplicitFunction(vtkImplicitFunction*);
00057   vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction);
00059 
00061 
00062   vtkSetMacro(OutputScalarType,int);
00063   vtkGetMacro(OutputScalarType,int);
00064   void SetOutputScalarTypeToDouble()
00065     {this->SetOutputScalarType(VTK_DOUBLE);}
00066   void SetOutputScalarTypeToFloat()
00067     {this->SetOutputScalarType(VTK_FLOAT);}
00068   void SetOutputScalarTypeToLong()
00069     {this->SetOutputScalarType(VTK_LONG);}
00070   void SetOutputScalarTypeToUnsignedLong()
00071     {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
00072   void SetOutputScalarTypeToInt()
00073     {this->SetOutputScalarType(VTK_INT);}
00074   void SetOutputScalarTypeToUnsignedInt()
00075     {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
00076   void SetOutputScalarTypeToShort()
00077     {this->SetOutputScalarType(VTK_SHORT);}
00078   void SetOutputScalarTypeToUnsignedShort()
00079     {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
00080   void SetOutputScalarTypeToChar()
00081     {this->SetOutputScalarType(VTK_CHAR);}
00082   void SetOutputScalarTypeToUnsignedChar()
00083     {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
00085 
00089   virtual void SetScalars(vtkDataArray *da);
00090 
00092   void SetSampleDimensions(int i, int j, int k);
00093 
00095 
00096   void SetSampleDimensions(int dim[3]);
00097   vtkGetVectorMacro(SampleDimensions,int,3);
00099 
00101 
00103   vtkSetVector6Macro(ModelBounds,double);
00104   vtkGetVectorMacro(ModelBounds,double,6);
00106 
00108 
00111   vtkSetMacro(Capping,int);
00112   vtkGetMacro(Capping,int);
00113   vtkBooleanMacro(Capping,int);
00115   
00117 
00118   vtkSetMacro(CapValue,double);
00119   vtkGetMacro(CapValue,double);
00121 
00123 
00124   vtkSetMacro(ComputeNormals,int);
00125   vtkGetMacro(ComputeNormals,int);
00126   vtkBooleanMacro(ComputeNormals,int);
00128 
00130 
00132   vtkSetStringMacro(ScalarArrayName);
00133   vtkGetStringMacro(ScalarArrayName);
00135   
00137 
00139   vtkSetStringMacro(NormalArrayName);
00140   vtkGetStringMacro(NormalArrayName);
00142   
00144   unsigned long GetMTime();
00145 
00146 protected:
00152   vtkSampleFunction();
00153   
00154   ~vtkSampleFunction();
00155 
00156   virtual void ReportReferences(vtkGarbageCollector*);
00157 
00158   void ExecuteData(vtkDataObject *);
00159   virtual int RequestInformation (vtkInformation *, 
00160                                   vtkInformationVector **,
00161                                   vtkInformationVector *);
00162   void Cap(vtkDataArray *s);
00163 
00164   int OutputScalarType;
00165   int SampleDimensions[3];
00166   double ModelBounds[6];
00167   int Capping;
00168   double CapValue;
00169   vtkImplicitFunction *ImplicitFunction;
00170   int ComputeNormals;
00171   char *ScalarArrayName;
00172   char *NormalArrayName;
00173   
00174 private:
00175   vtkSampleFunction(const vtkSampleFunction&);  // Not implemented.
00176   void operator=(const vtkSampleFunction&);  // Not implemented.
00177 };
00178 
00179 #endif
00180 
00181