Gamma = 0.8;
IntensityMax = 255,
- startValue = 400;
- endValue = 700;
-
m_realWidth = 360;
m_realHeight = 200;
int start = (int)startValue % 10;
double dist = width()/(endValue-startValue) * 10; //distance between the tickles in px
- int count = startValue - start + 10;
+ int count = ( int )startValue - start + 10;
start *= width()/(endValue-startValue);
for ( int i = start; i < width(); i += dist )
return c;
}
-SpectrumView::SpectrumView( QWidget *parent, const char* name )
+SpectrumView::SpectrumView( Spectrum *spec, QWidget *parent, const char* name )
: QWidget( parent, name )
{
+ m_spectrum = spec;
+
QVBoxLayout *spectrumLayout = new QVBoxLayout( this );
m_spectrumWidget = new SpectrumWidget( this, "spectrum" );
+ m_spectrumWidget->setBorders( spec->min(), spec->max() );
+
spectrumLayout->addWidget( m_spectrumWidget );
QHBoxLayout *hbox = new QHBoxLayout( this );
#include <kimageeffect.h>
#include <kdebug.h>
-#include <kpixmapeffect.h>
#include <kcombobox.h>
#include "element.h"
m_bandlist.append( b );
}
+ double min() const{
+ return m_min;
+ }
+
+ double max() const{
+ return m_max;
+ }
+
private:
/**
* @return the smallest wavelength
* @param right the right border
*/
void setBorders( double left, double right ){
- startValue = left;
- endValue = right;
+ startValue = ( int )left;
+ endValue = ( int )right;
}
/**
Q_OBJECT
public:
- SpectrumView( QWidget* parent, const char* name );
-
- void setSpectra( Spectrum* spec ){
- m_spectrum = spec;
- }
+ SpectrumView( Spectrum *spec, QWidget* parent, const char* name );
private:
SpectrumWidget *m_spectrumWidget;