VTK
vtkGenericGlyph3DFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGenericGlyph3DFilter.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 =========================================================================*/
81 #ifndef vtkGenericGlyph3DFilter_h
82 #define vtkGenericGlyph3DFilter_h
83 
84 #include "vtkFiltersGenericModule.h" // For export macro
85 #include "vtkPolyDataAlgorithm.h"
86 
87 #define VTK_SCALE_BY_SCALAR 0
88 #define VTK_SCALE_BY_VECTOR 1
89 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
90 #define VTK_DATA_SCALING_OFF 3
91 
92 #define VTK_COLOR_BY_SCALE 0
93 #define VTK_COLOR_BY_SCALAR 1
94 #define VTK_COLOR_BY_VECTOR 2
95 
96 #define VTK_USE_VECTOR 0
97 #define VTK_USE_NORMAL 1
98 #define VTK_VECTOR_ROTATION_OFF 2
99 
100 #define VTK_INDEXING_OFF 0
101 #define VTK_INDEXING_BY_SCALAR 1
102 #define VTK_INDEXING_BY_VECTOR 2
103 
105 {
106 public:
108  void PrintSelf(ostream& os, vtkIndent indent);
109 
114  static vtkGenericGlyph3DFilter *New();
115 
117  void SetSourceData(vtkPolyData *pd) {this->SetSourceData(0,pd);};
118 
120  void SetSourceData(int id, vtkPolyData *pd);
121 
123  vtkPolyData *GetSource(int id=0);
124 
126 
127  vtkSetMacro(Scaling,int);
128  vtkBooleanMacro(Scaling,int);
129  vtkGetMacro(Scaling,int);
131 
133 
134  vtkSetMacro(ScaleMode,int);
135  vtkGetMacro(ScaleMode,int);
137  {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
139  {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
141  {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
143  {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
144  const char *GetScaleModeAsString();
146 
148 
149  vtkSetMacro(ColorMode,int);
150  vtkGetMacro(ColorMode,int);
152  {this->SetColorMode(VTK_COLOR_BY_SCALE);};
154  {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
156  {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
157  const char *GetColorModeAsString();
159 
161 
162  vtkSetMacro(ScaleFactor,double);
163  vtkGetMacro(ScaleFactor,double);
165 
167 
168  vtkSetVector2Macro(Range,double);
169  vtkGetVectorMacro(Range,double,2);
171 
173 
174  vtkSetMacro(Orient,int);
175  vtkBooleanMacro(Orient,int);
176  vtkGetMacro(Orient,int);
178 
180 
182  vtkSetMacro(Clamping,int);
183  vtkBooleanMacro(Clamping,int);
184  vtkGetMacro(Clamping,int);
186 
188 
189  vtkSetMacro(VectorMode,int);
190  vtkGetMacro(VectorMode,int);
191  void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
192  void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
194  {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
195  const char *GetVectorModeAsString();
197 
199 
202  vtkSetMacro(IndexMode,int);
203  vtkGetMacro(IndexMode,int);
204  void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
205  void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
206  void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
207  const char *GetIndexModeAsString();
209 
211 
215  vtkSetMacro(GeneratePointIds,int);
216  vtkGetMacro(GeneratePointIds,int);
217  vtkBooleanMacro(GeneratePointIds,int);
219 
221 
224  vtkSetStringMacro(PointIdsName);
225  vtkGetStringMacro(PointIdsName);
227 
229 
232  vtkGetStringMacro(InputScalarsSelection);
233  void SelectInputScalars(const char *fieldName)
234  {this->SetInputScalarsSelection(fieldName);}
236 
238 
241  vtkGetStringMacro(InputVectorsSelection);
242  void SelectInputVectors(const char *fieldName)
243  {this->SetInputVectorsSelection(fieldName);}
245 
247 
250  vtkGetStringMacro(InputNormalsSelection);
251  void SelectInputNormals(const char *fieldName)
252  {this->SetInputNormalsSelection(fieldName);}
254 
255 protected:
258 
260 
264  vtkPolyData **Source; // Geometry to copy to each point
265  int Scaling; // Determine whether scaling of geometry is performed
266  int ScaleMode; // Scale by scalar value or vector magnitude
267  int ColorMode; // new scalars based on scale, scalar or vector
268  double ScaleFactor; // Scale factor to use to scale geometry
269  double Range[2]; // Range to use to perform scalar scaling
270  int Orient; // boolean controls whether to "orient" data
271  int VectorMode; // Orient/scale via normal or via vector data
272  int Clamping; // whether to clamp scale factor
273  int IndexMode; // what to use to index into glyph table
274  int GeneratePointIds; // produce input points ids for each output point
276 
280  vtkSetStringMacro(InputScalarsSelection);
281  vtkSetStringMacro(InputVectorsSelection);
282  vtkSetStringMacro(InputNormalsSelection);
283 
284 private:
285  vtkGenericGlyph3DFilter(const vtkGenericGlyph3DFilter&); // Not implemented.
286  void operator=(const vtkGenericGlyph3DFilter&); // Not implemented.
287 };
288 
290 
292 {
293  if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
294  {
295  return "ScaleByScalar";
296  }
297  else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
298  {
299  return "ScaleByVector";
300  }
301  else
302  {
303  return "DataScalingOff";
304  }
305 }
307 
309 
311 {
312  if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
313  {
314  return "ColorByScalar";
315  }
316  else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
317  {
318  return "ColorByVector";
319  }
320  else
321  {
322  return "ColorByScale";
323  }
324 }
326 
328 
330 {
331  if ( this->VectorMode == VTK_USE_VECTOR)
332  {
333  return "UseVector";
334  }
335  else if ( this->VectorMode == VTK_USE_NORMAL)
336  {
337  return "UseNormal";
338  }
339  else
340  {
341  return "VectorRotationOff";
342  }
343 }
345 
347 
349 {
350  if ( this->IndexMode == VTK_INDEXING_OFF)
351  {
352  return "IndexingOff";
353  }
354  else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
355  {
356  return "IndexingByScalar";
357  }
358  else
359  {
360  return "IndexingByVector";
361  }
362 }
364 
365 #endif
void SetSourceData(vtkPolyData *pd)
#define VTK_INDEXING_BY_VECTOR
virtual int FillInputPortInformation(int port, vtkInformation *info)
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SelectInputNormals(const char *fieldName)
#define VTKFILTERSGENERIC_EXPORT
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
#define VTK_VECTOR_ROTATION_OFF
#define VTK_COLOR_BY_VECTOR
void SelectInputVectors(const char *fieldName)
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
copy oriented and scaled glyph geometry to every input point
void SelectInputScalars(const char *fieldName)
Superclass for algorithms that produce only polydata as output.
#define VTK_SCALE_BY_SCALAR
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTK_USE_VECTOR
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_SCALE_BY_VECTORCOMPONENTS
#define VTK_COLOR_BY_SCALAR
#define VTK_INDEXING_BY_SCALAR
#define VTK_DATA_SCALING_OFF
#define VTK_USE_NORMAL
Store zero or more vtkInformation instances.
#define VTK_SCALE_BY_VECTOR
#define VTK_INDEXING_OFF
#define VTK_COLOR_BY_SCALE