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 =========================================================================*/
56 #ifndef vtkMarchingContourFilter_h
57 #define vtkMarchingContourFilter_h
58 
59 #include "vtkFiltersGeneralModule.h" // For export macro
60 #include "vtkPolyDataAlgorithm.h"
61 
62 #include "vtkContourValues.h" // Needed for direct access to ContourValues
63 
65 class vtkScalarTree;
66 
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
75  static vtkMarchingContourFilter *New();
76 
78 
79  void SetValue(int i, double value);
80  double GetValue(int i);
81  double *GetValues();
82  void GetValues(double *contourValues);
83  void SetNumberOfContours(int number);
84  int GetNumberOfContours();
85  void GenerateValues(int numContours, double range[2]);
86  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
88 
90  unsigned long GetMTime();
91 
93 
97  vtkSetMacro(ComputeNormals,int);
98  vtkGetMacro(ComputeNormals,int);
99  vtkBooleanMacro(ComputeNormals,int);
101 
103 
109  vtkSetMacro(ComputeGradients,int);
110  vtkGetMacro(ComputeGradients,int);
111  vtkBooleanMacro(ComputeGradients,int);
113 
115 
116  vtkSetMacro(ComputeScalars,int);
117  vtkGetMacro(ComputeScalars,int);
118  vtkBooleanMacro(ComputeScalars,int);
120 
122 
123  vtkSetMacro(UseScalarTree,int);
124  vtkGetMacro(UseScalarTree,int);
125  vtkBooleanMacro(UseScalarTree,int);
127 
129 
131  void SetLocator(vtkIncrementalPointLocator *locator);
132  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
134 
137  void CreateDefaultLocator();
138 
139 protected:
142 
145 
153 
154  //special contouring for structured points
155  void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output);
156  //special contouring for image data
157  void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output);
158  //default if not structured data
159  void DataSetContour(vtkDataSet *input, vtkPolyData *output);
160 private:
161  vtkMarchingContourFilter(const vtkMarchingContourFilter&); // Not implemented.
162  void operator=(const vtkMarchingContourFilter&); // Not implemented.
163 };
164 
166 
168 inline void vtkMarchingContourFilter::SetValue(int i, double value)
169 {
170  this->ContourValues->SetValue(i,value);
171 }
173 
175 
177 {
178  return this->ContourValues->GetValue(i);
179 }
181 
183 
186 {
187  return this->ContourValues->GetValues();
188 }
190 
192 
195 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
196 {
197  this->ContourValues->GetValues(contourValues);
198 }
200 
202 
206 {
207  this->ContourValues->SetNumberOfContours(number);
208 }
210 
212 
214 {
215  return this->ContourValues->GetNumberOfContours();
216 }
218 
220 
222 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
223  double range[2])
224 {
225  this->ContourValues->GenerateValues(numContours, range);
226 }
228 
230 
232 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
233  double rangeStart,
234  double rangeEnd)
235 {
236  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
237 }
239 
240 #endif
helper object to manage setting and generating contour values
virtual int FillInputPortInformation(int port, vtkInformation *info)
Store vtkAlgorithm input/output information.
vtkIncrementalPointLocator * Locator
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetNumberOfContours(const int number)
Abstract class in support of both point location and point insertion.
void GenerateValues(int numContours, double range[2])
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
double GetValue(int i)
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
double * GetValues()
Superclass for algorithms that produce only polydata as output.
void GenerateValues(int numContours, double range[2])
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
generate isosurfaces/isolines from scalar values
#define VTKFILTERSGENERAL_EXPORT
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:46
void SetValue(int i, double value)
Store zero or more vtkInformation instances.
int GetNumberOfContours()
void SetValue(int i, double value)