VTK
dox/Filters/Programmable/vtkProgrammableGlyphFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkProgrammableGlyphFilter.h
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 =========================================================================*/
00063 #ifndef __vtkProgrammableGlyphFilter_h
00064 #define __vtkProgrammableGlyphFilter_h
00065 
00066 #define VTK_COLOR_BY_INPUT  0
00067 #define VTK_COLOR_BY_SOURCE 1
00068 
00069 #include "vtkFiltersProgrammableModule.h" // For export macro
00070 #include "vtkPolyDataAlgorithm.h"
00071 
00072 class vtkPointData;
00073 
00074 class VTKFILTERSPROGRAMMABLE_EXPORT vtkProgrammableGlyphFilter : public vtkPolyDataAlgorithm
00075 {
00076 public:
00077   vtkTypeMacro(vtkProgrammableGlyphFilter,vtkPolyDataAlgorithm);
00078   void PrintSelf(ostream& os, vtkIndent indent);
00079 
00082   static vtkProgrammableGlyphFilter *New();
00083 
00087   void SetSourceConnection(vtkAlgorithmOutput* output);
00088 
00090 
00092   void SetSourceData(vtkPolyData *source);
00093   vtkPolyData *GetSource();
00095 
00102   typedef void (*ProgrammableMethodCallbackType)(void *arg);
00103 
00105   void SetGlyphMethod(void (*f)(void *), void *arg);
00106 
00109   void SetGlyphMethodArgDelete(void (*f)(void *));
00110 
00112 
00115   vtkGetMacro(PointId, vtkIdType);
00117 
00119 
00122   vtkGetVector3Macro(Point,double);
00124 
00126 
00129   vtkGetObjectMacro(PointData,vtkPointData);
00131 
00133 
00134   vtkSetMacro(ColorMode,int);
00135   vtkGetMacro(ColorMode,int);
00136   void SetColorModeToColorByInput()
00137     {this->SetColorMode(VTK_COLOR_BY_INPUT);};
00138   void SetColorModeToColorBySource()
00139     {this->SetColorMode(VTK_COLOR_BY_SOURCE);};
00140   const char *GetColorModeAsString();
00142 
00143 protected:
00144   vtkProgrammableGlyphFilter();
00145   ~vtkProgrammableGlyphFilter();
00146 
00147   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00148   virtual int FillInputPortInformation(int, vtkInformation *);
00149 
00150   double Point[3]; // Coordinates of point
00151   vtkIdType PointId; // Current point id during processing
00152   vtkPointData *PointData;
00153   int ColorMode;
00154 
00155   ProgrammableMethodCallbackType GlyphMethod; // Support GlyphMethod
00156   ProgrammableMethodCallbackType GlyphMethodArgDelete;
00157   void *GlyphMethodArg;
00158 
00159 private:
00160   vtkProgrammableGlyphFilter(const vtkProgrammableGlyphFilter&);  // Not implemented.
00161   void operator=(const vtkProgrammableGlyphFilter&);  // Not implemented.
00162 };
00163 
00164 #endif