• 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
linelistlabel.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  linelistlabel.h - K Desktop Planetarium
4  -------------------
5  begin : 2007-08-08
6  copyright : (C) 2007 by James B. Bowlin
7  email : bowlin@mindspring.com
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef LINE_LIST_LABEL_H
20 #define LINE_LIST_LABEL_H
21 
22 
23 #include <QPointF>
24 
25 class SkyLabeler;
26 class Projector;
27 class LineList;
28 
36 class LineListLabel
37 {
38 public:
39 
40  explicit LineListLabel( const QString& text );
41 
42  enum { TopCandidate, BotCandidate, LeftCandidate, RightCandidate };
43 
44  /* @short prepare the context for selecting label position candidates.
45  */
46  void reset();
47 
48  /* @short draw the label if any. Is currently called at the bottom of
49  * draw() but that call could be removed and it could be called
50  * externally AFTER draw() has been called so draw() can set up the label
51  * position candidates.
52  */
53  void draw();
54 
55  void updateLabelCandidates( qreal x, qreal y, LineList* lineList, int i );
56 
57 private:
58  const QString m_text;
59  SkyLabeler* m_skyLabeler;
60 
61  // these two arrays track/contain 4 candidate points
62  int m_labIndex[4];
63  LineList* m_labList[4];
64 
65  float m_marginLeft, m_marginRight, m_marginTop, m_marginBot;
66  float m_farLeft, m_farRight, m_farTop, m_farBot;
67 
68  /* @short This routine does two things at once. It returns the QPointF
69  * corresponding to pointList[i] and also computes the angle using
70  * pointList[i] and pointList[i-1] therefore you MUST ensure that:
71  *
72  * 1 <= i < pointList.size().
73  */
74  QPointF angleAt( const Projector *proj, LineList* list, int i,
75  double *angle );
76 };
77 
78 #endif
LineListLabel::TopCandidate
Definition: linelistlabel.h:42
LineListLabel
Definition: linelistlabel.h:36
LineList
Definition: linelist.h:35
Projector
This class serves as an interface to handle projections.
Definition: projector.h:49
LineListLabel::BotCandidate
Definition: linelistlabel.h:42
LineListLabel::LineListLabel
LineListLabel(const QString &text)
Definition: linelistlabel.cpp:28
LineListLabel::reset
void reset()
Definition: linelistlabel.cpp:40
LineListLabel::draw
void draw()
Definition: linelistlabel.cpp:92
SkyLabeler
The purpose of this class is to prevent labels from overlapping.
Definition: skylabeler.h:112
LineListLabel::RightCandidate
Definition: linelistlabel.h:42
LineListLabel::LeftCandidate
Definition: linelistlabel.h:42
LineListLabel::updateLabelCandidates
void updateLabelCandidates(qreal x, qreal y, LineList *lineList, int i)
Definition: linelistlabel.cpp:62
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