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 =========================================================================*/
39 #ifndef vtkIconGlyphFilter_h
40 #define vtkIconGlyphFilter_h
41 
42 #include "vtkFiltersGeneralModule.h" // For export macro
43 #include "vtkPolyDataAlgorithm.h"
44 
45 #define VTK_ICON_GRAVITY_TOP_RIGHT 1
46 #define VTK_ICON_GRAVITY_TOP_CENTER 2
47 #define VTK_ICON_GRAVITY_TOP_LEFT 3
48 #define VTK_ICON_GRAVITY_CENTER_RIGHT 4
49 #define VTK_ICON_GRAVITY_CENTER_CENTER 5
50 #define VTK_ICON_GRAVITY_CENTER_LEFT 6
51 #define VTK_ICON_GRAVITY_BOTTOM_RIGHT 7
52 #define VTK_ICON_GRAVITY_BOTTOM_CENTER 8
53 #define VTK_ICON_GRAVITY_BOTTOM_LEFT 9
54 
55 #define VTK_ICON_SCALING_OFF 0
56 #define VTK_ICON_SCALING_USE_SCALING_ARRAY 1
57 
58 
59 class VTKFILTERSGENERAL_EXPORT vtkIconGlyphFilter : public vtkPolyDataAlgorithm
60 {
61 public:
63 
66  static vtkIconGlyphFilter *New();
68  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70 
72 
75  vtkSetVector2Macro(IconSize,int);
76  vtkGetVectorMacro(IconSize,int,2);
78 
80 
83  vtkSetVector2Macro(IconSheetSize,int);
84  vtkGetVectorMacro(IconSheetSize,int,2);
86 
88 
95  vtkSetVector2Macro(DisplaySize,int);
96  vtkGetVectorMacro(DisplaySize,int,2);
98 
100 
104  vtkSetMacro(UseIconSize,bool);
105  vtkGetMacro(UseIconSize,bool);
106  vtkBooleanMacro(UseIconSize, bool);
108 
110 
115  vtkSetMacro(IconScaling,int);
116  vtkGetMacro(IconScaling,int);
117  void SetIconScalingToScalingOff() {this->SetIconScaling(VTK_ICON_SCALING_OFF);}
119  {this->SetIconScaling(VTK_ICON_SCALING_USE_SCALING_ARRAY);}
121 
123 
129  vtkSetMacro(PassScalars,bool);
130  vtkGetMacro(PassScalars,bool);
131  vtkBooleanMacro(PassScalars,bool);
133 
135 
140  vtkSetMacro(Gravity, int);
141  vtkGetMacro(Gravity, int);
144  void SetGravityToTopLeft() {this->SetGravity(VTK_ICON_GRAVITY_TOP_LEFT);};
152 
154 
158  vtkSetVector2Macro(Offset,int);
159  vtkGetVectorMacro(Offset,int,2);
161 
162 protected:
164  ~vtkIconGlyphFilter() VTK_OVERRIDE;
165 
166  int RequestData(vtkInformation *,
168  vtkInformationVector *) VTK_OVERRIDE;
169 
170  int IconSize[2]; // Size in pixels of an icon in an icon sheet
171  int IconSheetSize[2]; // Size in pixels of the icon sheet
172  int DisplaySize[2]; // Size in pixels of the icon when displayed
173 
174  int Gravity;
175  bool UseIconSize;
176  int IconScaling;
177  bool PassScalars;
178  int Offset[2];
179 
180 private:
181  vtkIconGlyphFilter(const vtkIconGlyphFilter&) VTK_DELETE_FUNCTION;
182  void operator=(const vtkIconGlyphFilter&) VTK_DELETE_FUNCTION;
183 
184  void IconConvertIndex(int id, int & j, int & k);
185 };
186 
187 inline void vtkIconGlyphFilter::IconConvertIndex(int id, int & j, int & k)
188 {
189  int dimX = this->IconSheetSize[0]/this->IconSize[0];
190  int dimY = this->IconSheetSize[1]/this->IconSize[1];
191 
192  j = id - dimX * static_cast<int>(id/dimX);
193  k = dimY - static_cast<int>(id/dimX) - 1;
194 }
195 
196 #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...
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:33
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
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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...
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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