X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FOpenGLMeshMapper.h;h=ff80ce37ddffcc79fdddc7ad0b8320b8a407cea1;hb=73332fee95f5410c46e3b0cff1e2755d5e4a8b71;hp=6a959e39329c4b2ef97004af70f67530889fd194;hpb=2361f4f97631e09d88d8a5510a369817dcaa19db;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/OpenGLMeshMapper.h b/lib/cpExtensions/Visualization/OpenGLMeshMapper.h index 6a959e3..ff80ce3 100644 --- a/lib/cpExtensions/Visualization/OpenGLMeshMapper.h +++ b/lib/cpExtensions/Visualization/OpenGLMeshMapper.h @@ -6,70 +6,72 @@ #include namespace cpExtensions +{ + namespace Visualization { - namespace Visualization + /** + */ + template< class M > + class OpenGLMeshMapper + : public MeshMapper< M > { - /** - */ - template< class M > - class OpenGLMeshMapper - : public MeshMapper< M > - { - public: - typedef OpenGLMeshMapper Self; - vtkTypeMacro( OpenGLMeshMapper, MeshMapper< M > ); - - typedef typename Superclass::TMesh TMesh; - typedef typename Superclass::TPoint TPoint; - typedef typename Superclass::TVector TVector; - typedef typename Superclass::TScalar TScalar; - - protected: - typedef unsigned int TIndex; - typedef typename M::CellType TCell; - typedef typename M::CellsContainer TCellsContainer; - typedef typename TCellsContainer::ConstIterator TCellIt; - - public: - virtual const char* GetNameOfClass( ) const - { return( "cpExtensions::OpenGLMeshMapper" ); } - static Self* New( ); - - virtual void RenderPiece( vtkRenderer* aren, vtkActor* act ); - virtual void ReleaseGraphicsResources( vtkWindow* win ); - virtual int Draw( vtkRenderer* aren, vtkActor* act ); - - protected: - OpenGLMeshMapper( ); - virtual ~OpenGLMeshMapper( ); - - bool _ConfigureOpenGL( ); - - private: - // Purposely not implemented - OpenGLMeshMapper( const Self& other ); - Self& operator=( const Self& other ); - - protected: - vtkIdType TotalCells; - // TODO: vtkSmartPointer< vtkOpenGLTexture > InternalColorTexture; - - bool FirstRendering; - - bool VBOSupported; - unsigned int VBOID1, VBOID2; - - std::vector< unsigned int > Sizes; - std::vector< TIndex > Indices; - long IndexElementType; - long ElementValueType; - }; - - } // ecapseman + public: + typedef OpenGLMeshMapper Self; + vtkTypeMacro( OpenGLMeshMapper, MeshMapper< M > ); + + typedef typename Superclass::TMesh TMesh; + typedef typename Superclass::TPoint TPoint; + typedef typename Superclass::TVector TVector; + typedef typename Superclass::TScalar TScalar; + + protected: + typedef unsigned int TIndex; + typedef typename M::CellType TCell; + typedef typename M::CellsContainer TCellsContainer; + typedef typename TCellsContainer::ConstIterator TCellIt; + + public: + virtual const char* GetNameOfClass( ) const + { return( "cpExtensions::OpenGLMeshMapper" ); } + static Self* New( ); + + virtual void RenderPiece( vtkRenderer* aren, vtkActor* act ); + virtual void ReleaseGraphicsResources( vtkWindow* win ); + virtual int Draw( vtkRenderer* aren, vtkActor* act ); + + protected: + OpenGLMeshMapper( ); + virtual ~OpenGLMeshMapper( ); + + bool _ConfigureOpenGL( ); + + private: + // Purposely not implemented + OpenGLMeshMapper( const Self& other ); + Self& operator=( const Self& other ); + + protected: + vtkIdType TotalCells; + // TODO: vtkSmartPointer< vtkOpenGLTexture > InternalColorTexture; + + bool FirstRendering; + + bool VBOSupported; + unsigned int VBOID1, VBOID2; + + std::vector< unsigned int > Sizes; + std::vector< TIndex > Indices; + long IndexElementType; + long ElementValueType; + }; } // ecapseman +} // ecapseman + +#ifndef ITK_MANUAL_INSTANTIATION #include +#endif // ITK_MANUAL_INSTANTIATION #endif // __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__H__