VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkGlyph3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGlyph3D.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 =========================================================================*/
85 #ifndef __vtkGlyph3D_h
86 #define __vtkGlyph3D_h
87 
88 #include "vtkFiltersCoreModule.h" // For export macro
89 #include "vtkPolyDataAlgorithm.h"
90 
91 #define VTK_SCALE_BY_SCALAR 0
92 #define VTK_SCALE_BY_VECTOR 1
93 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
94 #define VTK_DATA_SCALING_OFF 3
95 
96 #define VTK_COLOR_BY_SCALE 0
97 #define VTK_COLOR_BY_SCALAR 1
98 #define VTK_COLOR_BY_VECTOR 2
99 
100 #define VTK_USE_VECTOR 0
101 #define VTK_USE_NORMAL 1
102 #define VTK_VECTOR_ROTATION_OFF 2
103 
104 #define VTK_INDEXING_OFF 0
105 #define VTK_INDEXING_BY_SCALAR 1
106 #define VTK_INDEXING_BY_VECTOR 2
107 
108 class vtkTransform;
109 
111 {
112 public:
114  void PrintSelf(ostream& os, vtkIndent indent);
115 
120  static vtkGlyph3D *New();
121 
124  void SetSourceData(vtkPolyData *pd) {this->SetSourceData(0,pd);};
125 
128  void SetSourceData(int id, vtkPolyData *pd);
129 
131 
134  void SetSourceConnection(int id, vtkAlgorithmOutput* algOutput);
136  {
137  this->SetSourceConnection(0, algOutput);
138  }
140 
142  vtkPolyData *GetSource(int id=0);
143 
145 
146  vtkSetMacro(Scaling,int);
147  vtkBooleanMacro(Scaling,int);
148  vtkGetMacro(Scaling,int);
150 
152 
153  vtkSetMacro(ScaleMode,int);
154  vtkGetMacro(ScaleMode,int);
156  {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
158  {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
160  {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
162  {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
163  const char *GetScaleModeAsString();
165 
167 
168  vtkSetMacro(ColorMode,int);
169  vtkGetMacro(ColorMode,int);
171  {this->SetColorMode(VTK_COLOR_BY_SCALE);};
173  {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
175  {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
176  const char *GetColorModeAsString();
178 
180 
181  vtkSetMacro(ScaleFactor,double);
182  vtkGetMacro(ScaleFactor,double);
184 
186 
187  vtkSetVector2Macro(Range,double);
188  vtkGetVectorMacro(Range,double,2);
190 
192 
193  vtkSetMacro(Orient,int);
194  vtkBooleanMacro(Orient,int);
195  vtkGetMacro(Orient,int);
197 
199 
201  vtkSetMacro(Clamping,int);
202  vtkBooleanMacro(Clamping,int);
203  vtkGetMacro(Clamping,int);
205 
207 
208  vtkSetMacro(VectorMode,int);
209  vtkGetMacro(VectorMode,int);
210  void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
211  void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
213  {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
214  const char *GetVectorModeAsString();
216 
218 
224  vtkSetMacro(IndexMode,int);
225  vtkGetMacro(IndexMode,int);
226  void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
227  void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
228  void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
229  const char *GetIndexModeAsString();
231 
233 
237  vtkSetMacro(GeneratePointIds,int);
238  vtkGetMacro(GeneratePointIds,int);
239  vtkBooleanMacro(GeneratePointIds,int);
241 
243 
246  vtkSetStringMacro(PointIdsName);
247  vtkGetStringMacro(PointIdsName);
249 
251 
254  vtkSetMacro(FillCellData,int);
255  vtkGetMacro(FillCellData,int);
256  vtkBooleanMacro(FillCellData,int);
258 
261  virtual int IsPointVisible(vtkDataSet*, vtkIdType) {return 1;};
262 
264 
267  void SetSourceTransform(vtkTransform*);
268  vtkGetObjectMacro(SourceTransform, vtkTransform);
270 
272  virtual unsigned long GetMTime();
273 
274 protected:
275  vtkGlyph3D();
276  ~vtkGlyph3D();
277 
280  virtual int FillInputPortInformation(int, vtkInformation *);
281 
282  vtkPolyData* GetSource(int idx, vtkInformationVector *sourceInfo);
283 
284  vtkPolyData **Source; // Geometry to copy to each point
285  int Scaling; // Determine whether scaling of geometry is performed
286  int ScaleMode; // Scale by scalar value or vector magnitude
287  int ColorMode; // new scalars based on scale, scalar or vector
288  double ScaleFactor; // Scale factor to use to scale geometry
289  double Range[2]; // Range to use to perform scalar scaling
290  int Orient; // boolean controls whether to "orient" data
291  int VectorMode; // Orient/scale via normal or via vector data
292  int Clamping; // whether to clamp scale factor
293  int IndexMode; // what to use to index into glyph table
294  int GeneratePointIds; // produce input points ids for each output point
295  int FillCellData; // whether to fill output cell data
298 
299 private:
300  vtkGlyph3D(const vtkGlyph3D&); // Not implemented.
301  void operator=(const vtkGlyph3D&); // Not implemented.
302 };
303 
305 
306 inline const char *vtkGlyph3D::GetScaleModeAsString(void)
307 {
308  if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
309  {
310  return "ScaleByScalar";
311  }
312  else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
313  {
314  return "ScaleByVector";
315  }
316  else
317  {
318  return "DataScalingOff";
319  }
320 }
322 
324 
325 inline const char *vtkGlyph3D::GetColorModeAsString(void)
326 {
327  if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
328  {
329  return "ColorByScalar";
330  }
331  else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
332  {
333  return "ColorByVector";
334  }
335  else
336  {
337  return "ColorByScale";
338  }
339 }
341 
343 
344 inline const char *vtkGlyph3D::GetVectorModeAsString(void)
345 {
346  if ( this->VectorMode == VTK_USE_VECTOR)
347  {
348  return "UseVector";
349  }
350  else if ( this->VectorMode == VTK_USE_NORMAL)
351  {
352  return "UseNormal";
353  }
354  else
355  {
356  return "VectorRotationOff";
357  }
358 }
360 
362 
363 inline const char *vtkGlyph3D::GetIndexModeAsString(void)
364 {
365  if ( this->IndexMode == VTK_INDEXING_OFF)
366  {
367  return "IndexingOff";
368  }
369  else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
370  {
371  return "IndexingByScalar";
372  }
373  else
374  {
375  return "IndexingByVector";
376  }
377 }
379 
380 #endif
void SetScaleModeToScaleByVectorComponents()
Definition: vtkGlyph3D.h:159
#define VTK_USE_NORMAL
Definition: vtkGlyph3D.h:101
const char * GetIndexModeAsString()
Definition: vtkGlyph3D.h:363
void SetSourceData(vtkPolyData *pd)
Definition: vtkGlyph3D.h:124
void SetScaleModeToScaleByVector()
Definition: vtkGlyph3D.h:157
virtual int FillInputPortInformation(int port, vtkInformation *info)
void SetColorModeToColorByScale()
Definition: vtkGlyph3D.h:170
void SetIndexModeToVector()
Definition: vtkGlyph3D.h:227
vtkTransform * SourceTransform
Definition: vtkGlyph3D.h:297
Store vtkAlgorithm input/output information.
#define VTK_SCALE_BY_VECTORCOMPONENTS
Definition: vtkGlyph3D.h:93
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
void SetScaleModeToScaleByScalar()
Definition: vtkGlyph3D.h:155
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
int ScaleMode
Definition: vtkGlyph3D.h:286
#define VTKFILTERSCORE_EXPORT
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
int Clamping
Definition: vtkGlyph3D.h:292
const char * GetColorModeAsString()
Definition: vtkGlyph3D.h:325
#define VTK_COLOR_BY_VECTOR
Definition: vtkGlyph3D.h:98
#define VTK_SCALE_BY_SCALAR
Definition: vtkGlyph3D.h:91
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
int vtkIdType
Definition: vtkType.h:268
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
#define VTK_SCALE_BY_VECTOR
Definition: vtkGlyph3D.h:92
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:94
char * PointIdsName
Definition: vtkGlyph3D.h:296
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
#define VTK_USE_VECTOR
Definition: vtkGlyph3D.h:100
void SetColorModeToColorByVector()
Definition: vtkGlyph3D.h:174
Proxy object to connect input/output ports.
#define VTK_COLOR_BY_SCALAR
Definition: vtkGlyph3D.h:97
#define VTK_DATA_SCALING_OFF
Definition: vtkGlyph3D.h:94
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Superclass for algorithms that produce only polydata as output.
#define VTK_INDEXING_BY_SCALAR
Definition: vtkGlyph3D.h:105
void SetIndexModeToScalar()
Definition: vtkGlyph3D.h:226
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTK_INDEXING_OFF
Definition: vtkGlyph3D.h:104
void SetColorModeToColorByScalar()
Definition: vtkGlyph3D.h:172
void SetVectorModeToUseNormal()
Definition: vtkGlyph3D.h:211
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:110
void SetVectorModeToVectorRotationOff()
Definition: vtkGlyph3D.h:212
void SetScaleModeToDataScalingOff()
Definition: vtkGlyph3D.h:161
#define VTK_VECTOR_ROTATION_OFF
Definition: vtkGlyph3D.h:102
const char * GetVectorModeAsString()
Definition: vtkGlyph3D.h:344
#define vtkGetStringMacro(name)
Definition: vtkSetGet.h:120
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
const char * GetScaleModeAsString()
Definition: vtkGlyph3D.h:306
virtual int IsPointVisible(vtkDataSet *, vtkIdType)
Definition: vtkGlyph3D.h:261
int IndexMode
Definition: vtkGlyph3D.h:293
int GeneratePointIds
Definition: vtkGlyph3D.h:294
int ColorMode
Definition: vtkGlyph3D.h:287
void SetIndexModeToOff()
Definition: vtkGlyph3D.h:228
int FillCellData
Definition: vtkGlyph3D.h:295
Store zero or more vtkInformation instances.
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
vtkPolyData ** Source
Definition: vtkGlyph3D.h:284
#define VTK_COLOR_BY_SCALE
Definition: vtkGlyph3D.h:96
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Definition: vtkGlyph3D.h:135
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:414
int VectorMode
Definition: vtkGlyph3D.h:291
#define VTK_INDEXING_BY_VECTOR
Definition: vtkGlyph3D.h:106
#define vtkSetVector2Macro(name, type)
Definition: vtkSetGet.h:244
double ScaleFactor
Definition: vtkGlyph3D.h:288
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69
void SetVectorModeToUseVector()
Definition: vtkGlyph3D.h:210