Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
HMPlane.h
1#ifndef HMPLANE_H
2#define HMPLANE_H
3
4#include <vector>
5//#include "glm/gtc/matrix_transform.hpp"
6#include <wx/geometry.h>
7#include <wx/graphics.h>
8//
9//class VertexBuffer;
10//class IndexBuffer;
11//class VertexBufferLayout;
12//class VertexArray;
13//
14//class OpenGLUtils;
15//class Shader;
16//class Renderer;
17//
18//class OpenGLText;
19
21{
22 double x = 0.0;
23 double y = 0.0;
24 double z = 0.0;
25};
26
28{
29public:
30 //HMPlane(Shader* shader, Shader* labelShader, const float& width, const float& height, const float limits[2]);
31 HMPlane(const double& width, const double& height, const double limits[2]);
32 virtual ~HMPlane();
33
34 //virtual void Draw(const Renderer& renderer, const glm::mat4& projectionViewMatrix) const;
35 virtual void DrawDC(wxGraphicsContext* gc) const;
36 virtual void DrawDC(wxDC& dc) const;
37 //virtual void DrawLabel(const Renderer& renderer, const glm::mat4& projectionViewMatrix, const float& x = 0.0, const float& y = 0.0) const;
38 virtual void DrawLabelDC(wxGraphicsContext* gc) const;
39 virtual void DrawLabelDC(wxDC& dc) const;
40
41 virtual void SetLabelLimits(const double& min, const double& max);
42 virtual double GetMaxLimit() { return m_limits[0]; }
43 virtual double GetMinLimit() { return m_limits[1]; }
44
45 virtual void SetRectSlope(const wxRect2DDouble& rect, const double& angle, const double& depth);
46 //virtual void UpdateCoords() { FillIndexBuffer(); }
47 virtual void Resize(const double& width, const double& height);
48 virtual void ResizeDC(const double& width, const double& height);
49
50 virtual void SmoothPlane(const unsigned int& iterations);
51 virtual void Clear();
52
53protected:
54
55 void FillCoordsBuffer();
56 //void FillIndexBuffer();
57 //void BindOpenGLBuffers();
58 //void CreateLabel();
59
60 wxColour VoltToColour(double volt, int alpha = 160) const;
61
62
63 const double m_meshSize = 15.0f;
64 size_t m_meshTickX = 0;
65 size_t m_meshTickY = 0;
66 double m_width = 0.0;
67 double m_height = 0.0;
68
69 std::vector< std::vector<BufferMeshCoords*> > m_coords;
70 std::vector< std::vector<BufferMeshCoords*> > m_coordsT;
71 std::vector<double> m_bufferCoords;
72 std::vector<size_t> m_indexBuffer;
73
74 // OpenGL shader
75 //Shader* m_shader = nullptr;
76 //Shader* m_labelShader = nullptr;
77
78 // Buffers
79 //VertexBuffer* m_vb = nullptr;
80 //VertexBufferLayout* m_layout = nullptr;
81 //IndexBuffer* m_ib = nullptr;
82 //VertexArray* m_va = nullptr;
83
84 // Label
85 //float m_vertexBufferLabel[4 * 3];
86 //unsigned int m_indexBufferLabel[6];
87 //
88 //VertexBuffer* m_vbL = nullptr;
89 //VertexBufferLayout* m_layoutL = nullptr;
90 //IndexBuffer* m_ibL = nullptr;
91 //VertexArray* m_vaL = nullptr;
92 //
93 //std::vector<OpenGLText*> m_glTexts;
94 double m_limits[2] = {1.1, 0.9};
95
96 bool m_isClear = true;
97};
98
99#endif