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 =========================================================================*/
28 #ifndef vtkGlyph3DMapper_h
29 #define vtkGlyph3DMapper_h
30 
31 #include "vtkRenderingCoreModule.h" // For export macro
32 #include "vtkMapper.h"
33 #include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...).
34 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
35 
36 class vtkDataObjectTree;
37 
38 class VTKRENDERINGCORE_EXPORT vtkGlyph3DMapper : public vtkMapper
39 {
40 public:
41  static vtkGlyph3DMapper* New();
42  vtkTypeMacro(vtkGlyph3DMapper, vtkMapper);
43  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
44 
46  {
47  SCALE = 0,
48  SOURCE_INDEX = 1,
49  MASK = 2,
50  ORIENTATION = 3,
51  SELECTIONID = 4
52  };
53 
59  void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput);
61  { this->SetSourceConnection(0, algOutput); }
62 
68  void SetInputData(vtkDataObject *);
69 
73  void SetSourceData(int idx, vtkPolyData *pd);
74 
83  void SetSourceTableTree(vtkDataObjectTree *tree);
84 
91  void SetSourceData(vtkPolyData *pd);
92 
96  vtkPolyData *GetSource(int idx = 0);
97 
101  vtkDataObjectTree* GetSourceTableTree();
102 
104 
109  vtkSetMacro(Scaling, bool);
110  vtkBooleanMacro(Scaling, bool);
111  vtkGetMacro(Scaling, bool);
113 
115 
121  vtkSetMacro(ScaleMode, int);
122  vtkGetMacro(ScaleMode, int);
124 
126 
130  vtkSetMacro(ScaleFactor, double);
131  vtkGetMacro(ScaleFactor, double);
133 
135  {
136  NO_DATA_SCALING = 0,
137  SCALE_BY_MAGNITUDE = 1,
138  SCALE_BY_COMPONENTS = 2
139  };
140 
142  { this->SetScaleMode(SCALE_BY_MAGNITUDE); }
144  { this->SetScaleMode(SCALE_BY_COMPONENTS); }
146  { this->SetScaleMode(NO_DATA_SCALING); }
147  const char *GetScaleModeAsString();
148 
150 
153  vtkSetVector2Macro(Range, double);
154  vtkGetVectorMacro(Range, double, 2);
156 
158 
163  vtkSetMacro(Orient, bool);
164  vtkGetMacro(Orient, bool);
165  vtkBooleanMacro(Orient, bool);
167 
169 
174  vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION);
175  vtkGetMacro(OrientationMode, int);
177  { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); }
179  { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); }
180  const char* GetOrientationModeAsString();
182 
184  {
185  DIRECTION=0,
186  ROTATION=1
187  };
188 
190 
193  vtkSetMacro(Clamping, bool);
194  vtkGetMacro(Clamping, bool);
195  vtkBooleanMacro(Clamping, bool);
197 
199 
205  vtkSetMacro(SourceIndexing, bool);
206  vtkGetMacro(SourceIndexing, bool);
207  vtkBooleanMacro(SourceIndexing, bool);
209 
211 
216  vtkSetMacro(UseSourceTableTree, bool)
217  vtkGetMacro(UseSourceTableTree, bool)
218  vtkBooleanMacro(UseSourceTableTree, bool)
219 
220  //@{
225  vtkSetMacro(UseSelectionIds, bool);
226  vtkBooleanMacro(UseSelectionIds, bool);
227  vtkGetMacro(UseSelectionIds, bool);
229 
233  double *GetBounds() VTK_OVERRIDE;
234 
238  void GetBounds(double bounds[6]) VTK_OVERRIDE;
239 
243  void Render(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
244 
246 
254  vtkSetMacro(NestedDisplayLists, bool);
255  vtkGetMacro(NestedDisplayLists, bool);
256  vtkBooleanMacro(NestedDisplayLists, bool);
258 
260 
268  vtkSetMacro(Masking, bool);
269  vtkGetMacro(Masking, bool);
270  vtkBooleanMacro(Masking, bool);
272 
279  void SetMaskArray(const char* maskarrayname);
280 
293  void SetMaskArray(int fieldAttributeType);
294 
310  void SetOrientationArray(const char* orientationarrayname);
311 
333  void SetOrientationArray(int fieldAttributeType);
334 
340  void SetScaleArray(const char* scalarsarrayname);
341 
347  void SetScaleArray(int fieldAttributeType);
348 
355  void SetSourceIndexArray(const char* arrayname);
356 
363  void SetSourceIndexArray(int fieldAttributeType);
364 
374  void SetSelectionIdArray(const char* selectionIdArrayName);
375 
385  void SetSelectionIdArray(int fieldAttributeType);
386 
388 
393  vtkSetMacro(SelectionColorId, unsigned int);
394  vtkGetMacro(SelectionColorId, unsigned int);
396 
403  bool GetSupportsSelection() VTK_OVERRIDE
404  { return true; }
405 
406 protected:
408  ~vtkGlyph3DMapper() VTK_OVERRIDE;
409 
410  virtual int RequestUpdateExtent(vtkInformation *request,
411  vtkInformationVector **inInfo,
412  vtkInformationVector *outInfo);
413 
414  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
415 
416  vtkPolyData *GetSource(int idx, vtkInformationVector *sourceInfo);
417  vtkPolyData *GetSourceTable(int idx, vtkInformationVector *sourceInfo);
418 
420 
423  vtkDataArray* GetMaskArray(vtkDataSet* input);
424  vtkDataArray* GetSourceIndexArray(vtkDataSet* input);
425  vtkDataArray* GetOrientationArray(vtkDataSet* input);
426  vtkDataArray* GetScaleArray(vtkDataSet* input);
427  vtkDataArray* GetSelectionIdArray(vtkDataSet* input);
428  vtkUnsignedCharArray* GetColors(vtkDataSet* input);
430 
431  bool Scaling; // Determine whether scaling of geometry is performed
432  double ScaleFactor; // Scale factor to use to scale geometry
433  int ScaleMode; // Scale by scalar value or vector magnitude
434 
435  double Range[2]; // Range to use to perform scalar scaling
436  bool Orient; // boolean controls whether to "orient" data
437  bool Clamping; // whether to clamp scale factor
438  bool SourceIndexing; // Enable/disable indexing into the glyph table
439  bool UseSelectionIds; // Enable/disable custom pick ids
440  bool Masking; // Enable/disable masking.
441  int OrientationMode;
442  bool NestedDisplayLists; // boolean
443 
444  bool UseSourceTableTree; // Map DataObjectTree glyph source into table
445 
446  unsigned int SelectionColorId;
447 
448 private:
449  vtkGlyph3DMapper(const vtkGlyph3DMapper&) VTK_DELETE_FUNCTION;
450  void operator=(const vtkGlyph3DMapper&) VTK_DELETE_FUNCTION;
451 
455  bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
456 
457 };
458 
459 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
abstract specification for renderers
Definition: vtkRenderer.h:57
vtkGlyph3D on the GPU.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:85
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).
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:58