• 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
skypainter.cpp
Go to the documentation of this file.
1 /*
2  SkyPainter: class for painting onto the sky for KStars
3  Copyright (C) 2010 Henry de Valence <hdevalence@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 */
20 
21 #include "skypainter.h"
22 
23 #include "skymap.h"
24 #include "Options.h"
25 #include "kstarsdata.h"
26 #include "skycomponents/skiplist.h"
27 #include "skycomponents/linelistlabel.h"
28 #include "skyobjects/deepskyobject.h"
29 #include "skyobjects/kscomet.h"
30 #include "skyobjects/ksasteroid.h"
31 #include "skyobjects/ksplanetbase.h"
32 #include "skyobjects/trailobject.h"
33 
34 SkyPainter::SkyPainter()
35  : m_sizeMagLim(10.)
36 {
37  m_sm = SkyMap::Instance();
38 }
39 
40 SkyPainter::~SkyPainter()
41 {
42 
43 }
44 
45 void SkyPainter::setSizeMagLimit(float sizeMagLim)
46 {
47  m_sizeMagLim = sizeMagLim;
48 }
49 
50 float SkyPainter::starWidth(float mag) const
51 {
52  //adjust maglimit for ZoomLevel
53  const double maxSize = 10.0;
54 
55  double lgmin = log10(MINZOOM);
56 // double lgmax = log10(MAXZOOM);
57  double lgz = log10(Options::zoomFactor());
58 
59  float sizeFactor = maxSize + (lgz - lgmin);
60 
61  float size = ( sizeFactor*( m_sizeMagLim - mag ) / m_sizeMagLim ) + 1.;
62  if( size <= 1.0 ) size = 1.0;
63  if( size > maxSize ) size = maxSize;
64 
65  return size;
66 }
67 
ksplanetbase.h
skiplist.h
deepskyobject.h
skypainter.h
SkyPainter::m_sm
SkyMap * m_sm
Definition: skypainter.h:158
SkyPainter::starWidth
float starWidth(float mag) const
Get the width of a star of magnitude mag.
Definition: skypainter.cpp:50
MINZOOM
#define MINZOOM
Definition: kstarsdata.h:38
linelistlabel.h
SkyPainter::setSizeMagLimit
void setSizeMagLimit(float sizeMagLim)
Definition: skypainter.cpp:45
skymap.h
trailobject.h
Options.h
kscomet.h
Options::zoomFactor
static double zoomFactor()
Get Zoom Factor, in pixels per radian.
Definition: Options.h:2531
SkyMap::Instance
static SkyMap * Instance()
Definition: skymap.cpp:141
SkyPainter::SkyPainter
SkyPainter()
Constructor.
Definition: skypainter.cpp:34
ksasteroid.h
kstarsdata.h
SkyPainter::~SkyPainter
virtual ~SkyPainter()
Destructor.
Definition: skypainter.cpp:40
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