3 /***************************************************************************
5 orbitswidget.h - description
8 copyright : (C) 2003, 2004 by Carsten Niehaus
9 email : cniehaus@kde.org
10 ***************************************************************************/
12 /***************************************************************************
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
19 ***************************************************************************/
26 * @short the widget which displays the Bohr-orbit of the element
27 * @author Carsten Niehaus
29 class OrbitsWidget
: public QWidget
34 OrbitsWidget( const int Elemno
, QWidget
*parent
=0 , const char *name
=0 );
35 OrbitsWidget( QWidget
*parent
=0 , const char *name
=0 );
37 void setElementNumber( const int num
);
42 * the elementnumber we are looking at
47 * the number off hulls the atom has
51 typedef QValueList
<int> intList
;
52 intList numOfElectrons
;
56 const QString
& getNumber() const;
59 * @return the delta of the x-coordinate
60 * @param r is the radius of the circle
61 * @param angle is the n'st circle out of num
62 * @param num is the number of circles
64 inline double translateToDX( const double r
, const double angle
, const int num
)
66 return( r
* sin( M_PI
* angle
/ num
* 2 ) );
70 * @return the delta of the y-coordinate
71 * @param r is the radius of the circle
72 * @param angle is the n'st circle out of num
73 * @param num is the number of circles
75 inline double translateToDY( const double r
, const double angle
, const int num
)
77 return( r
* cos( M_PI
* angle
/ num
* 2 ) );
83 void getNumberOfOrbits();
86 virtual void paintEvent( QPaintEvent
* );
89 #endif // ORBITSWIDGET_H