VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
74  void SetSourceData(vtkPolyData *pd);
75 
77  vtkPolyData *GetSource(int idx = 0);
78 
80 
83  vtkSetMacro(Scaling, bool);
84  vtkBooleanMacro(Scaling, bool);
85  vtkGetMacro(Scaling, bool);
87 
89 
93  vtkSetMacro(ScaleMode, int);
94  vtkGetMacro(ScaleMode, int);
96 
98 
100  vtkSetMacro(ScaleFactor, double);
101  vtkGetMacro(ScaleFactor, double);
103 
104  //BTX
106  {
107  NO_DATA_SCALING = 0,
108  SCALE_BY_MAGNITUDE = 1,
109  SCALE_BY_COMPONENTS = 2
110  };
111  //ETX
113  { this->SetScaleMode(SCALE_BY_MAGNITUDE); }
115  { this->SetScaleMode(SCALE_BY_COMPONENTS); }
117  { this->SetScaleMode(NO_DATA_SCALING); }
118  const char *GetScaleModeAsString();
119 
121 
122  vtkSetVector2Macro(Range, double);
123  vtkGetVectorMacro(Range, double, 2);
125 
127 
129  vtkSetMacro(Orient, bool);
130  vtkGetMacro(Orient, bool);
131  vtkBooleanMacro(Orient, bool);
133 
135 
138  vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION);
139  vtkGetMacro(OrientationMode, int);
141  { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); }
143  { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); }
144  const char* GetOrientationModeAsString();
145  //BTX
147  {
148  DIRECTION=0,
149  ROTATION=1
150  };
151  //ETX
153 
155 
157  vtkSetMacro(Clamping, bool);
158  vtkGetMacro(Clamping, bool);
159  vtkBooleanMacro(Clamping, bool);
161 
163 
168  vtkSetMacro(SourceIndexing, bool);
169  vtkGetMacro(SourceIndexing, bool);
170  vtkBooleanMacro(SourceIndexing, bool);
172 
174 
176  vtkSetMacro(UseSelectionIds, bool);
177  vtkBooleanMacro(UseSelectionIds, bool);
178  vtkGetMacro(UseSelectionIds, bool);
180 
182  virtual double *GetBounds();
183 
186  virtual void GetBounds(double bounds[6]);
187 
189  virtual void Render(vtkRenderer *ren, vtkActor *act);
190 
192 
197  vtkSetMacro(NestedDisplayLists, bool);
198  vtkGetMacro(NestedDisplayLists, bool);
199  vtkBooleanMacro(NestedDisplayLists, bool);
201 
203 
208  vtkSetMacro(Masking, bool);
209  vtkGetMacro(Masking, bool);
210  vtkBooleanMacro(Masking, bool);
212 
217  void SetMaskArray(const char* maskarrayname);
218 
227  void SetMaskArray(int fieldAttributeType);
228 
242  void SetOrientationArray(const char* orientationarrayname);
243 
260  void SetOrientationArray(int fieldAttributeType);
261 
265  void SetScaleArray(const char* scalarsarrayname);
266 
270  void SetScaleArray(int fieldAttributeType);
271 
276  void SetSourceIndexArray(const char* arrayname);
277 
282  void SetSourceIndexArray(int fieldAttributeType);
283 
289  void SetSelectionIdArray(const char* selectionIdArrayName);
290 
296  void SetSelectionIdArray(int fieldAttributeType);
297 
299 
302  vtkSetMacro(SelectionColorId, unsigned int);
303  vtkGetMacro(SelectionColorId, unsigned int);
305 
307 
308  vtkSetMacro(SelectMode, int);
310 
312 
316  virtual bool GetSupportsSelection()
317  { return true; }
318  //BTX
319 protected:
321  ~vtkGlyph3DMapper();
323 
324  virtual int RequestUpdateExtent(vtkInformation *request,
325  vtkInformationVector **inInfo,
326  vtkInformationVector *outInfo);
327 
329 
330  vtkPolyData *GetSource(int idx, vtkInformationVector *sourceInfo);
331 
333 
334  vtkDataArray* GetMaskArray(vtkDataSet* input);
335  vtkDataArray* GetSourceIndexArray(vtkDataSet* input);
336  vtkDataArray* GetOrientationArray(vtkDataSet* input);
337  vtkDataArray* GetScaleArray(vtkDataSet* input);
338  vtkDataArray* GetSelectionIdArray(vtkDataSet* input);
341 
342  bool Scaling; // Determine whether scaling of geometry is performed
343  double ScaleFactor; // Scale factor to use to scale geometry
344  int ScaleMode; // Scale by scalar value or vector magnitude
345 
346  double Range[2]; // Range to use to perform scalar scaling
347  bool Orient; // boolean controls whether to "orient" data
348  bool Clamping; // whether to clamp scale factor
349  bool SourceIndexing; // Enable/disable indexing into the glyph table
350  bool UseSelectionIds; // Enable/disable custom pick ids
351  bool Masking; // Enable/disable masking.
353  bool NestedDisplayLists; // boolean
354 
355  unsigned int SelectionColorId;
357 
358 private:
359  vtkGlyph3DMapper(const vtkGlyph3DMapper&); // Not implemented.
360  void operator=(const vtkGlyph3DMapper&); // Not implemented.
361 
363 
364  bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
365  //ETX
366 };
368 
369 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
Store vtkAlgorithm input/output information.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
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:83
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:53
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:86
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