Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkOpenGLPolyDataMapper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkOpenGLPolyDataMapper.h,v $
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 =========================================================================*/
00039 #ifndef __vtkOpenGLPolyDataMapper_h
00040 #define __vtkOpenGLPolyDataMapper_h
00041 
00042 #include "vtkPolyDataMapper.h"
00043 
00044 #if defined(__APPLE__) && (defined(VTK_USE_CARBON) || defined(VTK_USE_COCOA))
00045 #include <OpenGL/gl.h> // Needed for GLenum
00046 #else
00047 #include <GL/gl.h> // Needed for GLenum
00048 #endif
00049 
00050 class vtkCellArray;
00051 class vtkPoints;
00052 class vtkProperty;
00053 class vtkRenderWindow;
00054 class vtkOpenGLRenderer;
00055 class vtkOpenGLTexture;
00056 
00057 class VTK_RENDERING_EXPORT vtkOpenGLPolyDataMapper : public vtkPolyDataMapper
00058 {
00059 public:
00060   static vtkOpenGLPolyDataMapper *New();
00061   vtkTypeRevisionMacro(vtkOpenGLPolyDataMapper,vtkPolyDataMapper);
00062   virtual void PrintSelf(ostream& os, vtkIndent indent);
00063 
00065   virtual void RenderPiece(vtkRenderer *ren, vtkActor *a);
00066 
00070   void ReleaseGraphicsResources(vtkWindow *);
00071 
00073   virtual int Draw(vtkRenderer *ren, vtkActor *a);
00074   
00075 protected:
00076   vtkOpenGLPolyDataMapper();
00077   ~vtkOpenGLPolyDataMapper();
00078 
00079   void DrawPoints(int idx,
00080                   vtkPoints *p, 
00081                   vtkDataArray *n,
00082                   vtkUnsignedCharArray *c,
00083                   vtkDataArray *t,
00084                   vtkIdType &cellNum,
00085                   int &noAbort,
00086                   vtkCellArray *ca,
00087                   vtkRenderer *ren);
00088   
00089   void DrawLines(int idx,
00090                  vtkPoints *p, 
00091                  vtkDataArray *n,
00092                  vtkUnsignedCharArray *c,
00093                  vtkDataArray *t,
00094                  vtkIdType &cellNum,
00095                  int &noAbort,
00096                  vtkCellArray *ca,
00097                  vtkRenderer *ren);
00098 
00099   void DrawPolygons(int idx,
00100                     vtkPoints *p, 
00101                     vtkDataArray *n,
00102                     vtkUnsignedCharArray *c,
00103                     vtkDataArray *t,
00104                     vtkIdType &cellNum,
00105                     int &noAbort,
00106                     GLenum rep,
00107                     vtkCellArray *ca,
00108                     vtkRenderer *ren);
00109 
00110   void DrawTStrips(int idx,
00111                    vtkPoints *p, 
00112                    vtkDataArray *n,
00113                    vtkUnsignedCharArray *c,
00114                    vtkDataArray *t,
00115                    vtkIdType &cellNum,
00116                    int &noAbort,
00117                    GLenum rep,
00118                    vtkCellArray *ca,
00119                    vtkRenderer *ren);
00120     
00121   vtkIdType TotalCells;
00122   int ListId;
00123   vtkOpenGLTexture* InternalColorTexture;
00124 
00125 private:
00126   vtkOpenGLPolyDataMapper(const vtkOpenGLPolyDataMapper&);  // Not implemented.
00127   void operator=(const vtkOpenGLPolyDataMapper&);  // Not implemented.
00128 };
00129 
00130 #endif