VTK  9.3.1
vtkProgrammableGlyphFilter.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
52 #ifndef vtkProgrammableGlyphFilter_h
53 #define vtkProgrammableGlyphFilter_h
54 
55 #define VTK_COLOR_BY_INPUT 0
56 #define VTK_COLOR_BY_SOURCE 1
57 
58 #include "vtkFiltersProgrammableModule.h" // For export macro
59 #include "vtkPolyDataAlgorithm.h"
60 
61 VTK_ABI_NAMESPACE_BEGIN
62 class vtkPointData;
63 
64 class VTKFILTERSPROGRAMMABLE_EXPORT vtkProgrammableGlyphFilter : public vtkPolyDataAlgorithm
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
75 
81  void SetSourceConnection(vtkAlgorithmOutput* output);
82 
84 
89  void SetSourceData(vtkPolyData* source);
90  vtkPolyData* GetSource();
92 
101  typedef void (*ProgrammableMethodCallbackType)(void* arg);
102 
106  void SetGlyphMethod(void (*f)(void*), void* arg);
107 
112  void SetGlyphMethodArgDelete(void (*f)(void*));
113 
115 
119  vtkGetMacro(PointId, vtkIdType);
121 
123 
127  vtkGetVector3Macro(Point, double);
129 
131 
136  vtkGetObjectMacro(PointData, vtkPointData);
138 
140 
143  vtkSetMacro(ColorMode, int);
144  vtkGetMacro(ColorMode, int);
145  void SetColorModeToColorByInput() { this->SetColorMode(VTK_COLOR_BY_INPUT); }
146  void SetColorModeToColorBySource() { this->SetColorMode(VTK_COLOR_BY_SOURCE); }
147  const char* GetColorModeAsString();
149 
150 protected:
152  ~vtkProgrammableGlyphFilter() override;
153 
155  int FillInputPortInformation(int, vtkInformation*) override;
156 
157  double Point[3]; // Coordinates of point
158  vtkIdType PointId; // Current point id during processing
161 
162  ProgrammableMethodCallbackType GlyphMethod; // Support GlyphMethod
163  ProgrammableMethodCallbackType GlyphMethodArgDelete;
165 
166 private:
168  void operator=(const vtkProgrammableGlyphFilter&) = delete;
169 };
170 
171 VTK_ABI_NAMESPACE_END
172 #endif
void SetColorModeToColorBySource()
Either color by the input or source scalar data.
represent and manipulate point attribute data
Definition: vtkPointData.h:29
#define VTK_COLOR_BY_SOURCE
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Proxy object to connect input/output ports.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetColorModeToColorByInput()
Either color by the input or source scalar data.
control the generation and placement of glyphs at input points
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
ProgrammableMethodCallbackType GlyphMethodArgDelete
#define VTK_COLOR_BY_INPUT
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
ProgrammableMethodCallbackType GlyphMethod
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.