00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00071 #ifndef __vtkGridSynchronizedTemplates3D_h
00072 #define __vtkGridSynchronizedTemplates3D_h
00073
00074 #include "vtkStructuredGridToPolyDataFilter.h"
00075 #include "vtkContourValues.h"
00076 #include "vtkMultiThreader.h"
00077 #include "vtkKitwareContourFilter.h"
00078
00079 class VTK_EXPORT vtkGridSynchronizedTemplates3D : public vtkStructuredGridToPolyDataFilter
00080 {
00081 public:
00082 static vtkGridSynchronizedTemplates3D *New();
00083 vtkTypeMacro(vtkGridSynchronizedTemplates3D,vtkStructuredGridToPolyDataFilter);
00084 void PrintSelf(ostream& os, vtkIndent indent);
00085
00087 unsigned long int GetMTime();
00088
00093 vtkSetMacro(ComputeNormals,int);
00094 vtkGetMacro(ComputeNormals,int);
00095 vtkBooleanMacro(ComputeNormals,int);
00096
00103 vtkSetMacro(ComputeGradients,int);
00104 vtkGetMacro(ComputeGradients,int);
00105 vtkBooleanMacro(ComputeGradients,int);
00106
00108 vtkSetMacro(ComputeScalars,int);
00109 vtkGetMacro(ComputeScalars,int);
00110 vtkBooleanMacro(ComputeScalars,int);
00111
00114 void SetValue(int i, float value) {this->ContourValues->SetValue(i,value);}
00115
00117 float GetValue(int i) {return this->ContourValues->GetValue(i);}
00118
00121 float *GetValues() {return this->ContourValues->GetValues();}
00122
00126 void GetValues(float *contourValues) {
00127 this->ContourValues->GetValues(contourValues);}
00128
00132 void SetNumberOfContours(int number) {
00133 this->ContourValues->SetNumberOfContours(number);}
00134
00136 int GetNumberOfContours() {
00137 return this->ContourValues->GetNumberOfContours();}
00138
00141 void GenerateValues(int numContours, float range[2]) {
00142 this->ContourValues->GenerateValues(numContours, range);}
00143
00146 void GenerateValues(int numContours, float rangeStart, float rangeEnd)
00147 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00148
00150 int *GetExecuteExtent() {return this->ExecuteExtent;}
00151 int SplitExtent(int piece, int numPieces, int *ext);
00152 void ThreadedExecute(int *exExt, int threadId);
00153
00155 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00156 vtkGetMacro( NumberOfThreads, int );
00157
00160 void SetInputMemoryLimit(long limit);
00161
00162 protected:
00163 vtkGridSynchronizedTemplates3D();
00164 ~vtkGridSynchronizedTemplates3D();
00165 vtkGridSynchronizedTemplates3D(const vtkGridSynchronizedTemplates3D&) {};
00166 void operator=(const vtkGridSynchronizedTemplates3D&) {};
00167
00168 int ComputeNormals;
00169 int ComputeGradients;
00170 int ComputeScalars;
00171 vtkContourValues *ContourValues;
00172
00173 void Execute();
00174 void ExecuteInformation();
00175
00176 void ComputeInputUpdateExtents( vtkDataObject *output );
00177
00178 int NumberOfThreads;
00179 vtkMultiThreader *Threader;
00180 int MinimumPieceSize[3];
00181 int ExecuteExtent[6];
00182
00183 vtkPolyData *Threads[VTK_MAX_THREADS];
00184 void InitializeOutput(int *ext,vtkPolyData *o);
00185
00186 private:
00187
00188 friend VTK_EXPORT vtkKitwareContourFilter;
00189
00190
00191
00192 };
00193
00194
00195 #endif
00196