1 #ifndef __CPM__VTK__OPENGLMESHMAPPER__H__
2 #define __CPM__VTK__OPENGLMESHMAPPER__H__
8 #include <vtkOpenGLTexture.h>
11 #include <vtkRenderWindow.h>
12 #include <vtkSmartPointer.h>
14 #include <cpm/VTK/MeshMapper.h>
23 class OpenGLMeshMapper
24 : public MeshMapper< M >
27 typedef OpenGLMeshMapper Self;
28 vtkTypeMacro( OpenGLMeshMapper, MeshMapper< M > );
30 typedef typename Superclass::TMesh TMesh;
31 typedef typename Superclass::TPoint TPoint;
32 typedef typename Superclass::TVector TVector;
33 typedef typename Superclass::TScalar TScalar;
36 typedef unsigned int TIndex;
37 typedef typename M::CellType TCell;
38 typedef typename M::CellsContainer TCellsContainer;
39 typedef typename TCellsContainer::ConstIterator TCellIt;
42 virtual const char* GetNameOfClass( ) const
43 { return( "cpm::VTK::OpenGLMeshMapper" ); }
46 virtual void RenderPiece( vtkRenderer* aren, vtkActor* act );
47 virtual void ReleaseGraphicsResources( vtkWindow* win );
48 virtual int Draw( vtkRenderer* aren, vtkActor* act );
52 virtual ~OpenGLMeshMapper( );
54 bool _ConfigureOpenGL( );
57 // Purposely not implemented
58 OpenGLMeshMapper( const Self& other );
59 Self& operator=( const Self& other );
63 // TODO: vtkSmartPointer< vtkOpenGLTexture > InternalColorTexture;
68 unsigned int VBOID1, VBOID2;
70 std::vector< unsigned int > Sizes;
71 std::vector< TIndex > Indices;
72 long IndexElementType;
73 long ElementValueType;
80 //#include <cpm/VTK/OpenGLMeshMapper.hxx>
82 #endif // __CPM__VTK__OPENGLMESHMAPPER__H__