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 VTKRENDERINGCORE_EXPORT vtkGlyph3DMapper : public vtkMapper
40 {
41 public:
42  static vtkGlyph3DMapper* New();
43  vtkTypeMacro(vtkGlyph3DMapper, vtkMapper);
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 
69  void SetInputData(vtkDataObject *);
70 
74  void SetSourceData(int idx, vtkPolyData *pd);
75 
82  void SetSourceData(vtkPolyData *pd);
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); }
166  const char* GetOrientationModeAsString();
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 
389 protected:
391  ~vtkGlyph3DMapper();
392 
393  virtual int RequestUpdateExtent(vtkInformation *request,
394  vtkInformationVector **inInfo,
395  vtkInformationVector *outInfo);
396 
398 
399  vtkPolyData *GetSource(int idx, vtkInformationVector *sourceInfo);
400 
402 
405  vtkDataArray* GetMaskArray(vtkDataSet* input);
406  vtkDataArray* GetSourceIndexArray(vtkDataSet* input);
407  vtkDataArray* GetOrientationArray(vtkDataSet* input);
408  vtkDataArray* GetScaleArray(vtkDataSet* input);
409  vtkDataArray* GetSelectionIdArray(vtkDataSet* input);
410  vtkUnsignedCharArray* GetColors(vtkDataSet* input);
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 
429 private:
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:51
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)
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.
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
void SetScaleModeToNoDataScaling()
void SetScaleModeToScaleByMagnitude()
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
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
virtual void Render(vtkRenderer *ren, vtkActor *a)=0
Method initiates the mapping process.