VTK
vtkProcessIdScalars.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProcessIdScalars.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkProcessIdScalars_h
32 #define vtkProcessIdScalars_h
33 
34 #include "vtkFiltersParallelModule.h" // For export macro
35 #include "vtkDataSetAlgorithm.h"
36 
37 class vtkFloatArray;
38 class vtkIntArray;
40 
41 class VTKFILTERSPARALLEL_EXPORT vtkProcessIdScalars : public vtkDataSetAlgorithm
42 {
43 public:
44  static vtkProcessIdScalars *New();
45 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  void SetScalarModeToCellData() {this->SetCellScalarsFlag(1);}
54  void SetScalarModeToPointData() {this->SetCellScalarsFlag(0);}
55  int GetScalarMode() {return this->CellScalarsFlag;}
56 
57  // Dscription:
58  // This option uses a random mapping between pieces and scalar values.
59  // The scalar values are chosen between 0 and 1. By default, random
60  // mode is off.
61  vtkSetMacro(RandomMode, vtkTypeBool);
62  vtkGetMacro(RandomMode, vtkTypeBool);
63  vtkBooleanMacro(RandomMode, vtkTypeBool);
64 
66 
70  virtual void SetController(vtkMultiProcessController*);
71  vtkGetObjectMacro(Controller, vtkMultiProcessController);
73 
74 
75 protected:
77  ~vtkProcessIdScalars() override;
78 
79  // Append the pieces.
80  int RequestData(
82 
83  vtkIntArray *MakeProcessIdScalars(int piece, vtkIdType numScalars);
84  vtkFloatArray *MakeRandomScalars(int piece, vtkIdType numScalars);
85 
86  vtkSetMacro(CellScalarsFlag,int);
87  int CellScalarsFlag;
89 
91 
92 private:
94  void operator=(const vtkProcessIdScalars&) = delete;
95 };
96 
97 #endif
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
int vtkIdType
Definition: vtkType.h:347
vtkMultiProcessController * Controller
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
a simple class to control print indentation
Definition: vtkIndent.h:39
Sets cell or point scalars to the processor rank.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetScalarModeToCellData()
Option to centerate cell scalars of points scalars.
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()
Multiprocessing communication superclass.