VTK  9.1.0
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=========================================================================*/
50#ifndef vtkBandedPolyDataContourFilter_h
51#define vtkBandedPolyDataContourFilter_h
52
53#include "vtkFiltersModelingModule.h" // For export macro
55
56#include "vtkContourValues.h" // Needed for inline methods
57
58class vtkPoints;
59class vtkCellArray;
60class vtkPointData;
61class vtkDataArray;
62class vtkFloatArray;
63class vtkDoubleArray;
64struct vtkBandedPolyDataContourFilterInternals;
65
66#define VTK_SCALAR_MODE_INDEX 0
67#define VTK_SCALAR_MODE_VALUE 1
68
69class VTKFILTERSMODELING_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm
70{
71public:
73 void PrintSelf(ostream& os, vtkIndent indent) override;
74
79
81
87 void SetValue(int i, double value);
88 double GetValue(int i);
89 double* GetValues();
90 void GetValues(double* contourValues);
91 void SetNumberOfContours(int number);
92 vtkIdType GetNumberOfContours();
93 void GenerateValues(int numContours, double range[2]);
94 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
96
98
104 vtkSetMacro(Clipping, vtkTypeBool);
105 vtkGetMacro(Clipping, vtkTypeBool);
106 vtkBooleanMacro(Clipping, vtkTypeBool);
108
110
116 vtkSetClampMacro(ScalarMode, int, VTK_SCALAR_MODE_INDEX, VTK_SCALAR_MODE_VALUE);
117 vtkGetMacro(ScalarMode, int);
118 void SetScalarModeToIndex() { this->SetScalarMode(VTK_SCALAR_MODE_INDEX); }
119 void SetScalarModeToValue() { this->SetScalarMode(VTK_SCALAR_MODE_VALUE); }
121
123
129 vtkSetMacro(GenerateContourEdges, vtkTypeBool);
130 vtkGetMacro(GenerateContourEdges, vtkTypeBool);
131 vtkBooleanMacro(GenerateContourEdges, vtkTypeBool);
133
135
141 vtkSetMacro(ClipTolerance, double);
142 vtkGetMacro(ClipTolerance, double);
144
146
150 vtkSetMacro(Component, int);
151 vtkGetMacro(Component, int);
153
159
165
166protected:
169
171
172 int ClipEdge(int v1, int v2, vtkPoints* pts, vtkDataArray* inScalars, vtkDoubleArray* outScalars,
173 vtkPointData* inPD, vtkPointData* outPD, vtkIdType edgePts[]);
175 vtkCellArray* cells, int npts, const vtkIdType* pts, int cellId, double s, vtkFloatArray* newS);
177 vtkCellArray* cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray* newS);
178 int ComputeClippedIndex(double s);
179 int InsertNextScalar(vtkFloatArray* scalars, int cellId, int idx);
180 // data members
182
186 double ClipTolerance; // specify numerical accuracy during clipping
187 // the second output
189
190 vtkBandedPolyDataContourFilterInternals* Internal;
191
192private:
194 void operator=(const vtkBandedPolyDataContourFilter&) = delete;
195};
196
202{
203 this->ContourValues->SetValue(i, value);
204}
205
210{
211 return this->ContourValues->GetValue(i);
212}
213
219{
220 return this->ContourValues->GetValues();
221}
222
228inline void vtkBandedPolyDataContourFilter::GetValues(double* contourValues)
229{
230 this->ContourValues->GetValues(contourValues);
231}
232
239{
240 this->ContourValues->SetNumberOfContours(number);
241}
242
247{
248 return this->ContourValues->GetNumberOfContours();
249}
250
255inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours, double range[2])
256{
257 this->ContourValues->GenerateValues(numContours, range);
258}
259
265 int numContours, double rangeStart, double rangeEnd)
266{
267 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
268}
269
270#endif
generate filled contours for vtkPolyData
vtkMTimeType GetMTime() override
Overload GetMTime because we delegate to vtkContourValues so its modified time must be taken into acc...
double * GetValues()
Get a pointer to an array of contour values.
double GetValue(int i)
Get the ith contour value.
int InsertLine(vtkCellArray *cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray *newS)
int InsertCell(vtkCellArray *cells, int npts, const vtkIdType *pts, int cellId, double s, vtkFloatArray *newS)
void SetScalarModeToIndex()
Control whether the cell scalars are output as an integer index or a scalar value.
~vtkBandedPolyDataContourFilter() override
vtkPolyData * GetContourEdgesOutput()
Get the second output which contains the edges dividing the contour bands.
static vtkBandedPolyDataContourFilter * New()
Construct object with no contours defined.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetScalarModeToValue()
Control whether the cell scalars are output as an integer index or a scalar value.
int InsertNextScalar(vtkFloatArray *scalars, int cellId, int idx)
int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars, vtkDoubleArray *outScalars, vtkPointData *inPD, vtkPointData *outPD, vtkIdType edgePts[])
void SetValue(int i, double value)
Methods to set / get contour values.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkBandedPolyDataContourFilterInternals * Internal
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
object to represent cell connectivity
Definition: vtkCellArray.h:190
helper object to manage setting and generating contour values
double * GetValues()
Return a pointer to a list of contour values.
int GetNumberOfContours()
Return the number of contours in the.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:42
represent and manipulate 3D points
Definition: vtkPoints.h:43
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
@ value
Definition: vtkX3D.h:226
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SCALAR_MODE_VALUE
#define VTK_SCALAR_MODE_INDEX
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287