VTK  9.2.6
vtkIconGlyphFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkIconGlyphFilter.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 =========================================================================*/
42 #ifndef vtkIconGlyphFilter_h
43 #define vtkIconGlyphFilter_h
44 
45 #include "vtkFiltersGeneralModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
47 
48 #define VTK_ICON_GRAVITY_TOP_RIGHT 1
49 #define VTK_ICON_GRAVITY_TOP_CENTER 2
50 #define VTK_ICON_GRAVITY_TOP_LEFT 3
51 #define VTK_ICON_GRAVITY_CENTER_RIGHT 4
52 #define VTK_ICON_GRAVITY_CENTER_CENTER 5
53 #define VTK_ICON_GRAVITY_CENTER_LEFT 6
54 #define VTK_ICON_GRAVITY_BOTTOM_RIGHT 7
55 #define VTK_ICON_GRAVITY_BOTTOM_CENTER 8
56 #define VTK_ICON_GRAVITY_BOTTOM_LEFT 9
57 
58 #define VTK_ICON_SCALING_OFF 0
59 #define VTK_ICON_SCALING_USE_SCALING_ARRAY 1
60 
61 class VTKFILTERSGENERAL_EXPORT vtkIconGlyphFilter : public vtkPolyDataAlgorithm
62 {
63 public:
65 
68  static vtkIconGlyphFilter* New();
70  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
74 
77  vtkSetVector2Macro(IconSize, int);
78  vtkGetVectorMacro(IconSize, int, 2);
80 
82 
85  vtkSetVector2Macro(IconSheetSize, int);
86  vtkGetVectorMacro(IconSheetSize, int, 2);
88 
90 
97  vtkSetVector2Macro(DisplaySize, int);
98  vtkGetVectorMacro(DisplaySize, int, 2);
100 
102 
106  vtkSetMacro(UseIconSize, bool);
107  vtkGetMacro(UseIconSize, bool);
108  vtkBooleanMacro(UseIconSize, bool);
110 
112 
117  vtkSetMacro(IconScaling, int);
118  vtkGetMacro(IconScaling, int);
119  void SetIconScalingToScalingOff() { this->SetIconScaling(VTK_ICON_SCALING_OFF); }
122 
124 
130  vtkSetMacro(PassScalars, bool);
131  vtkGetMacro(PassScalars, bool);
132  vtkBooleanMacro(PassScalars, bool);
134 
136 
141  vtkSetMacro(Gravity, int);
142  vtkGetMacro(Gravity, int);
143  void SetGravityToTopRight() { this->SetGravity(VTK_ICON_GRAVITY_TOP_RIGHT); }
145  void SetGravityToTopLeft() { this->SetGravity(VTK_ICON_GRAVITY_TOP_LEFT); }
153 
155 
159  vtkSetVector2Macro(Offset, int);
160  vtkGetVectorMacro(Offset, int, 2);
162 
163 protected:
165  ~vtkIconGlyphFilter() override;
166 
168 
169  int IconSize[2]; // Size in pixels of an icon in an icon sheet
170  int IconSheetSize[2]; // Size in pixels of the icon sheet
171  int DisplaySize[2]; // Size in pixels of the icon when displayed
172 
173  int Gravity;
177  int Offset[2];
178 
179 private:
180  vtkIconGlyphFilter(const vtkIconGlyphFilter&) = delete;
181  void operator=(const vtkIconGlyphFilter&) = delete;
182 
183  void IconConvertIndex(int id, int& j, int& k);
184 };
185 
186 inline void vtkIconGlyphFilter::IconConvertIndex(int id, int& j, int& k)
187 {
188  int dimX = this->IconSheetSize[0] / this->IconSize[0];
189  int dimY = this->IconSheetSize[1] / this->IconSize[1];
190 
191  j = id - dimX * static_cast<int>(id / dimX);
192  k = dimY - static_cast<int>(id / dimX) - 1;
193 }
194 
195 #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:39
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