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

Patented/vtkSynchronizedTemplates3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSynchronizedTemplates3D.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          469 Clifton Corporate Parkway,
00022          Clifton Park, NY 12065
00023          Phone:1-518-371-3971 
00024      for more information.
00025 
00026 =========================================================================*/
00045 #ifndef __vtkSynchronizedTemplates3D_h
00046 #define __vtkSynchronizedTemplates3D_h
00047 
00048 #include "vtkPolyDataSource.h"
00049 #include "vtkContourValues.h" // Passes calls through
00050 
00051 class vtkImageData;
00052 class vtkKitwareContourFilter;
00053 class vtkMultiThreader;
00054 
00055 class VTK_PATENTED_EXPORT vtkSynchronizedTemplates3D : public vtkPolyDataSource
00056 {
00057 public:
00058   static vtkSynchronizedTemplates3D *New();
00059 
00060   vtkTypeRevisionMacro(vtkSynchronizedTemplates3D,vtkPolyDataSource);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062   
00064 
00065   void SetInput(vtkImageData *input);
00066   vtkImageData *GetInput();
00068   
00070   unsigned long int GetMTime();
00071 
00073 
00077   vtkSetMacro(ComputeNormals,int);
00078   vtkGetMacro(ComputeNormals,int);
00079   vtkBooleanMacro(ComputeNormals,int);
00081 
00083 
00089   vtkSetMacro(ComputeGradients,int);
00090   vtkGetMacro(ComputeGradients,int);
00091   vtkBooleanMacro(ComputeGradients,int);
00093 
00095 
00096   vtkSetMacro(ComputeScalars,int);
00097   vtkGetMacro(ComputeScalars,int);
00098   vtkBooleanMacro(ComputeScalars,int);
00100 
00103   void SetValue(int i, double value) {this->ContourValues->SetValue(i,value);}
00104 
00106   double GetValue(int i) {return this->ContourValues->GetValue(i);}
00107 
00110   double *GetValues() {return this->ContourValues->GetValues();}
00111 
00113 
00116   void GetValues(double *contourValues) {
00117     this->ContourValues->GetValues(contourValues);}
00119 
00121 
00124   void SetNumberOfContours(int number) {
00125     this->ContourValues->SetNumberOfContours(number);}
00127 
00129 
00130   int GetNumberOfContours() {
00131     return this->ContourValues->GetNumberOfContours();}
00133 
00135 
00137   void GenerateValues(int numContours, double range[2]) {
00138     this->ContourValues->GenerateValues(numContours, range);}
00140 
00142 
00144   void GenerateValues(int numContours, double rangeStart, double rangeEnd)
00145     {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00147 
00149 
00150   int *GetExecuteExtent() {return this->ExecuteExtent;}
00151   void ThreadedExecute(vtkImageData *data, int *exExt, int threadId);
00153 
00155 
00156   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00157   vtkGetMacro( NumberOfThreads, int );
00159 
00161 
00164   void SetInputMemoryLimit(unsigned long limit);
00165   unsigned long GetInputMemoryLimit();  
00167 
00169 
00172   vtkGetStringMacro(InputScalarsSelection);
00173   void SelectInputScalars(const char *fieldName) 
00174     {this->SetInputScalarsSelection(fieldName);}
00176 
00178 
00180   vtkSetMacro(ArrayComponent, int);
00181   vtkGetMacro(ArrayComponent, int);
00183 
00184 protected:
00185   vtkSynchronizedTemplates3D();
00186   ~vtkSynchronizedTemplates3D();
00187 
00188   int ComputeNormals;
00189   int ComputeGradients;
00190   int ComputeScalars;
00191   vtkContourValues *ContourValues;
00192 
00193   void Execute();
00194   void ExecuteInformation();
00195 
00196   void ComputeInputUpdateExtents(vtkDataObject *output);
00197   
00198   int ExecuteExtent[6];
00199 
00200   int NumberOfThreads;
00201   vtkMultiThreader *Threader;
00202   // temporary outputs
00203   vtkPolyData *Threads[VTK_MAX_THREADS];
00204 
00205   char *InputScalarsSelection;
00206   vtkSetStringMacro(InputScalarsSelection);
00207 
00208   int ArrayComponent;
00209   
00210 private:
00211   //BTX
00212   friend class VTK_PATENTED_EXPORT vtkKitwareContourFilter;
00213   //ETX
00214   
00215 private:
00216   vtkSynchronizedTemplates3D(const vtkSynchronizedTemplates3D&);  // Not implemented.
00217   void operator=(const vtkSynchronizedTemplates3D&);  // Not implemented.
00218 };
00219 
00220 
00221 
00222 
00223 
00224 
00225 
00226 // template table.
00227 //BTX
00228 
00229 extern int VTK_SYNCHONIZED_TEMPLATES_3D_TABLE_1[];
00230 extern int VTK_SYNCHONIZED_TEMPLATES_3D_TABLE_2[];
00231 
00232 //ETX
00233 
00234 #endif
00235