VTK
dox/Accelerators/Piston/vtkPistonMapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPistonMapper.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 =========================================================================*/
00026 #ifndef __vtkPistonMapper_h
00027 #define __vtkPistonMapper_h
00028 
00029 #include "vtkAcceleratorsPistonModule.h" // For export macro
00030 #include "vtkMapper.h"
00031 
00032 class vtkActor;
00033 class vtkRenderer;
00034 class vtkPistonDataObject;
00035 class vtkPistonScalarsColors;
00036 class vtkRenderWindow;
00037 class vtkWindow;
00038 
00039 class VTKACCELERATORSPISTON_EXPORT vtkPistonMapper : public vtkMapper
00040 {
00041 public:
00042   static vtkPistonMapper *New();
00043   vtkTypeMacro(vtkPistonMapper,vtkMapper);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00048   static void InitCudaGL(vtkRenderWindow *rw);
00049 
00051 
00052   inline static bool IsEnabledCudaGL()
00053     {
00054     return CudaGLInitted;
00055     }
00057 
00060   vtkPistonDataObject *GetPistonDataObjectInput(int port);
00061 
00063   void ShallowCopy(vtkAbstractMapper *m);
00064 
00067   virtual void Render(vtkRenderer *ren, vtkActor *a);
00068 
00072   virtual void ReleaseGraphicsResources(vtkWindow *) {}
00073 
00075 
00077   virtual double *GetBounds();
00078   virtual void GetBounds(double bounds[6])
00079     {this->vtkAbstractMapper3D::GetBounds(bounds);};
00081 
00083 
00087   virtual bool GetSupportsSelection()
00088     { return false; }
00090 
00093   virtual void Update();
00094 
00096 
00097   vtkSetMacro(Piece, int);
00098   vtkGetMacro(Piece, int);
00099   vtkSetMacro(NumberOfPieces, int);
00100   vtkGetMacro(NumberOfPieces, int);
00102 
00104 
00105   vtkSetMacro(GhostLevel, int);
00106   vtkGetMacro(GhostLevel, int);
00108 
00109 protected:
00110   vtkPistonMapper();
00111   ~vtkPistonMapper();
00112 
00114   virtual int FillInputPortInformation(int port, vtkInformation* info);
00115 
00117 
00118   void RenderOnCPU();
00119   void RenderOnGPU();
00120   void RenderImageDataOutline();
00122 
00123   int Piece;
00124   int NumberOfPieces;
00125   int GhostLevel;
00126 
00127 private:
00128   vtkPistonMapper(const vtkPistonMapper&); // Not implemented.
00129   void operator=(const vtkPistonMapper&);  // Not implemented.
00130 
00132   void PrepareDirectRenderBuffers(int nPoints);
00133 
00134   static bool CudaGLInitted;
00135 
00136   class InternalInfo;
00137   InternalInfo *Internal;
00138 };
00139 
00140 #endif