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