• 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
fov.h
Go to the documentation of this file.
1 /***************************************************************************
2  fov.h - description
3  -------------------
4  begin : Fri 05 Sept 2003
5  copyright : (C) 2003 by Jason Harris
6  email : kstars@30doradus.org
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 FOV_H_
19 #define FOV_H_
20 
21 #include <QList>
22 
23 #include <QString>
24 #include <klocale.h>
25 
26 class QPainter;
27 
32 class FOV {
33 public:
34  enum Shape { SQUARE,
35  CIRCLE,
36  CROSSHAIRS,
37  BULLSEYE,
38  SOLIDCIRCLE,
39  UNKNOWN };
40  static FOV::Shape intToShape(int);
41 
43  FOV();
44  FOV( const QString &name, float a, float b=-1, float xoffset=0, float yoffset=0, float rot=0, Shape shape=SQUARE, const QString &color="#FFFFFF" );
45 
46  inline QString name() const { return m_name; }
47  void setName( const QString &n ) { m_name = n; }
48 
49  inline Shape shape() const { return m_shape; }
50  void setShape( Shape s ) { m_shape = s; }
51  void setShape( int s);
52 
53  inline float sizeX() const { return m_sizeX; }
54  inline float sizeY() const { return m_sizeY; }
55  void setSize( float s ) { m_sizeX = m_sizeY = s; }
56  void setSize( float sx, float sy ) { m_sizeX = sx; m_sizeY = sy; }
57 
58  void setOffset(float fx, float fy) { m_offsetX = fx ; m_offsetY = fy; }
59  inline float offsetX() const { return m_offsetX; }
60  inline float offsetY() const { return m_offsetY; }
61 
62  void setRotation(float rt) { m_rotation = rt; }
63  inline float rotation() const { return m_rotation; }
64 
65  inline QString color() const { return m_color; }
66  void setColor( const QString &c ) { m_color = c; }
67 
72  void draw( QPainter &p, float zoomFactor);
78  void draw(QPainter &p, float x, float y);
79 
81  static QList<FOV*> defaults();
83  static void writeFOVs(const QList<FOV*> fovs);
85  static QList<FOV*>readFOVs();
86 private:
87  QString m_name, m_color;
88  Shape m_shape;
89  float m_sizeX, m_sizeY;
90  float m_offsetX, m_offsetY;
91  float m_rotation;
92 };
93 
94 #endif
FOV::setRotation
void setRotation(float rt)
Definition: fov.h:62
FOV::setShape
void setShape(Shape s)
Definition: fov.h:50
FOV::FOV
FOV()
Default constructor.
Definition: fov.cpp:47
FOV
class encapulating a Field-of-View symbol
Definition: fov.h:32
FOV::setSize
void setSize(float sx, float sy)
Definition: fov.h:56
FOV::offsetX
float offsetX() const
Definition: fov.h:59
FOV::sizeX
float sizeX() const
Definition: fov.h:53
FOV::readFOVs
static QList< FOV * > readFOVs()
Read list of FOVs from "fov.dat".
Definition: fov.cpp:177
FOV::rotation
float rotation() const
Definition: fov.h:63
FOV::writeFOVs
static void writeFOVs(const QList< FOV * > fovs)
Write list of FOVs to "fov.dat".
Definition: fov.cpp:154
FOV::CIRCLE
Definition: fov.h:35
FOV::SQUARE
Definition: fov.h:34
FOV::SOLIDCIRCLE
Definition: fov.h:38
FOV::draw
void draw(QPainter &p, float zoomFactor)
draw the FOV symbol on a QPainter
Definition: fov.cpp:57
FOV::setSize
void setSize(float s)
Definition: fov.h:55
FOV::defaults
static QList< FOV * > defaults()
Fill list with default FOVs.
Definition: fov.cpp:138
FOV::Shape
Shape
Definition: fov.h:34
FOV::setOffset
void setOffset(float fx, float fy)
Definition: fov.h:58
FOV::offsetY
float offsetY() const
Definition: fov.h:60
FOV::intToShape
static FOV::Shape intToShape(int)
Definition: fov.cpp:29
FOV::CROSSHAIRS
Definition: fov.h:36
FOV::BULLSEYE
Definition: fov.h:37
FOV::shape
Shape shape() const
Definition: fov.h:49
FOV::name
QString name() const
Definition: fov.h:46
FOV::UNKNOWN
Definition: fov.h:39
FOV::setName
void setName(const QString &n)
Definition: fov.h:47
FOV::sizeY
float sizeY() const
Definition: fov.h:54
FOV::color
QString color() const
Definition: fov.h:65
FOV::setColor
void setColor(const QString &c)
Definition: fov.h:66
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