• 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
starcomponent.h
Go to the documentation of this file.
1 /***************************************************************************
2  starcomponent.h - K Desktop Planetarium
3  -------------------
4  begin : 2005/14/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 STARCOMPONENT_H
19 #define STARCOMPONENT_H
20 
37 #include "listcomponent.h"
38 #include "kstarsdatetime.h"
39 #include "ksnumbers.h"
40 #include "starblock.h"
41 #include "skylabel.h"
42 #include "typedef.h"
43 #include "highpmstarlist.h"
44 #include "skyobjects/starobject.h"
45 #include "binfilehelper.h"
46 #include "starblockfactory.h"
47 #include "skymesh.h"
48 
49 class SkyMesh;
50 class StarObject;
51 class SkyLabeler;
52 class KStarsSplash;
53 class BinFileHelper;
54 class StarBlockFactory;
55 class MeshIterator;
56 
57 #define MAX_LINENUMBER_MAG 90
58 
59 class StarComponent: public ListComponent
60 {
61 protected:
62 
63  StarComponent( SkyComposite* );
64 
65 public:
66 
67  virtual ~StarComponent();
68 
69  // TODO: Desingletonize StarComponent
71  static StarComponent *Create( SkyComposite* );
72 
74  static StarComponent *Instance() { return pinstance; }
75 
76  //This function is empty; we need that so that the JiT update
77  //is the only one beiong used.
78  virtual void update( KSNumbers *num );
79 
80  bool selected();
81 
82  void draw( SkyPainter *skyp );
83 
84  /* @short draw all the labels in the prioritized LabelLists and then
85  * clear the LabelLists. */
86  void drawLabels();
87 
88  static float zoomMagnitudeLimit();
89 
90  virtual SkyObject* objectNearest(SkyPoint *p, double &maxrad );
91 
92  virtual SkyObject* findStarByGenetiveName( const QString name );
93 
104  virtual SkyObject* findByName( const QString &name );
105 
115  virtual void objectsInArea( QList<SkyObject*>& list, const SkyRegion& region );
116 
124  // FIXME: check whether return type should be StarObject*
125  SkyObject* findByHDIndex( int HDnum );
126 
140  void starsInAperture( QList<StarObject*> &list, const SkyPoint &center, float radius, float maglim=-29 );
141 
142 
143  // TODO: Make byteSwap a template method and put it in byteorder.h
144  // It should ideally handle 32-bit, 16-bit fields and starData and
145  // deepStarData fields
146  static void byteSwap( starData *stardata );
147 
148 private:
159  bool loadStaticData();
160 
162  float faintMagnitude() const;
163 
164  void reindex( KSNumbers *num );
165 
166 
167  SkyMesh* m_skyMesh;
168  StarIndex* m_starIndex;
169 
170  KSNumbers m_reindexNum;
171  double m_reindexInterval;
172 
173  LabelList* m_labelList[ MAX_LINENUMBER_MAG + 1 ];
174  bool m_hideLabels;
175 
176  float m_zoomMagLimit;
177 
178  float m_FaintMagnitude; // Limiting magnitude of the catalog currently loaded
179  bool starsLoaded;
180  float magLim; // Current limiting magnitude for visible stars
181 
182  StarObject m_starObject;
183  StarObject *focusStar; // This object is always drawn
184 
185  KStarsSplash* m_reindexSplash;
186 
187  StarBlockFactory *m_StarBlockFactory;
188 
189  QVector<HighPMStarList*> m_highPMStars;
190  QHash<QString, SkyObject*> m_genName;
191  QHash<int, StarObject*> m_HDHash;
192  QVector<DeepStarComponent*> m_DeepStarComponents;
193 
198  void addLabel( const QPointF& p, StarObject *star );
199 
200  void reindexAll( KSNumbers *num );
201 
205  int loadDeepStarCatalogs();
206 
207  bool addDeepStarCatalogIfExists( const QString &fileName, float trigMag, bool staticstars=false );
208 
212  typedef struct starName {
213  char bayerName[8];
214  char longName[32];
215  } starName;
216 
217  starData stardata;
218  starName starname;
219 
220  static StarComponent *pinstance;
221 
222 };
223 
224 #endif
starData
Structure that holds star data.
Definition: stardata.h:28
SkyRegion
QHash< Trixel, bool > SkyRegion
Definition: skycomponents/typedef.h:47
StarComponent::drawLabels
void drawLabels()
Definition: starcomponent.cpp:340
highpmstarlist.h
typedef.h
skylabel.h
StarComponent::objectNearest
virtual SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Find the SkyObject nearest the given SkyPoint.
Definition: starcomponent.cpp:571
ListComponent
An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
Definition: listcomponent.h:36
MAX_LINENUMBER_MAG
#define MAX_LINENUMBER_MAG
Definition: starcomponent.h:57
StarComponent::Instance
static StarComponent * Instance()
Definition: starcomponent.h:74
starblock.h
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
StarComponent::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: starcomponent.cpp:514
BinFileHelper
This class provides utility functions to handle binary data files in the format prescribed by KStars...
Definition: binfilehelper.h:52
StarBlockFactory
A factory that creates StarBlocks and recycles them in an LRU Cache.
Definition: starblockfactory.h:32
listcomponent.h
StarComponent::zoomMagnitudeLimit
static float zoomMagnitudeLimit()
Definition: starcomponent.cpp:199
starblockfactory.h
ksnumbers.h
StarComponent::draw
void draw(SkyPainter *skyp)
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition: starcomponent.cpp:232
SkyComposite
SkyComposite is a kind of container class for SkyComponent objects.
Definition: skycomposite.h:43
StarComponent::Create
static StarComponent * Create(SkyComposite *)
Create an instance of StarComponent.
Definition: starcomponent.cpp:86
StarComponent::update
virtual void update(KSNumbers *num)
Update the sky positions of this component.
Definition: starcomponent.cpp:124
MeshIterator
Definition: MeshIterator.h:22
binfilehelper.h
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
StarComponent::findByHDIndex
SkyObject * findByHDIndex(int HDnum)
Find stars by HD catalog index.
Definition: starcomponent.cpp:526
KStarsSplash
The KStars Splash Screen.
Definition: kstarssplash.h:30
StarComponent::selected
bool selected()
Definition: starcomponent.cpp:92
StarIndex
QVector< StarList * > StarIndex
Definition: skycomponents/typedef.h:49
StarComponent::starsInAperture
void starsInAperture(QList< StarObject * > &list, const SkyPoint &center, float radius, float maglim=-29)
Add to the given list, the stars from this component, that lie within the specified circular aperture...
Definition: starcomponent.cpp:611
SkyMesh
Definition: skymesh.h:93
starobject.h
kstarsdatetime.h
StarComponent::byteSwap
static void byteSwap(starData *stardata)
Definition: starcomponent.cpp:642
skymesh.h
SkyLabeler
The purpose of this class is to prevent labels from overlapping.
Definition: skylabeler.h:112
StarComponent::StarComponent
StarComponent(SkyComposite *)
Definition: starcomponent.cpp:55
StarObject
This is a subclass of SkyObject.
Definition: starobject.h:41
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
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
StarComponent
Represents the stars on the sky map.
Definition: starcomponent.h:59
StarComponent::findStarByGenetiveName
virtual SkyObject * findStarByGenetiveName(const QString name)
Definition: starcomponent.cpp:498
QList
StarComponent::findByName
virtual SkyObject * findByName(const QString &name)
Find stars by name (including genetive name)
Definition: starcomponent.cpp:503
StarComponent::~StarComponent
virtual ~StarComponent()
Definition: starcomponent.cpp:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 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