1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkImplicitDataSet.h,v $
6 Date: $Date: 2002/10/04 20:43:44 $
7 Version: $Revision: 1.26 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkImplicitDataSet - treat a dataset as if it were an implicit function
19 // .SECTION Description
20 // vtkImplicitDataSet treats any type of dataset as if it were an
21 // implicit function. This means it computes a function value and
22 // gradient. vtkImplicitDataSet is a concrete implementation of
23 // vtkImplicitFunction.
25 // vtkImplicitDataSet computes the function (at the point x) by performing
26 // cell interpolation. That is, it finds the cell containing x, and then
27 // uses the cell's interpolation functions to compute an interpolated
28 // scalar value at x. (A similar approach is used to find the
29 // gradient, if requested.) Points outside of the dataset are assigned
30 // the value of the ivar OutValue, and the gradient value OutGradient.
33 // Any type of dataset can be used as an implicit function as long as it
34 // has scalar data associated with it.
37 // vtkImplicitFunction vtkImplicitVolume vtkClipPolyData vtkCutter
38 // vtkImplicitWindowFunction
40 #ifndef __vtkImplicitDataSet_h
41 #define __vtkImplicitDataSet_h
43 #include "vtkImplicitFunction.h"
47 class VTK_FILTERING_EXPORT vtkImplicitDataSet : public vtkImplicitFunction
50 vtkTypeRevisionMacro(vtkImplicitDataSet,vtkImplicitFunction);
51 void PrintSelf(ostream& os, vtkIndent indent);
54 // Construct an vtkImplicitDataSet with no initial dataset; the OutValue
55 // set to a large negative number; and the OutGradient set to (0,0,1).
56 static vtkImplicitDataSet *New();
59 // Return the MTime also considering the DataSet dependency.
60 unsigned long GetMTime();
63 // Evaluate the implicit function. This returns the interpolated scalar value
65 float EvaluateFunction(float x[3]);
66 float EvaluateFunction(float x, float y, float z)
67 {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
70 // Evaluate implicit function gradient.
71 void EvaluateGradient(float x[3], float n[3]);
74 // Set / get the dataset used for the implicit function evaluation.
75 virtual void SetDataSet(vtkDataSet*);
76 vtkGetObjectMacro(DataSet,vtkDataSet);
79 // Set / get the function value to use for points outside of the dataset.
80 vtkSetMacro(OutValue,float);
81 vtkGetMacro(OutValue,float);
84 // Set / get the function gradient to use for points outside of the dataset.
85 vtkSetVector3Macro(OutGradient,float);
86 vtkGetVector3Macro(OutGradient,float);
90 ~vtkImplicitDataSet();
96 float *Weights; //used to compute interpolation weights
97 int Size; //keeps track of length of weights array
100 vtkImplicitDataSet(const vtkImplicitDataSet&); // Not implemented.
101 void operator=(const vtkImplicitDataSet&); // Not implemented.