00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00085 #ifndef __vtkGlyph3D_h
00086 #define __vtkGlyph3D_h
00087
00088 #include "vtkPolyDataAlgorithm.h"
00089
00090 #define VTK_SCALE_BY_SCALAR 0
00091 #define VTK_SCALE_BY_VECTOR 1
00092 #define VTK_SCALE_BY_VECTORCOMPONENTS 2
00093 #define VTK_DATA_SCALING_OFF 3
00094
00095 #define VTK_COLOR_BY_SCALE 0
00096 #define VTK_COLOR_BY_SCALAR 1
00097 #define VTK_COLOR_BY_VECTOR 2
00098
00099 #define VTK_USE_VECTOR 0
00100 #define VTK_USE_NORMAL 1
00101 #define VTK_VECTOR_ROTATION_OFF 2
00102
00103 #define VTK_INDEXING_OFF 0
00104 #define VTK_INDEXING_BY_SCALAR 1
00105 #define VTK_INDEXING_BY_VECTOR 2
00106
00107 class VTK_GRAPHICS_EXPORT vtkGlyph3D : public vtkPolyDataAlgorithm
00108 {
00109 public:
00110 vtkTypeRevisionMacro(vtkGlyph3D,vtkPolyDataAlgorithm);
00111 void PrintSelf(ostream& os, vtkIndent indent);
00112
00117 static vtkGlyph3D *New();
00118
00121 void SetSource(vtkPolyData *pd) {this->SetSource(0,pd);};
00122
00125 void SetSource(int id, vtkPolyData *pd);
00126
00128
00131 void SetSourceConnection(int id, vtkAlgorithmOutput* algOutput);
00132 void SetSourceConnection(vtkAlgorithmOutput* algOutput)
00133 {
00134 this->SetSourceConnection(0, algOutput);
00135 }
00137
00139 vtkPolyData *GetSource(int id=0);
00140
00142
00143 vtkSetMacro(Scaling,int);
00144 vtkBooleanMacro(Scaling,int);
00145 vtkGetMacro(Scaling,int);
00147
00149
00150 vtkSetMacro(ScaleMode,int);
00151 vtkGetMacro(ScaleMode,int);
00152 void SetScaleModeToScaleByScalar()
00153 {this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
00154 void SetScaleModeToScaleByVector()
00155 {this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
00156 void SetScaleModeToScaleByVectorComponents()
00157 {this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
00158 void SetScaleModeToDataScalingOff()
00159 {this->SetScaleMode(VTK_DATA_SCALING_OFF);};
00160 const char *GetScaleModeAsString();
00162
00164
00165 vtkSetMacro(ColorMode,int);
00166 vtkGetMacro(ColorMode,int);
00167 void SetColorModeToColorByScale()
00168 {this->SetColorMode(VTK_COLOR_BY_SCALE);};
00169 void SetColorModeToColorByScalar()
00170 {this->SetColorMode(VTK_COLOR_BY_SCALAR);};
00171 void SetColorModeToColorByVector()
00172 {this->SetColorMode(VTK_COLOR_BY_VECTOR);};
00173 const char *GetColorModeAsString();
00175
00177
00178 vtkSetMacro(ScaleFactor,double);
00179 vtkGetMacro(ScaleFactor,double);
00181
00183
00184 vtkSetVector2Macro(Range,double);
00185 vtkGetVectorMacro(Range,double,2);
00187
00189
00190 vtkSetMacro(Orient,int);
00191 vtkBooleanMacro(Orient,int);
00192 vtkGetMacro(Orient,int);
00194
00196
00198 vtkSetMacro(Clamping,int);
00199 vtkBooleanMacro(Clamping,int);
00200 vtkGetMacro(Clamping,int);
00202
00204
00205 vtkSetMacro(VectorMode,int);
00206 vtkGetMacro(VectorMode,int);
00207 void SetVectorModeToUseVector() {this->SetVectorMode(VTK_USE_VECTOR);};
00208 void SetVectorModeToUseNormal() {this->SetVectorMode(VTK_USE_NORMAL);};
00209 void SetVectorModeToVectorRotationOff()
00210 {this->SetVectorMode(VTK_VECTOR_ROTATION_OFF);};
00211 const char *GetVectorModeAsString();
00213
00215
00221 vtkSetMacro(IndexMode,int);
00222 vtkGetMacro(IndexMode,int);
00223 void SetIndexModeToScalar() {this->SetIndexMode(VTK_INDEXING_BY_SCALAR);};
00224 void SetIndexModeToVector() {this->SetIndexMode(VTK_INDEXING_BY_VECTOR);};
00225 void SetIndexModeToOff() {this->SetIndexMode(VTK_INDEXING_OFF);};
00226 const char *GetIndexModeAsString();
00228
00230
00234 vtkSetMacro(GeneratePointIds,int);
00235 vtkGetMacro(GeneratePointIds,int);
00236 vtkBooleanMacro(GeneratePointIds,int);
00238
00240
00243 vtkSetStringMacro(PointIdsName);
00244 vtkGetStringMacro(PointIdsName);
00246
00249 virtual int IsPointVisible(vtkDataSet*, vtkIdType) {return 1;};
00250
00251 protected:
00252 vtkGlyph3D();
00253 ~vtkGlyph3D();
00254
00255 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00256 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00257 virtual int FillInputPortInformation(int, vtkInformation *);
00258
00259 vtkPolyData* GetSource(int idx, vtkInformationVector *sourceInfo);
00260
00261 vtkPolyData **Source;
00262 int Scaling;
00263 int ScaleMode;
00264 int ColorMode;
00265 double ScaleFactor;
00266 double Range[2];
00267 int Orient;
00268 int VectorMode;
00269 int Clamping;
00270 int IndexMode;
00271 int GeneratePointIds;
00272 char *PointIdsName;
00273
00274 private:
00275 vtkGlyph3D(const vtkGlyph3D&);
00276 void operator=(const vtkGlyph3D&);
00277 };
00278
00280 inline const char *vtkGlyph3D::GetScaleModeAsString(void)
00281 {
00282 if ( this->ScaleMode == VTK_SCALE_BY_SCALAR )
00283 {
00284 return "ScaleByScalar";
00285 }
00286 else if ( this->ScaleMode == VTK_SCALE_BY_VECTOR )
00287 {
00288 return "ScaleByVector";
00289 }
00290 else
00291 {
00292 return "DataScalingOff";
00293 }
00294 }
00295
00297 inline const char *vtkGlyph3D::GetColorModeAsString(void)
00298 {
00299 if ( this->ColorMode == VTK_COLOR_BY_SCALAR )
00300 {
00301 return "ColorByScalar";
00302 }
00303 else if ( this->ColorMode == VTK_COLOR_BY_VECTOR )
00304 {
00305 return "ColorByVector";
00306 }
00307 else
00308 {
00309 return "ColorByScale";
00310 }
00311 }
00312
00314 inline const char *vtkGlyph3D::GetVectorModeAsString(void)
00315 {
00316 if ( this->VectorMode == VTK_USE_VECTOR)
00317 {
00318 return "UseVector";
00319 }
00320 else if ( this->VectorMode == VTK_USE_NORMAL)
00321 {
00322 return "UseNormal";
00323 }
00324 else
00325 {
00326 return "VectorRotationOff";
00327 }
00328 }
00329
00331 inline const char *vtkGlyph3D::GetIndexModeAsString(void)
00332 {
00333 if ( this->IndexMode == VTK_INDEXING_OFF)
00334 {
00335 return "IndexingOff";
00336 }
00337 else if ( this->IndexMode == VTK_INDEXING_BY_SCALAR)
00338 {
00339 return "IndexingByScalar";
00340 }
00341 else
00342 {
00343 return "IndexingByVector";
00344 }
00345 }
00346
00347 #endif