VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkProcessIdScalars.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 =========================================================================*/ 00027 #ifndef __vtkProcessIdScalars_h 00028 #define __vtkProcessIdScalars_h 00029 00030 #include "vtkFiltersParallelModule.h" // For export macro 00031 #include "vtkDataSetAlgorithm.h" 00032 00033 class vtkFloatArray; 00034 class vtkIntArray; 00035 class vtkMultiProcessController; 00036 00037 class VTKFILTERSPARALLEL_EXPORT vtkProcessIdScalars : public vtkDataSetAlgorithm 00038 { 00039 public: 00040 static vtkProcessIdScalars *New(); 00041 00042 vtkTypeMacro(vtkProcessIdScalars,vtkDataSetAlgorithm); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 00048 void SetScalarModeToCellData() {this->SetCellScalarsFlag(1);} 00049 void SetScalarModeToPointData() {this->SetCellScalarsFlag(0);} 00050 int GetScalarMode() {return this->CellScalarsFlag;} 00052 00053 // Dscription: 00054 // This option uses a random mapping between pieces and scalar values. 00055 // The scalar values are chosen between 0 and 1. By default, random 00056 // mode is off. 00057 vtkSetMacro(RandomMode, int); 00058 vtkGetMacro(RandomMode, int); 00059 vtkBooleanMacro(RandomMode, int); 00060 00062 00064 virtual void SetController(vtkMultiProcessController*); 00065 vtkGetObjectMacro(Controller, vtkMultiProcessController); 00067 00068 00069 protected: 00070 vtkProcessIdScalars(); 00071 ~vtkProcessIdScalars(); 00072 00073 // Append the pieces. 00074 int RequestData( 00075 vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00076 00077 vtkIntArray *MakeProcessIdScalars(int piece, vtkIdType numScalars); 00078 vtkFloatArray *MakeRandomScalars(int piece, vtkIdType numScalars); 00079 00080 vtkSetMacro(CellScalarsFlag,int); 00081 int CellScalarsFlag; 00082 int RandomMode; 00083 00084 vtkMultiProcessController* Controller; 00085 00086 private: 00087 vtkProcessIdScalars(const vtkProcessIdScalars&); // Not implemented. 00088 void operator=(const vtkProcessIdScalars&); // Not implemented. 00089 }; 00090 00091 #endif