VTK
dox/Rendering/Core/vtkPolyDataMapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPolyDataMapper.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00030 #ifndef __vtkPolyDataMapper_h
00031 #define __vtkPolyDataMapper_h
00032 
00033 #include "vtkRenderingCoreModule.h" // For export macro
00034 #include "vtkMapper.h"
00035 #include "vtkTexture.h" // used to include texture unit enum.
00036 
00037 class vtkPolyData;
00038 class vtkRenderer;
00039 class vtkRenderWindow;
00040 
00041 class VTKRENDERINGCORE_EXPORT vtkPolyDataMapper : public vtkMapper
00042 {
00043 public:
00044   static vtkPolyDataMapper *New();
00045   vtkTypeMacro(vtkPolyDataMapper, vtkMapper);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049   virtual void RenderPiece(vtkRenderer *ren, vtkActor *act) = 0;
00050 
00052   virtual void Render(vtkRenderer *ren, vtkActor *act);
00053 
00055 
00056   void SetInputData(vtkPolyData *in);
00057   vtkPolyData *GetInput();
00059 
00061 
00062   void Update();
00063   void Update(int port);
00065 
00067 
00068   vtkSetMacro(Piece, int);
00069   vtkGetMacro(Piece, int);
00070   vtkSetMacro(NumberOfPieces, int);
00071   vtkGetMacro(NumberOfPieces, int);
00072   vtkSetMacro(NumberOfSubPieces, int);
00073   vtkGetMacro(NumberOfSubPieces, int);
00075 
00077 
00078   vtkSetMacro(GhostLevel, int);
00079   vtkGetMacro(GhostLevel, int);
00081 
00083 
00085   virtual double *GetBounds();
00086   virtual void GetBounds(double bounds[6])
00087     { this->Superclass::GetBounds(bounds); }
00089 
00091   void ShallowCopy(vtkAbstractMapper *m);
00092 
00094 
00102   virtual void MapDataArrayToVertexAttribute(
00103     const char* vertexAttributeName,
00104     const char* dataArrayName, int fieldAssociation, int componentno = -1);
00106 
00107   virtual void MapDataArrayToMultiTextureAttribute(
00108     int unit,
00109     const char* dataArrayName, int fieldAssociation, int componentno = -1);
00110 
00112   virtual void RemoveVertexAttributeMapping(const char* vertexAttributeName);
00113 
00115   virtual void RemoveAllVertexAttributeMappings();
00116 
00117 protected:
00118   vtkPolyDataMapper();
00119   ~vtkPolyDataMapper() {}
00120 
00125   virtual void ComputeBounds();
00126 
00127   int Piece;
00128   int NumberOfPieces;
00129   int NumberOfSubPieces;
00130   int GhostLevel;
00131 
00132   virtual int FillInputPortInformation(int, vtkInformation*);
00133 
00134 private:
00135   vtkPolyDataMapper(const vtkPolyDataMapper&);  // Not implemented.
00136   void operator=(const vtkPolyDataMapper&);  // Not implemented.
00137 };
00138 
00139 #endif