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=========================================================================*/
82#ifndef vtkGenericGlyph3DFilter_h
83#define vtkGenericGlyph3DFilter_h
84
85#include "vtkFiltersGenericModule.h" // For export macro
87
88#define VTK_SCALE_BY_SCALAR 0
89#define VTK_SCALE_BY_VECTOR 1
90#define VTK_SCALE_BY_VECTORCOMPONENTS 2
91#define VTK_DATA_SCALING_OFF 3
92
93#define VTK_COLOR_BY_SCALE 0
94#define VTK_COLOR_BY_SCALAR 1
95#define VTK_COLOR_BY_VECTOR 2
96
97#define VTK_USE_VECTOR 0
98#define VTK_USE_NORMAL 1
99#define VTK_VECTOR_ROTATION_OFF 2
100
101#define VTK_INDEXING_OFF 0
102#define VTK_INDEXING_BY_SCALAR 1
103#define VTK_INDEXING_BY_VECTOR 2
104
105class VTKFILTERSGENERIC_EXPORT vtkGenericGlyph3DFilter : public vtkPolyDataAlgorithm
106{
107public:
109 void PrintSelf(ostream& os, vtkIndent indent);
110
118
122 void SetSourceData(vtkPolyData *pd) {this->SetSourceData(0,pd);};
123
127 void SetSourceData(int id, vtkPolyData *pd);
128
133
135
138 vtkSetMacro(Scaling,int);
139 vtkBooleanMacro(Scaling,int);
140 vtkGetMacro(Scaling,int);
142
144
147 vtkSetMacro(ScaleMode,int);
148 vtkGetMacro(ScaleMode,int);
150 {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
152 {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
154 {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
156 {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
157 const char *GetScaleModeAsString();
159
161
164 vtkSetMacro(ColorMode,int);
165 vtkGetMacro(ColorMode,int);
167 {this->SetColorMode(VTK_COLOR_BY_SCALE);};
169 {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
171 {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
172 const char *GetColorModeAsString();
174
176
179 vtkSetMacro(ScaleFactor,double);
180 vtkGetMacro(ScaleFactor,double);
182
184
187 vtkSetVector2Macro(Range,double);
188 vtkGetVectorMacro(Range,double,2);
190
192
195 vtkSetMacro(Orient,int);
196 vtkBooleanMacro(Orient,int);
197 vtkGetMacro(Orient,int);
199
201
205 vtkSetMacro(Clamping,int);
206 vtkBooleanMacro(Clamping,int);
207 vtkGetMacro(Clamping,int);
209
211
214 vtkSetMacro(VectorMode,int);
215 vtkGetMacro(VectorMode,int);
216 void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
217 void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
219 {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
220 const char *GetVectorModeAsString();
222
224
229 vtkSetMacro(IndexMode,int);
230 vtkGetMacro(IndexMode,int);
231 void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
232 void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
233 void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
234 const char *GetIndexModeAsString();
236
238
244 vtkSetMacro(GeneratePointIds,int);
245 vtkGetMacro(GeneratePointIds,int);
246 vtkBooleanMacro(GeneratePointIds,int);
248
250
254 vtkSetStringMacro(PointIdsName);
255 vtkGetStringMacro(PointIdsName);
257
259
263 vtkGetStringMacro(InputScalarsSelection);
264 void SelectInputScalars(const char *fieldName)
265 {this->SetInputScalarsSelection(fieldName);}
267
269
273 vtkGetStringMacro(InputVectorsSelection);
274 void SelectInputVectors(const char *fieldName)
275 {this->SetInputVectorsSelection(fieldName);}
277
279
283 vtkGetStringMacro(InputNormalsSelection);
284 void SelectInputNormals(const char *fieldName)
285 {this->SetInputNormalsSelection(fieldName);}
287
288protected:
291
293
297 vtkPolyData **Source; // Geometry to copy to each point
298 int Scaling; // Determine whether scaling of geometry is performed
299 int ScaleMode; // Scale by scalar value or vector magnitude
300 int ColorMode; // new scalars based on scale, scalar or vector
301 double ScaleFactor; // Scale factor to use to scale geometry
302 double Range[2]; // Range to use to perform scalar scaling
303 int Orient; // boolean controls whether to "orient" data
304 int VectorMode; // Orient/scale via normal or via vector data
305 int Clamping; // whether to clamp scale factor
306 int IndexMode; // what to use to index into glyph table
307 int GeneratePointIds; // produce input points ids for each output point
309
313 vtkSetStringMacro(InputScalarsSelection);
314 vtkSetStringMacro(InputVectorsSelection);
315 vtkSetStringMacro(InputNormalsSelection);
316
317private:
318 vtkGenericGlyph3DFilter(const vtkGenericGlyph3DFilter&) VTK_DELETE_FUNCTION;
319 void operator=(const vtkGenericGlyph3DFilter&) VTK_DELETE_FUNCTION;
320};
321
323
327{
328 if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
329 {
330 return "ScaleByScalar";
331 }
332 else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
333 {
334 return "ScaleByVector";
335 }
336 else
337 {
338 return "DataScalingOff";
339 }
340}
342
344
348{
349 if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
350 {
351 return "ColorByScalar";
352 }
353 else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
354 {
355 return "ColorByVector";
356 }
357 else
358 {
359 return "ColorByScale";
360 }
361}
363
365
369{
370 if ( this->VectorMode == VTK_USE_VECTOR)
371 {
372 return "UseVector";
373 }
374 else if ( this->VectorMode == VTK_USE_NORMAL)
375 {
376 return "UseNormal";
377 }
378 else
379 {
380 return "VectorRotationOff";
381 }
382}
384
386
390{
391 if ( this->IndexMode == VTK_INDEXING_OFF)
392 {
393 return "IndexingOff";
394 }
395 else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
396 {
397 return "IndexingByScalar";
398 }
399 else
400 {
401 return "IndexingByVector";
402 }
403}
405
406#endif
copy oriented and scaled glyph geometry to every input point
void SelectInputVectors(const char *fieldName)
void SelectInputNormals(const char *fieldName)
int FillInputPortInformation(int, vtkInformation *)
Fill the input port information objects for this algorithm.
vtkPolyData * GetSource(int id=0)
Get a pointer to a source object at a specified table location.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
const char * GetScaleModeAsString()
Return the method of scaling as a descriptive character string.
void SetSourceData(vtkPolyData *pd)
Set the source to use for the glyph.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
const char * GetColorModeAsString()
Return the method of coloring as a descriptive character string.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkGenericGlyph3DFilter * New()
Construct object with scaling on, scaling mode is by scalar value, scale factor = 1....
const char * GetVectorModeAsString()
Return the vector mode as a character string.
void SetSourceData(int id, vtkPolyData *pd)
Specify a source object at a specified table location.
void SelectInputScalars(const char *fieldName)
const char * GetIndexModeAsString()
Return the index mode as a character string.
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.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
#define VTK_COLOR_BY_VECTOR
#define VTK_SCALE_BY_SCALAR
#define VTK_INDEXING_BY_SCALAR
#define VTK_DATA_SCALING_OFF
#define VTK_VECTOR_ROTATION_OFF
#define VTK_COLOR_BY_SCALAR
#define VTK_USE_VECTOR
#define VTK_USE_NORMAL
#define VTK_INDEXING_BY_VECTOR
#define VTK_SCALE_BY_VECTOR
#define VTK_INDEXING_OFF
#define VTK_COLOR_BY_SCALE
#define VTK_SCALE_BY_VECTORCOMPONENTS
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.