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

Rendering/vtkPolyDataMapper2D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPolyDataMapper2D.h,v $
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00065 #ifndef __vtkPolyDataMapper2D_h
00066 #define __vtkPolyDataMapper2D_h
00067 
00068 
00069 #include "vtkMapper2D.h"
00070 #include "vtkWindow.h"
00071 #include "vtkViewport.h"
00072 #include "vtkActor2D.h"
00073 #include "vtkProperty2D.h"
00074 #include "vtkScalarsToColors.h"
00075 #include "vtkPolyData.h"
00076 
00077 class VTK_RENDERING_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
00078 {
00079 public:
00080   vtkTypeMacro(vtkPolyDataMapper2D,vtkMapper2D);
00081   static vtkPolyDataMapper2D *New();
00082   void PrintSelf(ostream& os, vtkIndent indent);
00083   
00085 
00086   vtkSetObjectMacro(Input, vtkPolyData);
00087   vtkGetObjectMacro(Input, vtkPolyData);
00089 
00091 
00092   void SetLookupTable(vtkScalarsToColors *lut);
00093   vtkScalarsToColors *GetLookupTable();
00095 
00098   virtual void CreateDefaultLookupTable();
00099 
00101 
00103   vtkSetMacro(ScalarVisibility,int);
00104   vtkGetMacro(ScalarVisibility,int);
00105   vtkBooleanMacro(ScalarVisibility,int);
00107 
00109 
00116   vtkSetMacro(ColorMode,int);
00117   vtkGetMacro(ColorMode,int);
00118   void SetColorModeToDefault() 
00119     {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);};
00120   void SetColorModeToMapScalars() 
00121     {this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS);};
00123 
00125   const char *GetColorModeAsString();
00126 
00128 
00134   vtkSetMacro(UseLookupTableScalarRange,int);
00135   vtkGetMacro(UseLookupTableScalarRange,int);
00136   vtkBooleanMacro(UseLookupTableScalarRange,int);
00138 
00140 
00143   vtkSetVector2Macro(ScalarRange,float);
00144   vtkGetVectorMacro(ScalarRange,float,2);
00146 
00148 
00158   vtkSetMacro(ScalarMode,int);
00159   vtkGetMacro(ScalarMode,int);
00160   void SetScalarModeToDefault() {
00161     this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00162   void SetScalarModeToUsePointData() {
00163     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00164   void SetScalarModeToUseCellData() {
00165     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00166   void SetScalarModeToUsePointFieldData() {
00167     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
00168   void SetScalarModeToUseCellFieldData() {
00169     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
00171   
00173 
00174   void ColorByArrayComponent(int arrayNum, int component);
00175   void ColorByArrayComponent(char* arrayName, int component);
00177   
00179 
00180   char* GetArrayName() { return this->ArrayName; }
00181   int GetArrayId() { return this->ArrayId; }
00182   int GetArrayAccessMode() { return this->ArrayAccessMode; }
00183   int GetArrayComponent() { return this->ArrayComponent; }
00185 
00188   virtual unsigned long GetMTime();
00189 
00191 
00195   vtkSetObjectMacro(TransformCoordinate, vtkCoordinate);
00196   vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00198 
00204   vtkUnsignedCharArray *MapScalars(float alpha);
00205   
00207   void ShallowCopy(vtkAbstractMapper *m);
00208 
00209 protected:
00210   vtkPolyDataMapper2D();
00211   ~vtkPolyDataMapper2D();
00212 
00213   vtkPolyData* Input;
00214 
00215   vtkUnsignedCharArray *Colors;
00216 
00217   vtkScalarsToColors *LookupTable;
00218   int ScalarVisibility;
00219   vtkTimeStamp BuildTime;
00220   float ScalarRange[2];
00221   int UseLookupTableScalarRange;
00222   int ColorMode;
00223   int ScalarMode;
00224   
00225   vtkCoordinate *TransformCoordinate;
00226 
00227   // for coloring by a component of a field data array
00228   int ArrayId;
00229   char ArrayName[256];
00230   int ArrayComponent;
00231   int ArrayAccessMode;
00232 private:
00233   vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);  // Not implemented.
00234   void operator=(const vtkPolyDataMapper2D&);  // Not implemented.
00235 };
00236 
00237 
00238 #endif
00239 

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