VTK
dox/Graphics/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 "vtkPolyDataAlgorithm.h"
00070 
00071 class vtkPointData;
00072 
00073 class VTK_GRAPHICS_EXPORT vtkProgrammableGlyphFilter : public vtkPolyDataAlgorithm
00074 {
00075 public:
00076   vtkTypeMacro(vtkProgrammableGlyphFilter,vtkPolyDataAlgorithm);
00077   void PrintSelf(ostream& os, vtkIndent indent);
00078 
00081   static vtkProgrammableGlyphFilter *New();
00082 
00084 
00086   void SetSource(vtkPolyData *source);
00087   vtkPolyData *GetSource();
00089 
00096   typedef void (*ProgrammableMethodCallbackType)(void *arg);
00097 
00099   void SetGlyphMethod(void (*f)(void *), void *arg);
00100 
00103   void SetGlyphMethodArgDelete(void (*f)(void *));
00104 
00106 
00109   vtkGetMacro(PointId, vtkIdType);
00111 
00113 
00116   vtkGetVector3Macro(Point,double);
00118 
00120 
00123   vtkGetObjectMacro(PointData,vtkPointData);
00125 
00127 
00128   vtkSetMacro(ColorMode,int);
00129   vtkGetMacro(ColorMode,int);
00130   void SetColorModeToColorByInput() 
00131     {this->SetColorMode(VTK_COLOR_BY_INPUT);};
00132   void SetColorModeToColorBySource() 
00133     {this->SetColorMode(VTK_COLOR_BY_SOURCE);};
00134   const char *GetColorModeAsString();
00136 
00137 protected:
00138   vtkProgrammableGlyphFilter();
00139   ~vtkProgrammableGlyphFilter();
00140 
00141   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00142   virtual int FillInputPortInformation(int, vtkInformation *);
00143 
00144   double Point[3]; // Coordinates of point
00145   vtkIdType PointId; // Current point id during processing
00146   vtkPointData *PointData;
00147   int ColorMode;
00148   
00149   ProgrammableMethodCallbackType GlyphMethod; // Support GlyphMethod
00150   ProgrammableMethodCallbackType GlyphMethodArgDelete;
00151   void *GlyphMethodArg;
00152   
00153 private:
00154   vtkProgrammableGlyphFilter(const vtkProgrammableGlyphFilter&);  // Not implemented.
00155   void operator=(const vtkProgrammableGlyphFilter&);  // Not implemented.
00156 };
00157 
00158 #endif