VTK  9.5.2
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_4_0
45#include "vtkFiltersGeneralModule.h" // For export macro
47
48VTK_ABI_NAMESPACE_BEGIN
49class vtkCellData;
51class vtkDataSet;
52class vtkFieldData;
54class vtkPointData;
55
56class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkPassInputTypeAlgorithm
57{
58public:
60
65 void PrintSelf(ostream& os, vtkIndent indent) override;
67
69
73 vtkSetMacro(DataType, int);
88 vtkGetMacro(DataType, int);
90
92
98 vtkSetClampMacro(NumberOfComponents, int, 1, VTK_INT_MAX);
99 vtkGetMacro(NumberOfComponents, int);
101
103
108 vtkSetMacro(MinimumComponentValue, double);
109 vtkGetMacro(MinimumComponentValue, double);
110 void SetComponentRange(double minimumValue, double maximumValue)
111 {
112 this->SetMinimumComponentValue(minimumValue);
113 this->SetMaximumComponentValue(maximumValue);
114 }
115
116
118
123 vtkSetMacro(MaximumComponentValue, double);
124 vtkGetMacro(MaximumComponentValue, double);
126
128
133 vtkSetClampMacro(NumberOfTuples, vtkIdType, 0, VTK_INT_MAX);
136
138
146
148
156
158
166
168
176
178
187
189
200
202
210
212
220
222
230
232
240
242
251
253
264
266
274
276
281 vtkSetMacro(AttributesConstantPerBlock, bool);
282 vtkGetMacro(AttributesConstantPerBlock, bool);
283 vtkBooleanMacro(AttributesConstantPerBlock, bool);
285
287
294 {
300 this->GeneratePointArrayOn();
301 }
312 {
313 this->GenerateCellScalarsOn();
314 this->GenerateCellVectorsOn();
315 this->GenerateCellNormalsOn();
316 this->GenerateCellTCoordsOn();
317 this->GenerateCellTensorsOn();
318 this->GenerateCellArrayOn();
319 }
321 {
327 this->GenerateCellArrayOff();
328 }
330 {
332 this->GenerateAllCellDataOn();
333 this->GenerateFieldArrayOn();
334 }
336 {
339 this->GenerateFieldArrayOff();
340 }
341
342
343protected:
345 ~vtkRandomAttributeGenerator() override = default;
346
348 int FillInputPortInformation(int port, vtkInformation* info) override;
349
355
362
369
372
377 vtkDataArray* GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp,
378 int maxComp, double min, double max);
379
384 template <class T>
386 T* data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max);
387
388 VTK_DEPRECATED_IN_9_4_0("This function has confusing naming and contains implementation details, "
389 "it as been made private.")
390 int RequestData(vtkDataSet* input, vtkDataSet* output);
391 VTK_DEPRECATED_IN_9_4_0("This function has confusing naming and contains implementation details, "
392 "it as been made private.")
394
395private:
397 void operator=(const vtkRandomAttributeGenerator&) = delete;
398
402 int ProcessDataSet(vtkDataSet* input, vtkDataSet* output);
403 int ProcessComposite(vtkCompositeDataSet* input, vtkCompositeDataSet* output);
404 int ProcessHTG(vtkHyperTreeGrid* input, vtkHyperTreeGrid* output);
405
412 void GeneratePointData(vtkPointData* outputPD, vtkIdType numPts);
413 void GenerateCellData(vtkCellData* outputCD, vtkIdType numCells);
414 void GenerateFieldData(vtkFieldData* outputFD);
415};
416
417VTK_ABI_NAMESPACE_END
418#endif
represent and manipulate cell attribute data
Definition vtkCellData.h:32
abstract superclass for composite (multi-block or AMR) datasets
abstract class to specify dataset behavior
Definition vtkDataSet.h:56
represent and manipulate fields of data
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
a simple class to control print indentation
Definition vtkIndent.h:29
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
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_DEPRECATED_IN_9_4_0(reason)
#define VTK_SHORT
Definition vtkType.h:37
int vtkIdType
Definition vtkType.h:332
#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:161
#define VTK_LONG
Definition vtkType.h:41
#define VTK_ID_TYPE
Definition vtkType.h:45
#define max(a, b)