VAPOR3 3.9.4
MatrixManager.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <string>
5#include <stack>
6#include <glm/fwd.hpp>
7#include <glm/mat4x4.hpp>
8#include <glm/gtc/type_ptr.hpp>
9
10using std::map;
11using std::stack;
12using std::string;
13
14namespace VAPoR {
15
26
28public:
29 enum class Mode { ModelView, Projection };
30
32
33 glm::mat4 GetCurrentMatrix() const;
34 glm::mat4 GetProjectionMatrix() const;
35 glm::mat4 GetModelViewMatrix() const;
37 void SetCurrentMatrix(const glm::mat4 m);
38
41 void PushMatrix();
42 void PopMatrix();
43
44 void LoadMatrixd(const double *m);
45 void GetDoublev(Mode mode, double *m) const;
46
48 void Translate(float x, float y, float z);
49 void Scale(float x, float y, float z);
50 void Rotate(float angle, float x, float y, float z);
51 void Perspective(float fovy, float aspect, float zNear, float zFar);
52 void Ortho(float left, float right, float bottom, float top);
53 void Ortho(float left, float right, float bottom, float top, float zNear, float zFar);
54
55 glm::vec2 ProjectToScreen(float x, float y, float z) const;
56 glm::vec2 ProjectToScreen(const glm::vec3 &v) const;
57
59
60#ifdef LEGACY_GL_DEBUG
61 int GetGLMatrixMode();
62 const char *GetGLMatrixModeStr();
63 int GetGLModelViewStackDepth();
64 int GetGLProjectionStackDepth();
65 int GetGLCurrentStackDepth();
66 const char *GetMatrixModeStr();
67#endif
68
69 float Near, Far, FOV, Aspect;
70
71private:
72 stack<glm::mat4> _modelviewStack;
73 stack<glm::mat4> _projectionStack;
74 stack<glm::mat4> *_currentStack;
75 Mode _mode;
76 float _projectionAspectRatio = 0;
77
78 glm::mat4 & top();
79 const glm::mat4 &top() const;
80};
81
82} // namespace VAPoR
Replaces the OpenGL matrix stack.
Definition: MatrixManager.h:27
void GetDoublev(Mode mode, double *m) const
glm::mat4 GetModelViewProjectionMatrix() const
void Perspective(float fovy, float aspect, float zNear, float zFar)
glm::vec2 ProjectToScreen(const glm::vec3 &v) const
void Ortho(float left, float right, float bottom, float top)
float GetProjectionAspectRatio() const
void Rotate(float angle, float x, float y, float z)
glm::mat4 GetModelViewMatrix() const
void LoadMatrixd(const double *m)
void Ortho(float left, float right, float bottom, float top, float zNear, float zFar)
void Translate(float x, float y, float z)
void SetCurrentMatrix(const glm::mat4 m)
glm::vec2 ProjectToScreen(float x, float y, float z) const
void Scale(float x, float y, float z)
glm::mat4 GetProjectionMatrix() const
glm::mat4 GetCurrentMatrix() const
#define RENDER_API
Definition: common.h:78