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 -------------------------------------------------------------------------*/ 00043 #ifndef __vtkThreadedStreamingPipeline_h 00044 #define __vtkThreadedStreamingPipeline_h 00045 00046 #include "vtkCompositeDataPipeline.h" 00047 00048 class vtkComputingResources; 00049 class vtkExecutionScheduler; 00050 class vtkExecutiveCollection; 00051 00052 class VTK_FILTERING_EXPORT vtkThreadedStreamingPipeline : public vtkCompositeDataPipeline 00053 { 00054 public: 00055 static vtkThreadedStreamingPipeline* New(); 00056 vtkTypeMacro(vtkThreadedStreamingPipeline,vtkCompositeDataPipeline); 00057 void PrintSelf(ostream &os, vtkIndent indent); 00058 00060 static vtkInformationIntegerKey* AUTO_PROPAGATE(); 00061 00063 static vtkInformationObjectBaseKey* EXTRA_INFORMATION(); 00064 00066 00068 enum 00069 { 00070 PROCESSING_UNIT_NONE = 0, 00071 PROCESSING_UNIT_CPU = 1, 00072 PROCESSING_UNIT_GPU = 2 00073 }; 00074 //ETX 00076 00078 static void SetMultiThreadedEnabled(bool enabled); 00079 00081 static void SetAutoPropagatePush(bool enabled); 00082 00085 static void Pull(vtkExecutiveCollection *execs); 00086 00089 static void Pull(vtkExecutiveCollection *execs, vtkInformation *info); 00090 00093 static void Push(vtkExecutiveCollection *execs); 00094 00097 static void Push(vtkExecutiveCollection *execs, vtkInformation *info); 00098 00101 static void Pull(vtkExecutive *exec); 00102 00105 static void Pull(vtkExecutive *exec, vtkInformation *info); 00106 00109 static void Push(vtkExecutive *exec); 00110 00113 static void Push(vtkExecutive *exec, vtkInformation *info); 00114 00116 void Pull(); 00117 00119 void Pull(vtkInformation *info); 00120 00122 void Push(); 00123 00125 void Push(vtkInformation *info); 00126 00128 void ReleaseInputs(); 00129 00131 00133 virtual int ProcessRequest(vtkInformation* request, 00134 vtkInformationVector** inInfo, 00135 vtkInformationVector* outInfo); 00137 00139 int ForceUpdateData(int processingUnit, vtkInformation *info); 00140 00142 void UpdateRequestDataTimeFromSource(); 00143 00145 vtkComputingResources *GetResources(); 00146 00147 float LastDataRequestTime; 00148 float LastDataRequestTimeFromSource; 00149 vtkInformation *ForceDataRequest; 00150 vtkComputingResources *Resources; 00151 vtkExecutionScheduler *Scheduler; 00152 00153 protected: 00154 vtkThreadedStreamingPipeline(); 00155 ~vtkThreadedStreamingPipeline(); 00156 00157 virtual int ForwardUpstream(vtkInformation* request); 00158 virtual int ForwardUpstream(int i, int j, vtkInformation* request); 00159 00160 private: 00161 vtkThreadedStreamingPipeline(const vtkThreadedStreamingPipeline&); // Not implemented. 00162 void operator=(const vtkThreadedStreamingPipeline&); // Not implemented. 00163 }; 00164 00165 #endif