VTK
vtkMarchingContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMarchingContourFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
57 #ifndef vtkMarchingContourFilter_h
58 #define vtkMarchingContourFilter_h
59 
60 #include "vtkFiltersGeneralModule.h" // For export macro
61 #include "vtkPolyDataAlgorithm.h"
62 
63 #include "vtkContourValues.h" // Needed for direct access to ContourValues
64 
66 class vtkScalarTree;
67 
68 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
73 
79 
81 
84  void SetValue(int i, double value);
85  double GetValue(int i);
86  double *GetValues();
87  void GetValues(double *contourValues);
88  void SetNumberOfContours(int number);
89  int GetNumberOfContours();
90  void GenerateValues(int numContours, double range[2]);
91  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
93 
97  vtkMTimeType GetMTime() VTK_OVERRIDE;
98 
100 
106  vtkSetMacro(ComputeNormals,int);
107  vtkGetMacro(ComputeNormals,int);
108  vtkBooleanMacro(ComputeNormals,int);
110 
112 
120  vtkSetMacro(ComputeGradients,int);
121  vtkGetMacro(ComputeGradients,int);
122  vtkBooleanMacro(ComputeGradients,int);
124 
126 
129  vtkSetMacro(ComputeScalars,int);
130  vtkGetMacro(ComputeScalars,int);
131  vtkBooleanMacro(ComputeScalars,int);
133 
135 
138  vtkSetMacro(UseScalarTree,int);
139  vtkGetMacro(UseScalarTree,int);
140  vtkBooleanMacro(UseScalarTree,int);
142 
144 
148  void SetLocator(vtkIncrementalPointLocator *locator);
149  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
151 
156  void CreateDefaultLocator();
157 
158 protected:
160  ~vtkMarchingContourFilter() VTK_OVERRIDE;
161 
162  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
163  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
164 
165  vtkContourValues *ContourValues;
166  int ComputeNormals;
167  int ComputeGradients;
168  int ComputeScalars;
170  int UseScalarTree;
171  vtkScalarTree *ScalarTree;
172 
173  //special contouring for structured points
174  void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output);
175  //special contouring for image data
176  void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output);
177  //default if not structured data
178  void DataSetContour(vtkDataSet *input, vtkPolyData *output);
179 private:
180  vtkMarchingContourFilter(const vtkMarchingContourFilter&) VTK_DELETE_FUNCTION;
181  void operator=(const vtkMarchingContourFilter&) VTK_DELETE_FUNCTION;
182 };
183 
188 inline void vtkMarchingContourFilter::SetValue(int i, double value)
189 {
190  this->ContourValues->SetValue(i,value);
191 }
192 
197 {
198  return this->ContourValues->GetValue(i);
199 }
200 
206 {
207  return this->ContourValues->GetValues();
208 }
209 
215 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
216 {
217  this->ContourValues->GetValues(contourValues);
218 }
219 
226 {
227  this->ContourValues->SetNumberOfContours(number);
228 }
229 
234 {
235  return this->ContourValues->GetNumberOfContours();
236 }
237 
242 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
243  double range[2])
244 {
245  this->ContourValues->GenerateValues(numContours, range);
246 }
247 
252 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
253  double rangeStart,
254  double rangeEnd)
255 {
256  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
257 }
258 
259 #endif
vtkMarchingContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingContourFilter.h:242
vtkMarchingContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingContourFilter.h:196
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkMarchingContourFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkMarchingContourFilter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingContourFilter.h:233
vtkMarchingContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkMarchingContourFilter.h:69
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkPolyDataAlgorithm.h
vtkMarchingContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingContourFilter.h:225
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMarchingContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingContourFilter.h:205
vtkMarchingContourFilter::GetMTime
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:36
vtkMarchingContourFilter::New
static vtkMarchingContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:52
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkContourValues.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:45