Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

AngleSpinBox Class Reference

A spin box for displaying/entering angular values. More...

#include <AngleSpinBox.hpp>

List of all members.

Public Types

enum  DisplayFormat {
  DMSLetters, DMSSymbols, HMSLetters, HMSSymbols,
  DecimalDeg
}
enum  PrefixType {
  Normal, NormalPlus, Longitude, Latitude,
  Unknown
}

Public Slots

void clear ()
void setRadians (double radians)
void setDegrees (double degrees)

Signals

void valueChanged ()

Public Member Functions

 AngleSpinBox (QWidget *parent=0, DisplayFormat format=DMSSymbols, PrefixType prefix=Normal)
void stepBy (int steps)
QValidator::State validate (QString &input, int &pos) const
double valueRadians ()
double valueDegrees ()
QString text ()
double stringToDouble (QString input, QValidator::State *state, PrefixType prefix=Unknown) const
void setDecimals (int places)
int decimals ()
void setDisplayFormat (DisplayFormat format)
DisplayFormat displayFormat ()
void setPrefixType (PrefixType prefix)
PrefixType prefixType ()

Protected Member Functions

StepEnabled stepEnabled () const


Detailed Description

A spin box for displaying/entering angular values.

This class can accept angles in various formats commonly used in astronomy including decimal degrees, DMS and HMS.


Member Enumeration Documentation

Used to decide how to display the angle.

Enumerator:
DMSLetters  Degrees, minutes and seconds, e.g. 180d 4m 8s.
DMSSymbols  Degrees, minutes and seconds, e.g. 180° 4' 8".
HMSLetters  Hours, minutes and seconds, e.g. 12h 4m 6s.
HMSSymbols  Hours, minutes and seconds, e.g. 12h 4' 6s".
DecimalDeg  Decimal degrees, e.g. 180.06888.

Determines how positive and negative values are indicated.

Enumerator:
Normal  negative values have '-' prefix
NormalPlus  positive values have '+' prefix, negative values have '-' prefix.
Longitude  positive values have 'E' prefix, negative values have 'W' prefix.
Latitude  positive values have 'N' prefix, negative values have 'S' prefix.


Member Function Documentation

double AngleSpinBox::valueRadians (  ) 

Get the angle held in the AngleSpinBox.

Returns:
the angle in radians

double AngleSpinBox::valueDegrees (  ) 

Get the angle held in the AngleSpinBox.

Returns:
the angle in degrees

QString AngleSpinBox::text (  ) 

Get the angle held in the AngleSpinBox.

Returns:
the angle as formatted according to the current format and flags

double AngleSpinBox::stringToDouble ( QString  input,
QValidator::State *  state,
PrefixType  prefix = Unknown 
) const

Convert a string value to a angle in radians.

This function can be used to validate a string as expressing an angle. Accepted are any formats which the AngleSpinBox understands.

Parameters:
input the string value to be converted / validated.
state a pointer to a QValidator::State value which is set according to the validation.
prefix the kind of prefix to use for conversion.
Returns:
the value of the angle expressed in input in radians.

void AngleSpinBox::setDecimals ( int  places  )  [inline]

Set the number of decimal places to express float values to (e.g.

seconds in DMSLetters format)

Parameters:
places the number of decimal places to use.

int AngleSpinBox::decimals (  )  [inline]

Set the number of decimal places to express float values to (e.g.

seconds in DMSLetters format)

Returns:
the number of decimal places used.

void AngleSpinBox::setDisplayFormat ( DisplayFormat  format  )  [inline]

Set the display format.

Parameters:
format the new format to use

DisplayFormat AngleSpinBox::displayFormat (  )  [inline]

Get the current display format.

Returns:
the current DisplayFormat

void AngleSpinBox::setPrefixType ( PrefixType  prefix  )  [inline]

Set the prefix type.

Parameters:
prefix the new prefix type to use

PrefixType AngleSpinBox::prefixType (  )  [inline]

Get the current display format.

Returns:
the current DisplayFormat

void AngleSpinBox::setRadians ( double  radians  )  [slot]

Set the value of the spin box in radians.

Parameters:
radians the value to set, in radians

void AngleSpinBox::setDegrees ( double  degrees  )  [slot]

Set the value of the spin box in decimal degrees.

Parameters:
degrees the value to set, in decimal degrees

void AngleSpinBox::valueChanged (  )  [signal]

emitted when the value changes.


Generated on Mon Feb 2 17:23:48 2009 for Stellarium by  doxygen 1.5.5