VTK  9.3.20240423
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
25VTK_ABI_NAMESPACE_BEGIN
26class vtkFloatArray;
27class vtkIntArray;
28
29class VTKFILTERSPARALLEL_EXPORT vtkPieceScalars : public vtkDataSetAlgorithm
30{
31public:
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
51protected:
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);
64
65private:
66 vtkPieceScalars(const vtkPieceScalars&) = delete;
67 void operator=(const vtkPieceScalars&) = delete;
68};
69
70VTK_ABI_NAMESPACE_END
71#endif
Superclass for algorithms that produce output of the same type as input.
dynamic, self-adjusting array of float
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
Sets all cell scalars from the update piece.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkPieceScalars() override
void SetScalarModeToCellData()
Option to centerate cell scalars of points scalars.
vtkIntArray * MakePieceScalars(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.
void SetScalarModeToPointData()
static vtkPieceScalars * New()
vtkTypeBool RandomMode
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315