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 
39 class vtkDataObjectTree;
40 
41 class VTKRENDERINGCORE_EXPORT vtkGlyph3DMapper : public vtkMapper
42 {
43 public:
44  static vtkGlyph3DMapper* New();
45  vtkTypeMacro(vtkGlyph3DMapper, vtkMapper);
46  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
47 
49  {
50  SCALE = 0,
51  SOURCE_INDEX = 1,
52  MASK = 2,
53  ORIENTATION = 3,
54  SELECTIONID = 4
55  };
56 
62  void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput);
64  { this->SetSourceConnection(0, algOutput); }
65 
71  void SetInputData(vtkDataObject *);
72 
76  void SetSourceData(int idx, vtkPolyData *pd);
77 
86  void SetSourceTableTree(vtkDataObjectTree *tree);
87 
94  void SetSourceData(vtkPolyData *pd);
95 
99  vtkPolyData *GetSource(int idx = 0);
100 
104  vtkDataObjectTree* GetSourceTableTree();
105 
107 
112  vtkSetMacro(Scaling, bool);
113  vtkBooleanMacro(Scaling, bool);
114  vtkGetMacro(Scaling, bool);
116 
118 
124  vtkSetMacro(ScaleMode, int);
125  vtkGetMacro(ScaleMode, int);
127 
129 
133  vtkSetMacro(ScaleFactor, double);
134  vtkGetMacro(ScaleFactor, double);
136 
138  {
139  NO_DATA_SCALING = 0,
140  SCALE_BY_MAGNITUDE = 1,
141  SCALE_BY_COMPONENTS = 2
142  };
143 
145  { this->SetScaleMode(SCALE_BY_MAGNITUDE); }
147  { this->SetScaleMode(SCALE_BY_COMPONENTS); }
149  { this->SetScaleMode(NO_DATA_SCALING); }
150  const char *GetScaleModeAsString();
151 
153 
156  vtkSetVector2Macro(Range, double);
157  vtkGetVectorMacro(Range, double, 2);
159 
161 
166  vtkSetMacro(Orient, bool);
167  vtkGetMacro(Orient, bool);
168  vtkBooleanMacro(Orient, bool);
170 
172 
177  vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION);
178  vtkGetMacro(OrientationMode, int);
180  { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); }
182  { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); }
183  const char* GetOrientationModeAsString();
185 
187  {
188  DIRECTION=0,
189  ROTATION=1
190  };
191 
193 
196  vtkSetMacro(Clamping, bool);
197  vtkGetMacro(Clamping, bool);
198  vtkBooleanMacro(Clamping, bool);
200 
202 
208  vtkSetMacro(SourceIndexing, bool);
209  vtkGetMacro(SourceIndexing, bool);
210  vtkBooleanMacro(SourceIndexing, bool);
212 
214 
219  vtkSetMacro(UseSourceTableTree, bool)
220  vtkGetMacro(UseSourceTableTree, bool)
221  vtkBooleanMacro(UseSourceTableTree, bool)
222 
223  //@{
228  vtkSetMacro(UseSelectionIds, bool);
229  vtkBooleanMacro(UseSelectionIds, bool);
230  vtkGetMacro(UseSelectionIds, bool);
232 
236  double *GetBounds() VTK_OVERRIDE;
237 
241  void GetBounds(double bounds[6]) VTK_OVERRIDE;
242 
246  void Render(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
247 
249 
257  vtkSetMacro(NestedDisplayLists, bool);
258  vtkGetMacro(NestedDisplayLists, bool);
259  vtkBooleanMacro(NestedDisplayLists, bool);
261 
263 
271  vtkSetMacro(Masking, bool);
272  vtkGetMacro(Masking, bool);
273  vtkBooleanMacro(Masking, bool);
275 
282  void SetMaskArray(const char* maskarrayname);
283 
296  void SetMaskArray(int fieldAttributeType);
297 
313  void SetOrientationArray(const char* orientationarrayname);
314 
336  void SetOrientationArray(int fieldAttributeType);
337 
343  void SetScaleArray(const char* scalarsarrayname);
344 
350  void SetScaleArray(int fieldAttributeType);
351 
358  void SetSourceIndexArray(const char* arrayname);
359 
366  void SetSourceIndexArray(int fieldAttributeType);
367 
377  void SetSelectionIdArray(const char* selectionIdArrayName);
378 
388  void SetSelectionIdArray(int fieldAttributeType);
389 
391 
396  vtkSetMacro(SelectionColorId, unsigned int);
397  vtkGetMacro(SelectionColorId, unsigned int);
399 
406  bool GetSupportsSelection() VTK_OVERRIDE
407  { return true; }
408 
409 protected:
411  ~vtkGlyph3DMapper() VTK_OVERRIDE;
412 
413  virtual int RequestUpdateExtent(vtkInformation *request,
414  vtkInformationVector **inInfo,
415  vtkInformationVector *outInfo);
416 
417  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
418 
419  vtkPolyData *GetSource(int idx, vtkInformationVector *sourceInfo);
420  vtkPolyData *GetSourceTable(int idx, vtkInformationVector *sourceInfo);
421 
423 
426  vtkDataArray* GetMaskArray(vtkDataSet* input);
427  vtkDataArray* GetSourceIndexArray(vtkDataSet* input);
428  vtkDataArray* GetOrientationArray(vtkDataSet* input);
429  vtkDataArray* GetScaleArray(vtkDataSet* input);
430  vtkDataArray* GetSelectionIdArray(vtkDataSet* input);
431  vtkUnsignedCharArray* GetColors(vtkDataSet* input);
433 
434  bool Scaling; // Determine whether scaling of geometry is performed
435  double ScaleFactor; // Scale factor to use to scale geometry
436  int ScaleMode; // Scale by scalar value or vector magnitude
437 
438  double Range[2]; // Range to use to perform scalar scaling
439  bool Orient; // boolean controls whether to "orient" data
440  bool Clamping; // whether to clamp scale factor
441  bool SourceIndexing; // Enable/disable indexing into the glyph table
442  bool UseSelectionIds; // Enable/disable custom pick ids
443  bool Masking; // Enable/disable masking.
445  bool NestedDisplayLists; // boolean
446 
447  bool UseSourceTableTree; // Map DataObjectTree glyph source into table
448 
449  unsigned int SelectionColorId;
450 
451 private:
452  vtkGlyph3DMapper(const vtkGlyph3DMapper&) VTK_DELETE_FUNCTION;
453  void operator=(const vtkGlyph3DMapper&) VTK_DELETE_FUNCTION;
454 
458  bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
459 
460 };
461 
462 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkGlyph3D on the GPU.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
Proxy object to connect input/output ports.
void SetOrientationModeToDirection()
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
void SetOrientationModeToRotation()
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
void SetScaleModeToScaleByVectorComponents()
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:91
dynamic, self-adjusting array of unsigned char
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetScaleModeToNoDataScaling()
void SetScaleModeToScaleByMagnitude()
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
double * GetBounds() override
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
unsigned int SelectionColorId
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64