|
VTK
|
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 00092 00094 virtual void Update(); 00095 // Use the other overloads of Update. 00096 using vtkAlgorithm::Update; 00098 00100 00101 vtkSetMacro(Piece, int); 00102 vtkGetMacro(Piece, int); 00103 vtkSetMacro(NumberOfPieces, int); 00104 vtkGetMacro(NumberOfPieces, int); 00106 00108 00109 vtkSetMacro(GhostLevel, int); 00110 vtkGetMacro(GhostLevel, int); 00112 00113 protected: 00114 vtkPistonMapper(); 00115 ~vtkPistonMapper(); 00116 00118 virtual int FillInputPortInformation(int port, vtkInformation* info); 00119 00121 00122 void RenderOnCPU(); 00123 void RenderOnGPU(); 00124 void RenderImageDataOutline(); 00126 00127 int Piece; 00128 int NumberOfPieces; 00129 int GhostLevel; 00130 00131 private: 00132 vtkPistonMapper(const vtkPistonMapper&); // Not implemented. 00133 void operator=(const vtkPistonMapper&); // Not implemented. 00134 00136 void PrepareDirectRenderBuffers(int nPoints); 00137 00138 static bool CudaGLInitted; 00139 00140 class InternalInfo; 00141 InternalInfo *Internal; 00142 }; 00143 00144 #endif
1.8.0