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

graphics/vtkMapper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMapper.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 =========================================================================*/
00084 #ifndef __vtkMapper_h
00085 #define __vtkMapper_h
00086 
00087 #include "vtkAbstractMapper3D.h"
00088 #include "vtkScalarsToColors.h"
00089 #include "vtkDataSet.h"
00090 
00091 #define VTK_SCALAR_MODE_DEFAULT 0
00092 #define VTK_SCALAR_MODE_USE_POINT_DATA 1
00093 #define VTK_SCALAR_MODE_USE_CELL_DATA 2
00094 
00095 #define VTK_RESOLVE_OFF 0
00096 #define VTK_RESOLVE_POLYGON_OFFSET 1
00097 #define VTK_RESOLVE_SHIFT_ZBUFFER 2
00098 
00099 class vtkWindow;
00100 class vtkRenderer;
00101 class vtkActor;
00102 
00103 class VTK_EXPORT vtkMapper : public vtkAbstractMapper3D
00104 {
00105 public:
00106   vtkTypeMacro(vtkMapper,vtkAbstractMapper3D);
00107   void PrintSelf(ostream& os, vtkIndent indent);
00108 
00110   void ShallowCopy(vtkMapper *m);
00111 
00114   unsigned long GetMTime();
00115 
00118   virtual void Render(vtkRenderer *ren, vtkActor *a) = 0;
00119 
00123   virtual void ReleaseGraphicsResources(vtkWindow *) {};
00124 
00126   void SetLookupTable(vtkScalarsToColors *lut);
00127   vtkScalarsToColors *GetLookupTable();
00128 
00131   virtual void CreateDefaultLookupTable();
00132 
00135   vtkSetMacro(ScalarVisibility,int);
00136   vtkGetMacro(ScalarVisibility,int);
00137   vtkBooleanMacro(ScalarVisibility,int);
00138 
00148   vtkSetMacro(ColorMode,int);
00149   vtkGetMacro(ColorMode,int);
00150   void SetColorModeToDefault() 
00151     {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);};
00152   void SetColorModeToMapScalars() 
00153     {this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS);};
00154   void SetColorModeToLuminance() 
00155     {this->SetColorMode(VTK_COLOR_MODE_LUMINANCE);};
00156 
00158   const char *GetColorModeAsString();
00159 
00165   vtkSetMacro(ImmediateModeRendering,int);
00166   vtkGetMacro(ImmediateModeRendering,int);
00167   vtkBooleanMacro(ImmediateModeRendering,int);
00168 
00174   static void SetGlobalImmediateModeRendering(int val);
00175   static void GlobalImmediateModeRenderingOn() 
00176     {vtkMapper::SetGlobalImmediateModeRendering(1);};
00177   static void GlobalImmediateModeRenderingOff() 
00178     {vtkMapper::SetGlobalImmediateModeRendering(0);};
00179   static int  GetGlobalImmediateModeRendering();
00180 
00183   vtkSetVector2Macro(ScalarRange,float);
00184   vtkGetVectorMacro(ScalarRange,float,2);
00185 
00187   virtual void Update();
00188 
00192   vtkScalars *GetColors();
00193   
00200   vtkSetMacro(ScalarMode,int);
00201   vtkGetMacro(ScalarMode,int);
00202   void SetScalarModeToDefault() {
00203     this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00204   void SetScalarModeToUsePointData() {
00205     this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00206   void SetScalarModeToUseCellData() {
00207     this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00208 
00210   const char *GetScalarModeAsString();
00211 
00222   static void SetResolveCoincidentTopology(int val);
00223   static int  GetResolveCoincidentTopology();
00224   static void SetResolveCoincidentTopologyToDefault();
00225   static void SetResolveCoincidentTopologyToOff() 
00226     {SetResolveCoincidentTopology(VTK_RESOLVE_OFF);};
00227   static void SetResolveCoincidentTopologyToPolygonOffset() 
00228     {SetResolveCoincidentTopology(VTK_RESOLVE_POLYGON_OFFSET);};
00229   static void SetResolveCoincidentTopologyToShiftZBuffer() 
00230     {SetResolveCoincidentTopology(VTK_RESOLVE_SHIFT_ZBUFFER);};
00231 
00234   static void SetResolveCoincidentTopologyZShift(double val);
00235   static double GetResolveCoincidentTopologyZShift();
00236 
00239   virtual float *GetBounds();
00240   virtual void GetBounds(float bounds[6]) 
00241     {this->vtkAbstractMapper3D::GetBounds(bounds);};
00242 
00246   void SetRenderTime(float time) {this->RenderTime = time;}
00247   vtkGetMacro(RenderTime, float);
00248 
00249   //BTX
00252   vtkDataSet *GetInput();
00253   //ETX
00254 
00258   vtkDataSet *GetInputAsDataSet() { return this->GetInput(); };
00259 
00260 protected:
00261   vtkMapper();
00262   ~vtkMapper();
00263   vtkMapper(const vtkMapper&) {};
00264   void operator=(const vtkMapper&) {};
00265 
00266   vtkScalars *Colors;
00267 
00268   vtkScalarsToColors *LookupTable;
00269   int ScalarVisibility;
00270   vtkTimeStamp BuildTime;
00271   float ScalarRange[2];
00272   int ImmediateModeRendering;
00273   int ColorMode;
00274   int ScalarMode;
00275 
00276   float RenderTime;
00277 
00278 };
00279 
00280 #endif
00281 
00282 

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