VTK  9.3.0
vtkProcessIdScalars.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkProcessIdScalars_h
17 #define vtkProcessIdScalars_h
18 
19 #include "vtkDataSetAlgorithm.h"
20 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
21 #include "vtkFiltersParallelModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkFloatArray;
25 class vtkIntArray;
27 
28 class VTKFILTERSPARALLEL_EXPORT vtkProcessIdScalars : public vtkDataSetAlgorithm
29 {
30 public:
31  VTK_DEPRECATED_IN_9_3_0("Use `vtkGenerateProcessIds` instead")
32  static vtkProcessIdScalars* New();
33 
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38 
42  void SetScalarModeToCellData() { this->SetCellScalarsFlag(1); }
43  void SetScalarModeToPointData() { this->SetCellScalarsFlag(0); }
44  vtkSetMacro(CellScalarsFlag, int);
45  int GetScalarMode() { return this->CellScalarsFlag; }
47 
49 
54  vtkSetMacro(RandomMode, vtkTypeBool);
55  vtkGetMacro(RandomMode, vtkTypeBool);
56  vtkBooleanMacro(RandomMode, vtkTypeBool);
58 
60 
65  vtkGetObjectMacro(Controller, vtkMultiProcessController);
67 
68 protected:
71 
72  // Append the pieces.
74 
75  vtkIntArray* MakeProcessIdScalars(int piece, vtkIdType numScalars);
76  vtkFloatArray* MakeRandomScalars(int piece, vtkIdType numScalars);
77 
80 
82 
83 private:
85  void operator=(const vtkProcessIdScalars&) = delete;
86 };
87 
88 VTK_ABI_NAMESPACE_END
89 #endif
Superclass for algorithms that produce output of the same type as input.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:44
Multiprocessing communication superclass.
Sets cell or point scalars to the processor rank.
~vtkProcessIdScalars() override
int GetScalarMode()
Option to centerate cell scalars of points scalars.
vtkMultiProcessController * Controller
vtkIntArray * MakeProcessIdScalars(int piece, vtkIdType numScalars)
vtkFloatArray * MakeRandomScalars(int piece, vtkIdType numScalars)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
virtual void SetController(vtkMultiProcessController *)
By default this filter uses the global controller, but this method can be used to set another instead...
void SetScalarModeToPointData()
Option to centerate cell scalars of points scalars.
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition: vtkType.h:315