VTK
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
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
62class VTKFILTERSGENERAL_EXPORT vtkIconGlyphFilter : public vtkPolyDataAlgorithm
63{
64public:
66
71 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
73
75
78 vtkSetVector2Macro(IconSize,int);
79 vtkGetVectorMacro(IconSize,int,2);
81
83
86 vtkSetVector2Macro(IconSheetSize,int);
87 vtkGetVectorMacro(IconSheetSize,int,2);
89
91
98 vtkSetVector2Macro(DisplaySize,int);
99 vtkGetVectorMacro(DisplaySize,int,2);
101
103
107 vtkSetMacro(UseIconSize,bool);
108 vtkGetMacro(UseIconSize,bool);
109 vtkBooleanMacro(UseIconSize, bool);
111
113
118 vtkSetMacro(IconScaling,int);
119 vtkGetMacro(IconScaling,int);
120 void SetIconScalingToScalingOff() {this->SetIconScaling(VTK_ICON_SCALING_OFF);}
122 {this->SetIconScaling(VTK_ICON_SCALING_USE_SCALING_ARRAY);}
124
126
132 vtkSetMacro(PassScalars,bool);
133 vtkGetMacro(PassScalars,bool);
134 vtkBooleanMacro(PassScalars,bool);
136
138
143 vtkSetMacro(Gravity, int);
144 vtkGetMacro(Gravity, int);
155
157
161 vtkSetVector2Macro(Offset,int);
162 vtkGetVectorMacro(Offset,int,2);
164
165protected:
167 ~vtkIconGlyphFilter() VTK_OVERRIDE;
168
169 int RequestData(vtkInformation *,
171 vtkInformationVector *) VTK_OVERRIDE;
172
173 int IconSize[2]; // Size in pixels of an icon in an icon sheet
174 int IconSheetSize[2]; // Size in pixels of the icon sheet
175 int DisplaySize[2]; // Size in pixels of the icon when displayed
176
177 int Gravity;
178 bool UseIconSize;
179 int IconScaling;
180 bool PassScalars;
181 int Offset[2];
182
183private:
184 vtkIconGlyphFilter(const vtkIconGlyphFilter&) VTK_DELETE_FUNCTION;
185 void operator=(const vtkIconGlyphFilter&) VTK_DELETE_FUNCTION;
186
187 void IconConvertIndex(int id, int & j, int & k);
188};
189
190inline void vtkIconGlyphFilter::IconConvertIndex(int id, int & j, int & k)
191{
192 int dimX = this->IconSheetSize[0]/this->IconSize[0];
193 int dimY = this->IconSheetSize[1]/this->IconSize[1];
194
195 j = id - dimX * static_cast<int>(id/dimX);
196 k = dimY - static_cast<int>(id/dimX) - 1;
197}
198
199#endif
Filter that generates a polydata consisting of quads with texture coordinates referring to a set of i...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkIconGlyphFilter() override
static vtkIconGlyphFilter * New()
Standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
#define VTK_ICON_GRAVITY_BOTTOM_RIGHT
#define VTK_ICON_GRAVITY_CENTER_LEFT
#define VTK_ICON_SCALING_USE_SCALING_ARRAY
#define VTK_ICON_GRAVITY_TOP_RIGHT
#define VTK_ICON_GRAVITY_BOTTOM_LEFT
#define VTK_ICON_GRAVITY_TOP_LEFT
#define VTK_ICON_GRAVITY_BOTTOM_CENTER
#define VTK_ICON_GRAVITY_CENTER_CENTER
#define VTK_ICON_GRAVITY_TOP_CENTER
#define VTK_ICON_GRAVITY_CENTER_RIGHT
#define VTK_ICON_SCALING_OFF
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.