VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBandedPolyDataContourFilter.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00046 #ifndef vtkBandedPolyDataContourFilter_h 00047 #define vtkBandedPolyDataContourFilter_h 00048 00049 #include "vtkFiltersModelingModule.h" // For export macro 00050 #include "vtkPolyDataAlgorithm.h" 00051 00052 #include "vtkContourValues.h" // Needed for inline methods 00053 00054 class vtkPoints; 00055 class vtkCellArray; 00056 class vtkPointData; 00057 class vtkDataArray; 00058 class vtkFloatArray; 00059 class vtkDoubleArray; 00060 00061 #define VTK_SCALAR_MODE_INDEX 0 00062 #define VTK_SCALAR_MODE_VALUE 1 00063 00064 class VTKFILTERSMODELING_EXPORT vtkBandedPolyDataContourFilter : public vtkPolyDataAlgorithm 00065 { 00066 public: 00067 vtkTypeMacro(vtkBandedPolyDataContourFilter,vtkPolyDataAlgorithm); 00068 void PrintSelf(ostream& os, vtkIndent indent); 00069 00071 static vtkBandedPolyDataContourFilter *New(); 00072 00074 00078 void SetValue(int i, double value); 00079 double GetValue(int i); 00080 double *GetValues(); 00081 void GetValues(double *contourValues); 00082 void SetNumberOfContours(int number); 00083 int GetNumberOfContours(); 00084 void GenerateValues(int numContours, double range[2]); 00085 void GenerateValues(int numContours, double rangeStart, double rangeEnd); 00087 00089 00093 vtkSetMacro(Clipping,int); 00094 vtkGetMacro(Clipping,int); 00095 vtkBooleanMacro(Clipping,int); 00097 00099 00103 vtkSetClampMacro(ScalarMode,int,VTK_SCALAR_MODE_INDEX,VTK_SCALAR_MODE_VALUE); 00104 vtkGetMacro(ScalarMode,int); 00105 void SetScalarModeToIndex() 00106 {this->SetScalarMode(VTK_SCALAR_MODE_INDEX);} 00107 void SetScalarModeToValue() 00108 {this->SetScalarMode(VTK_SCALAR_MODE_VALUE);} 00110 00112 00116 vtkSetMacro(GenerateContourEdges,int); 00117 vtkGetMacro(GenerateContourEdges,int); 00118 vtkBooleanMacro(GenerateContourEdges,int); 00120 00122 00126 vtkSetMacro(ClipTolerance,double); 00127 vtkGetMacro(ClipTolerance,double); 00129 00132 vtkPolyData *GetContourEdgesOutput(); 00133 00136 unsigned long GetMTime(); 00137 00138 protected: 00139 vtkBandedPolyDataContourFilter(); 00140 ~vtkBandedPolyDataContourFilter(); 00141 00142 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00143 00144 int ComputeScalarIndex(double); 00145 int IsContourValue(double val); 00146 int ClipEdge(int v1, int v2, vtkPoints *pts, vtkDataArray *inScalars, 00147 vtkDoubleArray *outScalars, 00148 vtkPointData *inPD, vtkPointData *outPD); 00149 int InsertCell(vtkCellArray *cells, int npts, vtkIdType *pts, 00150 int cellId, double s, vtkFloatArray *newS); 00151 00152 // data members 00153 vtkContourValues *ContourValues; 00154 00155 int Clipping; 00156 int ScalarMode; 00157 00158 // sorted and cleaned contour values 00159 double *ClipValues; 00160 int NumberOfClipValues; 00161 int ClipIndex[2]; //indices outside of this range (inclusive) are clipped 00162 double ClipTolerance; //specify numerical accuracy during clipping 00163 double InternalClipTolerance; //used to clean up numerical problems 00164 00165 //the second output 00166 int GenerateContourEdges; 00167 00168 private: 00169 vtkBandedPolyDataContourFilter(const vtkBandedPolyDataContourFilter&); // Not implemented. 00170 void operator=(const vtkBandedPolyDataContourFilter&); // Not implemented. 00171 }; 00172 00174 00176 inline void vtkBandedPolyDataContourFilter::SetValue(int i, double value) 00177 {this->ContourValues->SetValue(i,value);} 00179 00181 00182 inline double vtkBandedPolyDataContourFilter::GetValue(int i) 00183 {return this->ContourValues->GetValue(i);} 00185 00187 00189 inline double *vtkBandedPolyDataContourFilter::GetValues() 00190 {return this->ContourValues->GetValues();} 00192 00194 00197 inline void vtkBandedPolyDataContourFilter::GetValues(double *contourValues) 00198 {this->ContourValues->GetValues(contourValues);} 00200 00202 00205 inline void vtkBandedPolyDataContourFilter::SetNumberOfContours(int number) 00206 {this->ContourValues->SetNumberOfContours(number);} 00208 00210 00211 inline int vtkBandedPolyDataContourFilter::GetNumberOfContours() 00212 {return this->ContourValues->GetNumberOfContours();} 00214 00216 00218 inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours, 00219 double range[2]) 00220 {this->ContourValues->GenerateValues(numContours, range);} 00222 00224 00226 inline void vtkBandedPolyDataContourFilter::GenerateValues(int numContours, 00227 double rangeStart, 00228 double rangeEnd) 00229 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);} 00231 00232 00233 #endif