VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
64 class vtkIncrementalPointLocator;
65 class vtkScalarTree;
66 
67 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
68 {
69 public:
70  vtkTypeMacro(vtkMarchingContourFilter,vtkPolyDataAlgorithm);
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 
143  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
144  virtual int FillInputPortInformation(int port, vtkInformation *info);
145 
146  vtkContourValues *ContourValues;
150  vtkIncrementalPointLocator *Locator;
152  vtkScalarTree *ScalarTree;
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
vtkIncrementalPointLocator * Locator
void GenerateValues(int numContours, double range[2])
generate isosurfaces/isolines from scalar values
void SetValue(int i, double value)