ListComponent

Search for usage in LXR

#include <listcomponent.h>

Inheritance diagram for ListComponent:

Public Member Functions

 ListComponent (SkyComposite *parent)
 
void appendListObject (SkyObject *object)
 
void clear ()
 
SkyObjectfindByName (const QString &name, bool exact=true) override
 
const QList< SkyObject * > & objectList () const
 
SkyObjectobjectNearest (SkyPoint *p, double &maxrad) override
 
void update (KSNumbers *num=nullptr) override
 
- Public Member Functions inherited from SkyComponent
 SkyComponent (SkyComposite *parent=nullptr)
 
virtual void draw (SkyPainter *skyp)=0
 
virtual void drawTrails (SkyPainter *skyp)
 
virtual void emitProgressText (const QString &message)
 
QHash< int, QVector< QPair< QString, const SkyObject * > > > & objectLists ()
 
QVector< QPair< QString, const SkyObject * > > & objectLists (int type)
 
QHash< int, QStringList > & objectNames ()
 
QStringListobjectNames (int type)
 
virtual void objectsInArea (QList< SkyObject * > &list, const SkyRegion &region)
 
SkyCompositeparent ()
 
void removeFromLists (const SkyObject *obj)
 
void removeFromNames (const SkyObject *obj)
 
virtual bool selected ()
 
virtual void updateMoons (KSNumbers *)
 
virtual void updateSolarSystemBodies (KSNumbers *)
 

Protected Attributes

QHash< QString, SkyObject * > m_ObjectHash
 
QList< SkyObject * > m_ObjectList
 

Detailed Description

An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.

Author
Jason Harris
Version
0.1

Definition at line 23 of file listcomponent.h.

Constructor & Destructor Documentation

◆ ListComponent()

ListComponent::ListComponent ( SkyComposite * parent)
explicit

Definition at line 14 of file listcomponent.cpp.

◆ ~ListComponent()

ListComponent::~ListComponent ( )
override

Definition at line 18 of file listcomponent.cpp.

Member Function Documentation

◆ appendListObject()

void ListComponent::appendListObject ( SkyObject * object)

Add an object to the Object list.

This method is a handy wrapper, which automatically appends the given SkyObject to m_ObjectList and inserts references with all common names (name, name2, longname) into the m_ObjectHash QHash to enable a faster findbyname.

Definition at line 30 of file listcomponent.cpp.

◆ clear()

void ListComponent::clear ( )

Definition at line 23 of file listcomponent.cpp.

◆ findByName()

SkyObject * ListComponent::findByName ( const QString & name,
bool exact = true )
overridevirtual

Search the children of this SkyComponent for a SkyObject whose name matches the argument name the name to be matched exact If true, it will return an exact match, otherwise it can return a partial match.

Returns
a pointer to the SkyObject whose name matches the argument, or a nullptr pointer if no match was found.
Note
This function simply returns the nullptr pointer; it is reimplemented in various sub-classes

Reimplemented from SkyComponent.

Definition at line 54 of file listcomponent.cpp.

◆ objectList()

const QList< SkyObject * > & ListComponent::objectList ( ) const
inline

Definition at line 49 of file listcomponent.h.

◆ objectNearest()

SkyObject * ListComponent::objectNearest ( SkyPoint * p,
double & maxrad )
overridevirtual

Find the SkyObject nearest the given SkyPoint.

Look for a SkyObject that is nearer to point p than maxrad. If one is found, then maxrad is reset to the separation of the new nearest object. p pointer to the SkyPoint to search around maxrad reference to current search radius in degrees

Returns
a pointer to the nearest SkyObject
Note
This function simply returns a nullptr pointer; it is reimplemented in various sub-classes.

Reimplemented from SkyComponent.

Reimplemented in StarComponent, and SupernovaeComponent.

Definition at line 72 of file listcomponent.cpp.

◆ update()

void ListComponent::update ( KSNumbers * num = nullptr)
overridevirtual

Update the sky positions of this component.

This function usually just updates the Horizontal (Azimuth/Altitude) coordinates of the objects in this component. If the KSNumbers* argument is not nullptr, this function also recomputes precession and nutation for the date in KSNumbers. num Pointer to the KSNumbers object

Note
By default, the num parameter is nullptr, indicating that Precession/Nutation computation should be skipped; this computation is only occasionally required.

Reimplemented from SkyComponent.

Reimplemented in SolarSystemListComponent, StarComponent, and SupernovaeComponent.

Definition at line 41 of file listcomponent.cpp.

Member Data Documentation

◆ m_ObjectHash

QHash<QString, SkyObject *> ListComponent::m_ObjectHash
protected

Definition at line 65 of file listcomponent.h.

◆ m_ObjectList

QList<SkyObject *> ListComponent::m_ObjectList
protected

Definition at line 64 of file listcomponent.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.