Salome HOME
Update copyrights
[modules/gui.git] / src / VTKViewer / VTKViewer_OpenGLRenderer.h
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef VTKVIEWER_OPENGLRENDERER_H
24 #define VTKVIEWER_OPENGLRENDERER_H
25
26 #include "VTKViewer.h"
27 #include "vtkOpenGLRenderer.h"
28 #include "VTKViewer_OpenGLHelper.h"
29
30 class VTKVIEWER_EXPORT VTKViewer_OpenGLRenderer : public vtkOpenGLRenderer
31 {
32 public:
33   enum {
34     HorizontalGradient,
35     VerticalGradient,
36     FirstDiagonalGradient,
37     SecondDiagonalGradient,
38     FirstCornerGradient,
39     SecondCornerGradient,
40     ThirdCornerGradient,
41     FourthCornerGradient
42   };
43
44 public:
45   static VTKViewer_OpenGLRenderer *New();
46   vtkTypeMacro(VTKViewer_OpenGLRenderer,vtkOpenGLRenderer);
47
48   virtual void SetGradientType( const int );
49
50   virtual void Clear(void);
51
52 protected:
53   VTKViewer_OpenGLRenderer();
54   ~VTKViewer_OpenGLRenderer();
55
56 private:
57   int GradientType;
58
59 #ifdef VTK_OPENGL2
60   VTKViewer_OpenGLHelper OpenGLHelper;
61   GLhandleARB            BackgroundProgram;
62   GLhandleARB            BackgroundVertexShader;
63   GLhandleARB            BackgroundFragmentShader;
64   GLuint                 VertexArrayObject;
65
66   struct Locations
67   {
68     static const GLint INVALID_LOCATION = -1;
69
70     GLint UseTexture;
71     GLint BackgroundTexture;
72
73     Locations()
74     : UseTexture        (INVALID_LOCATION),
75       BackgroundTexture (INVALID_LOCATION)
76     {
77       //
78     }
79
80   } myLocations;
81 #endif
82
83
84 private:
85   VTKViewer_OpenGLRenderer(const VTKViewer_OpenGLRenderer&);  // Not implemented.
86   void operator=(const VTKViewer_OpenGLRenderer&);  // Not implemented.
87 };
88
89 #endif