File indexing completed on 2024-07-14 07:17:22

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 "typedef.h"
0010 
0011 #include <QList>
0012 
0013 class SkyPoint;
0014 class KSNumbers;
0015 
0016 /**
0017  * @class LineList
0018  * A simple data container used by LineListIndex.  It contains a list of
0019  * SkyPoints and integer drawID, updateID and updateNumID.
0020  *
0021  * @author James B. Bowlin
0022  * @version 0.2
0023 */
0024 class LineList
0025 {
0026   public:
0027     LineList() : drawID(0), updateID(0), updateNumID(0) {}
0028     virtual ~LineList() = default;
0029 
0030     /**
0031      * @short return the list of points for iterating or appending (or whatever).
0032      */
0033     SkyList *points() { return &pointList; }
0034     std::shared_ptr<SkyPoint> at(int i) { return pointList.at(i); }
0035     void append(std::shared_ptr<SkyPoint> p) { pointList.append(p); }
0036 
0037     /**
0038      * A global drawID (in SkyMesh) is updated at the start of each draw
0039      * cycle.  Since an extended object is often covered by more than one
0040      * trixel, the drawID is used to make sure each object gets drawn at
0041      * most once per draw cycle.  It is public because it is both set and
0042      * read by the LineListIndex class.
0043      */
0044     DrawID drawID;
0045     UpdateID updateID;
0046     UpdateID updateNumID;
0047 
0048   private:
0049     SkyList pointList;
0050 };