VTK  9.1.0
vtkPieceScalars.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPieceScalars.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 vtkPieceScalars_h
29#define vtkPieceScalars_h
30
31#include "vtkDataSetAlgorithm.h"
32#include "vtkFiltersParallelModule.h" // For export macro
33
34class vtkFloatArray;
35class vtkIntArray;
36
37class VTKFILTERSPARALLEL_EXPORT vtkPieceScalars : public vtkDataSetAlgorithm
38{
39public:
41
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
48 void SetScalarModeToCellData() { this->SetCellScalarsFlag(1); }
49 void SetScalarModeToPointData() { this->SetCellScalarsFlag(0); }
50 int GetScalarMode() { return this->CellScalarsFlag; }
51
52 // Dscription:
53 // This option uses a random mapping between pieces and scalar values.
54 // The scalar values are chosen between 0 and 1. By default, random mode is off.
55 vtkSetMacro(RandomMode, vtkTypeBool);
56 vtkGetMacro(RandomMode, vtkTypeBool);
57 vtkBooleanMacro(RandomMode, vtkTypeBool);
58
59protected:
61 ~vtkPieceScalars() override;
62
63 // Append the pieces.
65
66 vtkIntArray* MakePieceScalars(int piece, vtkIdType numScalars);
67 vtkFloatArray* MakeRandomScalars(int piece, vtkIdType numScalars);
68
69 vtkSetMacro(CellScalarsFlag, int);
72
73private:
74 vtkPieceScalars(const vtkPieceScalars&) = delete;
75 void operator=(const vtkPieceScalars&) = delete;
76};
77
78#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:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:149
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:69
int vtkIdType
Definition: vtkType.h:332