00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00082 #ifndef __vtkGlyph3D_h
00083 #define __vtkGlyph3D_h
00084
00085 #include "vtkPolyDataAlgorithm.h"
00086
00087 #define VTK_SCALE_BY_SCALAR 0
00088 #define VTK_SCALE_BY_VECTOR 1
00089 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
00090 #define VTK_DATA_SCALING_OFF 3
00091
00092 #define VTK_COLOR_BY_SCALE 0
00093 #define VTK_COLOR_BY_SCALAR 1
00094 #define VTK_COLOR_BY_VECTOR 2
00095
00096 #define VTK_USE_VECTOR 0
00097 #define VTK_USE_NORMAL 1
00098 #define VTK_VECTOR_ROTATION_OFF 2
00099
00100 #define VTK_INDEXING_OFF 0
00101 #define VTK_INDEXING_BY_SCALAR 1
00102 #define VTK_INDEXING_BY_VECTOR 2
00103
00104 class VTK_GRAPHICS_EXPORT vtkGlyph3D : public vtkPolyDataAlgorithm
00105 {
00106 public:
00107 vtkTypeRevisionMacro(vtkGlyph3D,vtkPolyDataAlgorithm);
00108 void PrintSelf(ostream& os, vtkIndent indent);
00109
00114 static vtkGlyph3D *New();
00115
00118 void SetSource(vtkPolyData *pd) {this->SetSource(0,pd);};
00119
00122 void SetSource(int id, vtkPolyData *pd);
00123
00125
00128 void SetSourceConnection(int id, vtkAlgorithmOutput* algOutput);
00129 void SetSourceConnection(vtkAlgorithmOutput* algOutput)
00130 {
00131 this->SetSourceConnection(0, algOutput);
00132 }
00134
00136 vtkPolyData *GetSource(int id=0);
00137
00139
00140 vtkSetMacro(Scaling,int);
00141 vtkBooleanMacro(Scaling,int);
00142 vtkGetMacro(Scaling,int);
00144
00146
00147 vtkSetMacro(ScaleMode,int);
00148 vtkGetMacro(ScaleMode,int);
00149 void SetScaleModeToScaleByScalar()
00150 {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
00151 void SetScaleModeToScaleByVector()
00152 {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
00153 void SetScaleModeToScaleByVectorComponents()
00154 {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
00155 void SetScaleModeToDataScalingOff()
00156 {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
00157 const char *GetScaleModeAsString();
00159
00161
00162 vtkSetMacro(ColorMode,int);
00163 vtkGetMacro(ColorMode,int);
00164 void SetColorModeToColorByScale()
00165 {this->SetColorMode(VTK_COLOR_BY_SCALE);};
00166 void SetColorModeToColorByScalar()
00167 {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
00168 void SetColorModeToColorByVector()
00169 {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
00170 const char *GetColorModeAsString();
00172
00174
00175 vtkSetMacro(ScaleFactor,double);
00176 vtkGetMacro(ScaleFactor,double);
00178
00180
00181 vtkSetVector2Macro(Range,double);
00182 vtkGetVectorMacro(Range,double,2);
00184
00186
00187 vtkSetMacro(Orient,int);
00188 vtkBooleanMacro(Orient,int);
00189 vtkGetMacro(Orient,int);
00191
00193
00195 vtkSetMacro(Clamping,int);
00196 vtkBooleanMacro(Clamping,int);
00197 vtkGetMacro(Clamping,int);
00199
00201
00202 vtkSetMacro(VectorMode,int);
00203 vtkGetMacro(VectorMode,int);
00204 void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
00205 void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
00206 void SetVectorModeToVectorRotationOff()
00207 {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
00208 const char *GetVectorModeAsString();
00210
00212
00218 vtkSetMacro(IndexMode,int);
00219 vtkGetMacro(IndexMode,int);
00220 void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
00221 void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
00222 void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
00223 const char *GetIndexModeAsString();
00225
00227
00231 vtkSetMacro(GeneratePointIds,int);
00232 vtkGetMacro(GeneratePointIds,int);
00233 vtkBooleanMacro(GeneratePointIds,int);
00235
00237
00240 vtkSetStringMacro(PointIdsName);
00241 vtkGetStringMacro(PointIdsName);
00243
00245
00248 vtkSetMacro(FillCellData,int);
00249 vtkGetMacro(FillCellData,int);
00250 vtkBooleanMacro(FillCellData,int);
00252
00255 virtual int IsPointVisible(vtkDataSet*, vtkIdType) {return 1;};
00256
00257 protected:
00258 vtkGlyph3D();
00259 ~vtkGlyph3D();
00260
00261 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00262 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00263 virtual int FillInputPortInformation(int, vtkInformation *);
00264
00265 vtkPolyData* GetSource(int idx, vtkInformationVector *sourceInfo);
00266
00267 vtkPolyData **Source;
00268 int Scaling;
00269 int ScaleMode;
00270 int ColorMode;
00271 double ScaleFactor;
00272 double Range[2];
00273 int Orient;
00274 int VectorMode;
00275 int Clamping;
00276 int IndexMode;
00277 int GeneratePointIds;
00278 int FillCellData;
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