VTK  9.2.6
vtkRandomAttributeGenerator.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkRandomAttributeGenerator.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=========================================================================*/
49
50#ifndef vtkRandomAttributeGenerator_h
51#define vtkRandomAttributeGenerator_h
52
53#include "vtkFiltersGeneralModule.h" // For export macro
55
56class vtkDataSet;
58
59class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkPassInputTypeAlgorithm
60{
61public:
63
68 void PrintSelf(ostream& os, vtkIndent indent) override;
70
72
76 vtkSetMacro(DataType, int);
91 vtkGetMacro(DataType, int);
93
95
101 vtkSetClampMacro(NumberOfComponents, int, 1, VTK_INT_MAX);
102 vtkGetMacro(NumberOfComponents, int);
104
106
111 vtkSetMacro(MinimumComponentValue, double);
112 vtkGetMacro(MinimumComponentValue, double);
113 void SetComponentRange(double minimumValue, double maximumValue)
114 {
115 this->SetMinimumComponentValue(minimumValue);
116 this->SetMaximumComponentValue(maximumValue);
117 }
118
119
121
126 vtkSetMacro(MaximumComponentValue, double);
127 vtkGetMacro(MaximumComponentValue, double);
129
131
136 vtkSetClampMacro(NumberOfTuples, vtkIdType, 0, VTK_INT_MAX);
139
141
149
151
159
161
169
171
179
181
190
192
203
205
213
215
223
225
233
235
243
245
254
256
267
269
277
279
284 vtkSetMacro(AttributesConstantPerBlock, bool);
285 vtkGetMacro(AttributesConstantPerBlock, bool);
286 vtkBooleanMacro(AttributesConstantPerBlock, bool);
288
290
297 {
303 this->GeneratePointArrayOn();
304 }
315 {
316 this->GenerateCellScalarsOn();
317 this->GenerateCellVectorsOn();
318 this->GenerateCellNormalsOn();
319 this->GenerateCellTCoordsOn();
320 this->GenerateCellTensorsOn();
321 this->GenerateCellArrayOn();
322 }
324 {
330 this->GenerateCellArrayOff();
331 }
333 {
335 this->GenerateAllCellDataOn();
336 this->GenerateFieldArrayOn();
337 }
339 {
342 this->GenerateFieldArrayOff();
343 }
344
345
346protected:
348 ~vtkRandomAttributeGenerator() override = default;
349
351 int FillInputPortInformation(int port, vtkInformation* info) override;
352
358
365
372
375
376 // Helper functions
377 vtkDataArray* GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp,
378 int maxComp, double min, double max);
379 int RequestData(vtkDataSet* input, vtkDataSet* output);
381 template <class T>
383 T* data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max);
384
385private:
387 void operator=(const vtkRandomAttributeGenerator&) = delete;
388};
389
390#endif
abstract superclass for composite (multi-block or AMR) datasets
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
a simple class to control print indentation
Definition vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
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.
int RequestData(vtkDataSet *input, vtkDataSet *output)
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)
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).
int RequestData(vtkCompositeDataSet *input, vtkCompositeDataSet *output)
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)
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:69
#define vtkDataArray
#define VTK_SHORT
Definition vtkType.h:48
int vtkIdType
Definition vtkType.h:332
#define VTK_UNSIGNED_INT
Definition vtkType.h:51
#define VTK_LONG_LONG
Definition vtkType.h:63
#define VTK_DOUBLE
Definition vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:49
#define VTK_INT
Definition vtkType.h:50
#define VTK_FLOAT
Definition vtkType.h:54
#define VTK_CHAR
Definition vtkType.h:45
#define VTK_UNSIGNED_LONG
Definition vtkType.h:53
#define VTK_BIT
Definition vtkType.h:44
#define VTK_UNSIGNED_LONG_LONG
Definition vtkType.h:64
#define VTK_INT_MAX
Definition vtkType.h:155
#define VTK_LONG
Definition vtkType.h:52
#define VTK_ID_TYPE
Definition vtkType.h:56
#define max(a, b)