Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkGridSynchronizedTemplates3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGridSynchronizedTemplates3D.h,v $
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 
00015      THIS CLASS IS PATENT PENDING.
00016 
00017      Application of this software for commercial purposes requires 
00018      a license grant from Kitware. Contact:
00019          Ken Martin
00020          Kitware
00021          28 Corporate Drive Suite 204,
00022          Clifton Park, NY 12065
00023          Phone:1-518-371-3971 
00024      for more information.
00025 
00026 =========================================================================*/
00054 #ifndef __vtkGridSynchronizedTemplates3D_h
00055 #define __vtkGridSynchronizedTemplates3D_h
00056 
00057 #include "vtkStructuredGridToPolyDataFilter.h"
00058 #include "vtkContourValues.h" // Because it passes all the calls to it
00059 
00060 class vtkKitwareContourFilter;
00061 class vtkMultiThreader;
00062 
00063 class VTK_PATENTED_EXPORT vtkGridSynchronizedTemplates3D : public vtkStructuredGridToPolyDataFilter
00064 {
00065 public:
00066   static vtkGridSynchronizedTemplates3D *New();
00067   vtkTypeRevisionMacro(vtkGridSynchronizedTemplates3D,vtkStructuredGridToPolyDataFilter);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071   unsigned long int GetMTime();
00072 
00074 
00078   vtkSetMacro(ComputeNormals,int);
00079   vtkGetMacro(ComputeNormals,int);
00080   vtkBooleanMacro(ComputeNormals,int);
00082 
00084 
00090   vtkSetMacro(ComputeGradients,int);
00091   vtkGetMacro(ComputeGradients,int);
00092   vtkBooleanMacro(ComputeGradients,int);
00094 
00096 
00097   vtkSetMacro(ComputeScalars,int);
00098   vtkGetMacro(ComputeScalars,int);
00099   vtkBooleanMacro(ComputeScalars,int);
00101 
00104   void SetValue(int i, double value) {this->ContourValues->SetValue(i,value);}
00105 
00107   double GetValue(int i) {return this->ContourValues->GetValue(i);}
00108 
00111   double *GetValues() {return this->ContourValues->GetValues();}
00112 
00114 
00117   void GetValues(double *contourValues) {
00118     this->ContourValues->GetValues(contourValues);}
00120 
00122 
00125   void SetNumberOfContours(int number) {
00126     this->ContourValues->SetNumberOfContours(number);}
00128 
00130 
00131   int GetNumberOfContours() {
00132     return this->ContourValues->GetNumberOfContours();}
00134 
00136 
00138   void GenerateValues(int numContours, double range[2]) {
00139     this->ContourValues->GenerateValues(numContours, range);}
00141 
00143 
00145   void GenerateValues(int numContours, double rangeStart, double rangeEnd)
00146     {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00148 
00150 
00151   int *GetExecuteExtent() {return this->ExecuteExtent;}
00152   void ThreadedExecute(int *exExt, int threadId);
00154 
00156 
00157   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00158   vtkGetMacro( NumberOfThreads, int );
00160 
00163   void SetInputMemoryLimit(long limit);
00164 
00166 
00169   vtkGetStringMacro(InputScalarsSelection);
00170   void SelectInputScalars(const char *fieldName) 
00171     {this->SetInputScalarsSelection(fieldName);}
00173   
00174 protected:
00175   vtkGridSynchronizedTemplates3D();
00176   ~vtkGridSynchronizedTemplates3D();
00177 
00178   void Execute();
00179   void ExecuteInformation();
00180 
00181   void ComputeInputUpdateExtents( vtkDataObject *output );
00182 
00183   int ComputeNormals;
00184   int ComputeGradients;
00185   int ComputeScalars;
00186   vtkContourValues *ContourValues;
00187 
00188   int NumberOfThreads;
00189   vtkMultiThreader *Threader;
00190   int MinimumPieceSize[3];
00191   int ExecuteExtent[6];
00192 
00193   vtkPolyData *Threads[VTK_MAX_THREADS];
00194 
00195   char *InputScalarsSelection;
00196   vtkSetStringMacro(InputScalarsSelection);
00197 
00198 private:
00199   //BTX
00200   friend class VTK_PATENTED_EXPORT vtkKitwareContourFilter;
00201   //ETX
00202 private:
00203   vtkGridSynchronizedTemplates3D(const vtkGridSynchronizedTemplates3D&);  // Not implemented.
00204   void operator=(const vtkGridSynchronizedTemplates3D&);  // Not implemented.
00205 };
00206 
00207 
00208 #endif