VTK
|
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 "vtkImagingHybridModule.h" // For export macro 00039 #include "vtkImageAlgorithm.h" 00040 00041 class vtkImplicitFunction; 00042 class vtkDataArray; 00043 00044 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm 00045 { 00046 public: 00047 vtkTypeMacro(vtkSampleFunction,vtkImageAlgorithm); 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 00053 static vtkSampleFunction *New(); 00054 00056 00057 virtual void SetImplicitFunction(vtkImplicitFunction*); 00058 vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction); 00060 00062 00063 vtkSetMacro(OutputScalarType,int); 00064 vtkGetMacro(OutputScalarType,int); 00065 void SetOutputScalarTypeToDouble() 00066 {this->SetOutputScalarType(VTK_DOUBLE);} 00067 void SetOutputScalarTypeToFloat() 00068 {this->SetOutputScalarType(VTK_FLOAT);} 00069 void SetOutputScalarTypeToLong() 00070 {this->SetOutputScalarType(VTK_LONG);} 00071 void SetOutputScalarTypeToUnsignedLong() 00072 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}; 00073 void SetOutputScalarTypeToInt() 00074 {this->SetOutputScalarType(VTK_INT);} 00075 void SetOutputScalarTypeToUnsignedInt() 00076 {this->SetOutputScalarType(VTK_UNSIGNED_INT);} 00077 void SetOutputScalarTypeToShort() 00078 {this->SetOutputScalarType(VTK_SHORT);} 00079 void SetOutputScalarTypeToUnsignedShort() 00080 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);} 00081 void SetOutputScalarTypeToChar() 00082 {this->SetOutputScalarType(VTK_CHAR);} 00083 void SetOutputScalarTypeToUnsignedChar() 00084 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);} 00086 00090 VTK_LEGACY(virtual void SetScalars(vtkDataArray *da)); 00091 00093 void SetSampleDimensions(int i, int j, int k); 00094 00096 00097 void SetSampleDimensions(int dim[3]); 00098 vtkGetVectorMacro(SampleDimensions,int,3); 00100 00102 00104 void SetModelBounds(double bounds[6]); 00105 void SetModelBounds(double xMin, double xMax, 00106 double yMin, double yMax, 00107 double zMin, double zMax); 00108 vtkGetVectorMacro(ModelBounds,double,6); 00110 00112 00115 vtkSetMacro(Capping,int); 00116 vtkGetMacro(Capping,int); 00117 vtkBooleanMacro(Capping,int); 00119 00121 00122 vtkSetMacro(CapValue,double); 00123 vtkGetMacro(CapValue,double); 00125 00127 00128 vtkSetMacro(ComputeNormals,int); 00129 vtkGetMacro(ComputeNormals,int); 00130 vtkBooleanMacro(ComputeNormals,int); 00132 00134 00136 vtkSetStringMacro(ScalarArrayName); 00137 vtkGetStringMacro(ScalarArrayName); 00139 00141 00143 vtkSetStringMacro(NormalArrayName); 00144 vtkGetStringMacro(NormalArrayName); 00146 00148 unsigned long GetMTime(); 00149 00150 protected: 00156 vtkSampleFunction(); 00157 00158 ~vtkSampleFunction(); 00159 00160 virtual void ReportReferences(vtkGarbageCollector*); 00161 00162 void ExecuteDataWithInformation(vtkDataObject *, vtkInformation *); 00163 virtual int RequestInformation (vtkInformation *, 00164 vtkInformationVector **, 00165 vtkInformationVector *); 00166 void Cap(vtkDataArray *s); 00167 00168 int OutputScalarType; 00169 int SampleDimensions[3]; 00170 double ModelBounds[6]; 00171 int Capping; 00172 double CapValue; 00173 vtkImplicitFunction *ImplicitFunction; 00174 int ComputeNormals; 00175 char *ScalarArrayName; 00176 char *NormalArrayName; 00177 00178 private: 00179 vtkSampleFunction(const vtkSampleFunction&); // Not implemented. 00180 void operator=(const vtkSampleFunction&); // Not implemented. 00181 }; 00182 00183 #endif 00184 00185