VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
123  vtkPolyData *GetContourEdgesOutput();
124 
127  unsigned long GetMTime();
128 
129 protected:
132 
134 
135  int ComputeScalarIndex(double);
136  int IsContourValue(double val);
137  int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars,
138  vtkDoubleArray *outScalars,
139  vtkPointData *inPD, vtkPointData *outPD);
140  int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts,
141  int cellId, double s, vtkFloatArray *newS);
142 
143  // data members
145 
146  int Clipping;
148 
149  // sorted and cleaned contour values
150  double *ClipValues;
152  int ClipIndex[2]; //indices outside of this range (inclusive) are clipped
153  double ClipTolerance; //used to clean up numerical problems
154 
155  //the second output
157 
158 private:
160  void operator=(const vtkBandedPolyDataContourFilter&); // Not implemented.
161 };
162 
164 
167  {this->ContourValues->SetValue(i,value);}
169 
171 
173  {return this->ContourValues->GetValue(i);}
175 
177 
180  {return this->ContourValues->GetValues();}
182 
184 
187 inline void vtkBandedPolyDataContourFilter::GetValues(double *contourValues)
188  {this->ContourValues->GetValues(contourValues);}
190 
192 
196  {this->ContourValues->SetNumberOfContours(number);}
198 
200 
202  {return this->ContourValues->GetNumberOfContours();}
204 
206 
209  double range[2])
210  {this->ContourValues->GenerateValues(numContours, range);}
212 
214 
217  double rangeStart,
218  double rangeEnd)
219  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
221 
222 
223 #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 vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
#define VTKFILTERSMODELING_EXPORT
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:133
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
void GenerateValues(int numContours, double range[2])
int vtkIdType
Definition: vtkType.h:268
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
double GetValue(int i)
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
#define VTK_SCALAR_MODE_VALUE
void PrintSelf(ostream &os, vtkIndent indent)
double * GetValues()
GLfloat GLfloat GLfloat v2
Definition: vtkgl.h:12015
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:53
#define VTK_SCALAR_MODE_INDEX
object to represent cell connectivity
Definition: vtkCellArray.h:49
GLfloat GLfloat v1
Definition: vtkgl.h:12014
GLdouble s
Definition: vtkgl.h:11594
Store zero or more vtkInformation instances.
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
int GetNumberOfContours()
GLenum GLint * range
Definition: vtkgl.h:14180
void SetValue(int i, double value)
represent and manipulate 3D points
Definition: vtkPoints.h:39
GLuint GLfloat * val
Definition: vtkgl.h:13789
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69