VTK
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 
126  void SetSourceData(vtkPolyData *pd) {this->SetSourceData(0,pd);};
127 
132  void SetSourceData(int id, vtkPolyData *pd);
133 
135 
138  void SetSourceConnection(int id, vtkAlgorithmOutput* algOutput);
140  {
141  this->SetSourceConnection(0, algOutput);
142  }
144 
146  vtkPolyData *GetSource(int id=0);
147 
149 
150  vtkSetMacro(Scaling,int);
151  vtkBooleanMacro(Scaling,int);
152  vtkGetMacro(Scaling,int);
154 
156 
157  vtkSetMacro(ScaleMode,int);
158  vtkGetMacro(ScaleMode,int);
160  {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
162  {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
164  {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
166  {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
167  const char *GetScaleModeAsString();
169 
171 
172  vtkSetMacro(ColorMode,int);
173  vtkGetMacro(ColorMode,int);
175  {this->SetColorMode(VTK_COLOR_BY_SCALE);};
177  {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
179  {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
180  const char *GetColorModeAsString();
182 
184 
185  vtkSetMacro(ScaleFactor,double);
186  vtkGetMacro(ScaleFactor,double);
188 
190 
191  vtkSetVector2Macro(Range,double);
192  vtkGetVectorMacro(Range,double,2);
194 
196 
197  vtkSetMacro(Orient,int);
198  vtkBooleanMacro(Orient,int);
199  vtkGetMacro(Orient,int);
201 
203 
205  vtkSetMacro(Clamping,int);
206  vtkBooleanMacro(Clamping,int);
207  vtkGetMacro(Clamping,int);
209 
211 
212  vtkSetMacro(VectorMode,int);
213  vtkGetMacro(VectorMode,int);
214  void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
215  void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
217  {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
218  const char *GetVectorModeAsString();
220 
222 
228  vtkSetMacro(IndexMode,int);
229  vtkGetMacro(IndexMode,int);
230  void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
231  void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
232  void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
233  const char *GetIndexModeAsString();
235 
237 
241  vtkSetMacro(GeneratePointIds,int);
242  vtkGetMacro(GeneratePointIds,int);
243  vtkBooleanMacro(GeneratePointIds,int);
245 
247 
250  vtkSetStringMacro(PointIdsName);
251  vtkGetStringMacro(PointIdsName);
253 
255 
258  vtkSetMacro(FillCellData,int);
259  vtkGetMacro(FillCellData,int);
260  vtkBooleanMacro(FillCellData,int);
262 
265  virtual int IsPointVisible(vtkDataSet*, vtkIdType) {return 1;};
266 
268 
272  vtkGetObjectMacro(SourceTransform, vtkTransform);
274 
276  virtual unsigned long GetMTime();
277 
278 protected:
281 
285 
287 
289 
292  virtual bool Execute(vtkDataSet* input,
293  vtkInformationVector* sourceVector,
294  vtkPolyData* output);
296 
297  vtkPolyData **Source; // Geometry to copy to each point
298  int Scaling; // Determine whether scaling of geometry is performed
299  int ScaleMode; // Scale by scalar value or vector magnitude
300  int ColorMode; // new scalars based on scale, scalar or vector
301  double ScaleFactor; // Scale factor to use to scale geometry
302  double Range[2]; // Range to use to perform scalar scaling
303  int Orient; // boolean controls whether to "orient" data
304  int VectorMode; // Orient/scale via normal or via vector data
305  int Clamping; // whether to clamp scale factor
306  int IndexMode; // what to use to index into glyph table
307  int GeneratePointIds; // produce input points ids for each output point
308  int FillCellData; // whether to fill output cell data
311 
312 private:
313  vtkGlyph3D(const vtkGlyph3D&); // Not implemented.
314  void operator=(const vtkGlyph3D&); // Not implemented.
315 };
316 
318 
319 inline const char *vtkGlyph3D::GetScaleModeAsString(void)
320 {
321  if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
322  {
323  return "ScaleByScalar";
324  }
325  else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
326  {
327  return "ScaleByVector";
328  }
329  else
330  {
331  return "DataScalingOff";
332  }
333 }
335 
337 
338 inline const char *vtkGlyph3D::GetColorModeAsString(void)
339 {
340  if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
341  {
342  return "ColorByScalar";
343  }
344  else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
345  {
346  return "ColorByVector";
347  }
348  else
349  {
350  return "ColorByScale";
351  }
352 }
354 
356 
357 inline const char *vtkGlyph3D::GetVectorModeAsString(void)
358 {
359  if ( this->VectorMode == VTK_USE_VECTOR)
360  {
361  return "UseVector";
362  }
363  else if ( this->VectorMode == VTK_USE_NORMAL)
364  {
365  return "UseNormal";
366  }
367  else
368  {
369  return "VectorRotationOff";
370  }
371 }
373 
375 
376 inline const char *vtkGlyph3D::GetIndexModeAsString(void)
377 {
378  if ( this->IndexMode == VTK_INDEXING_OFF)
379  {
380  return "IndexingOff";
381  }
382  else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
383  {
384  return "IndexingByScalar";
385  }
386  else
387  {
388  return "IndexingByVector";
389  }
390 }
392 
393 #endif
vtkGlyph3D::SetIndexModeToOff
void SetIndexModeToOff()
Definition: vtkGlyph3D.h:232
vtkGlyph3D::SetSourceConnection
void SetSourceConnection(int id, vtkAlgorithmOutput *algOutput)
vtkGlyph3D::GetColorModeAsString
const char * GetColorModeAsString()
Definition: vtkGlyph3D.h:338
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkGlyph3D::IsPointVisible
virtual int IsPointVisible(vtkDataSet *, vtkIdType)
Definition: vtkGlyph3D.h:265
vtkGlyph3D::SetScaleModeToScaleByVectorComponents
void SetScaleModeToScaleByVectorComponents()
Definition: vtkGlyph3D.h:163
vtkSetVector2Macro
#define vtkSetVector2Macro(name, type)
Definition: vtkSetGet.h:254
VTK_VECTOR_ROTATION_OFF
#define VTK_VECTOR_ROTATION_OFF
Definition: vtkGlyph3D.h:102
vtkGlyph3D::ScaleFactor
double ScaleFactor
Definition: vtkGlyph3D.h:301
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkGlyph3D::SetSourceConnection
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Definition: vtkGlyph3D.h:139
vtkGlyph3D::SourceTransform
vtkTransform * SourceTransform
Definition: vtkGlyph3D.h:310
vtkGlyph3D::FillCellData
int FillCellData
Definition: vtkGlyph3D.h:308
vtkGlyph3D::Orient
int Orient
Definition: vtkGlyph3D.h:303
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkGlyph3D::GetIndexModeAsString
const char * GetIndexModeAsString()
Definition: vtkGlyph3D.h:376
vtkGlyph3D::Clamping
int Clamping
Definition: vtkGlyph3D.h:305
vtkGlyph3D::SetIndexModeToScalar
void SetIndexModeToScalar()
Definition: vtkGlyph3D.h:230
vtkGlyph3D::Scaling
int Scaling
Definition: vtkGlyph3D.h:298
vtkGlyph3D::PointIdsName
char * PointIdsName
Definition: vtkGlyph3D.h:309
vtkGlyph3D::GetVectorModeAsString
const char * GetVectorModeAsString()
Definition: vtkGlyph3D.h:357
VTK_SCALE_BY_SCALAR
#define VTK_SCALE_BY_SCALAR
Definition: vtkGlyph3D.h:91
vtkGlyph3D::GetSource
vtkPolyData * GetSource(int idx, vtkInformationVector *sourceInfo)
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
VTK_SCALE_BY_VECTOR
#define VTK_SCALE_BY_VECTOR
Definition: vtkGlyph3D.h:92
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkGetVectorMacro
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:424
vtkGlyph3D::SetColorModeToColorByVector
void SetColorModeToColorByVector()
Definition: vtkGlyph3D.h:178
vtkGlyph3D::ColorMode
int ColorMode
Definition: vtkGlyph3D.h:300
vtkGlyph3D::SetScaleModeToDataScalingOff
void SetScaleModeToDataScalingOff()
Definition: vtkGlyph3D.h:165
vtkGlyph3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGlyph3D::SetIndexModeToVector
void SetIndexModeToVector()
Definition: vtkGlyph3D.h:231
vtkFiltersCoreModule.h
VTK_INDEXING_BY_VECTOR
#define VTK_INDEXING_BY_VECTOR
Definition: vtkGlyph3D.h:106
vtkPolyDataAlgorithm.h
vtkGlyph3D::Source
vtkPolyData ** Source
Definition: vtkGlyph3D.h:297
VTK_COLOR_BY_SCALAR
#define VTK_COLOR_BY_SCALAR
Definition: vtkGlyph3D.h:97
vtkGlyph3D::FillInputPortInformation
virtual int FillInputPortInformation(int, vtkInformation *)
vtkGlyph3D::GetSource
vtkPolyData * GetSource(int id=0)
vtkGlyph3D::SetSourceTransform
void SetSourceTransform(vtkTransform *)
vtkGlyph3D::SetSourceData
void SetSourceData(int id, vtkPolyData *pd)
vtkGlyph3D::~vtkGlyph3D
~vtkGlyph3D()
vtkGlyph3D::New
static vtkGlyph3D * New()
vtkGlyph3D::GetMTime
virtual unsigned long GetMTime()
vtkGlyph3D::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkGlyph3D::IndexMode
int IndexMode
Definition: vtkGlyph3D.h:306
VTKFILTERSCORE_EXPORT
#define VTKFILTERSCORE_EXPORT
Definition: vtkFiltersCoreModule.h:15
vtkGlyph3D::SetColorModeToColorByScalar
void SetColorModeToColorByScalar()
Definition: vtkGlyph3D.h:176
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkGlyph3D::SetVectorModeToUseNormal
void SetVectorModeToUseNormal()
Definition: vtkGlyph3D.h:215
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGlyph3D::SetScaleModeToScaleByVector
void SetScaleModeToScaleByVector()
Definition: vtkGlyph3D.h:161
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkGlyph3D::Execute
virtual bool Execute(vtkDataSet *input, vtkInformationVector *sourceVector, vtkPolyData *output)
vtkGlyph3D::GetScaleModeAsString
const char * GetScaleModeAsString()
Definition: vtkGlyph3D.h:319
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
VTK_COLOR_BY_VECTOR
#define VTK_COLOR_BY_VECTOR
Definition: vtkGlyph3D.h:98
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkGlyph3D::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
VTK_COLOR_BY_SCALE
#define VTK_COLOR_BY_SCALE
Definition: vtkGlyph3D.h:96
vtkGlyph3D::SetColorModeToColorByScale
void SetColorModeToColorByScale()
Definition: vtkGlyph3D.h:174
VTK_SCALE_BY_VECTORCOMPONENTS
#define VTK_SCALE_BY_VECTORCOMPONENTS
Definition: vtkGlyph3D.h:93
vtkGlyph3D::SetVectorModeToVectorRotationOff
void SetVectorModeToVectorRotationOff()
Definition: vtkGlyph3D.h:216
vtkGlyph3D::SetVectorModeToUseVector
void SetVectorModeToUseVector()
Definition: vtkGlyph3D.h:214
vtkGlyph3D::GeneratePointIds
int GeneratePointIds
Definition: vtkGlyph3D.h:307
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkGlyph3D::SetSourceData
void SetSourceData(vtkPolyData *pd)
Definition: vtkGlyph3D.h:126
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkGlyph3D::vtkGlyph3D
vtkGlyph3D()
vtkGlyph3D::SetScaleModeToScaleByScalar
void SetScaleModeToScaleByScalar()
Definition: vtkGlyph3D.h:159
VTK_USE_NORMAL
#define VTK_USE_NORMAL
Definition: vtkGlyph3D.h:101
VTK_USE_VECTOR
#define VTK_USE_VECTOR
Definition: vtkGlyph3D.h:100
VTK_INDEXING_BY_SCALAR
#define VTK_INDEXING_BY_SCALAR
Definition: vtkGlyph3D.h:105
VTK_DATA_SCALING_OFF
#define VTK_DATA_SCALING_OFF
Definition: vtkGlyph3D.h:94
vtkGlyph3D::ScaleMode
int ScaleMode
Definition: vtkGlyph3D.h:299
vtkGlyph3D::VectorMode
int VectorMode
Definition: vtkGlyph3D.h:304
VTK_INDEXING_OFF
#define VTK_INDEXING_OFF
Definition: vtkGlyph3D.h:104
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44