20 #ifndef _STELPROJECTIONS_HPP_
21 #define _STELPROJECTIONS_HPP_
23 #include "StelProjector.hpp"
68 virtual void project(
int n,
const Vec3d* in,
Vec3f* out)
71 for (
int i = 0; i < n; ++i, ++out)
74 modelViewTransform->forward(v);
75 out->set(v[0], v[1], v[2]);
77 out->set(viewportCenter[0] + flipHorz * pixelPerRad * (*out)[0],
78 viewportCenter[1] + flipVert * pixelPerRad * (*out)[1],
79 ((*out)[2] - zNear) * oneOverZNearMinusZFar);
119 virtual void project(
int n,
const Vec3d* in,
Vec3f* out)
122 for (
int i = 0; i < n; ++i)
125 modelViewTransform->forward(v);
126 out[i].set(v[0], v[1], v[2]);
128 out[i][0] = viewportCenter[0] + flipHorz * pixelPerRad * out[i][0];
129 out[i][1] = viewportCenter[1] + flipVert * pixelPerRad * out[i][1];
130 out[i][2] = (out[i][2] - zNear) * oneOverZNearMinusZFar;
147 return cap.intersects(cap1) && cap.intersects(cap2) && cap.intersects(cap3);
157 virtual float getMaxFov()
const {
return 175.f * 4.f/3.f;}
167 return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);
175 return cap.intersects(cap1) && cap.intersects(cap2) && cap.intersects(cap2);
185 virtual float getMaxFov()
const {
return 175.f * 4.f/3.f;}
195 return p1[0]*p2[0]<0 && !(p1[2]<0 && p2[2]<0);
203 return cap.intersects(cap1) && cap.intersects(cap2) && cap.intersects(cap2);
255 #endif // _STELPROJECTIONS_HPP_
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &capN, double capD) const
Determine whether a cap intersects with a projection discontinuity.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
bool forward(Vec3f &win) const
Apply the transformation in the forward direction in place.
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
bool forward(Vec3f &win) const
Apply the transformation in the forward direction in place.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
A SphericalCap is defined by a direction and an aperture.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &capN, double capD) const
Determine whether a cap intersects with a projection discontinuity.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
bool forward(Vec3f &win) const
Apply the transformation in the forward direction in place.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
bool forward(Vec3f &win) const
Apply the transformation in the forward direction in place.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &p1, const Vec3d &p2) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
StelProjector(ModelViewTranformP amodelViewTransform)
Private constructor. Only StelCore can create instances of StelProjector.
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
bool forward(Vec3f &win) const
Apply the transformation in the forward direction in place.
Provide the main interface to all operations of projecting coordinates from sky to screen...
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &p1, const Vec3d &p2) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual QString getNameI18() const
Get a human-readable name for this projection type.
bool forward(Vec3f &v) const
Apply the transformation in the forward direction in place.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
QSharedPointer< ModelViewTranform > ModelViewTranformP
Shared pointer on a ModelViewTranform instance (implement reference counting)
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
virtual bool hasDiscontinuity() const
Return whether the projection presents discontinuities. Used for optimization.
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
virtual void computeBoundingCap()
Initialize the bounding cap.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
bool backward(Vec3d &v) const
Apply the transformation in the backward projection in place.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
virtual QString getDescriptionI18() const
Get a human-readable short description for this projection type.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, double) const
Determine whether a cap intersects with a projection discontinuity.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &, const Vec3d &) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &capN, double capD) const
Determine whether a cap intersects with a projection discontinuity.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
float deltaZoom(float fov) const
Return the small zoom increment to use at the given FOV for nice movements.
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
virtual QString getNameI18() const
Get a human-readable name for this projection type.
float fovToViewScalingFactor(float fov) const
Convert a Field Of View radius value in radians in ViewScalingFactor (used internally) ...
virtual float getMaxFov() const
Get the maximum FOV apperture in degree.
float viewScalingFactorToFov(float vsf) const
Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians.
virtual bool intersectViewportDiscontinuityInternal(const Vec3d &p1, const Vec3d &p2) const
Determine whether a great circle connection p1 and p2 intersects with a projection discontinuity...