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 =========================================================================*/
30 #ifndef vtkGlyph3DMapper_h
31 #define vtkGlyph3DMapper_h
32 
33 #include "vtkRenderingCoreModule.h" // For export macro
34 #include "vtkMapper.h"
35 #include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...).
36 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
37 
39 {
40 public:
41  static vtkGlyph3DMapper* New();
42  vtkTypeMacro(vtkGlyph3DMapper, vtkMapper);
43  void PrintSelf(ostream& os, vtkIndent indent);
44  //BTX
46  {
47  SCALE = 0,
48  SOURCE_INDEX = 1,
49  MASK = 2,
50  ORIENTATION = 3,
51  SELECTIONID = 4
52  };
53  //ETX
54 
56 
59  void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput);
61  { this->SetSourceConnection(0, algOutput); }
63 
67  void SetInputData(vtkDataObject *);
68 
70  void SetSourceData(int idx, vtkPolyData *pd);
71 
76  void SetSourceData(vtkPolyData *pd);
77 
79  vtkPolyData *GetSource(int idx = 0);
80 
82 
85  vtkSetMacro(Scaling, bool);
86  vtkBooleanMacro(Scaling, bool);
87  vtkGetMacro(Scaling, bool);
89 
91 
95  vtkSetMacro(ScaleMode, int);
96  vtkGetMacro(ScaleMode, int);
98 
100 
102  vtkSetMacro(ScaleFactor, double);
103  vtkGetMacro(ScaleFactor, double);
105 
106  //BTX
108  {
109  NO_DATA_SCALING = 0,
110  SCALE_BY_MAGNITUDE = 1,
111  SCALE_BY_COMPONENTS = 2
112  };
113  //ETX
115  { this->SetScaleMode(SCALE_BY_MAGNITUDE); }
117  { this->SetScaleMode(SCALE_BY_COMPONENTS); }
119  { this->SetScaleMode(NO_DATA_SCALING); }
120  const char *GetScaleModeAsString();
121 
123 
124  vtkSetVector2Macro(Range, double);
125  vtkGetVectorMacro(Range, double, 2);
127 
129 
131  vtkSetMacro(Orient, bool);
132  vtkGetMacro(Orient, bool);
133  vtkBooleanMacro(Orient, bool);
135 
137 
140  vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION);
141  vtkGetMacro(OrientationMode, int);
143  { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); }
145  { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); }
146  const char* GetOrientationModeAsString();
147  //BTX
149  {
150  DIRECTION=0,
151  ROTATION=1
152  };
153  //ETX
155 
157 
159  vtkSetMacro(Clamping, bool);
160  vtkGetMacro(Clamping, bool);
161  vtkBooleanMacro(Clamping, bool);
163 
165 
170  vtkSetMacro(SourceIndexing, bool);
171  vtkGetMacro(SourceIndexing, bool);
172  vtkBooleanMacro(SourceIndexing, bool);
174 
176 
178  vtkSetMacro(UseSelectionIds, bool);
179  vtkBooleanMacro(UseSelectionIds, bool);
180  vtkGetMacro(UseSelectionIds, bool);
182 
184  virtual double *GetBounds();
185 
188  virtual void GetBounds(double bounds[6]);
189 
191  virtual void Render(vtkRenderer *ren, vtkActor *act);
192 
194 
199  vtkSetMacro(NestedDisplayLists, bool);
200  vtkGetMacro(NestedDisplayLists, bool);
201  vtkBooleanMacro(NestedDisplayLists, bool);
203 
205 
210  vtkSetMacro(Masking, bool);
211  vtkGetMacro(Masking, bool);
212  vtkBooleanMacro(Masking, bool);
214 
219  void SetMaskArray(const char* maskarrayname);
220 
229  void SetMaskArray(int fieldAttributeType);
230 
244  void SetOrientationArray(const char* orientationarrayname);
245 
262  void SetOrientationArray(int fieldAttributeType);
263 
267  void SetScaleArray(const char* scalarsarrayname);
268 
272  void SetScaleArray(int fieldAttributeType);
273 
278  void SetSourceIndexArray(const char* arrayname);
279 
284  void SetSourceIndexArray(int fieldAttributeType);
285 
291  void SetSelectionIdArray(const char* selectionIdArrayName);
292 
298  void SetSelectionIdArray(int fieldAttributeType);
299 
301 
304  vtkSetMacro(SelectionColorId, unsigned int);
305  vtkGetMacro(SelectionColorId, unsigned int);
307 
309 
310  vtkSetMacro(SelectMode, int);
312 
314 
318  virtual bool GetSupportsSelection()
319  { return true; }
320  //BTX
321 protected:
323  ~vtkGlyph3DMapper();
325 
326  virtual int RequestUpdateExtent(vtkInformation *request,
327  vtkInformationVector **inInfo,
328  vtkInformationVector *outInfo);
329 
331 
332  vtkPolyData *GetSource(int idx, vtkInformationVector *sourceInfo);
333 
335 
336  vtkDataArray* GetMaskArray(vtkDataSet* input);
337  vtkDataArray* GetSourceIndexArray(vtkDataSet* input);
338  vtkDataArray* GetOrientationArray(vtkDataSet* input);
339  vtkDataArray* GetScaleArray(vtkDataSet* input);
340  vtkDataArray* GetSelectionIdArray(vtkDataSet* input);
341  vtkUnsignedCharArray* GetColors(vtkDataSet* input);
343 
344  bool Scaling; // Determine whether scaling of geometry is performed
345  double ScaleFactor; // Scale factor to use to scale geometry
346  int ScaleMode; // Scale by scalar value or vector magnitude
347 
348  double Range[2]; // Range to use to perform scalar scaling
349  bool Orient; // boolean controls whether to "orient" data
350  bool Clamping; // whether to clamp scale factor
351  bool SourceIndexing; // Enable/disable indexing into the glyph table
352  bool UseSelectionIds; // Enable/disable custom pick ids
353  bool Masking; // Enable/disable masking.
355  bool NestedDisplayLists; // boolean
356 
357  unsigned int SelectionColorId;
359 
360 private:
361  vtkGlyph3DMapper(const vtkGlyph3DMapper&); // Not implemented.
362  void operator=(const vtkGlyph3DMapper&); // Not implemented.
363 
365 
366  bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
367  //ETX
368 };
370 
371 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
abstract specification for renderers
Definition: vtkRenderer.h:62
vtkGlyph3D on the GPU.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
Proxy object to connect input/output ports.
void SetOrientationModeToDirection()
void SetOrientationModeToRotation()
void SetScaleModeToScaleByVectorComponents()
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void PrintSelf(ostream &os, vtkIndent indent)
virtual int FillInputPortInformation(int port, vtkInformation *info)
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:89
dynamic, self-adjusting array of unsigned char
virtual bool GetSupportsSelection()
#define VTKRENDERINGCORE_EXPORT
virtual double * GetBounds()
void SetScaleModeToNoDataScaling()
void SetScaleModeToScaleByMagnitude()
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
unsigned int SelectionColorId
general representation of visualization data
Definition: vtkDataObject.h:64
virtual void Render(vtkRenderer *ren, vtkActor *a)=0