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

# Common/vtkProcessObject.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkProcessObject.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00069 #ifndef __vtkProcessObject_h
    00070 #define __vtkProcessObject_h
    00071
    00072 #include "vtkObject.h"
    00073
    00074 class vtkDataObject;
    00075
    00076 class VTK_COMMON_EXPORT vtkProcessObject : public vtkObject
    00077 {
    00078 public:
    00079   vtkTypeRevisionMacro(vtkProcessObject,vtkObject);
    00080   void PrintSelf(ostream& os, vtkIndent indent);
    00081
    00083   void SetStartMethod(void (*f)(void *), void *arg);
    00084
    00086   void SetProgressMethod(void (*f)(void *), void *arg);
    00087
    00089   void SetEndMethod(void (*f)(void *), void *arg);
    00090
    00092   void SetStartMethodArgDelete(void (*f)(void *));
    00093
    00095   void SetProgressMethodArgDelete(void (*f)(void *));
    00096
    00098   void SetEndMethodArgDelete(void (*f)(void *));
    00099
    00101
    00103   vtkSetMacro(AbortExecute,int);
    00104   vtkGetMacro(AbortExecute,int);
    00105   vtkBooleanMacro(AbortExecute,int);
    00107
    00109
    00110   vtkSetClampMacro(Progress,float,0.0f,1.0f);
    00111   vtkGetMacro(Progress,float);
    00113
    00117   void UpdateProgress(float amount);
    00118
    00120
    00122   vtkSetStringMacro(ProgressText);
    00123   vtkGetStringMacro(ProgressText);
    00125
    00126   // left public for performance since it is used in inner loops
    00127   int AbortExecute;
    00128
    00130
    00132   vtkDataObject **GetInputs() {return this->Inputs;}
    00133   vtkGetMacro(NumberOfInputs,int);
    00135
    00138   void SqueezeInputArray();
    00139
    00141   void RemoveAllInputs();
    00142
    00143 protected:
    00144   vtkProcessObject();
    00145   ~vtkProcessObject();
    00146
    00147   // Progress/Update handling
    00148   unsigned long StartTag;
    00149   unsigned long ProgressTag;
    00150   unsigned long EndTag;
    00151   float Progress;
    00152   char  *ProgressText;
    00153
    00154   int NumberOfInputs;
    00155   int NumberOfRequiredInputs;
    00156   vtkDataObject **Inputs;     //An array of the inputs to the filter
    00157   // Temporary arrays used internally.
    00158   // It is only valid after SortInputsByLocality is called.
    00159   vtkDataObject **SortedInputs;   // Inputs sorted by locality
    00160   // We need a second array for an effficeint search.
    00161   // This array is never valid.
    00162   vtkDataObject **SortedInputs2;
    00163   void SortInputsByLocality();
    00164   // A helper method for quicksort.
    00165   void SortMerge(vtkDataObject **a1, int l1,
    00166                  vtkDataObject **a2, int l2,
    00167                  vtkDataObject **results);
    00168
    00169   // Called to allocate the input array.  Copies old inputs.
    00170   void SetNumberOfInputs(int num);
    00171
    00172   // protected methods for setting inputs.
    00173   virtual void SetNthInput(int num, vtkDataObject *input);
    00174   virtual void AddInput(vtkDataObject *input);
    00175   virtual void RemoveInput(vtkDataObject *input);
    00176
    00177 private:
    00178   vtkProcessObject(const vtkProcessObject&);  // Not implemented.
    00179   void operator=(const vtkProcessObject&);  // Not implemented.
    00180 };
    00181
    00182 #endif
    00183