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 "vtkPolyDataAlgorithm.h"
60 
61 #include "vtkContourValues.h" // Needed for direct access to ContourValues
62 
64 class vtkScalarTree;
65 
67 {
68 public:
70  void PrintSelf(ostream& os, vtkIndent indent);
71 
74  static vtkMarchingContourFilter *New();
75 
77 
78  void SetValue(int i, double value);
79  double GetValue(int i);
80  double *GetValues();
81  void GetValues(double *contourValues);
82  void SetNumberOfContours(int number);
83  int GetNumberOfContours();
84  void GenerateValues(int numContours, double range[2]);
85  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
87 
89  unsigned long GetMTime();
90 
92 
96  vtkSetMacro(ComputeNormals,int);
97  vtkGetMacro(ComputeNormals,int);
98  vtkBooleanMacro(ComputeNormals,int);
100 
102 
108  vtkSetMacro(ComputeGradients,int);
109  vtkGetMacro(ComputeGradients,int);
110  vtkBooleanMacro(ComputeGradients,int);
112 
114 
115  vtkSetMacro(ComputeScalars,int);
116  vtkGetMacro(ComputeScalars,int);
117  vtkBooleanMacro(ComputeScalars,int);
119 
121 
122  vtkSetMacro(UseScalarTree,int);
123  vtkGetMacro(UseScalarTree,int);
124  vtkBooleanMacro(UseScalarTree,int);
126 
128 
130  void SetLocator(vtkIncrementalPointLocator *locator);
131  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
133 
136  void CreateDefaultLocator();
137 
138 protected:
141 
144 
152 
153  //special contouring for structured points
154  void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output);
155  //special contouring for image data
156  void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output);
157  //default if not structured data
158  void DataSetContour(vtkDataSet *input, vtkPolyData *output);
159 private:
160  vtkMarchingContourFilter(const vtkMarchingContourFilter&); // Not implemented.
161  void operator=(const vtkMarchingContourFilter&); // Not implemented.
162 };
163 
165 
167 inline void vtkMarchingContourFilter::SetValue(int i, double value)
168 {
169  this->ContourValues->SetValue(i,value);
170 }
172 
174 
176 {
177  return this->ContourValues->GetValue(i);
178 }
180 
182 
185 {
186  return this->ContourValues->GetValues();
187 }
189 
191 
194 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
195 {
196  this->ContourValues->GetValues(contourValues);
197 }
199 
201 
205 {
206  this->ContourValues->SetNumberOfContours(number);
207 }
209 
211 
213 {
214  return this->ContourValues->GetNumberOfContours();
215 }
217 
219 
221 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
222  double range[2])
223 {
224  this->ContourValues->GenerateValues(numContours, range);
225 }
227 
229 
231 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
232  double rangeStart,
233  double rangeEnd)
234 {
235  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
236 }
238 
239 #endif
helper object to manage setting and generating contour values
#define VTK_GRAPHICS_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
Store vtkAlgorithm input/output information.
vtkIncrementalPointLocator * Locator
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
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:81
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:37
generate isosurfaces/isolines from scalar values
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:45
void SetValue(int i, double value)
Store zero or more vtkInformation instances.
int GetNumberOfContours()
void SetValue(int i, double value)