• 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
  • printing
simplefovexporter.h
Go to the documentation of this file.
1 /***************************************************************************
2  simplefovexporter.h - K Desktop Planetarium
3  -------------------
4  begin : Thu Jul 7 2011
5  copyright : (C) 2011 by Rafał Kułaga
6  email : rl.kulaga@gmail.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 SIMPLEFOVEXPORTER_H
19 #define SIMPLEFOVEXPORTER_H
20 
21 #include "QList"
22 
23 class SkyPoint;
24 class SkyQPainter;
25 class FOV;
26 class KStarsData;
27 class SkyMap;
28 class QPainter;
29 class QPaintDevice;
30 
43 class SimpleFovExporter
44 {
45 public:
49  SimpleFovExporter();
50 
57  void exportFov(SkyPoint *point, FOV *fov, QPaintDevice *pd);
58 
64  void exportFov(FOV *fov, QPaintDevice *pd);
65 
70  void exportFov(QPaintDevice *pd);
71 
78  void exportFov(const QList<SkyPoint*> &points, const QList<FOV*> &fovs, const QList<QPaintDevice*> &pds);
79 
86  void exportFov(const QList<SkyPoint*> &points, FOV* fov, const QList<QPaintDevice*> &pds);
87 
93  inline bool isClockStopping() { return m_StopClock; }
94 
99  inline bool isFovShapeOverriden() { return m_OverrideFovShape; }
100 
105  inline bool isFovSymbolDrawn() { return m_DrawFovSymbol; }
106 
111  inline void setClockStopping(bool stopping) { m_StopClock = stopping; }
112 
117  inline void setFovShapeOverriden(bool override) { m_OverrideFovShape = override; }
118 
123  inline void setFovSymbolDrawn(bool draw) { m_DrawFovSymbol = draw; }
124 
131  static inline double calculateZoomLevel(int pixelSize, float degrees) { return (pixelSize * 57.3 * 60) / degrees; }
132 
139  static inline double calculatePixelSize(float degrees, double zoomLevel) { return degrees * zoomLevel / (57.3 * 60.0); }
140 
141 private:
146  void saveState(bool savePos);
147 
152  void restoreState(bool restorePos);
153 
161  void pExportFov(SkyPoint *point, FOV* fov, QPaintDevice *pd);
162 
163  KStarsData *m_KSData;
164  SkyMap *m_Map;
165 
166  bool m_StopClock;
167  bool m_OverrideFovShape;
168  bool m_DrawFovSymbol;
169 
170  bool m_PrevClockState;
171  bool m_PrevSlewing;
172  SkyPoint *m_PrevPoint;
173  double m_PrevZoom;
174 };
175 
176 #endif // SIMPLEFOVEXPORTER_H
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
FOV
class encapulating a Field-of-View symbol
Definition: fov.h:32
SimpleFovExporter::calculatePixelSize
static double calculatePixelSize(float degrees, double zoomLevel)
Calculate pixel size of given angular length at given zoom level.
Definition: simplefovexporter.h:139
SimpleFovExporter::isClockStopping
bool isClockStopping()
Check if FOV export will cause simulation clock to be stopped.
Definition: simplefovexporter.h:93
SimpleFovExporter::setFovShapeOverriden
void setFovShapeOverriden(bool override)
Enable or disable FOV shape overriding.
Definition: simplefovexporter.h:117
SimpleFovExporter::SimpleFovExporter
SimpleFovExporter()
Constructor.
Definition: simplefovexporter.cpp:26
SkyQPainter
The QPainter-based painting backend.
Definition: skyqpainter.h:32
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
SimpleFovExporter::calculateZoomLevel
static double calculateZoomLevel(int pixelSize, float degrees)
Calculate zoom level at which given angular length will occupy given length in pixels.
Definition: simplefovexporter.h:131
SimpleFovExporter::isFovSymbolDrawn
bool isFovSymbolDrawn()
Check if FOV symbol will be drawn.
Definition: simplefovexporter.h:105
SimpleFovExporter
SimpleFovExporter class is used for FOV representation exporting.
Definition: simplefovexporter.h:43
SimpleFovExporter::setClockStopping
void setClockStopping(bool stopping)
Enable or disable stopping simulation for FOV export.
Definition: simplefovexporter.h:111
SimpleFovExporter::exportFov
void exportFov(SkyPoint *point, FOV *fov, QPaintDevice *pd)
Paint FOV representation on passed QPaintDevice subclass.
Definition: simplefovexporter.cpp:33
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
SimpleFovExporter::setFovSymbolDrawn
void setFovSymbolDrawn(bool draw)
Enable or disable FOV symbol drawing.
Definition: simplefovexporter.h:123
SimpleFovExporter::isFovShapeOverriden
bool isFovShapeOverriden()
Check if FOV representation will be always rectangular.
Definition: simplefovexporter.h:99
QList
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