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
00107 #ifndef __vtkGlyph3D_h
00108 #define __vtkGlyph3D_h
00109
00110 #include "vtkDataSetToPolyDataFilter.h"
00111
00112 #define VTK_SCALE_BY_SCALAR 0
00113 #define VTK_SCALE_BY_VECTOR 1
00114 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
00115 #define VTK_DATA_SCALING_OFF 3
00116
00117 #define VTK_COLOR_BY_SCALE 0
00118 #define VTK_COLOR_BY_SCALAR 1
00119 #define VTK_COLOR_BY_VECTOR 2
00120
00121 #define VTK_USE_VECTOR 0
00122 #define VTK_USE_NORMAL 1
00123 #define VTK_VECTOR_ROTATION_OFF 2
00124
00125 #define VTK_INDEXING_OFF 0
00126 #define VTK_INDEXING_BY_SCALAR 1
00127 #define VTK_INDEXING_BY_VECTOR 2
00128
00129 class VTK_GRAPHICS_EXPORT vtkGlyph3D : public vtkDataSetToPolyDataFilter
00130 {
00131 public:
00132 vtkTypeMacro(vtkGlyph3D,vtkDataSetToPolyDataFilter);
00133 void PrintSelf(ostream& os, vtkIndent indent);
00134
00139 static vtkGlyph3D *New();
00140
00142
00144 void SetNumberOfSources(int num);
00145 int GetNumberOfSources();
00147
00149 void SetSource(vtkPolyData *pd) {this->SetSource(0,pd);};
00150
00152 void SetSource(int id, vtkPolyData *pd);
00153
00155 vtkPolyData *GetSource(int id=0);
00156
00158
00159 vtkSetMacro(Scaling,int);
00160 vtkBooleanMacro(Scaling,int);
00161 vtkGetMacro(Scaling,int);
00163
00165
00166 vtkSetMacro(ScaleMode,int);
00167 vtkGetMacro(ScaleMode,int);
00168 void SetScaleModeToScaleByScalar()
00169 {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
00170 void SetScaleModeToScaleByVector()
00171 {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
00172 void SetScaleModeToScaleByVectorComponents()
00173 {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
00174 void SetScaleModeToDataScalingOff()
00175 {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
00176 const char *GetScaleModeAsString();
00178
00180
00181 vtkSetMacro(ColorMode,int);
00182 vtkGetMacro(ColorMode,int);
00183 void SetColorModeToColorByScale()
00184 {this->SetColorMode(VTK_COLOR_BY_SCALE);};
00185 void SetColorModeToColorByScalar()
00186 {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
00187 void SetColorModeToColorByVector()
00188 {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
00189 const char *GetColorModeAsString();
00191
00193
00194 vtkSetMacro(ScaleFactor,float);
00195 vtkGetMacro(ScaleFactor,float);
00197
00199
00200 vtkSetVector2Macro(Range,float);
00201 vtkGetVectorMacro(Range,float,2);
00203
00205
00206 vtkSetMacro(Orient,int);
00207 vtkBooleanMacro(Orient,int);
00208 vtkGetMacro(Orient,int);
00210
00212
00214 vtkSetMacro(Clamping,int);
00215 vtkBooleanMacro(Clamping,int);
00216 vtkGetMacro(Clamping,int);
00218
00220
00221 vtkSetMacro(VectorMode,int);
00222 vtkGetMacro(VectorMode,int);
00223 void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
00224 void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
00225 void SetVectorModeToVectorRotationOff()
00226 {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
00227 const char *GetVectorModeAsString();
00229
00231
00234 vtkSetMacro(IndexMode,int);
00235 vtkGetMacro(IndexMode,int);
00236 void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
00237 void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
00238 void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
00239 const char *GetIndexModeAsString();
00241
00243
00247 vtkSetMacro(GeneratePointIds,int);
00248 vtkGetMacro(GeneratePointIds,int);
00249 vtkBooleanMacro(GeneratePointIds,int);
00251
00253
00256 vtkSetStringMacro(PointIdsName);
00257 vtkGetStringMacro(PointIdsName);
00259 protected:
00260 vtkGlyph3D();
00261 ~vtkGlyph3D();
00262
00263 void Execute();
00264 void ExecuteInformation();
00265 void ComputeInputUpdateExtents(vtkDataObject *output);
00266
00267 int NumberOfSources;
00268 vtkPolyData **Source;
00269 int Scaling;
00270 int ScaleMode;
00271 int ColorMode;
00272 float ScaleFactor;
00273 float Range[2];
00274 int Orient;
00275 int VectorMode;
00276 int Clamping;
00277 int IndexMode;
00278 int GeneratePointIds;
00279 char *PointIdsName;
00280
00281 private:
00282 vtkGlyph3D(const vtkGlyph3D&);
00283 void operator=(const vtkGlyph3D&);
00284 };
00285
00287 inline const char *vtkGlyph3D::GetScaleModeAsString(void)
00288 {
00289 if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
00290 {
00291 return "ScaleByScalar";
00292 }
00293 else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
00294 {
00295 return "ScaleByVector";
00296 }
00297 else
00298 {
00299 return "DataScalingOff";
00300 }
00301 }
00302
00304 inline const char *vtkGlyph3D::GetColorModeAsString(void)
00305 {
00306 if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
00307 {
00308 return "ColorByScalar";
00309 }
00310 else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
00311 {
00312 return "ColorByVector";
00313 }
00314 else
00315 {
00316 return "ColorByScale";
00317 }
00318 }
00319
00321 inline const char *vtkGlyph3D::GetVectorModeAsString(void)
00322 {
00323 if ( this->VectorMode == VTK_USE_VECTOR)
00324 {
00325 return "UseVector";
00326 }
00327 else if ( this->VectorMode == VTK_USE_NORMAL)
00328 {
00329 return "UseNormal";
00330 }
00331 else
00332 {
00333 return "VectorRotationOff";
00334 }
00335 }
00336
00338 inline const char *vtkGlyph3D::GetIndexModeAsString(void)
00339 {
00340 if ( this->IndexMode == VTK_INDEXING_OFF)
00341 {
00342 return "IndexingOff";
00343 }
00344 else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
00345 {
00346 return "IndexingByScalar";
00347 }
00348 else
00349 {
00350 return "IndexingByVector";
00351 }
00352 }
00353
00354 #endif