OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkImplicitDataSet.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkImplicitDataSet.h,v $
5   Language:  C++
6   Date:      $Date: 2002/10/04 20:43:44 $
7   Version:   $Revision: 1.26 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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.
24 //
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.
31
32 // .SECTION Caveats
33 // Any type of dataset can be used as an implicit function as long as it
34 // has scalar data associated with it.
35
36 // .SECTION See Also
37 // vtkImplicitFunction vtkImplicitVolume vtkClipPolyData vtkCutter
38 // vtkImplicitWindowFunction
39
40 #ifndef __vtkImplicitDataSet_h
41 #define __vtkImplicitDataSet_h
42
43 #include "vtkImplicitFunction.h"
44
45 class vtkDataSet;
46
47 class VTK_FILTERING_EXPORT vtkImplicitDataSet : public vtkImplicitFunction
48 {
49 public:
50   vtkTypeRevisionMacro(vtkImplicitDataSet,vtkImplicitFunction);
51   void PrintSelf(ostream& os, vtkIndent indent);
52
53   // Description
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();
57
58   // Description:
59   // Return the MTime also considering the DataSet dependency.
60   unsigned long GetMTime();
61
62   // Description
63   // Evaluate the implicit function. This returns the interpolated scalar value
64   // at x[3].
65   float EvaluateFunction(float x[3]);
66   float EvaluateFunction(float x, float y, float z)
67     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
68
69   // Description
70   // Evaluate implicit function gradient.
71   void EvaluateGradient(float x[3], float n[3]);
72
73   // Description:
74   // Set / get the dataset used for the implicit function evaluation.
75   virtual void SetDataSet(vtkDataSet*);
76   vtkGetObjectMacro(DataSet,vtkDataSet);
77
78   // Description:
79   // Set / get the function value to use for points outside of the dataset.
80   vtkSetMacro(OutValue,float);
81   vtkGetMacro(OutValue,float);
82
83   // Description:
84   // Set / get the function gradient to use for points outside of the dataset.
85   vtkSetVector3Macro(OutGradient,float);
86   vtkGetVector3Macro(OutGradient,float);
87
88 protected:
89   vtkImplicitDataSet();
90   ~vtkImplicitDataSet();
91
92   vtkDataSet *DataSet;
93   float OutValue;
94   float OutGradient[3];
95
96   float *Weights; //used to compute interpolation weights
97   int Size; //keeps track of length of weights array
98
99 private:
100   vtkImplicitDataSet(const vtkImplicitDataSet&);  // Not implemented.
101   void operator=(const vtkImplicitDataSet&);  // Not implemented.
102 };
103
104 #endif
105
106