Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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   Language:  C++
00006 
00007 
00008 
00009 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00010 All rights reserved.
00011 
00012     THIS CLASS IS PATENT PENDING.
00013 
00014     Application of this software for commercial purposes requires 
00015     a license grant from Kitware. Contact:
00016         Ken Martin
00017         Kitware
00018         469 Clifton Corporate Parkway,
00019         Clifton Park, NY 12065
00020         Phone:1-518-371-3971 
00021     for more information.
00022 
00023 Redistribution and use in source and binary forms, with or without
00024 modification, are permitted provided that the following conditions are met:
00025 
00026  * Redistributions of source code must retain the above copyright notice,
00027    this list of conditions and the following disclaimer.
00028 
00029  * Redistributions in binary form must reproduce the above copyright notice,
00030    this list of conditions and the following disclaimer in the documentation
00031    and/or other materials provided with the distribution.
00032 
00033  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00034    of any contributors may be used to endorse or promote products derived
00035    from this software without specific prior written permission.
00036 
00037  * Modified source versions must be plainly marked as such, and must not be
00038    misrepresented as being the original software.
00039 
00040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00041 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00042 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00043 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00044 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00045 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00046 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00047 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00048 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00049 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00050 
00051 =========================================================================*/
00070 #ifndef __vtkSynchronizedTemplates3D_h
00071 #define __vtkSynchronizedTemplates3D_h
00072 
00073 #include "vtkPolyDataSource.h"
00074 #include "vtkImageData.h"
00075 #include "vtkContourValues.h"
00076 #include "vtkMultiThreader.h"
00077 #include "vtkKitwareContourFilter.h"
00078 
00079 class VTK_PATENTED_EXPORT vtkSynchronizedTemplates3D : public vtkPolyDataSource
00080 {
00081 public:
00082   static vtkSynchronizedTemplates3D *New();
00083 
00084   vtkTypeMacro(vtkSynchronizedTemplates3D,vtkPolyDataSource);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086   
00088 
00089   void SetInput(vtkImageData *input);
00090   vtkImageData *GetInput();
00092   
00094   unsigned long int GetMTime();
00095 
00097 
00101   vtkSetMacro(ComputeNormals,int);
00102   vtkGetMacro(ComputeNormals,int);
00103   vtkBooleanMacro(ComputeNormals,int);
00105 
00107 
00113   vtkSetMacro(ComputeGradients,int);
00114   vtkGetMacro(ComputeGradients,int);
00115   vtkBooleanMacro(ComputeGradients,int);
00117 
00119 
00120   vtkSetMacro(ComputeScalars,int);
00121   vtkGetMacro(ComputeScalars,int);
00122   vtkBooleanMacro(ComputeScalars,int);
00124 
00127   void SetValue(int i, float value) {this->ContourValues->SetValue(i,value);}
00128 
00130   float GetValue(int i) {return this->ContourValues->GetValue(i);}
00131 
00134   float *GetValues() {return this->ContourValues->GetValues();}
00135 
00137 
00140   void GetValues(float *contourValues) {
00141     this->ContourValues->GetValues(contourValues);}
00143 
00145 
00148   void SetNumberOfContours(int number) {
00149     this->ContourValues->SetNumberOfContours(number);}
00151 
00153 
00154   int GetNumberOfContours() {
00155     return this->ContourValues->GetNumberOfContours();}
00157 
00159 
00161   void GenerateValues(int numContours, float range[2]) {
00162     this->ContourValues->GenerateValues(numContours, range);}
00164 
00166 
00168   void GenerateValues(int numContours, float rangeStart, float rangeEnd)
00169     {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00171 
00173 
00174   int *GetExecuteExtent() {return this->ExecuteExtent;}
00175   void ThreadedExecute(vtkImageData *data, int *exExt, int threadId);
00177 
00179 
00180   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00181   vtkGetMacro( NumberOfThreads, int );
00183 
00185 
00188   void SetInputMemoryLimit(unsigned long limit);
00189   unsigned long GetInputMemoryLimit();  
00191 
00192 protected:
00193   vtkSynchronizedTemplates3D();
00194   ~vtkSynchronizedTemplates3D();
00195 
00196   int ComputeNormals;
00197   int ComputeGradients;
00198   int ComputeScalars;
00199   vtkContourValues *ContourValues;
00200 
00201   void Execute();
00202   void ExecuteInformation();
00203 
00204   void ComputeInputUpdateExtents(vtkDataObject *output);
00205   
00206   int ExecuteExtent[6];
00207 
00208   int NumberOfThreads;
00209   vtkMultiThreader *Threader;
00210   // temporary outputs
00211   vtkPolyData *Threads[VTK_MAX_THREADS];
00212   void InitializeOutput(int *ext,vtkPolyData *o);
00213 
00214 private:
00215   //BTX
00216   friend class VTK_PATENTED_EXPORT vtkKitwareContourFilter;
00217   //ETX
00218   
00219 private:
00220   vtkSynchronizedTemplates3D(const vtkSynchronizedTemplates3D&);  // Not implemented.
00221   void operator=(const vtkSynchronizedTemplates3D&);  // Not implemented.
00222 };
00223 
00224 
00225 
00226 
00227 
00228 
00229 
00230 // template table.
00231 //BTX
00232 
00233 extern int VTK_SYNCHONIZED_TEMPLATES_3D_TABLE_1[];
00234 extern int VTK_SYNCHONIZED_TEMPLATES_3D_TABLE_2[];
00235 
00236 //ETX
00237 
00238 #endif
00239 

Generated on Thu Mar 28 14:19:31 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001