Search for usage in LXR

TargetListComponent Class Reference

#include <targetlistcomponent.h>

Inheritance diagram for TargetListComponent:

Public Member Functions

 TargetListComponent (SkyComposite *parent)
 TargetListComponent (SkyComposite *parent, QList< SkyObject * > *objectList, QPen _pen, bool(*optionDrawSymbols)(void)=nullptr, bool(*optionDrawLabels)(void)=nullptr)
void draw (SkyPainter *skyp) override
- Public Member Functions inherited from SkyComponent
 SkyComponent (SkyComposite *parent=nullptr)
virtual void drawTrails (SkyPainter *skyp)
virtual void emitProgressText (const QString &message)
virtual SkyObjectfindByName (const QString &name, bool exact=true)
QHash< int, QVector< QPair< QString, const SkyObject * > > > & objectLists ()
QVector< QPair< QString, const SkyObject * > > & objectLists (int type)
QHash< int, QStringList > & objectNames ()
QStringListobjectNames (int type)
virtual SkyObjectobjectNearest (SkyPoint *p, double &maxrad)
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 update (KSNumbers *)
virtual void updateMoons (KSNumbers *)
virtual void updateSolarSystemBodies (KSNumbers *)

Public Attributes

bool(* drawLabels )(void)
bool(* drawSymbols )(void)
std::unique_ptr< SkyObjectListlist
QList< QSharedPointer< SkyObject > > list2
QPen pen

Detailed Description

Highlights objects present in certain lists by drawing "target" symbols around them.

To represent lists of specific objects on the skymap (eg: A star hopping route, or a list of planned observation targets), one would typically like to draw over the skymap, a bunch of symbols highlighting the locations of these objects. This class manages drawing of such lists. Along with the list, we also associate a pen to use to represent objects from that list. Once this class is made aware of a list to plot (which is stored somewhere else), it does so when called from the SkyMapComposite. The class may be supplied with pointers to two methods that tell it whether to draw symbols / labels or not. Disabling symbol drawing is equivalent to disabling the list. If the pointers are nullptr, the symbols are always drawn, but the labels are not drawn.

This does not inherit from ListComponent because it is not necessary. ListComponent has extra methods like objectNearest(), which we don't want. Also, ListComponent maintains its own list, whereas this class merely holds a pointer to a list that's manipulated from elsewhere.

Definition at line 37 of file targetlistcomponent.h.

Constructor & Destructor Documentation

◆ TargetListComponent() [1/2]

TargetListComponent::TargetListComponent ( SkyComposite * parent)

Default constructor.

Definition at line 15 of file targetlistcomponent.cpp.

◆ TargetListComponent() [2/2]

TargetListComponent::TargetListComponent ( SkyComposite * parent,
QList< SkyObject * > * objectList,
QPen _pen,
bool(*)(void) optionDrawSymbols = nullptr,
bool(*)(void) optionDrawLabels = nullptr )

Constructor that sets up this target list.

Definition at line 21 of file targetlistcomponent.cpp.

◆ ~TargetListComponent()

TargetListComponent::~TargetListComponent ( )

Definition at line 29 of file targetlistcomponent.cpp.

Member Function Documentation

◆ draw()

void TargetListComponent::draw ( SkyPainter * skyp)

Draw this component by iterating over the list.

This method does not bother refreshing the coordinates of the objects on the list. So this must be called only after the objects are drawn in a given draw cycle.

Implements SkyComponent.

Definition at line 37 of file targetlistcomponent.cpp.

Member Data Documentation

◆ drawLabels

bool(* TargetListComponent::drawLabels) (void)

Pointer to static method that tells us whether to draw labels for this list or not.

If the pointer is nullptr, labels are not drawn

Definition at line 80 of file targetlistcomponent.h.

◆ drawSymbols

bool(* TargetListComponent::drawSymbols) (void)

Pointer to static method that tells us whether to draw this list or not.

If the pointer is nullptr, the list is drawn nevertheless

Definition at line 74 of file targetlistcomponent.h.

◆ list

std::unique_ptr<SkyObjectList> TargetListComponent::list

Pointer to list of objects to draw.

Definition at line 64 of file targetlistcomponent.h.

◆ list2

QList<QSharedPointer<SkyObject> > TargetListComponent::list2

Pointer to list of objects to draw.

Definition at line 66 of file targetlistcomponent.h.

◆ pen

QPen TargetListComponent::pen

Pen to use to draw.

Definition at line 68 of file targetlistcomponent.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 Fri May 17 2024 11:48:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.