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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • skycomponents
skycomponent.h
Go to the documentation of this file.
1 /***************************************************************************
2  skycomponent.h - K Desktop Planetarium
3  -------------------
4  begin : 2005/07/08
5  copyright : (C) 2005 by Thomas Kabelmann
6  email : thomas.kabelmann@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef SKYCOMPONENT_H
19 #define SKYCOMPONENT_H
20 
21 
22 #include <kdebug.h>
23 #include "typedef.h"
24 
25 class QString;
26 
27 class KSNumbers;
28 class SkyObject;
29 class SkyPoint;
30 class SkyComposite;
31 class SkyPainter;
32 
44 class SkyComponent
45 {
46 public:
50  explicit SkyComponent( SkyComposite *parent );
51 
53  virtual ~SkyComponent();
54 
58  virtual void draw( SkyPainter *skyp ) = 0;
59 
61  virtual void drawTrails( SkyPainter *skyp );
62 
74  virtual void update( KSNumbers* ) {}
75  virtual void updatePlanets( KSNumbers * ) {}
76  virtual void updateMoons( KSNumbers * ) {}
77 
79  virtual bool selected() { return true; }
80 
82  SkyComposite* parent() { return m_parent; }
83 
93  virtual SkyObject* findByName( const QString &name );
94 
106  virtual void objectsInArea( QList<SkyObject*>& list, const SkyRegion& region );
107 
119  virtual SkyObject* objectNearest( SkyPoint *p, double &maxrad );
120 
125  virtual void emitProgressText( const QString &message );
126 
127  inline QHash<int, QStringList>& objectNames() { return getObjectNames(); }
128 
129  inline QStringList& objectNames(int type) { return getObjectNames()[type]; }
130 
131 protected:
132  void removeFromNames(const SkyObject* obj);
133 
134 private:
136  virtual QHash<int, QStringList>& getObjectNames();
137 
138  // Disallow copying and assignement
139  SkyComponent(const SkyComponent&);
140  SkyComponent& operator= (const SkyComponent&);
141 
143  SkyComposite *m_parent;
144 };
145 
146 #endif
SkyComponent::~SkyComponent
virtual ~SkyComponent()
Destructor.
Definition: skycomponent.cpp:31
SkyComponent::updatePlanets
virtual void updatePlanets(KSNumbers *)
Definition: skycomponent.h:75
SkyComponent::parent
SkyComposite * parent()
Definition: skycomponent.h:82
SkyRegion
QHash< Trixel, bool > SkyRegion
Definition: skycomponents/typedef.h:47
typedef.h
SkyComponent
SkyComponent represents an object on the sky map.
Definition: skycomponent.h:44
SkyComponent::SkyComponent
SkyComponent(SkyComposite *parent)
Constructor parent pointer to the parent SkyComposite.
Definition: skycomponent.cpp:27
SkyComponent::findByName
virtual SkyObject * findByName(const QString &name)
Search the children of this SkyComponent for a SkyObject whose name matches the argument name the nam...
Definition: skycomponent.cpp:39
SkyComponent::objectNearest
virtual SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Find the SkyObject nearest the given SkyPoint.
Definition: skycomponent.cpp:43
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
SkyComponent::removeFromNames
void removeFromNames(const SkyObject *obj)
Definition: skycomponent.cpp:58
SkyComposite
SkyComposite is a kind of container class for SkyComponent objects.
Definition: skycomposite.h:43
SkyComponent::updateMoons
virtual void updateMoons(KSNumbers *)
Definition: skycomponent.h:76
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
SkyComponent::update
virtual void update(KSNumbers *)
Update the sky position(s) of this component.
Definition: skycomponent.h:74
SkyComponent::emitProgressText
virtual void emitProgressText(const QString &message)
Emit signal about progress.
Definition: skycomponent.cpp:35
SkyComponent::objectNames
QHash< int, QStringList > & objectNames()
Definition: skycomponent.h:127
SkyComponent::objectNames
QStringList & objectNames(int type)
Definition: skycomponent.h:129
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
SkyComponent::selected
virtual bool selected()
Definition: skycomponent.h:79
SkyComponent::draw
virtual void draw(SkyPainter *skyp)=0
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
SkyComponent::objectsInArea
virtual void objectsInArea(QList< SkyObject * > &list, const SkyRegion &region)
Searches the region(s) and appends the SkyObjects found to the list of sky objects.
Definition: skycomponent.cpp:50
QList
SkyComponent::drawTrails
virtual void drawTrails(SkyPainter *skyp)
Draw trails for objects.
Definition: skycomponent.cpp:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 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