Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Graphics/vtkGlyph3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGlyph3D.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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; // Number of source objects
00268   vtkPolyData **Source; // Geometry to copy to each point
00269   int Scaling; // Determine whether scaling of geometry is performed
00270   int ScaleMode; // Scale by scalar value or vector magnitude
00271   int ColorMode; // new scalars based on scale, scalar or vector
00272   float ScaleFactor; // Scale factor to use to scale geometry
00273   float Range[2]; // Range to use to perform scalar scaling
00274   int Orient; // boolean controls whether to "orient" data
00275   int VectorMode; // Orient/scale via normal or via vector data
00276   int Clamping; // whether to clamp scale factor
00277   int IndexMode; // what to use to index into glyph table
00278   int GeneratePointIds; // produce input points ids for each output point
00279   char *PointIdsName;
00280 
00281 private:
00282   vtkGlyph3D(const vtkGlyph3D&);  // Not implemented.
00283   void operator=(const vtkGlyph3D&);  // Not implemented.
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

Generated on Thu Mar 28 14:19:21 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001