VTK
vtkGlyph3DMapper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkGlyph3DMapper.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=========================================================================*/
31#ifndef vtkGlyph3DMapper_h
32#define vtkGlyph3DMapper_h
33
34#include "vtkRenderingCoreModule.h" // For export macro
35#include "vtkMapper.h"
36#include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...).
37#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
38
39class VTKRENDERINGCORE_EXPORT vtkGlyph3DMapper : public vtkMapper
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent);
45
47 {
48 SCALE = 0,
49 SOURCE_INDEX = 1,
50 MASK = 2,
51 ORIENTATION = 3,
52 SELECTIONID = 4
53 };
54
60 void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput);
62 { this->SetSourceConnection(0, algOutput); }
63
70
74 void SetSourceData(int idx, vtkPolyData *pd);
75
83
87 vtkPolyData *GetSource(int idx = 0);
88
90
95 vtkSetMacro(Scaling, bool);
96 vtkBooleanMacro(Scaling, bool);
97 vtkGetMacro(Scaling, bool);
99
101
107 vtkSetMacro(ScaleMode, int);
108 vtkGetMacro(ScaleMode, int);
110
112
116 vtkSetMacro(ScaleFactor, double);
117 vtkGetMacro(ScaleFactor, double);
119
121 {
122 NO_DATA_SCALING = 0,
123 SCALE_BY_MAGNITUDE = 1,
124 SCALE_BY_COMPONENTS = 2
125 };
126
128 { this->SetScaleMode(SCALE_BY_MAGNITUDE); }
130 { this->SetScaleMode(SCALE_BY_COMPONENTS); }
132 { this->SetScaleMode(NO_DATA_SCALING); }
133 const char *GetScaleModeAsString();
134
136
139 vtkSetVector2Macro(Range, double);
140 vtkGetVectorMacro(Range, double, 2);
142
144
149 vtkSetMacro(Orient, bool);
150 vtkGetMacro(Orient, bool);
151 vtkBooleanMacro(Orient, bool);
153
155
160 vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION);
161 vtkGetMacro(OrientationMode, int);
163 { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); }
165 { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); }
168
170 {
171 DIRECTION=0,
172 ROTATION=1
173 };
174
176
179 vtkSetMacro(Clamping, bool);
180 vtkGetMacro(Clamping, bool);
181 vtkBooleanMacro(Clamping, bool);
183
185
191 vtkSetMacro(SourceIndexing, bool);
192 vtkGetMacro(SourceIndexing, bool);
193 vtkBooleanMacro(SourceIndexing, bool);
195
197
201 vtkSetMacro(UseSelectionIds, bool);
202 vtkBooleanMacro(UseSelectionIds, bool);
203 vtkGetMacro(UseSelectionIds, bool);
205
209 virtual double *GetBounds();
210
214 virtual void GetBounds(double bounds[6]);
215
219 virtual void Render(vtkRenderer *ren, vtkActor *act);
220
222
230 vtkSetMacro(NestedDisplayLists, bool);
231 vtkGetMacro(NestedDisplayLists, bool);
232 vtkBooleanMacro(NestedDisplayLists, bool);
234
236
244 vtkSetMacro(Masking, bool);
245 vtkGetMacro(Masking, bool);
246 vtkBooleanMacro(Masking, bool);
248
255 void SetMaskArray(const char* maskarrayname);
256
269 void SetMaskArray(int fieldAttributeType);
270
286 void SetOrientationArray(const char* orientationarrayname);
287
309 void SetOrientationArray(int fieldAttributeType);
310
316 void SetScaleArray(const char* scalarsarrayname);
317
323 void SetScaleArray(int fieldAttributeType);
324
331 void SetSourceIndexArray(const char* arrayname);
332
339 void SetSourceIndexArray(int fieldAttributeType);
340
350 void SetSelectionIdArray(const char* selectionIdArrayName);
351
361 void SetSelectionIdArray(int fieldAttributeType);
362
364
369 vtkSetMacro(SelectionColorId, unsigned int);
370 vtkGetMacro(SelectionColorId, unsigned int);
372
374
377 vtkSetMacro(SelectMode, int);
379
386 virtual bool GetSupportsSelection()
387 { return true; }
388
389protected:
392
394 vtkInformationVector **inInfo,
395 vtkInformationVector *outInfo);
396
398
400
402
412
413 bool Scaling; // Determine whether scaling of geometry is performed
414 double ScaleFactor; // Scale factor to use to scale geometry
415 int ScaleMode; // Scale by scalar value or vector magnitude
416
417 double Range[2]; // Range to use to perform scalar scaling
418 bool Orient; // boolean controls whether to "orient" data
419 bool Clamping; // whether to clamp scale factor
420 bool SourceIndexing; // Enable/disable indexing into the glyph table
421 bool UseSelectionIds; // Enable/disable custom pick ids
422 bool Masking; // Enable/disable masking.
424 bool NestedDisplayLists; // boolean
425
426 unsigned int SelectionColorId;
428
429private:
430 vtkGlyph3DMapper(const vtkGlyph3DMapper&) VTK_DELETE_FUNCTION;
431 void operator=(const vtkGlyph3DMapper&) VTK_DELETE_FUNCTION;
432
436 bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
437
438};
439
440#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
Proxy object to connect input/output ports.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
general representation of visualization data
Definition: vtkDataObject.h:65
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkGlyph3D on the GPU.
virtual double * GetBounds()
Redefined to take into account the bounds of the scaled glyphs.
void SetScaleModeToScaleByVectorComponents()
void SetSourceData(vtkPolyData *pd)
Set the source to use for he glyph.
void SetSourceData(int idx, vtkPolyData *pd)
Specify a source object at a specified table location.
void SetMaskArray(const char *maskarrayname)
Set the name of the point array to use as a mask for generating the glyphs.
vtkPolyData * GetSource(int idx, vtkInformationVector *sourceInfo)
vtkDataArray * GetScaleArray(vtkDataSet *input)
void SetSourceConnection(int idx, vtkAlgorithmOutput *algOutput)
Specify a source object at a specified table location.
void SetScaleModeToScaleByMagnitude()
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
void SetScaleArray(int fieldAttributeType)
Convenience method to set the array to scale with.
vtkDataArray * GetSelectionIdArray(vtkDataSet *input)
void SetSourceIndexArray(const char *arrayname)
Convenience method to set the array to use as index within the sources.
vtkDataArray * GetOrientationArray(vtkDataSet *input)
void SetInputData(vtkDataObject *)
Assign a data object as input.
void SetScaleModeToNoDataScaling()
const char * GetScaleModeAsString()
void SetOrientationArray(int fieldAttributeType)
Tells the mapper to use an orientation array if Orient is true.
void SetOrientationArray(const char *orientationarrayname)
Tells the mapper to use an orientation array if Orient is true.
void SetSelectionIdArray(int fieldAttributeType)
Convenience method to set the array used for selection IDs.
unsigned int SelectionColorId
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetOrientationModeToDirection()
vtkUnsignedCharArray * GetColors(vtkDataSet *input)
const char * GetOrientationModeAsString()
vtkDataArray * GetSourceIndexArray(vtkDataSet *input)
virtual void GetBounds(double bounds[6])
Same as superclass.
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual void Render(vtkRenderer *ren, vtkActor *act)
All the work is done is derived classes.
void SetMaskArray(int fieldAttributeType)
Set the point attribute to use as a mask for generating the glyphs.
vtkPolyData * GetSource(int idx=0)
Get a pointer to a source object at a specified table location.
void SetOrientationModeToRotation()
vtkDataArray * GetMaskArray(vtkDataSet *input)
Convenience methods to get each of the arrays.
void SetSelectionIdArray(const char *selectionIdArrayName)
Convenience method to set the array used for selection IDs.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
void SetScaleArray(const char *scalarsarrayname)
Convenience method to set the array to scale with.
void SetSourceIndexArray(int fieldAttributeType)
Convenience method to set the array to use as index within the sources.
static vtkGlyph3DMapper * New()
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:92
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract specification for renderers
Definition: vtkRenderer.h:64
dynamic, self-adjusting array of unsigned char
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.