Kstars

horizonmanager.h
1/*
2 SPDX-FileCopyrightText: 2015 Jasem Mutlaq <mutlaqja@ikarustech.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ui_horizonmanager.h"
10
11#include <QDialog>
12
13#include <memory>
14
15class QStandardItem;
17
18class ArtificialHorizonComponent;
19class ArtificialHorizonEntity;
20class LineList;
21class SkyPoint;
22
23class HorizonManagerUI : public QFrame, public Ui::HorizonManager
24{
26
27 public:
28 /** @short Constructor */
29 explicit HorizonManagerUI(QWidget *parent);
30};
31
32/**
33 * @class HorizonManager
34 * @short Manages adding/removing and editing regions and points associated with
35 * user-customized artificial horizons.
36 *
37 * @version 1.0
38 * @author Jasem Mutlaq
39 */
40class HorizonManager : public QDialog
41{
43 public:
44 /** @short Constructor */
45 explicit HorizonManager(QWidget *ks);
46
47 /** @short Destructor */
48 virtual ~HorizonManager() override = default;
49
50 void showRegion(const int regionID);
51
52 bool validate(int regionID);
53
54 void deleteRegion(int regionID);
55
56 protected:
57 void closeEvent(QCloseEvent *event) override;
58 void showEvent(QShowEvent *event) override;
59
60 public slots:
61 /** @short Add region */
62 void slotAddRegion();
63
64 /** @short Delete region */
65 void slotRemoveRegion();
66
67 void slotToggleCeiling();
68
69 void addSkyPoint(SkyPoint *skypoint);
70 void slotAddPoint();
71 void slotRemovePoint();
72 void slotClosed();
73
74 void clearPoints();
75
76 void setSelectPoints(bool);
77 void slotCurrentPointChanged(const QModelIndex &current, const QModelIndex &previous);
78
79 private slots:
80 void verifyItemValue(QStandardItem *item);
81 void slotSaveChanges();
82 void slotSetShownRegion(QModelIndex idx);
83
84 private:
85 void addPoint(SkyPoint *skyPoint);
86 void terminateLivePreview();
87 void setPointSelection(bool enable);
88 void removeEmptyRows(int regionID);
89 void setupLivePreview(QStandardItem *item);
90 void setupValidation(int regionID);
91
92 HorizonManagerUI *ui { nullptr };
93
94 QStandardItemModel *m_RegionsModel { nullptr };
95 ArtificialHorizonComponent *horizonComponent { nullptr };
96
97 std::shared_ptr<LineList> livePreview;
98 bool selectPoints { false };
99
100 friend class TestArtificialHorizon;
101};
Manages adding/removing and editing regions and points associated with user-customized artificial hor...
void slotRemoveRegion()
Delete region.
HorizonManager(QWidget *ks)
Constructor.
void slotAddRegion()
Add region.
virtual ~HorizonManager() override=default
Destructor.
A simple data container used by LineListIndex.
Definition linelist.h:25
The sky coordinates of a point in the sky.
Definition skypoint.h:45
Q_OBJECTQ_OBJECT
QObject * parent() const const
virtual bool event(QEvent *event) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.