Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
Camera.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef CAMERA_H
19#define CAMERA_H
20
21#include <wx/geometry.h>
22
30class Camera
31{
32 public:
33 Camera();
34 ~Camera();
35
36 void SetScale(wxPoint2DDouble screenPoint, double delta);
37 void SetScale(double scale) { m_scale = scale; }
38 void SetTranslation(wxPoint2DDouble screenPoint);
39 void StartTranslation(wxPoint2DDouble startPoint) { this->m_translationStartPt = startPoint; }
40 void UpdateMousePosition(wxPoint2DDouble mousePosition) { this->m_mousePosition = mousePosition; }
41 double GetScale() const { return m_scale; }
42 wxPoint2DDouble GetTranslation() const { return m_translation; }
43 wxPoint2DDouble GetMousePosition(bool worldCoords = true) const;
44 wxPoint2DDouble ScreenToWorld(wxPoint2DDouble screenCoords) const;
45 double GetZoomMin() const { return m_zoomMin; }
46 double GetZoomMax() const { return m_zoomMax; }
47 protected:
48 wxPoint2DDouble m_translation;
49 wxPoint2DDouble m_translationStartPt;
50 double m_scale;
51
52 wxPoint2DDouble m_mousePosition;
53
54 double m_zoomMin = 0.01;
55 double m_zoomMax = 3.0;
56};
57
58#endif // CAMERA_H
Class responsible for the correct visualization of the elements on screen.
Definition Camera.h:31