StelProjectorClasses.hpp   StelProjectorClasses.hpp 
skipping to change at line 56 skipping to change at line 56
} }
v[0] *= 1e99; v[0] *= 1e99;
v[1] *= 1e99; v[1] *= 1e99;
v[2] = r; v[2] = r;
return false; return false;
} }
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {return false;}
}; };
class StelProjectorEqualArea : public StelProjector class StelProjectorEqualArea : public StelProjector
{ {
public: public:
StelProjectorEqualArea(const Mat4d& modelViewMat) : StelProjector(mo delViewMat) {;} StelProjectorEqualArea(const Mat4d& modelViewMat) : StelProjector(mo delViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 360.;} virtual double getMaxFov() const {return 360.;}
bool forward(Vec3d &v) const bool forward(Vec3d &v) const
skipping to change at line 78 skipping to change at line 81
const double f = std::sqrt(2.0/(r*(r-v[2]))); const double f = std::sqrt(2.0/(r*(r-v[2])));
v[0] *= f; v[0] *= f;
v[1] *= f; v[1] *= f;
v[2] = r; v[2] = r;
return true; return true;
} }
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {return false;}
}; };
class StelProjectorStereographic : public StelProjector class StelProjectorStereographic : public StelProjector
{ {
public: public:
StelProjectorStereographic(const Mat4d& modelViewMat) : StelProjecto r(modelViewMat) {;} StelProjectorStereographic(const Mat4d& modelViewMat) : StelProjecto r(modelViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 235.;} virtual double getMaxFov() const {return 235.;}
bool forward(Vec3d &v) const bool forward(Vec3d &v) const
skipping to change at line 107 skipping to change at line 113
const double f = 1.0 / h; const double f = 1.0 / h;
v[0] *= f; v[0] *= f;
v[1] *= f; v[1] *= f;
v[2] = r; v[2] = r;
return true; return true;
} }
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {return false;}
}; };
class StelProjectorFisheye : public StelProjector class StelProjectorFisheye : public StelProjector
{ {
public: public:
StelProjectorFisheye(const Mat4d& modelViewMat) : StelProjector(mode lViewMat) {;} StelProjectorFisheye(const Mat4d& modelViewMat) : StelProjector(mode lViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 180.00001;} virtual double getMaxFov() const {return 180.00001;}
bool forward(Vec3d &v) const bool forward(Vec3d &v) const
skipping to change at line 142 skipping to change at line 151
} }
v[0] = 1e99; v[0] = 1e99;
v[1] = 1e99; v[1] = 1e99;
v[2] = -1e99; v[2] = -1e99;
return false; return false;
} }
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {return false;}
};
class StelProjectorHammer : public StelProjector
{
public:
StelProjectorHammer(const Mat4d& modelViewMat) : StelProjector(model
ViewMat) {;}
virtual QString getNameI18() const;
virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 360.;}
bool forward(Vec3d &v) const
{
// RealAitoff
// const double r = std::sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]
);
// const double alpha = std::atan2(v[0],-v[2]);
// const double cosDelta = std::sqrt(1.-v[1]*v[1]/(r*r));
// double z = std::acos(cosDelta*std::cos(alpha/2.));
// z = std::sin(z)/z;
// v[0] = 2.*cosDelta*std::sin(alpha/2.)/z;
// v[1] = v[1]/r/z;
// v[2] = r;
// return true;
// Hammer Aitoff
const double r = std::sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]
);
const double alpha = std::atan2(v[0],-v[2]);
const double cosDelta = std::sqrt(1.-v[1]*v[1]/(r*r));
double z = std::sqrt(1.+cosDelta*std::cos(alpha/2.));
v[0] = 2.*M_SQRT2*cosDelta*std::sin(alpha/2.)/z;
v[1] = M_SQRT2*v[1]/r/z;
v[2] = r;
return true;
}
bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return true;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);}
}; };
class StelProjectorCylinder : public StelProjector class StelProjectorCylinder : public StelProjector
{ {
public: public:
StelProjectorCylinder(const Mat4d& modelViewMat) : StelProjector(mod elViewMat) {;} StelProjectorCylinder(const Mat4d& modelViewMat) : StelProjector(mod elViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 175. * 4./3.;} // assume as pect ration of 4/3 for getting a full 360 degree horizon virtual double getMaxFov() const {return 175. * 4./3.;} // assume as pect ration of 4/3 for getting a full 360 degree horizon
bool forward(Vec3d &win) const; bool forward(Vec3d &win) const;
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return true;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const
{
return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);
}
}; };
class StelProjectorMercator : public StelProjector class StelProjectorMercator : public StelProjector
{ {
public: public:
StelProjectorMercator(const Mat4d& modelViewMat) : StelProjector(mod elViewMat) {;} StelProjectorMercator(const Mat4d& modelViewMat) : StelProjector(mod elViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 175. * 4./3.;} // assume as pect ration of 4/3 for getting a full 360 degree horizon virtual double getMaxFov() const {return 175. * 4./3.;} // assume as pect ration of 4/3 for getting a full 360 degree horizon
bool forward(Vec3d &win) const; bool forward(Vec3d &win) const;
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return true;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const
{
return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);
}
}; };
class StelProjectorOrthographic : public StelProjector class StelProjectorOrthographic : public StelProjector
{ {
public: public:
StelProjectorOrthographic(const Mat4d& modelViewMat) : StelProjector (modelViewMat) {;} StelProjectorOrthographic(const Mat4d& modelViewMat) : StelProjector (modelViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 179.9999;} virtual double getMaxFov() const {return 179.9999;}
bool forward(Vec3d &win) const; bool forward(Vec3d &win) const;
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {return false;}
}; };
class StelProjector2d : public StelProjector class StelProjector2d : public StelProjector
{ {
public: public:
StelProjector2d() : StelProjector(Mat4d::identity()) {;} StelProjector2d() : StelProjector(Mat4d::identity()) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 360.;} virtual double getMaxFov() const {return 360.;}
bool forward(Vec3d &win) const; bool forward(Vec3d &win) const;
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected:
virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const {Q_ASSERT(0); return false;}
}; };
#endif // _STELPROJECTIONS_HPP_ #endif // _STELPROJECTIONS_HPP_
 End of changes. 8 change blocks. 
0 lines changed or deleted 81 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/