VTK  9.0.3
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 =========================================================================*/
28 #ifndef vtkProcessIdScalars_h
29 #define vtkProcessIdScalars_h
30 
31 #include "vtkDataSetAlgorithm.h"
32 #include "vtkFiltersParallelModule.h" // For export macro
33 
34 class vtkFloatArray;
35 class vtkIntArray;
37 
38 class VTKFILTERSPARALLEL_EXPORT vtkProcessIdScalars : public vtkDataSetAlgorithm
39 {
40 public:
42 
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
50  void SetScalarModeToCellData() { this->SetCellScalarsFlag(1); }
51  void SetScalarModeToPointData() { this->SetCellScalarsFlag(0); }
52  int GetScalarMode() { return this->CellScalarsFlag; }
53 
54  // Dscription:
55  // This option uses a random mapping between pieces and scalar values.
56  // The scalar values are chosen between 0 and 1. By default, random
57  // mode is off.
58  vtkSetMacro(RandomMode, vtkTypeBool);
59  vtkGetMacro(RandomMode, vtkTypeBool);
60  vtkBooleanMacro(RandomMode, vtkTypeBool);
61 
63 
68  vtkGetObjectMacro(Controller, vtkMultiProcessController);
70 
71 protected:
74 
75  // Append the pieces.
77 
78  vtkIntArray* MakeProcessIdScalars(int piece, vtkIdType numScalars);
79  vtkFloatArray* MakeRandomScalars(int piece, vtkIdType numScalars);
80 
81  vtkSetMacro(CellScalarsFlag, int);
84 
86 
87 private:
89  void operator=(const vtkProcessIdScalars&) = delete;
90 };
91 
92 #endif
Superclass for algorithms that produce output of the same type as input.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:40
Multiprocessing communication superclass.
Sets cell or point scalars to the processor rank.
~vtkProcessIdScalars() override
static vtkProcessIdScalars * New()
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.
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:338