26 #ifndef GRALE_ELLIPTICALSOURCE_H
28 #define GRALE_ELLIPTICALSOURCE_H
30 #include "graleconfig.h"
31 #include "sourceimage.h"
32 #include "constants.h"
37 class GRALE_IMPORTEXPORT EllipticalSource :
public SourceImage
40 EllipticalSource(Vector2D<double> angularpos,
double angular_axis,
double excentricity,
double rotangle,
double brightnessScale);
42 void setFade(
bool f) { fade = f; }
43 SourceImage *createCopy()
const;
44 bool isSerializable()
const {
return true; }
48 bool writeInternal(serut::SerializationInterface &si)
const;
49 bool readInternal(serut::SerializationInterface &si);
50 double getIntensityInternal(Vector2D<double> diff)
const;
51 double getMaxRadius()
const {
return A; }
56 friend class SourceImage;
59 inline double EllipticalSource::getIntensityInternal(Vector2D<double> diff)
const
62 Vector2D<double> diff3(diff.getX()/A,diff.getY()/B);
64 if (diff3.getLengthSquared() <= 1.0)
66 double val = 32768.0L;
69 val *= (1.0L-(diff3.getLengthSquared()));
78 #endif // GRALE_ELLIPTICALSOURCE_H