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

vtkSampleFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSampleFunction.h,v $
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 =========================================================================*/
00047 #ifndef __vtkSampleFunction_h
00048 #define __vtkSampleFunction_h
00049 
00050 #include "vtkImageSource.h"
00051 
00052 class vtkImplicitFunction;
00053 class vtkDataArray;
00054 
00055 class VTK_IMAGING_EXPORT vtkSampleFunction : public vtkImageSource
00056 {
00057 public:
00058   vtkTypeRevisionMacro(vtkSampleFunction,vtkImageSource);
00059   void PrintSelf(ostream& os, vtkIndent indent);
00060 
00064   static vtkSampleFunction *New();
00065 
00067 
00068   virtual void SetImplicitFunction(vtkImplicitFunction*);
00069   vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction);
00071 
00073 
00074   vtkSetMacro(OutputScalarType,int);
00075   vtkGetMacro(OutputScalarType,int);
00076   void SetOutputScalarTypeToDouble()
00077     {this->SetOutputScalarType(VTK_DOUBLE);}
00078   void SetOutputScalarTypeToFloat()
00079     {this->SetOutputScalarType(VTK_FLOAT);}
00080   void SetOutputScalarTypeToLong()
00081     {this->SetOutputScalarType(VTK_LONG);}
00082   void SetOutputScalarTypeToUnsignedLong()
00083     {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
00084   void SetOutputScalarTypeToInt()
00085     {this->SetOutputScalarType(VTK_INT);}
00086   void SetOutputScalarTypeToUnsignedInt()
00087     {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
00088   void SetOutputScalarTypeToShort()
00089     {this->SetOutputScalarType(VTK_SHORT);}
00090   void SetOutputScalarTypeToUnsignedShort()
00091     {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
00092   void SetOutputScalarTypeToChar()
00093     {this->SetOutputScalarType(VTK_CHAR);}
00094   void SetOutputScalarTypeToUnsignedChar()
00095     {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
00097 
00101   virtual void SetScalars(vtkDataArray *da);
00102 
00104   void SetSampleDimensions(int i, int j, int k);
00105 
00107 
00108   void SetSampleDimensions(int dim[3]);
00109   vtkGetVectorMacro(SampleDimensions,int,3);
00111 
00113 
00115   vtkSetVector6Macro(ModelBounds,double);
00116   vtkGetVectorMacro(ModelBounds,double,6);
00118 
00120 
00123   vtkSetMacro(Capping,int);
00124   vtkGetMacro(Capping,int);
00125   vtkBooleanMacro(Capping,int);
00127   
00129 
00130   vtkSetMacro(CapValue,double);
00131   vtkGetMacro(CapValue,double);
00133 
00135 
00136   vtkSetMacro(ComputeNormals,int);
00137   vtkGetMacro(ComputeNormals,int);
00138   vtkBooleanMacro(ComputeNormals,int);
00140 
00142   unsigned long GetMTime();
00143 
00144 protected:
00145   vtkSampleFunction();
00146   ~vtkSampleFunction();
00147 
00148   virtual void ReportReferences(vtkGarbageCollector*);
00149   virtual void RemoveReferences();
00150 
00151   void ExecuteData(vtkDataObject *);
00152   void ExecuteInformation();
00153   void Cap(vtkDataArray *s);
00154 
00155   int OutputScalarType;
00156   int SampleDimensions[3];
00157   double ModelBounds[6];
00158   int Capping;
00159   double CapValue;
00160   vtkImplicitFunction *ImplicitFunction;
00161   int ComputeNormals;
00162 private:
00163   vtkSampleFunction(const vtkSampleFunction&);  // Not implemented.
00164   void operator=(const vtkSampleFunction&);  // Not implemented.
00165 };
00166 
00167 #endif
00168 
00169