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
00069 #ifndef __vtkGridSynchronizedTemplates3D_h
00070 #define __vtkGridSynchronizedTemplates3D_h
00071
00072 #include "vtkStructuredGridToPolyDataFilter.h"
00073 #include "vtkContourValues.h"
00074 #include "vtkMultiThreader.h"
00075 #include "vtkKitwareContourFilter.h"
00076
00077 class VTK_PATENTED_EXPORT vtkGridSynchronizedTemplates3D : public vtkStructuredGridToPolyDataFilter
00078 {
00079 public:
00080 static vtkGridSynchronizedTemplates3D *New();
00081 vtkTypeMacro(vtkGridSynchronizedTemplates3D,vtkStructuredGridToPolyDataFilter);
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00085 unsigned long int GetMTime();
00086
00088
00092 vtkSetMacro(ComputeNormals,int);
00093 vtkGetMacro(ComputeNormals,int);
00094 vtkBooleanMacro(ComputeNormals,int);
00096
00098
00104 vtkSetMacro(ComputeGradients,int);
00105 vtkGetMacro(ComputeGradients,int);
00106 vtkBooleanMacro(ComputeGradients,int);
00108
00110
00111 vtkSetMacro(ComputeScalars,int);
00112 vtkGetMacro(ComputeScalars,int);
00113 vtkBooleanMacro(ComputeScalars,int);
00115
00118 void SetValue(int i, float value) {this->ContourValues->SetValue(i,value);}
00119
00121 float GetValue(int i) {return this->ContourValues->GetValue(i);}
00122
00125 float *GetValues() {return this->ContourValues->GetValues();}
00126
00128
00131 void GetValues(float *contourValues) {
00132 this->ContourValues->GetValues(contourValues);}
00134
00136
00139 void SetNumberOfContours(int number) {
00140 this->ContourValues->SetNumberOfContours(number);}
00142
00144
00145 int GetNumberOfContours() {
00146 return this->ContourValues->GetNumberOfContours();}
00148
00150
00152 void GenerateValues(int numContours, float range[2]) {
00153 this->ContourValues->GenerateValues(numContours, range);}
00155
00157
00159 void GenerateValues(int numContours, float rangeStart, float rangeEnd)
00160 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00162
00164
00165 int *GetExecuteExtent() {return this->ExecuteExtent;}
00166 void ThreadedExecute(int *exExt, int threadId);
00168
00170
00171 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00172 vtkGetMacro( NumberOfThreads, int );
00174
00177 void SetInputMemoryLimit(long limit);
00178
00179 protected:
00180 vtkGridSynchronizedTemplates3D();
00181 ~vtkGridSynchronizedTemplates3D();
00182
00183 int ComputeNormals;
00184 int ComputeGradients;
00185 int ComputeScalars;
00186 vtkContourValues *ContourValues;
00187
00188 void Execute();
00189 void ExecuteInformation();
00190
00191 void ComputeInputUpdateExtents( vtkDataObject *output );
00192
00193 int NumberOfThreads;
00194 vtkMultiThreader *Threader;
00195 int MinimumPieceSize[3];
00196 int ExecuteExtent[6];
00197
00198 vtkPolyData *Threads[VTK_MAX_THREADS];
00199 void InitializeOutput(int *ext,vtkPolyData *o);
00200
00201 private:
00202
00203 friend class VTK_PATENTED_EXPORT vtkKitwareContourFilter;
00204
00205 private:
00206 vtkGridSynchronizedTemplates3D(const vtkGridSynchronizedTemplates3D&);
00207 void operator=(const vtkGridSynchronizedTemplates3D&);
00208 };
00209
00210
00211 #endif