• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Member Functions | List of all members
SkyComposite Class Reference

#include <skycomposite.h>

Inheritance diagram for SkyComposite:
Inheritance graph
[legend]

Public Member Functions

 SkyComposite (SkyComposite *parent)
 
virtual ~SkyComposite ()
 
void addComponent (SkyComponent *comp)
 
QList< SkyComponent * > & components ()
 
virtual void draw (SkyPainter *skyp)
 
virtual SkyObject * findByName (const QString &name)
 
virtual SkyObject * objectNearest (SkyPoint *p, double &maxrad)
 
void removeComponent (SkyComponent *comp)
 
virtual void update (KSNumbers *num=0)
 
- Public Member Functions inherited from SkyComponent
 SkyComponent (SkyComposite *parent)
 
virtual ~SkyComponent ()
 
virtual void drawTrails (SkyPainter *skyp)
 
virtual void emitProgressText (const QString &message)
 
QHash< int, QStringList > & objectNames ()
 
QStringList & objectNames (int type)
 
virtual void objectsInArea (QList< SkyObject * > &list, const SkyRegion &region)
 
SkyComposite * parent ()
 
virtual bool selected ()
 
virtual void updateMoons (KSNumbers *)
 
virtual void updatePlanets (KSNumbers *)
 

Additional Inherited Members

- Protected Member Functions inherited from SkyComponent
void removeFromNames (const SkyObject *obj)
 

Detailed Description

SkyComposite is a kind of container class for SkyComponent objects.

The SkyComposite is responsible for distributing calls to functions like draw() and update() to its children, which can be SkyComponents or other SkyComposites with their own children. This is based on the "composite/component" design pattern.

Performance tuning: Sometimes it will be better to override a virtual function and do the work in the composite instead of delegating the request to all sub components.

Author
Thomas Kabelmann
Version
0.1

Definition at line 43 of file skycomposite.h.

Constructor & Destructor Documentation

SkyComposite::SkyComposite ( SkyComposite *  parent)
explicit

Constructor parent pointer to the parent SkyComponent.

Definition at line 22 of file skycomposite.cpp.

SkyComposite::~SkyComposite ( )
virtual

Destructor

Definition at line 26 of file skycomposite.cpp.

Member Function Documentation

void SkyComposite::addComponent ( SkyComponent *  comp)

Add a new sub component to the composite comp Pointer to the SkyComponent to be added.

Definition at line 31 of file skycomposite.cpp.

QList<SkyComponent*>& SkyComposite::components ( )
inline

Definition at line 103 of file skycomposite.h.

void SkyComposite::draw ( SkyPainter *  skyp)
virtual

Delegate draw requests to all sub components psky Reference to the QPainter on which to paint.

Implements SkyComponent.

Reimplemented in SkyMapComposite.

Definition at line 43 of file skycomposite.cpp.

SkyObject * SkyComposite::findByName ( const QString &  name)
virtual

Search the children of this SkyComposite for a SkyObject whose name matches the argument.

The objects' primary, secondary and long-form names will all be checked for a match. name the name to be matched

Returns
a pointer to the SkyObject whose name matches the argument, or a NULL pointer if no match was found.

Reimplemented from SkyComponent.

Reimplemented in SkyMapComposite.

Definition at line 56 of file skycomposite.cpp.

SkyObject * SkyComposite::objectNearest ( SkyPoint *  p,
double &  maxrad 
)
virtual

Identify the nearest SkyObject to the given SkyPoint, among the children of this SkyComposite p pointer to the SkyPoint around which to search.

maxrad reference to current search radius

Returns
a pointer to the nearest SkyObject

Reimplemented from SkyComponent.

Reimplemented in SkyMapComposite.

Definition at line 64 of file skycomposite.cpp.

void SkyComposite::removeComponent ( SkyComponent *  comp)

Remove a sub component from the composite comp Pointer to the SkyComponent to be removed.

Definition at line 36 of file skycomposite.cpp.

void SkyComposite::update ( KSNumbers *  num = 0)
virtual

Delegate update-position requests to all sub components.

This function usually just updates the Horizontal (Azimuth/Altitude) coordinates. However, the precession and nutation must also be recomputed periodically. Requests to do so are sent through the doPrecess parameter. num Pointer to the KSNumbers object

See also
updatePlanets()
updateMoons()
Note
By default, the num parameter is NULL, indicating that Precession/Nutation computation should be skipped; this computation is only occasionally required.

Reimplemented from SkyComponent.

Reimplemented in SkyMapComposite, and SolarSystemComposite.

Definition at line 50 of file skycomposite.cpp.


The documentation for this class was generated from the following files:
  • skycomposite.h
  • skycomposite.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal