OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / HP / util / HP / include / vtk / vtkSampleFunction.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkSampleFunction.h,v $
5   Language:  C++
6   Date:      $Date: 2002/02/01 06:33:20 $
7   Version:   $Revision: 1.1.1.1 $
8
9
10 Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
11
12 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
13 The following terms apply to all files associated with the software unless
14 explicitly disclaimed in individual files. This copyright specifically does
15 not apply to the related textbook "The Visualization Toolkit" ISBN
16 013199837-4 published by Prentice Hall which is covered by its own copyright.
17
18 The authors hereby grant permission to use, copy, and distribute this
19 software and its documentation for any purpose, provided that existing
20 copyright notices are retained in all copies and that this notice is included
21 verbatim in any distributions. Additionally, the authors grant permission to
22 modify this software and its documentation for any purpose, provided that
23 such modifications are not distributed without the explicit consent of the
24 authors and that existing copyright notices are retained in all copies. Some
25 of the algorithms implemented by this software are patented, observe all
26 applicable patent law.
27
28 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
29 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
30 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
31 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
34 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
35 PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON AN
36 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
37 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
38
39
40 =========================================================================*/
41 // .NAME vtkSampleFunction - sample an implicit function over a structured point set
42 // .SECTION Description
43 // vtkSampleFunction is a source object that evaluates an implicit function
44 // and normals at each point in a vtkStructuredPoints. The user can 
45 // specify the sample dimensions and location in space to perform the
46 // sampling. To create closed surfaces (in conjunction with the 
47 // vtkContourFilter), capping can be turned on to set a particular 
48 // value on the boundaries of the sample space.
49 // .SECTION See Also
50 // vtkImplicitModeller
51
52 #ifndef __vtkSampleFunction_h
53 #define __vtkSampleFunction_h
54
55 #include "vtkStructuredPointsSource.h"
56 #include "vtkImplicitFunction.h"
57
58 class VTK_EXPORT vtkSampleFunction : public vtkStructuredPointsSource
59 {
60 public:
61   vtkSampleFunction();
62   ~vtkSampleFunction();
63   static vtkSampleFunction *New() {return new vtkSampleFunction;};
64   const char *GetClassName() {return "vtkSampleFunction";};
65   void PrintSelf(ostream& os, vtkIndent indent);
66
67   // Description:
68   // Specify the implicit function to use to generate data.
69   vtkSetObjectMacro(ImplicitFunction,vtkImplicitFunction);
70   vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction);
71
72   // Description:
73   // Control the type of the vtkScalars object by explicitly providing a scalar
74   // object.  vtkSampleFunction() will allocate space (as necessary)
75   // in the scalar object.
76   vtkSetObjectMacro(Scalars,vtkScalars);
77
78   void SetSampleDimensions(int i, int j, int k);
79   void SetSampleDimensions(int dim[3]);
80   vtkGetVectorMacro(SampleDimensions,int,3);
81
82   // Description:
83   // Specify the region in space over which the sampling occurs.
84   vtkSetVectorMacro(ModelBounds,float,6);
85   vtkGetVectorMacro(ModelBounds,float,6);
86
87   void SetModelBounds(float xmin, float xmax, float ymin, float ymax, 
88                       float zmin, float zmax);
89
90   // Description:
91   // Turn on/off capping. If capping is on, then the outer boundaries of the
92   // structured point set are set to cap value. This can be used to insure
93   // surfaces are closed.
94   vtkSetMacro(Capping,int);
95   vtkGetMacro(Capping,int);
96   vtkBooleanMacro(Capping,int);
97   
98   // Description:
99   // Set the cap value.
100   vtkSetMacro(CapValue,float);
101   vtkGetMacro(CapValue,float);
102
103   // Description:
104   // Turn on/off the computation of normals.
105   vtkSetMacro(ComputeNormals,int);
106   vtkGetMacro(ComputeNormals,int);
107   vtkBooleanMacro(ComputeNormals,int);
108
109   unsigned long int GetMTime();
110
111 protected:
112   void Execute();
113   void Cap(vtkScalars *s);
114
115   int SampleDimensions[3];
116   float ModelBounds[6];
117   vtkScalars *Scalars;
118   int Capping;
119   float CapValue;
120   vtkImplicitFunction *ImplicitFunction;
121   int ComputeNormals;
122 };
123
124 #endif
125
126