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=========================================================================*/
52
53#ifndef vtkRandomAttributeGenerator_h
54#define vtkRandomAttributeGenerator_h
55
56#include "vtkFiltersGeneralModule.h" // For export macro
58
59class vtkDataSet;
61
62class VTKFILTERSGENERAL_EXPORT vtkRandomAttributeGenerator : public vtkPassInputTypeAlgorithm
63{
64public:
66
71 void PrintSelf(ostream& os, vtkIndent indent) override;
73
75
79 vtkSetMacro(DataType, int);
94 vtkGetMacro(DataType, int);
96
98
104 vtkSetClampMacro(NumberOfComponents, int, 1, VTK_INT_MAX);
105 vtkGetMacro(NumberOfComponents, int);
107
109
114 vtkSetMacro(MinimumComponentValue, double);
115 vtkGetMacro(MinimumComponentValue, double);
116 void SetComponentRange(double minimumValue, double maximumValue)
117 {
118 this->SetMinimumComponentValue(minimumValue);
119 this->SetMaximumComponentValue(maximumValue);
120 }
121
122
124
129 vtkSetMacro(MaximumComponentValue, double);
130 vtkGetMacro(MaximumComponentValue, double);
132
134
139 vtkSetClampMacro(NumberOfTuples, vtkIdType, 0, VTK_INT_MAX);
142
144
152
154
162
164
172
174
182
184
193
195
206
208
216
218
226
228
236
238
246
248
257
259
270
272
280
282
287 vtkSetMacro(AttributesConstantPerBlock, bool);
288 vtkGetMacro(AttributesConstantPerBlock, bool);
289 vtkBooleanMacro(AttributesConstantPerBlock, bool);
291
293
300 {
306 this->GeneratePointArrayOn();
307 }
318 {
319 this->GenerateCellScalarsOn();
320 this->GenerateCellVectorsOn();
321 this->GenerateCellNormalsOn();
322 this->GenerateCellTCoordsOn();
323 this->GenerateCellTensorsOn();
324 this->GenerateCellArrayOn();
325 }
327 {
333 this->GenerateCellArrayOff();
334 }
336 {
338 this->GenerateAllCellDataOn();
339 this->GenerateFieldArrayOn();
340 }
342 {
345 this->GenerateFieldArrayOff();
346 }
347
348
349protected:
351 ~vtkRandomAttributeGenerator() override = default;
352
354 int FillInputPortInformation(int port, vtkInformation* info) override;
355
361
368
375
378
379 // Helper functions
380 vtkDataArray* GenerateData(int dataType, vtkIdType numTuples, int numComp, int minComp,
381 int maxComp, double min, double max);
382 int RequestData(vtkDataSet* input, vtkDataSet* output);
384 template <class T>
386 T* data, vtkIdType numTuples, int numComp, int minComp, int maxComp, double min, double max);
387
388private:
390 void operator=(const vtkRandomAttributeGenerator&) = delete;
391};
392
393#endif
abstract superclass for composite (multi-block or AMR) datasets
abstract class to specify dataset behavior
Definition vtkDataSet.h:63
a simple class to control print indentation
Definition vtkIndent.h:40
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)