Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Imaging/vtkSampleFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSampleFunction.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
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&);  // Not implemented.
00152   void operator=(const vtkSampleFunction&);  // Not implemented.
00153 };
00154 
00155 #endif
00156 
00157