Kstars

trixelnode.h
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #pragma once
7 
8 #include "typedef.h"
9 #include "../skyopacitynode.h"
10 
11 #include <QLinkedList>
12 
13 class SkyObject;
14 class SkyNode;
15 
16 /**
17  * @short Convenience class that represents trixel in SkyMapLite. It should be used as a parent for
18  * nodes that represent SkyObjects indexed by HTMesh
19  */
20 class TrixelNode : public SkyOpacityNode
21 {
22  public:
23  /** Constructor **/
24  explicit TrixelNode(const Trixel &trixel);
25 
26  /**
27  * m_hideCount is a counter of how much updates of SkyMapLite this trixel remained
28  * hidden. Used to reduce memory consumption
29  **/
30  inline int hideCount() { return m_hideCount; }
31 
32  /** Whenever the corresponding trixel is visible, m_hideCount is reset */
33  inline void resetHideCount() { m_hideCount = 0; }
34 
35  void virtual hide() override;
36  void virtual show() override;
37 
38  inline Trixel trixelID() { return m_trixel; }
39 
40  /** m_nodes - holds SkyNodes with corresponding SkyObjects */
42 
43  /** @short Delete all childNodes and remove nodes from pairs in m_nodes **/
44  virtual void deleteAllChildNodes();
45 
46  private:
47  Trixel m_trixel;
48  int m_hideCount { 0 };
49 };
virtual void deleteAllChildNodes()
Delete all childNodes and remove nodes from pairs in m_nodes.
Definition: trixelnode.cpp:16
virtual void show() override
makes this node visible
Definition: trixelnode.cpp:40
TrixelNode(const Trixel &trixel)
Constructor.
Definition: trixelnode.cpp:12
Convenience class that represents trixel in SkyMapLite.
Definition: trixelnode.h:20
A wrapper for QSGOpacityNode that provides hide() and show() functions. If node is invisible (opacity...
QLinkedList< QPair< SkyObject *, SkyNode * > > m_nodes
m_nodes - holds SkyNodes with corresponding SkyObjects
Definition: trixelnode.h:41
int hideCount()
m_hideCount is a counter of how much updates of SkyMapLite this trixel remained hidden.
Definition: trixelnode.h:30
void resetHideCount()
Whenever the corresponding trixel is visible, m_hideCount is reset.
Definition: trixelnode.h:33
virtual void hide() override
hides this node
Definition: trixelnode.cpp:34
Provides virtual functions for update of coordinates and nodes hiding.
Definition: skynode.h:27
Information about an object in the sky.
Definition: skyobject.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 04:00:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.