VTK  9.5.20251125
vtkRandomAttributeGenerator.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
40
41#ifndef vtkRandomAttributeGenerator_h
42#define vtkRandomAttributeGenerator_h
43
44#include "vtkFiltersGeneralModule.h" // For export macro
46
47VTK_ABI_NAMESPACE_BEGIN
48class vtkCellData;
50class vtkDataSet;
51class vtkFieldData;
53class vtkPointData;
54
55class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkPassInputTypeAlgorithm
56{
57public:
59
64 void PrintSelf(ostream& os, vtkIndent indent) override;
66
68
72 vtkSetMacro(DataType, int);
87 vtkGetMacro(DataType, int);
89
91
97 vtkSetClampMacro(NumberOfComponents, int, 1, VTK_INT_MAX);
98 vtkGetMacro(NumberOfComponents, int);
100
102
107 vtkSetMacro(MinimumComponentValue, double);
108 vtkGetMacro(MinimumComponentValue, double);
109 void SetComponentRange(double minimumValue, double maximumValue)
110 {
111 this->SetMinimumComponentValue(minimumValue);
112 this->SetMaximumComponentValue(maximumValue);
113 }
114
115
117
122 vtkSetMacro(MaximumComponentValue, double);
123 vtkGetMacro(MaximumComponentValue, double);
125
127
132 vtkSetClampMacro(NumberOfTuples, vtkIdType, 0, VTK_INT_MAX);
135
137
145
147
155
157
165
167
175
177
186
188
199
201
209
211
219
221
229
231
239
241
250
252
263
265
273
275
280 vtkSetMacro(AttributesConstantPerBlock, bool);
281 vtkGetMacro(AttributesConstantPerBlock, bool);
282 vtkBooleanMacro(AttributesConstantPerBlock, bool);
284
286
293 {
299 this->GeneratePointArrayOn();
300 }
311 {
312 this->GenerateCellScalarsOn();
313 this->GenerateCellVectorsOn();
314 this->GenerateCellNormalsOn();
315 this->GenerateCellTCoordsOn();
316 this->GenerateCellTensorsOn();
317 this->GenerateCellArrayOn();
318 }
320 {
326 this->GenerateCellArrayOff();
327 }
329 {
331 this->GenerateAllCellDataOn();
332 this->GenerateFieldArrayOn();
333 }
335 {
338 this->GenerateFieldArrayOff();
339 }
340
341
342protected:
344 ~vtkRandomAttributeGenerator() override = default;
345
347 int FillInputPortInformation(int port, vtkInformation* info) override;
348
354
361
368
371
376 vtkDataArray* GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp,
377 int maxComp, double min, double max);
378
383 template <class T>
385 T* data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max);
386
387private:
389 void operator=(const vtkRandomAttributeGenerator&) = delete;
390
394 int ProcessDataSet(vtkDataSet* input, vtkDataSet* output);
395 int ProcessComposite(vtkCompositeDataSet* input, vtkCompositeDataSet* output);
396 int ProcessHTG(vtkHyperTreeGrid* input, vtkHyperTreeGrid* output);
397
404 void GeneratePointData(vtkPointData* outputPD, vtkIdType numPts);
405 void GenerateCellData(vtkCellData* outputCD, vtkIdType numCells);
406 void GenerateFieldData(vtkFieldData* outputFD);
407};
408
409VTK_ABI_NAMESPACE_END
410#endif
represent and manipulate cell attribute data
abstract superclass for composite (multi-block or AMR) datasets
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
Represents and manipulates a collection of data arrays.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
void SetDataTypeToUnsignedChar()
Specify the type of array to create (all components of this array are of this type).
virtual void GeneratePointArrayOff()
Indicate that an arbitrary point array is to be generated.
virtual void GenerateFieldArrayOff()
Indicate that an arbitrary field data array is to be generated.
void SetDataTypeToUnsignedShort()
Specify the type of array to create (all components of this array are of this type).
void SetDataTypeToUnsignedInt()
Specify the type of array to create (all components of this array are of this type).
void GenerateAllPointDataOff()
Convenience methods for generating data: all data, all point data, or all cell data.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void GenerateAllDataOff()
Convenience methods for generating data: all data, all point data, or all cell data.
virtual void GenerateCellTCoordsOff()
Indicate that cell texture coordinates are to be generated.
static vtkRandomAttributeGenerator * New()
Standard methods for construction, type info, and printing.
void SetDataTypeToLongLong()
Specify the type of array to create (all components of this array are of this type).
void GenerateAllCellDataOn()
Convenience methods for generating data: all data, all point data, or all cell data.
virtual void GeneratePointTensorsOn()
Indicate that point tensors are to be generated.
virtual void GeneratePointNormalsOn()
Indicate that point normals are to be generated.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual void GenerateCellVectorsOn()
Indicate that cell vectors are to be generated.
virtual void GenerateCellTCoordsOn()
Indicate that cell texture coordinates are to be generated.
virtual void GeneratePointVectorsOff()
Indicate that point vectors are to be generated.
void SetDataTypeToIdType()
Specify the type of array to create (all components of this array are of this type).
void SetDataTypeToBit()
Specify the type of array to create (all components of this array are of this type).
vtkDataArray * GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max)
Returns new array with numTuples tuples and numComp components, with values in the range [min,...
virtual void GenerateFieldArrayOn()
Indicate that an arbitrary field data array is to be generated.
virtual void GeneratePointNormalsOff()
Indicate that point normals are to be generated.
void SetDataTypeToInt()
Specify the type of array to create (all components of this array are of this type).
virtual void GenerateCellNormalsOn()
Indicate that cell normals are to be generated.
void SetDataTypeToLong()
Specify the type of array to create (all components of this array are of this type).
void GenerateAllDataOn()
Convenience methods for generating data: all data, all point data, or all cell data.
void GenerateAllCellDataOff()
Convenience methods for generating data: all data, all point data, or all cell data.
virtual void GenerateCellTensorsOff()
Indicate that cell tensors are to be generated.
virtual void GenerateCellArrayOff()
Indicate that an arbitrary cell array is to be generated.
virtual void GeneratePointTCoordsOff()
Indicate that point texture coordinates are to be generated.
virtual void GeneratePointScalarsOff()
Indicate that point scalars are to be generated.
virtual void SetMaximumComponentValue(double)
Set the maximum component value.
void SetDataTypeToFloat()
Specify the type of array to create (all components of this array are of this type).
void SetDataTypeToShort()
Specify the type of array to create (all components of this array are of this type).
void SetDataTypeToDouble()
Specify the type of array to create (all components of this array are of this type).
virtual void GeneratePointVectorsOn()
Indicate that point vectors are to be generated.
virtual void SetMinimumComponentValue(double)
Set the minimum component value.
virtual void GenerateCellNormalsOff()
Indicate that cell normals are to be generated.
void SetDataTypeToUnsignedLong()
Specify the type of array to create (all components of this array are of this type).
void GenerateRandomTuples(T *data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max)
Fills data with numTuples tuples and numComp components, with values in the range [min,...
void SetDataTypeToChar()
Specify the type of array to create (all components of this array are of this type).
~vtkRandomAttributeGenerator() override=default
virtual void GenerateCellArrayOn()
Indicate that an arbitrary cell array is to be generated.
void SetDataTypeToUnsignedLongLong()
Specify the type of array to create (all components of this array are of this type).
virtual void GeneratePointTensorsOff()
Indicate that point tensors are to be generated.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type info, and printing.
virtual void GenerateCellVectorsOff()
Indicate that cell vectors are to be generated.
virtual void GeneratePointArrayOn()
Indicate that an arbitrary point array is to be generated.
virtual void SetDataType(int)
Specify the type of array to create (all components of this array are of this type).
virtual void GenerateCellScalarsOff()
Indicate that cell scalars are to be generated.
virtual void GenerateCellScalarsOn()
Indicate that cell scalars are to be generated.
virtual void GenerateCellTensorsOn()
Indicate that cell tensors are to be generated.
virtual void GeneratePointTCoordsOn()
Indicate that point texture coordinates are to be generated.
void SetComponentRange(double minimumValue, double maximumValue)
Set the minimum component value.
void GenerateAllPointDataOn()
Convenience methods for generating data: all data, all point data, or all cell data.
virtual void GeneratePointScalarsOn()
Indicate that point scalars are to be generated.
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
#define VTK_SHORT
Definition vtkType.h:37
int vtkIdType
Definition vtkType.h:367
#define VTK_UNSIGNED_INT
Definition vtkType.h:40
#define VTK_LONG_LONG
Definition vtkType.h:52
#define VTK_DOUBLE
Definition vtkType.h:44
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:36
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:38
#define VTK_INT
Definition vtkType.h:39
#define VTK_FLOAT
Definition vtkType.h:43
#define VTK_CHAR
Definition vtkType.h:34
#define VTK_UNSIGNED_LONG
Definition vtkType.h:42
#define VTK_BIT
Definition vtkType.h:33
#define VTK_UNSIGNED_LONG_LONG
Definition vtkType.h:53
#define VTK_INT_MAX
Definition vtkType.h:196
#define VTK_LONG
Definition vtkType.h:41
#define VTK_ID_TYPE
Definition vtkType.h:45
#define max(a, b)