• 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
linelistindex.h
Go to the documentation of this file.
1 /***************************************************************************
2  linelistindex.h - K Desktop Planetarium
3  -------------------
4  begin : 2007-07-04
5  copyright : (C) 2007 James B. Bowlin
6  email : bowlin@mindspring.com
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 LINELISTINDEX_H
19 #define LINELISTINDEX_H
20 
21 #include <QList>
22 #include <QHash>
23 
24 #include "skycomponent.h"
25 #include "skymesh.h"
26 #include "typedef.h"
27 
28 class LineListLabel;
29 class SkyPainter;
30 class LineList;
31 class SkipList;
32 
33 /* @class LineListIndex
34  * Contains almost all the code needed for indexing and drawing and clipping
35  * lines and polygons.
36  *
37  * @author James B. Bowlin @version 0.1
38  */
39 class LineListIndex : public SkyComponent
40 {
41 public:
42  /* @short Constructor
43  * Simply set the internal skyMesh, parent, and name.
44  * @param parent Pointer to the parent SkyComponent object
45  * @param mesh Pointer to the universal SkyMesh instance
46  * @param name name of the subclass used for debugging
47  */
48  explicit LineListIndex( SkyComposite *parent, const QString& name="" );
49 
50  /* @short Destructor */
51  ~LineListIndex();
52 
53  /* @short. The top level draw routine. Draws all the LineLists for any
54  * subclass in one fell swoop which minimizes some of the loop overhead.
55  * Overridden by MilkWay so it can decide whether to draw outlines or
56  * filled. Therefore MilkyWay does not need to override preDraw(). The
57  * MilkyWay draw() routine calls all of the more specific draw()
58  * routines below.
59  */
60  virtual void draw( SkyPainter *skyp );
61 
62 protected:
63  /* @short this is called from within the draw routines when the updateID
64  * of the lineList is stale. It is virtual because different subclasses
65  * have different update routines. NoPrecessIndex doesn't precess in
66  * the updates and ConstellationLines must update its points as stars,
67  * not points. that doesn't precess the points.
68  */
69  virtual void JITupdate( LineList* lineList );
70 
71  /* @short as the name says, recreates the lineIndex using the LineLists
72  * in the previous index. Since we are indexing everything at J2000
73  * this is only used by ConstellationLines which needs to reindex
74  * because of the proper motion of the stars.
75  */
76  void reindexLines();
77 
79  QString name() const { return m_name; }
80 
81  /* @short displays a message that we are loading m_name. Also prints
82  * out the message if skyMesh debug is greater than zero.
83  */
84  void intro();
85 
86  /* @short prints out some summary statistics if the skyMesh debug is
87  * greater than 1.
88  */
89  void summary();
90 
91  /* @short Returns the SkyMesh object. */
92  SkyMesh* skyMesh() { return m_skyMesh; }
93 
94  /* @short Typically called from within a subclasses constructors.
95  * Adds the trixels covering the outline of lineList to the lineIndex.
96  *
97  * @param debug if greater than zero causes the number of trixels found
98  * to be printed.
99  */
100  void appendLine( LineList* lineList, int debug=0 );
101 
102  /* @short Typically called from within a subclasses constructors.
103  * Adds the trixels covering the full lineList to the polyIndex.
104  *
105  * @param debug if greater than zero causes the number of trixels found
106  * to be printed.
107  */
108  void appendPoly( LineList* lineList, int debug=0 );
109 
110  /* @short a convenience method that adds a lineList to both the lineIndex
111  * and the polyIndex.
112  */
113  void appendBoth( LineList* lineList, int debug=0 );
114 
115  /* @short Draws all the lines in m_listList as simple lines in float
116  * mode.
117  */
118  void drawLines( SkyPainter* skyp );
119 
120  /* @short Draws all the lines in m_listList as filled polygons in float
121  * mode.
122  */
123  void drawFilled( SkyPainter* skyp );
124 
125  /* @short Gives the subclasses access to the top of the draw() method.
126  * Typically used for setting the QPen, etc. in the QPainter being
127  * passed in. Defaults to setting a thin white pen.
128  */
129  virtual void preDraw( SkyPainter* skyp );
130 
131  /* @short a callback overridden by NoPrecessIndex so it can use the
132  * drawing code with the non-reverse-precessed mesh buffer.
133  */
134  virtual MeshBufNum_t drawBuffer() { return DRAW_BUF; }
135 
136  /* @short Returns an IndexHash from the SkyMesh that contains the set of
137  * trixels that cover lineList. Overridden by SkipListIndex so it can
138  * pass SkyMesh an IndexHash indicating which line segments should not
139  * be indexed @param lineList contains the list of points to be covered.
140  */
141  virtual const IndexHash& getIndexHash(LineList* lineList );
142 
149  virtual SkipList* skipList( LineList* lineList );
150 
151  virtual LineListLabel* label() {return 0;};
152 
153  inline LineListList listList() { return m_listList; }
154 
155 private:
156  QString m_name;
157 
158  SkyMesh* m_skyMesh;
159  LineListHash* m_lineIndex;
160  LineListHash* m_polyIndex;
161 
162  LineListList m_listList;
163 };
164 
165 #endif
SkyComponent::parent
SkyComposite * parent()
Definition: skycomponent.h:82
LineListIndex::appendPoly
void appendPoly(LineList *lineList, int debug=0)
Definition: linelistindex.cpp:93
LineListIndex::reindexLines
void reindexLines()
Definition: linelistindex.cpp:116
LineListIndex::getIndexHash
virtual const IndexHash & getIndexHash(LineList *lineList)
Definition: linelistindex.cpp:68
LineListLabel
Definition: linelistlabel.h:36
LineListIndex::drawBuffer
virtual MeshBufNum_t drawBuffer()
Definition: linelistindex.h:134
typedef.h
LineListIndex::listList
LineListList listList()
Definition: linelistindex.h:153
LineListIndex::skipList
virtual SkipList * skipList(LineList *lineList)
Also overridden by SkipListIndex.
Definition: linelistindex.cpp:171
SkyComponent
SkyComponent represents an object on the sky map.
Definition: skycomponent.h:44
LineListIndex::preDraw
virtual void preDraw(SkyPainter *skyp)
Definition: linelistindex.cpp:157
LineListIndex::label
virtual LineListLabel * label()
Definition: linelistindex.h:151
LineListHash
QHash< Trixel, LineListList * > LineListHash
Definition: skycomponents/typedef.h:51
LineList
Definition: linelist.h:35
LineListIndex::intro
void intro()
Definition: linelistindex.cpp:224
LineListList
QVector< LineList * > LineListList
Definition: skycomponents/typedef.h:50
LineListIndex::appendLine
void appendLine(LineList *lineList, int debug=0)
Definition: linelistindex.cpp:73
LineListIndex::JITupdate
virtual void JITupdate(LineList *lineList)
Definition: linelistindex.cpp:136
LineListIndex::~LineListIndex
~LineListIndex()
Definition: linelistindex.cpp:61
LineListIndex::LineListIndex
LineListIndex(SkyComposite *parent, const QString &name="")
Definition: linelistindex.cpp:52
LineListIndex::drawLines
void drawLines(SkyPainter *skyp)
Definition: linelistindex.cpp:177
skycomponent.h
SkyComposite
SkyComposite is a kind of container class for SkyComponent objects.
Definition: skycomposite.h:43
DRAW_BUF
Definition: skymesh.h:52
LineListIndex
Definition: linelistindex.h:39
LineListIndex::skyMesh
SkyMesh * skyMesh()
Definition: linelistindex.h:92
MeshBufNum_t
MeshBufNum_t
Definition: skymesh.h:51
LineListIndex::drawFilled
void drawFilled(SkyPainter *skyp)
Definition: linelistindex.cpp:198
SkyMesh
Definition: skymesh.h:93
LineListIndex::appendBoth
void appendBoth(LineList *lineList, int debug=0)
Definition: linelistindex.cpp:110
LineListIndex::name
QString name() const
retrieve name of object
Definition: linelistindex.h:79
IndexHash
QHash< Trixel, bool > IndexHash
Definition: skycomponents/typedef.h:46
LineListIndex::summary
void summary()
Definition: linelistindex.cpp:232
skymesh.h
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
LineListIndex::draw
virtual void draw(SkyPainter *skyp)
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition: linelistindex.cpp:162
SkipList
Definition: SkipList.h:17
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