Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
00081 #ifndef __vtkGenericGlyph3DFilter_h
00082 #define __vtkGenericGlyph3DFilter_h
00083 
00084 #include "vtkPolyDataAlgorithm.h"
00085 
00086 #define VTK_SCALE_BY_SCALAR 0
00087 #define VTK_SCALE_BY_VECTOR 1
00088 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
00089 #define VTK_DATA_SCALING_OFF 3
00090 
00091 #define VTK_COLOR_BY_SCALE  0
00092 #define VTK_COLOR_BY_SCALAR 1
00093 #define VTK_COLOR_BY_VECTOR 2
00094 
00095 #define VTK_USE_VECTOR 0
00096 #define VTK_USE_NORMAL 1
00097 #define VTK_VECTOR_ROTATION_OFF 2
00098 
00099 #define VTK_INDEXING_OFF 0
00100 #define VTK_INDEXING_BY_SCALAR 1
00101 #define VTK_INDEXING_BY_VECTOR 2
00102 
00103 class VTK_GENERIC_FILTERING_EXPORT vtkGenericGlyph3DFilter : public vtkPolyDataAlgorithm
00104 {
00105 public:
00106   vtkTypeRevisionMacro(vtkGenericGlyph3DFilter,vtkPolyDataAlgorithm);
00107   void PrintSelf(ostream& os, vtkIndent indent);
00108 
00113   static vtkGenericGlyph3DFilter *New();
00114 
00116   void SetSource(vtkPolyData *pd) {this->SetSource(0,pd);};
00117 
00119   void SetSource(int id, vtkPolyData *pd);
00120 
00122   vtkPolyData *GetSource(int id=0);
00123 
00125 
00126   vtkSetMacro(Scaling,int);
00127   vtkBooleanMacro(Scaling,int);
00128   vtkGetMacro(Scaling,int);
00130 
00132 
00133   vtkSetMacro(ScaleMode,int);
00134   vtkGetMacro(ScaleMode,int);
00135   void SetScaleModeToScaleByScalar() 
00136     {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
00137   void SetScaleModeToScaleByVector() 
00138     {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
00139   void SetScaleModeToScaleByVectorComponents()
00140     {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
00141   void SetScaleModeToDataScalingOff()
00142     {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
00143   const char *GetScaleModeAsString();
00145 
00147 
00148   vtkSetMacro(ColorMode,int);
00149   vtkGetMacro(ColorMode,int);
00150   void SetColorModeToColorByScale() 
00151     {this->SetColorMode(VTK_COLOR_BY_SCALE);};
00152   void SetColorModeToColorByScalar() 
00153     {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
00154   void SetColorModeToColorByVector() 
00155     {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
00156   const char *GetColorModeAsString();
00158 
00160 
00161   vtkSetMacro(ScaleFactor,double);
00162   vtkGetMacro(ScaleFactor,double);
00164 
00166 
00167   vtkSetVector2Macro(Range,double);
00168   vtkGetVectorMacro(Range,double,2);
00170 
00172 
00173   vtkSetMacro(Orient,int);
00174   vtkBooleanMacro(Orient,int);
00175   vtkGetMacro(Orient,int);
00177 
00179 
00181   vtkSetMacro(Clamping,int);
00182   vtkBooleanMacro(Clamping,int);
00183   vtkGetMacro(Clamping,int);
00185 
00187 
00188   vtkSetMacro(VectorMode,int);
00189   vtkGetMacro(VectorMode,int);
00190   void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
00191   void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
00192   void SetVectorModeToVectorRotationOff() 
00193     {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
00194   const char *GetVectorModeAsString();
00196 
00198 
00201   vtkSetMacro(IndexMode,int);
00202   vtkGetMacro(IndexMode,int);
00203   void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
00204   void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
00205   void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
00206   const char *GetIndexModeAsString();
00208 
00210 
00214   vtkSetMacro(GeneratePointIds,int);
00215   vtkGetMacro(GeneratePointIds,int);
00216   vtkBooleanMacro(GeneratePointIds,int);
00218 
00220 
00223   vtkSetStringMacro(PointIdsName);
00224   vtkGetStringMacro(PointIdsName);
00226 
00228 
00231   vtkGetStringMacro(InputScalarsSelection);
00232   void SelectInputScalars(const char *fieldName) 
00233     {this->SetInputScalarsSelection(fieldName);}
00235 
00237 
00240   vtkGetStringMacro(InputVectorsSelection);
00241   void SelectInputVectors(const char *fieldName) 
00242     {this->SetInputVectorsSelection(fieldName);}
00244 
00246 
00249   vtkGetStringMacro(InputNormalsSelection);
00250   void SelectInputNormals(const char *fieldName) 
00251     {this->SetInputNormalsSelection(fieldName);}
00253 
00254 protected:
00255   vtkGenericGlyph3DFilter();
00256   ~vtkGenericGlyph3DFilter();
00257   
00258   int FillInputPortInformation(int, vtkInformation*);
00259   
00260   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00261   int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00262   int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00263   vtkPolyData **Source; // Geometry to copy to each point
00264   int Scaling; // Determine whether scaling of geometry is performed
00265   int ScaleMode; // Scale by scalar value or vector magnitude
00266   int ColorMode; // new scalars based on scale, scalar or vector
00267   double ScaleFactor; // Scale factor to use to scale geometry
00268   double Range[2]; // Range to use to perform scalar scaling
00269   int Orient; // boolean controls whether to "orient" data
00270   int VectorMode; // Orient/scale via normal or via vector data
00271   int Clamping; // whether to clamp scale factor
00272   int IndexMode; // what to use to index into glyph table
00273   int GeneratePointIds; // produce input points ids for each output point
00274   char *PointIdsName;
00275 
00276   char *InputScalarsSelection;
00277   char *InputVectorsSelection;
00278   char *InputNormalsSelection;
00279   vtkSetStringMacro(InputScalarsSelection);
00280   vtkSetStringMacro(InputVectorsSelection);
00281   vtkSetStringMacro(InputNormalsSelection);
00282 
00283 private:
00284   vtkGenericGlyph3DFilter(const vtkGenericGlyph3DFilter&);  // Not implemented.
00285   void operator=(const vtkGenericGlyph3DFilter&);  // Not implemented.
00286 };
00287 
00289 inline const char *vtkGenericGlyph3DFilter::GetScaleModeAsString(void)
00290 {
00291   if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
00292     {
00293     return "ScaleByScalar";
00294     }
00295   else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR ) 
00296     {
00297     return "ScaleByVector";
00298     }
00299   else 
00300     {
00301     return "DataScalingOff";
00302     }
00303 }
00304 
00306 inline const char *vtkGenericGlyph3DFilter::GetColorModeAsString(void)
00307 {
00308   if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
00309     {
00310     return "ColorByScalar";
00311     }
00312   else if ( this->ColorMode == VTK_COLOR_BY_VECTOR ) 
00313     {
00314     return "ColorByVector";
00315     }
00316   else 
00317     {
00318     return "ColorByScale";
00319     }
00320 }
00321 
00323 inline const char *vtkGenericGlyph3DFilter::GetVectorModeAsString(void)
00324 {
00325   if ( this->VectorMode == VTK_USE_VECTOR) 
00326     {
00327     return "UseVector";
00328     }
00329   else if ( this->VectorMode == VTK_USE_NORMAL) 
00330     {
00331     return "UseNormal";
00332     }
00333   else 
00334     {
00335     return "VectorRotationOff";
00336     }
00337 }
00338 
00340 inline const char *vtkGenericGlyph3DFilter::GetIndexModeAsString(void)
00341 {
00342   if ( this->IndexMode == VTK_INDEXING_OFF) 
00343     {
00344     return "IndexingOff";
00345     }
00346   else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR) 
00347     {
00348     return "IndexingByScalar";
00349     }
00350   else 
00351     {
00352     return "IndexingByVector";
00353     }
00354 }
00355 
00356 #endif

Generated on Mon Jan 21 23:07:23 2008 for VTK by  doxygen 1.4.3-20050530