X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVTKViewer%2FVTKViewer_PolyDataMapper.h;h=14418801a163c50146aee4304fb3f4b621409cad;hb=c257b5026d52dfc12641811662f11a8432e84735;hp=d7e3783105c16bc14c60eb11cd2a34422a0c1979;hpb=dd243976e72b27995de19643a438035581c25947;p=modules%2Fgui.git diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.h b/src/VTKViewer/VTKViewer_PolyDataMapper.h index d7e378310..14418801a 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.h +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.h @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,13 +23,17 @@ #include "VTKViewer.h" #include "VTKViewer_MarkerDef.h" -#ifdef WNT +#ifdef WIN32 #include #endif #include +#ifdef __APPLE__ +#include +#else #include +#endif #include @@ -43,6 +47,8 @@ class vtkImageData; #define MAPPER_SUPERCLASS vtkMesaPolyDataMapper #endif +#include "VTKViewer_OpenGLHelper.h" + //---------------------------------------------------------------------------- //! OpenGL Point Sprites PolyData Mapper. /*! @@ -70,6 +76,11 @@ public: bool GetBallEnabled( ); + //! Set ball scale factor + void SetBallScale( double ); + + double GetBallScale( ); + //! Set standard point marker void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale ); @@ -87,9 +98,12 @@ public: //! Implement superclass render method. virtual void RenderPiece( vtkRenderer*, vtkActor* ); - //! Draw method for OpenGL. +#ifndef VTK_OPENGL2 virtual int Draw( vtkRenderer*, vtkActor* ); +#else + virtual void RenderPieceDraw( vtkRenderer*, vtkActor* ); +#endif protected: VTKViewer_PolyDataMapper(); @@ -108,7 +122,9 @@ protected: void InitTextures(); //! Initializing of the Vertex Shader. - void InitShader(); + int InitShader(); + + void InternalDraw(vtkRenderer*, vtkActor*); private: int ExtensionsInitialized; @@ -116,11 +132,36 @@ private: GLuint PointSpriteTexture; vtkSmartPointer ImageData; - - GLhandleARB VertexProgram; + + VTKViewer_OpenGLHelper OpenGLHelper; + GLhandleARB PointProgram; +#ifdef VTK_OPENGL2 + GLhandleARB VertexShader; + GLhandleARB FragmentShader; + GLuint VertexArrayObject; +#endif + + struct Locations { + static const GLint INVALID_LOCATION = -1; + + GLint ModelViewProjection; + GLint Projection; + GLint GeneralPointSize; + GLint PointSprite; + + Locations() + : ModelViewProjection (INVALID_LOCATION), + Projection (INVALID_LOCATION), + GeneralPointSize (INVALID_LOCATION), + PointSprite (INVALID_LOCATION) + { + // + } + } myLocations; bool MarkerEnabled; - bool BallEnabled; + bool BallEnabled; + double BallScale; VTK::MarkerType MarkerType; VTK::MarkerScale MarkerScale; int MarkerId;