VTK  9.3.1
vtkIconGlyphFilter.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
30 #ifndef vtkIconGlyphFilter_h
31 #define vtkIconGlyphFilter_h
32 
33 #include "vtkFiltersGeneralModule.h" // For export macro
34 #include "vtkPolyDataAlgorithm.h"
35 
36 #define VTK_ICON_GRAVITY_TOP_RIGHT 1
37 #define VTK_ICON_GRAVITY_TOP_CENTER 2
38 #define VTK_ICON_GRAVITY_TOP_LEFT 3
39 #define VTK_ICON_GRAVITY_CENTER_RIGHT 4
40 #define VTK_ICON_GRAVITY_CENTER_CENTER 5
41 #define VTK_ICON_GRAVITY_CENTER_LEFT 6
42 #define VTK_ICON_GRAVITY_BOTTOM_RIGHT 7
43 #define VTK_ICON_GRAVITY_BOTTOM_CENTER 8
44 #define VTK_ICON_GRAVITY_BOTTOM_LEFT 9
45 
46 #define VTK_ICON_SCALING_OFF 0
47 #define VTK_ICON_SCALING_USE_SCALING_ARRAY 1
48 
49 VTK_ABI_NAMESPACE_BEGIN
50 class VTKFILTERSGENERAL_EXPORT vtkIconGlyphFilter : public vtkPolyDataAlgorithm
51 {
52 public:
54 
57  static vtkIconGlyphFilter* New();
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
66  vtkSetVector2Macro(IconSize, int);
67  vtkGetVectorMacro(IconSize, int, 2);
69 
71 
74  vtkSetVector2Macro(IconSheetSize, int);
75  vtkGetVectorMacro(IconSheetSize, int, 2);
77 
79 
86  vtkSetVector2Macro(DisplaySize, int);
87  vtkGetVectorMacro(DisplaySize, int, 2);
89 
91 
95  vtkSetMacro(UseIconSize, bool);
96  vtkGetMacro(UseIconSize, bool);
97  vtkBooleanMacro(UseIconSize, bool);
99 
101 
106  vtkSetMacro(IconScaling, int);
107  vtkGetMacro(IconScaling, int);
108  void SetIconScalingToScalingOff() { this->SetIconScaling(VTK_ICON_SCALING_OFF); }
111 
113 
119  vtkSetMacro(PassScalars, bool);
120  vtkGetMacro(PassScalars, bool);
121  vtkBooleanMacro(PassScalars, bool);
123 
125 
130  vtkSetMacro(Gravity, int);
131  vtkGetMacro(Gravity, int);
132  void SetGravityToTopRight() { this->SetGravity(VTK_ICON_GRAVITY_TOP_RIGHT); }
134  void SetGravityToTopLeft() { this->SetGravity(VTK_ICON_GRAVITY_TOP_LEFT); }
142 
144 
148  vtkSetVector2Macro(Offset, int);
149  vtkGetVectorMacro(Offset, int, 2);
151 
152 protected:
154  ~vtkIconGlyphFilter() override;
155 
157 
158  int IconSize[2]; // Size in pixels of an icon in an icon sheet
159  int IconSheetSize[2]; // Size in pixels of the icon sheet
160  int DisplaySize[2]; // Size in pixels of the icon when displayed
161 
162  int Gravity;
166  int Offset[2];
167 
168 private:
169  vtkIconGlyphFilter(const vtkIconGlyphFilter&) = delete;
170  void operator=(const vtkIconGlyphFilter&) = delete;
171 
172  void IconConvertIndex(int id, int& j, int& k);
173 };
174 
175 inline void vtkIconGlyphFilter::IconConvertIndex(int id, int& j, int& k)
176 {
177  int dimX = this->IconSheetSize[0] / this->IconSize[0];
178  int dimY = this->IconSheetSize[1] / this->IconSize[1];
179 
180  j = id - dimX * static_cast<int>(id / dimX);
181  k = dimY - static_cast<int>(id / dimX) - 1;
182 }
183 
184 VTK_ABI_NAMESPACE_END
185 #endif
void SetIconScalingToScalingArray()
Specify how to specify individual icons.
#define VTK_ICON_GRAVITY_BOTTOM_LEFT
Store vtkAlgorithm input/output information.
Filter that generates a polydata consisting of quads with texture coordinates referring to a set of i...
#define VTK_ICON_GRAVITY_BOTTOM_RIGHT
void SetGravityToCenterLeft()
Specify if the input points define the center of the icon quad or one of top right corner...
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetGravityToTopLeft()
Specify if the input points define the center of the icon quad or one of top right corner...
#define VTK_ICON_GRAVITY_CENTER_LEFT
#define VTK_ICON_GRAVITY_TOP_CENTER
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetGravityToBottomLeft()
Specify if the input points define the center of the icon quad or one of top right corner...
#define VTK_ICON_GRAVITY_CENTER_CENTER
void SetIconScalingToScalingOff()
Specify how to specify individual icons.
#define VTK_ICON_GRAVITY_TOP_LEFT
#define VTK_ICON_SCALING_USE_SCALING_ARRAY
#define VTK_ICON_GRAVITY_BOTTOM_CENTER
void SetGravityToTopCenter()
Specify if the input points define the center of the icon quad or one of top right corner...
void SetGravityToBottomRight()
Specify if the input points define the center of the icon quad or one of top right corner...
Store zero or more vtkInformation instances.
void SetGravityToTopRight()
Specify if the input points define the center of the icon quad or one of top right corner...
void SetGravityToCenterRight()
Specify if the input points define the center of the icon quad or one of top right corner...
void SetGravityToCenterCenter()
Specify if the input points define the center of the icon quad or one of top right corner...
#define VTK_ICON_GRAVITY_TOP_RIGHT
#define VTK_ICON_GRAVITY_CENTER_RIGHT
void SetGravityToBottomCenter()
Specify if the input points define the center of the icon quad or one of top right corner...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_ICON_SCALING_OFF