• 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
deepskycomponent.h
Go to the documentation of this file.
1 /***************************************************************************
2  deepskycomponent.h - K Desktop Planetarium
3  -------------------
4  begin : 2005/15/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 DEEPSKYCOMPONENT_H
19 #define DEEPSKYCOMPONENT_H
20 
21 #include "typedef.h"
22 
23 #include <QObject>
24 #include "skycomponent.h"
25 #include "skylabel.h"
26 #include "datahandlers/ksparser.h"
27 
28 #define NNGCFILES 14
29 
30 class QColor;
31 class SkyMap;
32 class KSNumbers;
33 class DeepSkyObject;
34 class SkyPoint;
35 class SkyMesh;
36 class SkyLabeler;
37 
38 // NOTE: Although the following symbol has nothing to do with line
39 // number in any file, we use this name to keep consistency in naming
40 // conventions with StarComponent
41 #define MAX_LINENUMBER_MAG 90
42 
43 typedef QVector< DeepSkyObject*> DeepSkyList;
44 typedef QHash< int, DeepSkyList*> DeepSkyIndex;
45 
55 class DeepSkyComponent: public SkyComponent
56 {
57 public:
58 
59  explicit DeepSkyComponent( SkyComposite* );
60 
61  ~DeepSkyComponent();
62 
63  virtual void draw( SkyPainter *skyp );
64 
65  /* @short draw all the labels in the prioritized LabelLists and then
66  * clear the LabelLists.
67  */
68  void drawLabels();
69 
82  virtual void update( KSNumbers *num=0 );
83 
91  virtual SkyObject* findByName( const QString &name );
92 
102  virtual void objectsInArea( QList<SkyObject*>& list, const SkyRegion& region );
103 
104  virtual SkyObject* objectNearest( SkyPoint *p, double &maxrad );
105 
106  const QList<DeepSkyObject*>& objectList() const { return m_DeepSkyList; }
107 
108  void clear();
109 
110  bool selected();
111 
112 private:
141  void loadData();
142 
143  void clearList(QList<DeepSkyObject*>& list);
144 
145  void mergeSplitFiles();
146 
147  void drawDeepSkyCatalog( SkyPainter *skyp, bool drawObject, DeepSkyIndex* dsIndex,
148  const QString& colorString, bool drawImage = false);
149 
150  QList<DeepSkyObject*> m_DeepSkyList;
151  QList<DeepSkyObject*> m_MessierList;
152  QList<DeepSkyObject*> m_NGCList;
153  QList<DeepSkyObject*> m_ICList;
154  QList<DeepSkyObject*> m_OtherList;
155 
156  LabelList* m_labelList[ MAX_LINENUMBER_MAG + 1 ];
157  bool m_hideLabels;
158  double m_zoomMagLimit;
159 
160 
161  SkyMesh* m_skyMesh;
162  DeepSkyIndex m_DeepSkyIndex;
163  DeepSkyIndex m_MessierIndex;
164  DeepSkyIndex m_NGCIndex;
165  DeepSkyIndex m_ICIndex;
166  DeepSkyIndex m_OtherIndex;
167 
168  void appendIndex( DeepSkyObject *o, DeepSkyIndex* dsIndex, Trixel trixel );
169 
170  QHash<QString, DeepSkyObject*> nameHash;
171 
176  void addLabel( const QPointF& p, DeepSkyObject *obj );
177 
178 };
179 
180 #endif
SkyRegion
QHash< Trixel, bool > SkyRegion
Definition: skycomponents/typedef.h:47
DeepSkyComponent::objectList
const QList< DeepSkyObject * > & objectList() const
Definition: deepskycomponent.h:106
DeepSkyComponent
Represents the deep sky objects separated by catalogs.
Definition: deepskycomponent.h:55
DeepSkyList
QVector< DeepSkyObject * > DeepSkyList
Definition: deepskycomponent.h:43
MAX_LINENUMBER_MAG
#define MAX_LINENUMBER_MAG
Definition: deepskycomponent.h:41
DeepSkyComponent::selected
bool selected()
Definition: deepskycomponent.cpp:54
DeepSkyComponent::clear
void clear()
Definition: deepskycomponent.cpp:640
typedef.h
SkyComponent
SkyComponent represents an object on the sky map.
Definition: skycomponent.h:44
skylabel.h
DeepSkyIndex
QHash< int, DeepSkyList * > DeepSkyIndex
Definition: deepskycomponent.h:44
DeepSkyComponent::draw
virtual void draw(SkyPainter *skyp)
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition: deepskycomponent.cpp:363
DeepSkyComponent::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: deepskycomponent.cpp:495
DeepSkyComponent::objectNearest
virtual SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Find the SkyObject nearest the given SkyPoint.
Definition: deepskycomponent.cpp:521
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
DeepSkyComponent::update
virtual void update(KSNumbers *num=0)
Update the sky positions of this component.
Definition: deepskycomponent.cpp:59
skycomponent.h
SkyComposite
SkyComposite is a kind of container class for SkyComponent objects.
Definition: skycomposite.h:43
Trixel
unsigned int Trixel
Definition: htmesh/typedef.h:4
DeepSkyObject
Provides all necessary information about a deep-sky object: data inherited from SkyObject (coordinate...
Definition: deepskyobject.h:43
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
SkyMesh
Definition: skymesh.h:93
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
ksparser.h
DeepSkyComponent::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: deepskycomponent.cpp:500
SkyLabeler
The purpose of this class is to prevent labels from overlapping.
Definition: skylabeler.h:112
DeepSkyComponent::~DeepSkyComponent
~DeepSkyComponent()
Definition: deepskycomponent.cpp:49
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
DeepSkyComponent::drawLabels
void drawLabels()
Definition: deepskycomponent.cpp:473
DeepSkyComponent::DeepSkyComponent
DeepSkyComponent(SkyComposite *)
Definition: deepskycomponent.cpp:39
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 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