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 =========================================================================*/
41 #ifndef vtkIconGlyphFilter_h
42 #define vtkIconGlyphFilter_h
43 
44 #include "vtkFiltersGeneralModule.h" // For export macro
45 #include "vtkPolyDataAlgorithm.h"
46 
47 #define VTK_ICON_GRAVITY_TOP_RIGHT 1
48 #define VTK_ICON_GRAVITY_TOP_CENTER 2
49 #define VTK_ICON_GRAVITY_TOP_LEFT 3
50 #define VTK_ICON_GRAVITY_CENTER_RIGHT 4
51 #define VTK_ICON_GRAVITY_CENTER_CENTER 5
52 #define VTK_ICON_GRAVITY_CENTER_LEFT 6
53 #define VTK_ICON_GRAVITY_BOTTOM_RIGHT 7
54 #define VTK_ICON_GRAVITY_BOTTOM_CENTER 8
55 #define VTK_ICON_GRAVITY_BOTTOM_LEFT 9
56 
57 #define VTK_ICON_SCALING_OFF 0
58 #define VTK_ICON_SCALING_USE_SCALING_ARRAY 1
59 
60 
62 {
63 public:
65 
66  static vtkIconGlyphFilter *New();
68  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
74  vtkSetVector2Macro(IconSize,int);
75  vtkGetVectorMacro(IconSize,int,2);
77 
79 
81  vtkSetVector2Macro(IconSheetSize,int);
82  vtkGetVectorMacro(IconSheetSize,int,2);
84 
86 
91  vtkSetVector2Macro(DisplaySize,int);
92  vtkGetVectorMacro(DisplaySize,int,2);
94 
96 
98  vtkSetMacro(UseIconSize,bool);
99  vtkGetMacro(UseIconSize,bool);
100  vtkBooleanMacro(UseIconSize, bool);
102 
104 
107  vtkSetMacro(IconScaling,int);
108  vtkGetMacro(IconScaling,int);
109  void SetIconScalingToScalingOff() {this->SetIconScaling(VTK_ICON_SCALING_OFF);}
111  {this->SetIconScaling(VTK_ICON_SCALING_USE_SCALING_ARRAY);}
113 
115 
119  vtkSetMacro(PassScalars,bool);
120  vtkGetMacro(PassScalars,bool);
121  vtkBooleanMacro(PassScalars,bool);
123 
125 
129  vtkSetMacro(Gravity, int);
130  vtkGetMacro(Gravity, int);
133  void SetGravityToTopLeft() {this->SetGravity(VTK_ICON_GRAVITY_TOP_LEFT);};
141 
143 
145  vtkSetVector2Macro(Offset,int);
146  vtkGetVectorMacro(Offset,int,2);
148 
149 protected:
152 
153  virtual int RequestData(vtkInformation *,
156 
157  int IconSize[2]; // Size in pixels of an icon in an icon sheet
158  int IconSheetSize[2]; // Size in pixels of the icon sheet
159  int DisplaySize[2]; // Size in pixels of the icon when displayed
160 
161  int Gravity;
165  int Offset[2];
166 
167 private:
168  vtkIconGlyphFilter(const vtkIconGlyphFilter&); // Not implemented.
169  void operator=(const vtkIconGlyphFilter&); // Not implemented.
170 
171  void IconConvertIndex(int id, int & j, int & k);
172 };
173 
174 inline void vtkIconGlyphFilter::IconConvertIndex(int id, int & j, int & k)
175 {
176  int dimX = this->IconSheetSize[0]/this->IconSize[0];
177  int dimY = this->IconSheetSize[1]/this->IconSize[1];
178 
179  j = id - dimX * static_cast<int>(id/dimX);
180  k = dimY - static_cast<int>(id/dimX) - 1;
181 }
182 
183 #endif
#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
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_ICON_GRAVITY_CENTER_LEFT
#define VTK_ICON_GRAVITY_TOP_CENTER
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTK_ICON_GRAVITY_CENTER_CENTER
#define VTKFILTERSGENERAL_EXPORT
#define VTK_ICON_GRAVITY_TOP_LEFT
#define VTK_ICON_SCALING_USE_SCALING_ARRAY
#define VTK_ICON_GRAVITY_BOTTOM_CENTER
Store zero or more vtkInformation instances.
#define VTK_ICON_GRAVITY_TOP_RIGHT
#define VTK_ICON_GRAVITY_CENTER_RIGHT
#define VTK_ICON_SCALING_OFF