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 =========================================================================*/
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; // Number of source objects
00229   vtkPolyData **Source; // Geometry to copy to each point
00230   int Scaling; // Determine whether scaling of geometry is performed
00231   int ScaleMode; // Scale by scalar value or vector magnitude
00232   int ColorMode; // new scalars based on scale, scalar or vector
00233   float ScaleFactor; // Scale factor to use to scale geometry
00234   float Range[2]; // Range to use to perform scalar scaling
00235   int Orient; // boolean controls whether to "orient" data
00236   int VectorMode; // Orient/scale via normal or via vector data
00237   int Clamping; // whether to clamp scale factor
00238   int IndexMode; // what to use to index into glyph table
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

Generated on Wed Nov 21 12:26:59 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001