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

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 "linelist.h"
0010 
0011 /**
0012  * @class SkipList
0013  * Extends LineList by adding the skip hash to allow the same the data in a
0014  * LineList to be drawn as a filled and an outlined polygon.
0015  *
0016  * NOTE: there is no skiplist.cpp file.  This is all there is.
0017  *
0018  * @author James B. Bowlin
0019  * @version 0.1
0020  */
0021 class SkipHashList : public LineList
0022 {
0023   public:
0024     /**
0025      * @short returns the entire skip hash.
0026      * Used by the indexLines() routine so all the line segments in
0027      * this SkipList can be indexed at once.
0028      */
0029     IndexHash *skipHash() { return &m_skip; }
0030 
0031     /**
0032      * @short instructs that the ith line segment should
0033      * be skipped when drawn (and hence when indexed too).
0034      */
0035     void setSkip(int i) { m_skip[i] = true; }
0036 
0037     /** @short returns the skip flag for the i-th line segment. */
0038     bool skip(int i) { return m_skip.contains(i); }
0039 
0040   private:
0041     IndexHash m_skip;
0042 };