VTK  9.3.20240419
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 
29  "Use `vtkGenerateProcessIds` instead") VTKFILTERSPARALLEL_EXPORT vtkProcessIdScalars
30  : public vtkDataSetAlgorithm
31 {
32 public:
34 
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
43  void SetScalarModeToCellData() { this->SetCellScalarsFlag(1); }
44  void SetScalarModeToPointData() { this->SetCellScalarsFlag(0); }
45  vtkSetMacro(CellScalarsFlag, int);
46  int GetScalarMode() { return this->CellScalarsFlag; }
48 
50 
55  vtkSetMacro(RandomMode, vtkTypeBool);
56  vtkGetMacro(RandomMode, vtkTypeBool);
57  vtkBooleanMacro(RandomMode, vtkTypeBool);
59 
61 
66  vtkGetObjectMacro(Controller, vtkMultiProcessController);
68 
69 protected:
72 
73  // Append the pieces.
75 
76  vtkIntArray* MakeProcessIdScalars(int piece, vtkIdType numScalars);
77  vtkFloatArray* MakeRandomScalars(int piece, vtkIdType numScalars);
78 
81 
83 
84 private:
86  void operator=(const vtkProcessIdScalars&) = delete;
87 };
88 
89 VTK_ABI_NAMESPACE_END
90 #endif
Superclass for algorithms that produce output of the same type as input.
dynamic, self-adjusting array of float
Sets ProcessIds attribute for PointData and/or CellData.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:144
Multiprocessing communication superclass.
Sets cell or point scalars to the processor rank.
~vtkProcessIdScalars() override
static vtkProcessIdScalars * New()
int GetScalarMode()
Option to centerate cell scalars of points scalars.
vtkMultiProcessController * Controller
vtkIntArray * MakeProcessIdScalars(int piece, vtkIdType numScalars)
vtkFloatArray * MakeRandomScalars(int piece, vtkIdType numScalars)
void SetScalarModeToCellData()
Option to centerate cell scalars of points scalars.
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 PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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