• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kalzium

SpectrumWidget Class Reference

#include <spectrumwidget.h>

Inheritance diagram for SpectrumWidget:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Carsten Niehaus

Definition at line 31 of file spectrumwidget.h.


Public Types

enum  SpectrumType { EmissionSpectrum = 0, AbsorptionSpectrum }

Public Slots

void setRightBorder (int value)
void setLeftBorder (int value)
void slotActivateSpectrum (int spectrumtype)

Signals

void bordersChanged (int, int)
void peakSelected (Spectrum::peak *peak)

Public Member Functions

 SpectrumWidget (QWidget *parent)
 ~SpectrumWidget ()
void setSpectrum (Spectrum *spec)
Spectrum * spectrum () const
void setBorders (double left, double right)
void setType (SpectrumType t)
SpectrumType spectrumType () const
QColor linecolor (double spectrum)
int Adjust (double color, double factor)
int xPos (double wavelength)
void findPeakFromMouseposition (double wavelength)
double Wavelength (double xpos)
void wavelengthToRGB (double wavelength, int &r, int &g, int &b)

Public Attributes

double Gamma
int IntensityMax

Protected Member Functions

virtual void paintEvent (QPaintEvent *e)
virtual void keyPressEvent (QKeyEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)

Member Enumeration Documentation

enum SpectrumWidget::SpectrumType

there are several possible types.

Enumerator:
EmissionSpectrum 
AbsorptionSpectrum 

Definition at line 62 of file spectrumwidget.h.


Constructor & Destructor Documentation

SpectrumWidget::SpectrumWidget ( QWidget *  parent  ) 

Definition at line 42 of file spectrumwidget.cpp.

SpectrumWidget::~SpectrumWidget (  )  [inline]

Definition at line 38 of file spectrumwidget.h.


Member Function Documentation

void SpectrumWidget::setSpectrum ( Spectrum *  spec  )  [inline]

Definition at line 40 of file spectrumwidget.h.

Spectrum* SpectrumWidget::spectrum (  )  const [inline]

Definition at line 45 of file spectrumwidget.h.

void SpectrumWidget::setBorders ( double  left,
double  right 
)

This limits the width of the spectrum in terms of wavelength.

For example you can set it to only show the area between 500 and 550 nm

Parameters:
left the left border
right the right border

Definition at line 290 of file spectrumwidget.cpp.

void SpectrumWidget::setType ( SpectrumType  t  )  [inline]

sets the type of the spectrum to t

Parameters:
t the type of the spectrum

Definition at line 72 of file spectrumwidget.h.

SpectrumType SpectrumWidget::spectrumType (  )  const [inline]

Returns:
the currently active type of the spectrum

Definition at line 80 of file spectrumwidget.h.

QColor SpectrumWidget::linecolor ( double  spectrum  ) 

Returns:
the color of a line

Parameters:
spectrum the value of the spectrum

Definition at line 143 of file spectrumwidget.cpp.

int SpectrumWidget::Adjust ( double  color,
double  factor 
)

Returns:
the adjusted value of the color.

The correction depends on factor which has been figured out emperically

Definition at line 215 of file spectrumwidget.cpp.

int SpectrumWidget::xPos ( double  wavelength  )  [inline]

Returns:
the postion in the widget of a band with the wavelength wavelength

Parameters:
wavelength the wavelength for which the position is needed

Definition at line 106 of file spectrumwidget.h.

void SpectrumWidget::findPeakFromMouseposition ( double  wavelength  ) 

based on the current position of the mouse-cursor the nearest peak is searched.

If found, it will be emitted.

See also:
peakSelected

Definition at line 333 of file spectrumwidget.cpp.

double SpectrumWidget::Wavelength ( double  xpos  )  [inline]

Parameters:
xpos The ratio of the position relative to the width of the widget.

Returns:
the wavelength on position xpos

Definition at line 123 of file spectrumwidget.h.

void SpectrumWidget::wavelengthToRGB ( double  wavelength,
int &  r,
int &  g,
int &  b 
)

This method changes the three values r, g and b to the correct values.

Parameters:
wavelength the wavelength for which the color is searched
r red
g green
b blue

Definition at line 153 of file spectrumwidget.cpp.

void SpectrumWidget::setRightBorder ( int  value  )  [inline, slot]

set the the maximum value to value

Definition at line 177 of file spectrumwidget.h.

void SpectrumWidget::setLeftBorder ( int  value  )  [inline, slot]

set the the minimum value to value

Definition at line 187 of file spectrumwidget.h.

void SpectrumWidget::slotActivateSpectrum ( int  spectrumtype  )  [inline, slot]

activates the spectrum of the type spectrumtype

Definition at line 197 of file spectrumwidget.h.

void SpectrumWidget::bordersChanged ( int  ,
int   
) [signal]

the minimum and maximum displayed wavelength have changed so emit the new minimum and maximum

void SpectrumWidget::peakSelected ( Spectrum::peak *  peak  )  [signal]

the user selected a peak

void SpectrumWidget::paintEvent ( QPaintEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 63 of file spectrumwidget.cpp.

void SpectrumWidget::keyPressEvent ( QKeyEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 256 of file spectrumwidget.cpp.

void SpectrumWidget::mouseMoveEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 317 of file spectrumwidget.cpp.

void SpectrumWidget::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 323 of file spectrumwidget.cpp.

void SpectrumWidget::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 368 of file spectrumwidget.cpp.


Member Data Documentation

double SpectrumWidget::Gamma

Definition at line 90 of file spectrumwidget.h.

int SpectrumWidget::IntensityMax

Definition at line 91 of file spectrumwidget.h.


The documentation for this class was generated from the following files:
  • spectrumwidget.h
  • spectrumwidget.cpp

kalzium

Skip menu "kalzium"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal