File indexing completed on 2025-01-19 09:46:00
0001 /* 0002 SPDX-FileCopyrightText: 2007 James B. Bowlin <bowlin@mindspring.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QHash> 0010 #include <QPolygonF> 0011 #include <QPointF> 0012 0013 /* @class PolyList is almost a clone of LineList but since they have no data 0014 * members in common, this is a new class instead of a subclass 0015 * 0016 * 0017 * @author James B. Bowlin @version 0.1 0018 */ 0019 class PolyList 0020 { 0021 public: 0022 /* @short trivial constructor that also sets the name. It was 0023 * convenient to specify the name at construction time. 0024 */ 0025 explicit PolyList(const QString &name) : m_wrapRA(false) 0026 { 0027 m_name = name; 0028 }; 0029 0030 /* @short returns the QPolygonF that holds the points. */ 0031 const QPolygonF *poly() 0032 { 0033 return &m_poly; 0034 } 0035 0036 /* @short we need a new append() method to append QPointF's 0037 * instead of SkyPoints. 0038 */ 0039 void append(const QPointF &p) 0040 { 0041 m_poly.append(p); 0042 } 0043 0044 /* @short returns the name. */ 0045 const QString &name() 0046 { 0047 return m_name; 0048 } 0049 0050 bool wrapRA() 0051 { 0052 return m_wrapRA; 0053 } 0054 0055 void setWrapRA(bool wrap) 0056 { 0057 m_wrapRA = wrap; 0058 } 0059 0060 private: 0061 QPolygonF m_poly; 0062 QString m_name; 0063 bool m_wrapRA; 0064 };