Free Electron
ViewOpenGL.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __opengl_ViewOpenGL_h__
8 #define __opengl_ViewOpenGL_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief OpenGL-specific implementations for ViewI
17 
18  @ingroup opengl
19 *//***************************************************************************/
20 class FE_DL_EXPORT ViewOpenGL: virtual public ViewCommon
21 {
22  public:
23  ViewOpenGL();
24 
25  //* as ViewI
26 virtual void use(ViewI::Projection a_projection);
27 
28 virtual Real pixelSize(const SpatialVector& center,
29  Real radius) const;
30 virtual Real worldSize(const SpatialVector& center,
31  Real pixels) const;
32 
33 virtual SpatialVector unproject(Real winx,Real winy,Real winz,
34  ViewI::Projection a_projection) const;
35 virtual SpatialVector project(const SpatialVector& point,
36  ViewI::Projection a_projection) const;
37 
38 virtual void setScissor(const Box2i* a_pBox);
39 virtual const Box2i* scissor(void) const;
40 
41  private:
42  bool currentContextIsSet(void);
43 
44  void useOrtho(void);
45  void usePerspective(void);
46  void prepare(ViewI::Projection a_projection,
47  GLdouble* model16,
48  GLdouble* proj16,GLint* view) const;
49 
50  BWORD m_scissoring;
51  Box2i m_scissor;
52 };
53 
54 } /* namespace ext */
55 } /* namespace fe */
56 
57 #endif /* __opengl_ViewOpenGL_h__ */
void unproject(Vector< 4, T > &a_r, const Matrix< 4, 4, T > &a_m, const Vector< 4, T > &a_v)
reverse project vector through matrix. reverses w division
Definition: Matrix.h:1197
kernel
Definition: namespace.dox:3
general-implementation methods for ViewI
Definition: ViewCommon.h:20
void project(Vector< 4, T > &a_r, const Matrix< 4, 4, T > &a_m, const Vector< 4, T > &a_v)
project vector through matrix. divides by transformed w
Definition: Matrix.h:1182
OpenGL-specific implementations for ViewI.
Definition: ViewOpenGL.h:20