VTK  9.3.1
vtkPieceScalars.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
19 #ifndef vtkPieceScalars_h
20 #define vtkPieceScalars_h
21 
22 #include "vtkDataSetAlgorithm.h"
23 #include "vtkFiltersParallelModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkFloatArray;
27 class vtkIntArray;
28 
29 class VTKFILTERSPARALLEL_EXPORT vtkPieceScalars : public vtkDataSetAlgorithm
30 {
31 public:
32  static vtkPieceScalars* New();
33 
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  void SetScalarModeToCellData() { this->SetCellScalarsFlag(1); }
41  void SetScalarModeToPointData() { this->SetCellScalarsFlag(0); }
42  int GetScalarMode() { return this->CellScalarsFlag; }
43 
44  // Dscription:
45  // This option uses a random mapping between pieces and scalar values.
46  // The scalar values are chosen between 0 and 1. By default, random mode is off.
47  vtkSetMacro(RandomMode, vtkTypeBool);
48  vtkGetMacro(RandomMode, vtkTypeBool);
49  vtkBooleanMacro(RandomMode, vtkTypeBool);
50 
51 protected:
53  ~vtkPieceScalars() override;
54 
55  // Append the pieces.
57 
58  vtkIntArray* MakePieceScalars(int piece, vtkIdType numScalars);
59  vtkFloatArray* MakeRandomScalars(int piece, vtkIdType numScalars);
60 
61  vtkSetMacro(CellScalarsFlag, int);
62  int CellScalarsFlag;
64 
65 private:
66  vtkPieceScalars(const vtkPieceScalars&) = delete;
67  void operator=(const vtkPieceScalars&) = delete;
68 };
69 
70 VTK_ABI_NAMESPACE_END
71 #endif
void SetScalarModeToCellData()
Option to centerate cell scalars of points scalars.
vtkTypeBool RandomMode
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:30
int vtkIdType
Definition: vtkType.h:315
int vtkTypeBool
Definition: vtkABI.h:64
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:34
a simple class to control print indentation
Definition: vtkIndent.h:28
Sets all cell scalars from the update piece.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetScalarModeToPointData()
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()