Kstars

trixelnode.h
1/*
2 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
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
13class SkyObject;
14class 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 */
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};
Provides virtual functions for update of coordinates and nodes hiding.
Definition skynode.h:28
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
A wrapper for QSGOpacityNode that provides hide() and show() functions.
Convenience class that represents trixel in SkyMapLite.
Definition trixelnode.h:21
TrixelNode(const Trixel &trixel)
Constructor.
int hideCount()
m_hideCount is a counter of how much updates of SkyMapLite this trixel remained hidden.
Definition trixelnode.h:30
virtual void deleteAllChildNodes()
Delete all childNodes and remove nodes from pairs in m_nodes.
virtual void show() override
makes this node visible
void resetHideCount()
Whenever the corresponding trixel is visible, m_hideCount is reset.
Definition trixelnode.h:33
virtual void hide() override
hides this node
QLinkedList< QPair< SkyObject *, SkyNode * > > m_nodes
m_nodes - holds SkyNodes with corresponding SkyObjects
Definition trixelnode.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:49:22 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.