00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00103 #ifndef __vtkGlyph3D_h
00104 #define __vtkGlyph3D_h
00105
00106 #include "vtkDataSetToPolyDataFilter.h"
00107
00108 #define VTK_SCALE_BY_SCALAR 0
00109 #define VTK_SCALE_BY_VECTOR 1
00110 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
00111 #define VTK_DATA_SCALING_OFF 3
00112
00113 #define VTK_COLOR_BY_SCALE 0
00114 #define VTK_COLOR_BY_SCALAR 1
00115 #define VTK_COLOR_BY_VECTOR 2
00116
00117 #define VTK_USE_VECTOR 0
00118 #define VTK_USE_NORMAL 1
00119 #define VTK_VECTOR_ROTATION_OFF 2
00120
00121 #define VTK_INDEXING_OFF 0
00122 #define VTK_INDEXING_BY_SCALAR 1
00123 #define VTK_INDEXING_BY_VECTOR 2
00124
00125 class VTK_EXPORT vtkGlyph3D : public vtkDataSetToPolyDataFilter
00126 {
00127 public:
00128 vtkTypeMacro(vtkGlyph3D,vtkDataSetToPolyDataFilter);
00129 void PrintSelf(ostream& os, vtkIndent indent);
00130
00135 static vtkGlyph3D *New();
00136
00139 void SetNumberOfSources(int num);
00140 int GetNumberOfSources();
00141
00143 void SetSource(vtkPolyData *pd) {this->SetSource(0,pd);};
00144
00146 void SetSource(int id, vtkPolyData *pd);
00147
00149 vtkPolyData *GetSource(int id=0);
00150
00152 vtkSetMacro(Scaling,int);
00153 vtkBooleanMacro(Scaling,int);
00154 vtkGetMacro(Scaling,int);
00155
00157 vtkSetMacro(ScaleMode,int);
00158 vtkGetMacro(ScaleMode,int);
00159 void SetScaleModeToScaleByScalar()
00160 {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
00161 void SetScaleModeToScaleByVector()
00162 {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
00163 void SetScaleModeToScaleByVectorComponents()
00164 {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
00165 void SetScaleModeToDataScalingOff()
00166 {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
00167 const char *GetScaleModeAsString();
00168
00170 vtkSetMacro(ColorMode,int);
00171 vtkGetMacro(ColorMode,int);
00172 void SetColorModeToColorByScale()
00173 {this->SetColorMode(VTK_COLOR_BY_SCALE);};
00174 void SetColorModeToColorByScalar()
00175 {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
00176 void SetColorModeToColorByVector()
00177 {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
00178 const char *GetColorModeAsString();
00179
00181 vtkSetMacro(ScaleFactor,float);
00182 vtkGetMacro(ScaleFactor,float);
00183
00185 vtkSetVector2Macro(Range,float);
00186 vtkGetVectorMacro(Range,float,2);
00187
00189 vtkSetMacro(Orient,int);
00190 vtkBooleanMacro(Orient,int);
00191 vtkGetMacro(Orient,int);
00192
00195 vtkSetMacro(Clamping,int);
00196 vtkBooleanMacro(Clamping,int);
00197 vtkGetMacro(Clamping,int);
00198
00200 vtkSetMacro(VectorMode,int);
00201 vtkGetMacro(VectorMode,int);
00202 void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
00203 void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
00204 void SetVectorModeToVectorRotationOff()
00205 {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
00206 const char *GetVectorModeAsString();
00207
00211 vtkSetMacro(IndexMode,int);
00212 vtkGetMacro(IndexMode,int);
00213 void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
00214 void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
00215 void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
00216 const char *GetIndexModeAsString();
00217
00218 protected:
00219 vtkGlyph3D();
00220 ~vtkGlyph3D();
00221 vtkGlyph3D(const vtkGlyph3D&) {};
00222 void operator=(const vtkGlyph3D&) {};
00223
00224 void Execute();
00225 void ExecuteInformation();
00226 void ComputeInputUpdateExtents(vtkDataObject *output);
00227
00228 int NumberOfSources;
00229 vtkPolyData **Source;
00230 int Scaling;
00231 int ScaleMode;
00232 int ColorMode;
00233 float ScaleFactor;
00234 float Range[2];
00235 int Orient;
00236 int VectorMode;
00237 int Clamping;
00238 int IndexMode;
00239 };
00240
00242 inline const char *vtkGlyph3D::GetScaleModeAsString(void)
00243 {
00244 if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
00245 {
00246 return "ScaleByScalar";
00247 }
00248 else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
00249 {
00250 return "ScaleByVector";
00251 }
00252 else
00253 {
00254 return "DataScalingOff";
00255 }
00256 }
00257
00259 inline const char *vtkGlyph3D::GetColorModeAsString(void)
00260 {
00261 if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
00262 {
00263 return "ColorByScalar";
00264 }
00265 else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
00266 {
00267 return "ColorByVector";
00268 }
00269 else
00270 {
00271 return "ColorByScale";
00272 }
00273 }
00274
00276 inline const char *vtkGlyph3D::GetVectorModeAsString(void)
00277 {
00278 if ( this->VectorMode == VTK_USE_VECTOR)
00279 {
00280 return "UseVector";
00281 }
00282 else if ( this->VectorMode == VTK_USE_NORMAL)
00283 {
00284 return "UseNormal";
00285 }
00286 else
00287 {
00288 return "VectorRotationOff";
00289 }
00290 }
00291
00293 inline const char *vtkGlyph3D::GetIndexModeAsString(void)
00294 {
00295 if ( this->IndexMode == VTK_INDEXING_OFF)
00296 {
00297 return "IndexingOff";
00298 }
00299 else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
00300 {
00301 return "IndexingByScalar";
00302 }
00303 else
00304 {
00305 return "IndexingByVector";
00306 }
00307 }
00308
00309 #endif