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 
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 
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkBandedPolyDataContourFilter::Clipping
int Clipping
Definition: vtkBandedPolyDataContourFilter.h:155
vtkBandedPolyDataContourFilter::GetValues
double * GetValues()
Definition: vtkBandedPolyDataContourFilter.h:189
vtkgl::v2
GLfloat GLfloat GLfloat v2
Definition: vtkgl.h:12015
vtkContourValues::GetValues
double * GetValues()
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
vtkBandedPolyDataContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Definition: vtkBandedPolyDataContourFilter.h:218
vtkBandedPolyDataContourFilter::IsContourValue
int IsContourValue(double val)
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkBandedPolyDataContourFilter::SetScalarModeToIndex
void SetScalarModeToIndex()
Definition: vtkBandedPolyDataContourFilter.h:105
VTK_SCALAR_MODE_INDEX
#define VTK_SCALAR_MODE_INDEX
Definition: vtkBandedPolyDataContourFilter.h:61
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:49
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkgl::s
GLdouble s
Definition: vtkgl.h:11594
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkBandedPolyDataContourFilter::NumberOfClipValues
int NumberOfClipValues
Definition: vtkBandedPolyDataContourFilter.h:160
vtkFiltersModelingModule.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkBandedPolyDataContourFilter::ScalarMode
int ScalarMode
Definition: vtkBandedPolyDataContourFilter.h:156
vtkgl::range
GLenum GLint * range
Definition: vtkgl.h:14180
vtkgl::v1
GLfloat GLfloat v1
Definition: vtkgl.h:12014
vtkBandedPolyDataContourFilter::GetNumberOfContours
int GetNumberOfContours()
Definition: vtkBandedPolyDataContourFilter.h:211
vtkBandedPolyDataContourFilter::ClipValues
double * ClipValues
Definition: vtkBandedPolyDataContourFilter.h:159
vtkPolyDataAlgorithm.h
vtkgl::val
GLuint GLfloat * val
Definition: vtkgl.h:13789
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkBandedPolyDataContourFilter::SetScalarModeToValue
void SetScalarModeToValue()
Definition: vtkBandedPolyDataContourFilter.h:107
vtkBandedPolyDataContourFilter::GetValue
double GetValue(int i)
Definition: vtkBandedPolyDataContourFilter.h:182
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkBandedPolyDataContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Definition: vtkBandedPolyDataContourFilter.h:205
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
vtkContourValues::GetValue
double GetValue(int i)
vtkContourValues::SetValue
void SetValue(int i, double value)
vtkBandedPolyDataContourFilter::ClipTolerance
double ClipTolerance
Definition: vtkBandedPolyDataContourFilter.h:162
vtkBandedPolyDataContourFilter::vtkBandedPolyDataContourFilter
vtkBandedPolyDataContourFilter()
vtkBandedPolyDataContourFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkBandedPolyDataContourFilter::New
static vtkBandedPolyDataContourFilter * New()
vtkContourValues.h
vtkBandedPolyDataContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkBandedPolyDataContourFilter.h:153
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkBandedPolyDataContourFilter::InternalClipTolerance
double InternalClipTolerance
Definition: vtkBandedPolyDataContourFilter.h:163
vtkBandedPolyDataContourFilter::~vtkBandedPolyDataContourFilter
~vtkBandedPolyDataContourFilter()
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkBandedPolyDataContourFilter::SetValue
void SetValue(int i, double value)
Definition: vtkBandedPolyDataContourFilter.h:176
vtkBandedPolyDataContourFilter::ClipEdge
int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars, vtkDoubleArray *outScalars, vtkPointData *inPD, vtkPointData *outPD)
VTKFILTERSMODELING_EXPORT
#define VTKFILTERSMODELING_EXPORT
Definition: vtkFiltersModelingModule.h:15
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkBandedPolyDataContourFilter::GenerateContourEdges
int GenerateContourEdges
Definition: vtkBandedPolyDataContourFilter.h:166
vtkBandedPolyDataContourFilter
generate filled contours for vtkPolyData
Definition: vtkBandedPolyDataContourFilter.h:65
vtkBandedPolyDataContourFilter::GetContourEdgesOutput
vtkPolyData * GetContourEdgesOutput()
vtkBandedPolyDataContourFilter::InsertCell
int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts, int cellId, double s, vtkFloatArray *newS)
vtkBandedPolyDataContourFilter::GetMTime
unsigned long GetMTime()
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
vtkBandedPolyDataContourFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkBandedPolyDataContourFilter::ComputeScalarIndex
int ComputeScalarIndex(double)
VTK_SCALAR_MODE_VALUE
#define VTK_SCALAR_MODE_VALUE
Definition: vtkBandedPolyDataContourFilter.h:62
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44