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 =========================================================================*/
110 #ifndef vtkBandedPolyDataContourFilter_h
111 #define vtkBandedPolyDataContourFilter_h
112 
113 #include "vtkFiltersModelingModule.h" // For export macro
114 #include "vtkPolyDataAlgorithm.h"
115 
116 #include "vtkContourValues.h" // Needed for inline methods
117 
118 class vtkPoints;
119 class vtkCellArray;
120 class vtkPointData;
121 class vtkDataArray;
122 class vtkFloatArray;
123 class vtkDoubleArray;
124 struct vtkBandedPolyDataContourFilterInternals;
125 
126 #define VTK_SCALAR_MODE_INDEX 0
127 #define VTK_SCALAR_MODE_VALUE 1
128 
129 class VTKFILTERSMODELING_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm
130 {
131 public:
133  void PrintSelf(ostream& os, vtkIndent indent) override;
134 
139 
141 
147  void SetValue(int i, double value);
148  double GetValue(int i);
149  double* GetValues();
150  void GetValues(double* contourValues);
151  void SetNumberOfContours(int number);
152  vtkIdType GetNumberOfContours();
153  void GenerateValues(int numContours, double range[2]);
154  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
156 
158 
164  vtkSetMacro(Clipping, vtkTypeBool);
165  vtkGetMacro(Clipping, vtkTypeBool);
166  vtkBooleanMacro(Clipping, vtkTypeBool);
168 
170 
176  vtkSetClampMacro(ScalarMode, int, VTK_SCALAR_MODE_INDEX, VTK_SCALAR_MODE_VALUE);
177  vtkGetMacro(ScalarMode, int);
178  void SetScalarModeToIndex() { this->SetScalarMode(VTK_SCALAR_MODE_INDEX); }
179  void SetScalarModeToValue() { this->SetScalarMode(VTK_SCALAR_MODE_VALUE); }
181 
183 
189  vtkSetMacro(GenerateContourEdges, vtkTypeBool);
190  vtkGetMacro(GenerateContourEdges, vtkTypeBool);
191  vtkBooleanMacro(GenerateContourEdges, vtkTypeBool);
193 
195 
201  vtkSetMacro(ClipTolerance, double);
202  vtkGetMacro(ClipTolerance, double);
204 
206 
210  vtkSetMacro(Component, int);
211  vtkGetMacro(Component, int);
213 
219 
224  vtkMTimeType GetMTime() override;
225 
226 protected:
229 
231 
232  int ClipEdge(int v1, int v2, vtkPoints* pts, vtkDataArray* inScalars, vtkDoubleArray* outScalars,
233  vtkPointData* inPD, vtkPointData* outPD, vtkIdType edgePts[]);
235  vtkCellArray* cells, int npts, const vtkIdType* pts, int cellId, double s, vtkFloatArray* newS);
237  vtkCellArray* cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray* newS);
238  int ComputeClippedIndex(double s);
239  int InsertNextScalar(vtkFloatArray* scalars, int cellId, int idx);
240  // data members
242 
246  double ClipTolerance; // specify numerical accuracy during clipping
247  // the second output
249 
250  vtkBandedPolyDataContourFilterInternals* Internal;
251 
252 private:
254  void operator=(const vtkBandedPolyDataContourFilter&) = delete;
255 };
256 
262 {
263  this->ContourValues->SetValue(i, value);
264 }
265 
270 {
271  return this->ContourValues->GetValue(i);
272 }
273 
279 {
280  return this->ContourValues->GetValues();
281 }
282 
288 inline void vtkBandedPolyDataContourFilter::GetValues(double* contourValues)
289 {
290  this->ContourValues->GetValues(contourValues);
291 }
292 
299 {
300  this->ContourValues->SetNumberOfContours(number);
301 }
302 
307 {
308  return this->ContourValues->GetNumberOfContours();
309 }
310 
315 inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours, double range[2])
316 {
317  this->ContourValues->GenerateValues(numContours, range);
318 }
319 
325  int numContours, double rangeStart, double rangeEnd)
326 {
327  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
328 }
329 
330 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkBandedPolyDataContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkBandedPolyDataContourFilter.h:278
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkBandedPolyDataContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkBandedPolyDataContourFilter.h:315
vtkBandedPolyDataContourFilter::ClipEdge
int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars, vtkDoubleArray *outScalars, vtkPointData *inPD, vtkPointData *outPD, vtkIdType edgePts[])
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:142
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkBandedPolyDataContourFilter::SetScalarModeToIndex
void SetScalarModeToIndex()
Control whether the cell scalars are output as an integer index or a scalar value.
Definition: vtkBandedPolyDataContourFilter.h:178
VTK_SCALAR_MODE_INDEX
#define VTK_SCALAR_MODE_INDEX
Definition: vtkBandedPolyDataContourFilter.h:126
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:145
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkBandedPolyDataContourFilter::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkBandedPolyDataContourFilter.h:306
vtkBandedPolyDataContourFilter::InsertNextScalar
int InsertNextScalar(vtkFloatArray *scalars, int cellId, int idx)
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkBandedPolyDataContourFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkBandedPolyDataContourFilter::ScalarMode
int ScalarMode
Definition: vtkBandedPolyDataContourFilter.h:244
vtkBandedPolyDataContourFilter::GenerateContourEdges
vtkTypeBool GenerateContourEdges
Definition: vtkBandedPolyDataContourFilter.h:248
vtkBandedPolyDataContourFilter::InsertCell
int InsertCell(vtkCellArray *cells, int npts, const vtkIdType *pts, int cellId, double s, vtkFloatArray *newS)
vtkPolyDataAlgorithm.h
vtkBandedPolyDataContourFilter::SetScalarModeToValue
void SetScalarModeToValue()
Control whether the cell scalars are output as an integer index or a scalar value.
Definition: vtkBandedPolyDataContourFilter.h:179
vtkBandedPolyDataContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkBandedPolyDataContourFilter.h:269
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:55
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:290
vtkBandedPolyDataContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkBandedPolyDataContourFilter.h:298
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkBandedPolyDataContourFilter::ComputeClippedIndex
int ComputeClippedIndex(double s)
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkBandedPolyDataContourFilter::ClipTolerance
double ClipTolerance
Definition: vtkBandedPolyDataContourFilter.h:246
vtkBandedPolyDataContourFilter::vtkBandedPolyDataContourFilter
vtkBandedPolyDataContourFilter()
vtkBandedPolyDataContourFilter::InsertLine
int InsertLine(vtkCellArray *cells, vtkIdType pt1, vtkIdType pt2, int cellId, double s, vtkFloatArray *newS)
vtkBandedPolyDataContourFilter::Internal
vtkBandedPolyDataContourFilterInternals * Internal
Definition: vtkBandedPolyDataContourFilter.h:250
vtkBandedPolyDataContourFilter::New
static vtkBandedPolyDataContourFilter * New()
Construct object with no contours defined.
vtkContourValues.h
vtkBandedPolyDataContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkBandedPolyDataContourFilter.h:241
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkBandedPolyDataContourFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkBandedPolyDataContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkBandedPolyDataContourFilter.h:261
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:145
vtkBandedPolyDataContourFilter::GetMTime
vtkMTimeType GetMTime() override
Overload GetMTime because we delegate to vtkContourValues so its modified time must be taken into acc...
vtkBandedPolyDataContourFilter::Component
int Component
Definition: vtkBandedPolyDataContourFilter.h:245
vtkBandedPolyDataContourFilter
generate filled contours for vtkPolyData
Definition: vtkBandedPolyDataContourFilter.h:130
vtkBandedPolyDataContourFilter::GetContourEdgesOutput
vtkPolyData * GetContourEdgesOutput()
Get the second output which contains the edges dividing the contour bands.
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
VTK_SCALAR_MODE_VALUE
#define VTK_SCALAR_MODE_VALUE
Definition: vtkBandedPolyDataContourFilter.h:127
vtkBandedPolyDataContourFilter::~vtkBandedPolyDataContourFilter
~vtkBandedPolyDataContourFilter() override
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkBandedPolyDataContourFilter::Clipping
vtkTypeBool Clipping
Definition: vtkBandedPolyDataContourFilter.h:243
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151