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 =========================================================================*/
79 #ifndef vtkGenericGlyph3DFilter_h
80 #define vtkGenericGlyph3DFilter_h
81 
82 #include "vtkFiltersGenericModule.h" // For export macro
83 #include "vtkPolyDataAlgorithm.h"
84 
85 #define VTK_SCALE_BY_SCALAR 0
86 #define VTK_SCALE_BY_VECTOR 1
87 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
88 #define VTK_DATA_SCALING_OFF 3
89 
90 #define VTK_COLOR_BY_SCALE 0
91 #define VTK_COLOR_BY_SCALAR 1
92 #define VTK_COLOR_BY_VECTOR 2
93 
94 #define VTK_USE_VECTOR 0
95 #define VTK_USE_NORMAL 1
96 #define VTK_VECTOR_ROTATION_OFF 2
97 
98 #define VTK_INDEXING_OFF 0
99 #define VTK_INDEXING_BY_SCALAR 1
100 #define VTK_INDEXING_BY_VECTOR 2
101 
102 class VTKFILTERSGENERIC_EXPORT vtkGenericGlyph3DFilter : public vtkPolyDataAlgorithm
103 {
104 public:
106  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
107 
114  static vtkGenericGlyph3DFilter *New();
115 
119  void SetSourceData(vtkPolyData *pd) {this->SetSourceData(0,pd);};
120 
124  void SetSourceData(int id, vtkPolyData *pd);
125 
129  vtkPolyData *GetSource(int id=0);
130 
132 
135  vtkSetMacro(Scaling,int);
136  vtkBooleanMacro(Scaling,int);
137  vtkGetMacro(Scaling,int);
139 
141 
144  vtkSetMacro(ScaleMode,int);
145  vtkGetMacro(ScaleMode,int);
147  {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
149  {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
151  {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
153  {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
154  const char *GetScaleModeAsString();
156 
158 
161  vtkSetMacro(ColorMode,int);
162  vtkGetMacro(ColorMode,int);
164  {this->SetColorMode(VTK_COLOR_BY_SCALE);};
166  {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
168  {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
169  const char *GetColorModeAsString();
171 
173 
176  vtkSetMacro(ScaleFactor,double);
177  vtkGetMacro(ScaleFactor,double);
179 
181 
184  vtkSetVector2Macro(Range,double);
185  vtkGetVectorMacro(Range,double,2);
187 
189 
192  vtkSetMacro(Orient,int);
193  vtkBooleanMacro(Orient,int);
194  vtkGetMacro(Orient,int);
196 
198 
202  vtkSetMacro(Clamping,int);
203  vtkBooleanMacro(Clamping,int);
204  vtkGetMacro(Clamping,int);
206 
208 
211  vtkSetMacro(VectorMode,int);
212  vtkGetMacro(VectorMode,int);
213  void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
214  void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
216  {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
217  const char *GetVectorModeAsString();
219 
221 
226  vtkSetMacro(IndexMode,int);
227  vtkGetMacro(IndexMode,int);
228  void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
229  void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
230  void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
231  const char *GetIndexModeAsString();
233 
235 
241  vtkSetMacro(GeneratePointIds,int);
242  vtkGetMacro(GeneratePointIds,int);
243  vtkBooleanMacro(GeneratePointIds,int);
245 
247 
251  vtkSetStringMacro(PointIdsName);
252  vtkGetStringMacro(PointIdsName);
254 
256 
260  vtkGetStringMacro(InputScalarsSelection);
261  void SelectInputScalars(const char *fieldName)
262  {this->SetInputScalarsSelection(fieldName);}
264 
266 
270  vtkGetStringMacro(InputVectorsSelection);
271  void SelectInputVectors(const char *fieldName)
272  {this->SetInputVectorsSelection(fieldName);}
274 
276 
280  vtkGetStringMacro(InputNormalsSelection);
281  void SelectInputNormals(const char *fieldName)
282  {this->SetInputNormalsSelection(fieldName);}
284 
285 protected:
287  ~vtkGenericGlyph3DFilter() VTK_OVERRIDE;
288 
289  int FillInputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
290 
294  vtkPolyData **Source; // Geometry to copy to each point
295  int Scaling; // Determine whether scaling of geometry is performed
296  int ScaleMode; // Scale by scalar value or vector magnitude
297  int ColorMode; // new scalars based on scale, scalar or vector
298  double ScaleFactor; // Scale factor to use to scale geometry
299  double Range[2]; // Range to use to perform scalar scaling
300  int Orient; // boolean controls whether to "orient" data
301  int VectorMode; // Orient/scale via normal or via vector data
302  int Clamping; // whether to clamp scale factor
303  int IndexMode; // what to use to index into glyph table
304  int GeneratePointIds; // produce input points ids for each output point
306 
310  vtkSetStringMacro(InputScalarsSelection);
311  vtkSetStringMacro(InputVectorsSelection);
312  vtkSetStringMacro(InputNormalsSelection);
313 
314 private:
315  vtkGenericGlyph3DFilter(const vtkGenericGlyph3DFilter&) VTK_DELETE_FUNCTION;
316  void operator=(const vtkGenericGlyph3DFilter&) VTK_DELETE_FUNCTION;
317 };
318 
320 
324 {
325  if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
326  {
327  return "ScaleByScalar";
328  }
329  else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
330  {
331  return "ScaleByVector";
332  }
333  else
334  {
335  return "DataScalingOff";
336  }
337 }
339 
341 
345 {
346  if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
347  {
348  return "ColorByScalar";
349  }
350  else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
351  {
352  return "ColorByVector";
353  }
354  else
355  {
356  return "ColorByScale";
357  }
358 }
360 
362 
366 {
367  if ( this->VectorMode == VTK_USE_VECTOR)
368  {
369  return "UseVector";
370  }
371  else if ( this->VectorMode == VTK_USE_NORMAL)
372  {
373  return "UseNormal";
374  }
375  else
376  {
377  return "VectorRotationOff";
378  }
379 }
381 
383 
387 {
388  if ( this->IndexMode == VTK_INDEXING_OFF)
389  {
390  return "IndexingOff";
391  }
392  else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
393  {
394  return "IndexingByScalar";
395  }
396  else
397  {
398  return "IndexingByVector";
399  }
400 }
402 
403 #endif
void SetIndexModeToOff()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
void SetSourceData(vtkPolyData *pd)
Set the source to use for the glyph.
void SetColorModeToColorByScale()
Either color by scale, scalar or by vector/normal magnitude.
void SetVectorModeToVectorRotationOff()
Specify whether to use vector or normal to perform vector operations.
#define VTK_INDEXING_BY_VECTOR
Store vtkAlgorithm input/output information.
void SetScaleModeToScaleByScalar()
Either scale by scalar or by vector/normal magnitude.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SelectInputNormals(const char *fieldName)
If you want to use an arbitrary normals array, then set its name here.
void SetScaleModeToScaleByVector()
Either scale by scalar or by vector/normal magnitude.
void SetColorModeToColorByVector()
Either color by scale, scalar or by vector/normal magnitude.
const char * GetVectorModeAsString()
Return the vector mode as a character string.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
#define VTK_VECTOR_ROTATION_OFF
#define VTK_COLOR_BY_VECTOR
void SelectInputVectors(const char *fieldName)
If you want to use an arbitrary vectors array, then set its name here.
static vtkPolyDataAlgorithm * New()
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
const char * GetColorModeAsString()
Return the method of coloring as a descriptive character string.
copy oriented and scaled glyph geometry to every input point
void SelectInputScalars(const char *fieldName)
If you want to use an arbitrary scalars array, then set its name here.
Superclass for algorithms that produce only polydata as output.
#define VTK_SCALE_BY_SCALAR
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_USE_VECTOR
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_SCALE_BY_VECTORCOMPONENTS
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
void SetVectorModeToUseVector()
Specify whether to use vector or normal to perform vector operations.
#define VTK_COLOR_BY_SCALAR
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
const char * GetIndexModeAsString()
Return the index mode as a character string.
void SetVectorModeToUseNormal()
Specify whether to use vector or normal to perform vector operations.
void SetScaleModeToDataScalingOff()
Either scale by scalar or by vector/normal magnitude.
#define VTK_INDEXING_BY_SCALAR
#define VTK_DATA_SCALING_OFF
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetColorModeToColorByScalar()
Either color by scale, scalar or by vector/normal magnitude.
#define VTK_USE_NORMAL
Store zero or more vtkInformation instances.
void SetScaleModeToScaleByVectorComponents()
Either scale by scalar or by vector/normal magnitude.
const char * GetScaleModeAsString()
Return the method of scaling as a descriptive character string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_SCALE_BY_VECTOR
#define VTK_INDEXING_OFF
void SetIndexModeToVector()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
#define VTK_COLOR_BY_SCALE
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetIndexModeToScalar()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.