VTK
vtkBandedPolyDataContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBandedPolyDataContourFilter.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 =========================================================================*/
46 #ifndef vtkBandedPolyDataContourFilter_h
47 #define vtkBandedPolyDataContourFilter_h
48 
49 #include "vtkFiltersModelingModule.h" // For export macro
50 #include "vtkPolyDataAlgorithm.h"
51 
52 #include "vtkContourValues.h" // Needed for inline methods
53 
54 class vtkPoints;
55 class vtkCellArray;
56 class vtkPointData;
57 class vtkDataArray;
58 class vtkFloatArray;
59 class vtkDoubleArray;
60 
61 #define VTK_SCALAR_MODE_INDEX 0
62 #define VTK_SCALAR_MODE_VALUE 1
63 
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent);
69 
72 
74 
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 
93  vtkSetMacro(Clipping,int);
94  vtkGetMacro(Clipping,int);
95  vtkBooleanMacro(Clipping,int);
97 
99 
103  vtkSetClampMacro(ScalarMode,int,VTK_SCALAR_MODE_INDEX,VTK_SCALAR_MODE_VALUE);
104  vtkGetMacro(ScalarMode,int);
106  {this->SetScalarMode(VTK_SCALAR_MODE_INDEX);}
108  {this->SetScalarMode(VTK_SCALAR_MODE_VALUE);}
110 
112 
116  vtkSetMacro(GenerateContourEdges,int);
117  vtkGetMacro(GenerateContourEdges,int);
118  vtkBooleanMacro(GenerateContourEdges,int);
120 
122 
126  vtkSetMacro(ClipTolerance,double);
127  vtkGetMacro(ClipTolerance,double);
129 
132  vtkPolyData *GetContourEdgesOutput();
133 
136  unsigned long GetMTime();
137 
138 protected:
141 
143 
144  int ComputeScalarIndex(double);
145  int IsContourValue(double val);
146  int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars,
147  vtkDoubleArray *outScalars,
148  vtkPointData *inPD, vtkPointData *outPD);
149  int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts,
150  int cellId, double s, vtkFloatArray *newS);
151 
152  // data members
154 
155  int Clipping;
157 
158  // sorted and cleaned contour values
159  double *ClipValues;
161  int ClipIndex[2]; //indices outside of this range (inclusive) are clipped
162  double ClipTolerance; //specify numerical accuracy during clipping
163  double InternalClipTolerance; //used to clean up numerical problems
164 
165  //the second output
167 
168 private:
170  void operator=(const vtkBandedPolyDataContourFilter&); // Not implemented.
171 };
172 
174 
177  {this->ContourValues->SetValue(i,value);}
179 
181 
183  {return this->ContourValues->GetValue(i);}
185 
187 
190  {return this->ContourValues->GetValues();}
192 
194 
197 inline void vtkBandedPolyDataContourFilter::GetValues(double *contourValues)
198  {this->ContourValues->GetValues(contourValues);}
200 
202 
206  {this->ContourValues->SetNumberOfContours(number);}
208 
210 
212  {return this->ContourValues->GetNumberOfContours();}
214 
216 
219  double range[2])
220  {this->ContourValues->GenerateValues(numContours, range);}
222 
224 
227  double rangeStart,
228  double rangeEnd)
229  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
231 
232 
233 #endif
helper object to manage setting and generating contour values
represent and manipulate point attribute data
Definition: vtkPointData.h:36
generate filled contours for vtkPolyData
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetNumberOfContours(const int number)
#define VTKFILTERSMODELING_EXPORT
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
void GenerateValues(int numContours, double range[2])
int vtkIdType
Definition: vtkType.h:247
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
double GetValue(int i)
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
#define VTK_SCALAR_MODE_VALUE
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
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
#define VTK_SCALAR_MODE_INDEX
object to represent cell connectivity
Definition: vtkCellArray.h:49
Store zero or more vtkInformation instances.
int GetNumberOfContours()
void SetValue(int i, double value)
represent and manipulate 3D points
Definition: vtkPoints.h:38