VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSMPProgressObserver.h 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 =========================================================================*/ 00026 #ifndef vtkSMPProgressObserver_h 00027 #define vtkSMPProgressObserver_h 00028 00029 #include "vtkCommonExecutionModelModule.h" // For export macro 00030 #include "vtkProgressObserver.h" 00031 #include "vtkSMPThreadLocalObject.h" // For thread local observers. 00032 00033 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSMPProgressObserver : public vtkProgressObserver 00034 { 00035 public: 00036 static vtkSMPProgressObserver *New(); 00037 vtkTypeMacro(vtkSMPProgressObserver,vtkProgressObserver); 00038 void PrintSelf(ostream& os, vtkIndent indent); 00039 00042 void UpdateProgress(double amount); 00043 00045 00046 vtkProgressObserver* GetLocalObserver() 00047 { 00048 return this->Observers.Local(); 00049 } 00051 00052 protected: 00053 vtkSMPProgressObserver(); 00054 ~vtkSMPProgressObserver(); 00055 00056 vtkSMPThreadLocalObject<vtkProgressObserver> Observers; 00057 00058 private: 00059 vtkSMPProgressObserver(const vtkSMPProgressObserver&); // Not implemented. 00060 void operator=(const vtkSMPProgressObserver&); // Not implemented. 00061 }; 00062 00063 #endif