VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkThreadedStreamingPipeline.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 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright (c) 2008, 2009 by SCI Institute, University of Utah. 00017 00018 This is part of the Parallel Dataflow System originally developed by 00019 Huy T. Vo and Claudio T. Silva. For more information, see: 00020 00021 "Parallel Dataflow Scheme for Streaming (Un)Structured Data" by Huy 00022 T. Vo, Daniel K. Osmari, Brian Summa, Joao L.D. Comba, Valerio 00023 Pascucci and Claudio T. Silva, SCI Institute, University of Utah, 00024 Technical Report #UUSCI-2009-004, 2009. 00025 00026 "Multi-Threaded Streaming Pipeline For VTK" by Huy T. Vo and Claudio 00027 T. Silva, SCI Institute, University of Utah, Technical Report 00028 #UUSCI-2009-005, 2009. 00029 -------------------------------------------------------------------------*/ 00046 #ifndef __vtkThreadedStreamingPipeline_h 00047 #define __vtkThreadedStreamingPipeline_h 00048 00049 #include "vtkCompositeDataPipeline.h" 00050 00051 class vtkComputingResources; 00052 class vtkExecutionScheduler; 00053 class vtkExecutiveCollection; 00054 00055 class VTK_FILTERING_EXPORT vtkThreadedStreamingPipeline : public vtkCompositeDataPipeline 00056 { 00057 public: 00058 static vtkThreadedStreamingPipeline* New(); 00059 vtkTypeMacro(vtkThreadedStreamingPipeline,vtkCompositeDataPipeline); 00060 void PrintSelf(ostream &os, vtkIndent indent); 00061 00063 static vtkInformationIntegerKey* AUTO_PROPAGATE(); 00064 00066 static vtkInformationObjectBaseKey* EXTRA_INFORMATION(); 00067 00068 //BTX 00070 00072 enum 00073 { 00074 PROCESSING_UNIT_NONE = 0, 00075 PROCESSING_UNIT_CPU = 1, 00076 PROCESSING_UNIT_GPU = 2 00077 }; 00078 //ETX 00080 00082 static void SetMultiThreadedEnabled(bool enabled); 00083 00085 static void SetAutoPropagatePush(bool enabled); 00086 00089 static void Pull(vtkExecutiveCollection *execs); 00090 00093 static void Pull(vtkExecutiveCollection *execs, vtkInformation *info); 00094 00097 static void Push(vtkExecutiveCollection *execs); 00098 00101 static void Push(vtkExecutiveCollection *execs, vtkInformation *info); 00102 00105 static void Pull(vtkExecutive *exec); 00106 00109 static void Pull(vtkExecutive *exec, vtkInformation *info); 00110 00113 static void Push(vtkExecutive *exec); 00114 00117 static void Push(vtkExecutive *exec, vtkInformation *info); 00118 00120 void Pull(); 00121 00123 void Pull(vtkInformation *info); 00124 00126 void Push(); 00127 00129 void Push(vtkInformation *info); 00130 00132 void ReleaseInputs(); 00133 00135 00137 virtual int ProcessRequest(vtkInformation* request, 00138 vtkInformationVector** inInfo, 00139 vtkInformationVector* outInfo); 00141 00143 int ForceUpdateData(int processingUnit, vtkInformation *info); 00144 00146 void UpdateRequestDataTimeFromSource(); 00147 00149 vtkComputingResources *GetResources(); 00150 00151 float LastDataRequestTime; 00152 float LastDataRequestTimeFromSource; 00153 vtkInformation *ForceDataRequest; 00154 vtkComputingResources *Resources; 00155 vtkExecutionScheduler *Scheduler; 00156 00157 protected: 00158 vtkThreadedStreamingPipeline(); 00159 ~vtkThreadedStreamingPipeline(); 00160 00161 virtual int ForwardUpstream(vtkInformation* request); 00162 virtual int ForwardUpstream(int i, int j, vtkInformation* request); 00163 00164 private: 00165 vtkThreadedStreamingPipeline(const vtkThreadedStreamingPipeline&); // Not implemented. 00166 void operator=(const vtkThreadedStreamingPipeline&); // Not implemented. 00167 }; 00168 00169 #endif