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 =========================================================================*/
54 #ifndef vtkMarchingContourFilter_h
55 #define vtkMarchingContourFilter_h
56 
57 #include "vtkFiltersGeneralModule.h" // For export macro
58 #include "vtkPolyDataAlgorithm.h"
59 
60 #include "vtkContourValues.h" // Needed for direct access to ContourValues
61 
63 class vtkScalarTree;
64 
65 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70 
75  static vtkMarchingContourFilter *New();
76 
78 
81  void SetValue(int i, double value);
82  double GetValue(int i);
83  double *GetValues();
84  void GetValues(double *contourValues);
85  void SetNumberOfContours(int number);
86  int GetNumberOfContours();
87  void GenerateValues(int numContours, double range[2]);
88  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
90 
94  vtkMTimeType GetMTime() VTK_OVERRIDE;
95 
97 
103  vtkSetMacro(ComputeNormals,int);
104  vtkGetMacro(ComputeNormals,int);
105  vtkBooleanMacro(ComputeNormals,int);
107 
109 
117  vtkSetMacro(ComputeGradients,int);
118  vtkGetMacro(ComputeGradients,int);
119  vtkBooleanMacro(ComputeGradients,int);
121 
123 
126  vtkSetMacro(ComputeScalars,int);
127  vtkGetMacro(ComputeScalars,int);
128  vtkBooleanMacro(ComputeScalars,int);
130 
132 
135  vtkSetMacro(UseScalarTree,int);
136  vtkGetMacro(UseScalarTree,int);
137  vtkBooleanMacro(UseScalarTree,int);
139 
141 
145  void SetLocator(vtkIncrementalPointLocator *locator);
146  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
148 
153  void CreateDefaultLocator();
154 
155 protected:
157  ~vtkMarchingContourFilter() VTK_OVERRIDE;
158 
159  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
160  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
161 
162  vtkContourValues *ContourValues;
163  int ComputeNormals;
164  int ComputeGradients;
165  int ComputeScalars;
166  vtkIncrementalPointLocator *Locator;
167  int UseScalarTree;
168  vtkScalarTree *ScalarTree;
169 
170  //special contouring for structured points
171  void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output);
172  //special contouring for image data
173  void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output);
174  //default if not structured data
175  void DataSetContour(vtkDataSet *input, vtkPolyData *output);
176 private:
177  vtkMarchingContourFilter(const vtkMarchingContourFilter&) VTK_DELETE_FUNCTION;
178  void operator=(const vtkMarchingContourFilter&) VTK_DELETE_FUNCTION;
179 };
180 
185 inline void vtkMarchingContourFilter::SetValue(int i, double value)
186 {
187  this->ContourValues->SetValue(i,value);
188 }
189 
194 {
195  return this->ContourValues->GetValue(i);
196 }
197 
203 {
204  return this->ContourValues->GetValues();
205 }
206 
212 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
213 {
214  this->ContourValues->GetValues(contourValues);
215 }
216 
223 {
224  this->ContourValues->SetNumberOfContours(number);
225 }
226 
231 {
232  return this->ContourValues->GetNumberOfContours();
233 }
234 
239 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
240  double range[2])
241 {
242  this->ContourValues->GenerateValues(numContours, range);
243 }
244 
249 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
250  double rangeStart,
251  double rangeEnd)
252 {
253  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
254 }
255 
256 #endif
helper object to manage setting and generating contour values
double GetValue(int i)
Get the ith contour value.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
Abstract class in support of both point location and point insertion.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
int GetNumberOfContours()
Get the number of contours in the list of contour values.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
double * GetValues()
Get a pointer to an array of contour values.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
generate isosurfaces/isolines from scalar values
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:54
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetValue(int i, double value)
Set the ith contour value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.