Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkGenericGlyph3DFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGenericGlyph3DFilter.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00091 #ifndef __vtkGenericGlyph3DFilter_h
00092 #define __vtkGenericGlyph3DFilter_h
00093 
00094 #include "vtkGenericDataSetToPolyDataFilter.h"
00095 
00096 #define VTK_SCALE_BY_SCALAR 0
00097 #define VTK_SCALE_BY_VECTOR 1
00098 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
00099 #define VTK_DATA_SCALING_OFF 3
00100 
00101 #define VTK_COLOR_BY_SCALE  0
00102 #define VTK_COLOR_BY_SCALAR 1
00103 #define VTK_COLOR_BY_VECTOR 2
00104 
00105 #define VTK_USE_VECTOR 0
00106 #define VTK_USE_NORMAL 1
00107 #define VTK_VECTOR_ROTATION_OFF 2
00108 
00109 #define VTK_INDEXING_OFF 0
00110 #define VTK_INDEXING_BY_SCALAR 1
00111 #define VTK_INDEXING_BY_VECTOR 2
00112 
00113 class VTK_GENERIC_FILTERING_EXPORT vtkGenericGlyph3DFilter : public vtkGenericDataSetToPolyDataFilter
00114 {
00115 public:
00116   vtkTypeRevisionMacro(vtkGenericGlyph3DFilter,vtkGenericDataSetToPolyDataFilter);
00117   void PrintSelf(ostream& os, vtkIndent indent);
00118 
00123   static vtkGenericGlyph3DFilter *New();
00124 
00126 
00128   void SetNumberOfSources(int num);
00129   int GetNumberOfSources();
00131 
00133   void SetSource(vtkPolyData *pd) {this->SetSource(0,pd);};
00134 
00136   void SetSource(int id, vtkPolyData *pd);
00137 
00139   vtkPolyData *GetSource(int id=0);
00140 
00142 
00143   vtkSetMacro(Scaling,int);
00144   vtkBooleanMacro(Scaling,int);
00145   vtkGetMacro(Scaling,int);
00147 
00149 
00150   vtkSetMacro(ScaleMode,int);
00151   vtkGetMacro(ScaleMode,int);
00152   void SetScaleModeToScaleByScalar() 
00153     {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
00154   void SetScaleModeToScaleByVector() 
00155     {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
00156   void SetScaleModeToScaleByVectorComponents()
00157     {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
00158   void SetScaleModeToDataScalingOff()
00159     {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
00160   const char *GetScaleModeAsString();
00162 
00164 
00165   vtkSetMacro(ColorMode,int);
00166   vtkGetMacro(ColorMode,int);
00167   void SetColorModeToColorByScale() 
00168     {this->SetColorMode(VTK_COLOR_BY_SCALE);};
00169   void SetColorModeToColorByScalar() 
00170     {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
00171   void SetColorModeToColorByVector() 
00172     {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
00173   const char *GetColorModeAsString();
00175 
00177 
00178   vtkSetMacro(ScaleFactor,double);
00179   vtkGetMacro(ScaleFactor,double);
00181 
00183 
00184   vtkSetVector2Macro(Range,double);
00185   vtkGetVectorMacro(Range,double,2);
00187 
00189 
00190   vtkSetMacro(Orient,int);
00191   vtkBooleanMacro(Orient,int);
00192   vtkGetMacro(Orient,int);
00194 
00196 
00198   vtkSetMacro(Clamping,int);
00199   vtkBooleanMacro(Clamping,int);
00200   vtkGetMacro(Clamping,int);
00202 
00204 
00205   vtkSetMacro(VectorMode,int);
00206   vtkGetMacro(VectorMode,int);
00207   void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
00208   void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
00209   void SetVectorModeToVectorRotationOff() 
00210     {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
00211   const char *GetVectorModeAsString();
00213 
00215 
00218   vtkSetMacro(IndexMode,int);
00219   vtkGetMacro(IndexMode,int);
00220   void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
00221   void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
00222   void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
00223   const char *GetIndexModeAsString();
00225 
00227 
00231   vtkSetMacro(GeneratePointIds,int);
00232   vtkGetMacro(GeneratePointIds,int);
00233   vtkBooleanMacro(GeneratePointIds,int);
00235 
00237 
00240   vtkSetStringMacro(PointIdsName);
00241   vtkGetStringMacro(PointIdsName);
00243 
00245 
00248   vtkGetStringMacro(InputScalarsSelection);
00249   void SelectInputScalars(const char *fieldName) 
00250     {this->SetInputScalarsSelection(fieldName);}
00252 
00254 
00257   vtkGetStringMacro(InputVectorsSelection);
00258   void SelectInputVectors(const char *fieldName) 
00259     {this->SetInputVectorsSelection(fieldName);}
00261 
00263 
00266   vtkGetStringMacro(InputNormalsSelection);
00267   void SelectInputNormals(const char *fieldName) 
00268     {this->SetInputNormalsSelection(fieldName);}
00270 
00271 protected:
00272   vtkGenericGlyph3DFilter();
00273   ~vtkGenericGlyph3DFilter();
00274 
00275   virtual int FillInputPortInformation(int, vtkInformation*);
00276   void Execute();
00277   void ExecuteInformation();
00278   void ComputeInputUpdateExtents(vtkDataObject *output);
00279 
00280   int NumberOfSources; // Number of source objects
00281   vtkPolyData **Source; // Geometry to copy to each point
00282   int Scaling; // Determine whether scaling of geometry is performed
00283   int ScaleMode; // Scale by scalar value or vector magnitude
00284   int ColorMode; // new scalars based on scale, scalar or vector
00285   double ScaleFactor; // Scale factor to use to scale geometry
00286   double Range[2]; // Range to use to perform scalar scaling
00287   int Orient; // boolean controls whether to "orient" data
00288   int VectorMode; // Orient/scale via normal or via vector data
00289   int Clamping; // whether to clamp scale factor
00290   int IndexMode; // what to use to index into glyph table
00291   int GeneratePointIds; // produce input points ids for each output point
00292   char *PointIdsName;
00293 
00294   char *InputScalarsSelection;
00295   char *InputVectorsSelection;
00296   char *InputNormalsSelection;
00297   vtkSetStringMacro(InputScalarsSelection);
00298   vtkSetStringMacro(InputVectorsSelection);
00299   vtkSetStringMacro(InputNormalsSelection);
00300 
00301 private:
00302   vtkGenericGlyph3DFilter(const vtkGenericGlyph3DFilter&);  // Not implemented.
00303   void operator=(const vtkGenericGlyph3DFilter&);  // Not implemented.
00304 };
00305 
00307 inline const char *vtkGenericGlyph3DFilter::GetScaleModeAsString(void)
00308 {
00309   if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
00310     {
00311     return "ScaleByScalar";
00312     }
00313   else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR ) 
00314     {
00315     return "ScaleByVector";
00316     }
00317   else 
00318     {
00319     return "DataScalingOff";
00320     }
00321 }
00322 
00324 inline const char *vtkGenericGlyph3DFilter::GetColorModeAsString(void)
00325 {
00326   if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
00327     {
00328     return "ColorByScalar";
00329     }
00330   else if ( this->ColorMode == VTK_COLOR_BY_VECTOR ) 
00331     {
00332     return "ColorByVector";
00333     }
00334   else 
00335     {
00336     return "ColorByScale";
00337     }
00338 }
00339 
00341 inline const char *vtkGenericGlyph3DFilter::GetVectorModeAsString(void)
00342 {
00343   if ( this->VectorMode == VTK_USE_VECTOR) 
00344     {
00345     return "UseVector";
00346     }
00347   else if ( this->VectorMode == VTK_USE_NORMAL) 
00348     {
00349     return "UseNormal";
00350     }
00351   else 
00352     {
00353     return "VectorRotationOff";
00354     }
00355 }
00356 
00358 inline const char *vtkGenericGlyph3DFilter::GetIndexModeAsString(void)
00359 {
00360   if ( this->IndexMode == VTK_INDEXING_OFF) 
00361     {
00362     return "IndexingOff";
00363     }
00364   else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR) 
00365     {
00366     return "IndexingByScalar";
00367     }
00368   else 
00369     {
00370     return "IndexingByVector";
00371     }
00372 }
00373 
00374 #endif