VTK: Filters/Sources/vtkProgrammableSource.h Source File

| VTK 9.3.1

vtkProgrammableSource.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
38 #ifndef vtkProgrammableSource_h
39 #define vtkProgrammableSource_h
40
41 #include "vtkDataObjectAlgorithm.h"
42 #include "vtkFiltersSourcesModule.h" // For export macro
43
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkGraph;
46 class vtkMolecule;
47 class vtkPolyData;
48 class vtkRectilinearGrid;
49 class vtkStructuredGrid;
50 class vtkStructuredPoints;
51 class vtkTable;
52 class vtkUnstructuredGrid;
53
54 class VTKFILTERSSOURCES_EXPORT vtkProgrammableSource : public vtkDataObjectAlgorithm
55 {
56 public:
57 static vtkProgrammableSource* New();
58 vtkTypeMacro(vtkProgrammableSource, vtkDataObjectAlgorithm);
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
70 typedef void (*ProgrammableMethodCallbackType)(void* arg);
71
76 void SetExecuteMethod(void (*f)(void*), void* arg);
77
81 void SetExecuteMethodArgDelete(void (*f)(void*));
82
86 void SetRequestInformationMethod(void (*f)(void*));
87
89
95 vtkPolyData* GetPolyDataOutput();
96 vtkStructuredPoints* GetStructuredPointsOutput();
97 vtkStructuredGrid* GetStructuredGridOutput();
98 vtkUnstructuredGrid* GetUnstructuredGridOutput();
99 vtkRectilinearGrid* GetRectilinearGridOutput();
100 vtkGraph* GetGraphOutput();
101 vtkMolecule* GetMoleculeOutput();
102 vtkTable* GetTableOutput();
104
105 protected:
106 vtkProgrammableSource();
107 ~vtkProgrammableSource() override;
108
109 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
110 int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
111 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
112
113 ProgrammableMethodCallbackType ExecuteMethod; // function to invoke
114 ProgrammableMethodCallbackType ExecuteMethodArgDelete;
115 void* ExecuteMethodArg;
116 ProgrammableMethodCallbackType RequestInformationMethod; // function to invoke
117
118 vtkTimeStamp ExecuteTime;
119 int RequestedDataType;
120
121 private:
122 vtkProgrammableSource(const vtkProgrammableSource&) = delete;
123 void operator=(const vtkProgrammableSource&) = delete;
124 };
125
126 VTK_ABI_NAMESPACE_END
127 #endif
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:33
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:290
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMolecule
class describing a molecule
Definition: vtkMolecule.h:84
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkProgrammableSource
generate source dataset via a user-specified function
Definition: vtkProgrammableSource.h:55
vtkProgrammableSource::RequestInformationMethod
ProgrammableMethodCallbackType RequestInformationMethod
Definition: vtkProgrammableSource.h:116
vtkProgrammableSource::RequestedDataType
int RequestedDataType
Definition: vtkProgrammableSource.h:119
vtkProgrammableSource::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkProgrammableSource::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkProgrammableSource::GetPolyDataOutput
vtkPolyData * GetPolyDataOutput()
Get the output as a concrete type.
vtkProgrammableSource::~vtkProgrammableSource
~vtkProgrammableSource() override
vtkProgrammableSource::New
static vtkProgrammableSource * New()
vtkProgrammableSource::vtkProgrammableSource
vtkProgrammableSource()
vtkProgrammableSource::GetStructuredGridOutput
vtkStructuredGrid * GetStructuredGridOutput()
Get the output as a concrete type.
vtkProgrammableSource::SetExecuteMethod
void SetExecuteMethod(void(*f)(void *), void *arg)
Specify the function to use to generate the source data.
vtkProgrammableSource::ExecuteMethod
ProgrammableMethodCallbackType ExecuteMethod
Definition: vtkProgrammableSource.h:113
vtkProgrammableSource::GetRectilinearGridOutput
vtkRectilinearGrid * GetRectilinearGridOutput()
Get the output as a concrete type.
vtkProgrammableSource::GetMoleculeOutput
vtkMolecule * GetMoleculeOutput()
Get the output as a concrete type.
vtkProgrammableSource::ExecuteTime
vtkTimeStamp ExecuteTime
Definition: vtkProgrammableSource.h:118
vtkProgrammableSource::SetExecuteMethodArgDelete
void SetExecuteMethodArgDelete(void(*f)(void *))
Set the arg delete method.
vtkProgrammableSource::GetStructuredPointsOutput
vtkStructuredPoints * GetStructuredPointsOutput()
Get the output as a concrete type.
vtkProgrammableSource::ExecuteMethodArg
void * ExecuteMethodArg
Definition: vtkProgrammableSource.h:115
vtkProgrammableSource::GetTableOutput
vtkTable * GetTableOutput()
Get the output as a concrete type.
vtkProgrammableSource::GetUnstructuredGridOutput
vtkUnstructuredGrid * GetUnstructuredGridOutput()
Get the output as a concrete type.
vtkProgrammableSource::RequestDataObject
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkProgrammableSource::GetGraphOutput
vtkGraph * GetGraphOutput()
Get the output as a concrete type.
vtkProgrammableSource::SetRequestInformationMethod
void SetRequestInformationMethod(void(*f)(void *))
Specify the function to use to fill in information about the source data.
vtkProgrammableSource::ExecuteMethodArgDelete
ProgrammableMethodCallbackType ExecuteMethodArgDelete
Definition: vtkProgrammableSource.h:114
vtkProgrammableSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:56
vtkStructuredGrid
topologically regular array of data
Definition: vtkStructuredGrid.h:63
vtkStructuredPoints
A subclass of ImageData.
Definition: vtkStructuredPoints.h:37
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:99
vtkDataObjectAlgorithm.h