StelProjector.cpp   StelProjector.cpp 
skipping to change at line 111 skipping to change at line 111
return MaskDisk; return MaskDisk;
return MaskNone; return MaskNone;
} }
void StelProjector::init(const StelProjectorParams& params) void StelProjector::init(const StelProjectorParams& params)
{ {
devicePixelsPerPixel = params.devicePixelsPerPixel; devicePixelsPerPixel = params.devicePixelsPerPixel;
maskType = (StelProjectorMaskType)params.maskType; maskType = (StelProjectorMaskType)params.maskType;
zNear = params.zNear; zNear = params.zNear;
oneOverZNearMinusZFar = 1.f/(zNear-params.zFar); oneOverZNearMinusZFar = 1.f/(zNear-params.zFar);
viewportCenterOffset = params.viewportCenterOffset;
viewportXywh = params.viewportXywh; viewportXywh = params.viewportXywh;
viewportXywh[0] *= devicePixelsPerPixel; viewportXywh[0] *= devicePixelsPerPixel;
viewportXywh[1] *= devicePixelsPerPixel; viewportXywh[1] *= devicePixelsPerPixel;
viewportXywh[2] *= devicePixelsPerPixel; viewportXywh[2] *= devicePixelsPerPixel;
viewportXywh[3] *= devicePixelsPerPixel; viewportXywh[3] *= devicePixelsPerPixel;
viewportCenter = params.viewportCenter; viewportCenter = params.viewportCenter;
viewportCenter *= devicePixelsPerPixel; viewportCenter *= devicePixelsPerPixel;
gravityLabels = params.gravityLabels; gravityLabels = params.gravityLabels;
defaultAngleForGravityText = params.defautAngleForGravityText; defaultAngleForGravityText = params.defaultAngleForGravityText;
flipHorz = params.flipHorz ? -1.f : 1.f; flipHorz = params.flipHorz ? -1.f : 1.f;
flipVert = params.flipVert ? -1.f : 1.f; flipVert = params.flipVert ? -1.f : 1.f;
viewportFovDiameter = params.viewportFovDiameter * devicePixelsPerPi xel; viewportFovDiameter = params.viewportFovDiameter * devicePixelsPerPi xel;
pixelPerRad = 0.5f * viewportFovDiameter / fovToViewScalingFactor(pa rams.fov*(M_PI/360.f)); pixelPerRad = 0.5f * viewportFovDiameter / fovToViewScalingFactor(pa rams.fov*(M_PI/360.f));
computeBoundingCap(); computeBoundingCap();
} }
QString StelProjector::getHtmlSummary() const QString StelProjector::getHtmlSummary() const
{ {
return QString("<h3>%1</h3><p>%2</p><b>%3</b>%4").arg(getNameI18()). arg(getDescriptionI18()).arg(q_("Maximum FOV: ")).arg(getMaxFov())+QChar(0x 00B0); return QString("<h3>%1</h3><p>%2</p><b>%3</b>%4").arg(getNameI18()). arg(getDescriptionI18()).arg(q_("Maximum FOV: ")).arg(getMaxFov())+QChar(0x 00B0);
skipping to change at line 386 skipping to change at line 387
//! @param v the unprojected direction vector in the current frame. //! @param v the unprojected direction vector in the current frame.
//! @return true if the projected coordinate is valid. //! @return true if the projected coordinate is valid.
bool StelProjector::unProject(const Vec3d& win, Vec3d& v) const bool StelProjector::unProject(const Vec3d& win, Vec3d& v) const
{ {
return unProject(win[0], win[1], v); return unProject(win[0], win[1], v);
} }
void StelProjector::computeBoundingCap() void StelProjector::computeBoundingCap()
{ {
bool ok = unProject(viewportXywh[0]+0.5f*viewportXywh[2], viewportXy wh[1]+0.5f*viewportXywh[3], boundingCap.n); bool ok = unProject(viewportXywh[0]+0.5f*viewportXywh[2], viewportXy wh[1]+0.5f*viewportXywh[3], boundingCap.n);
Q_ASSERT(ok); // The central point should be at a valid position b // The central point should be at a valid position by definition.
y definition // When center is offset, this assumption may not hold however.
Q_ASSERT(ok || (viewportCenterOffset.lengthSquared()>0.0) );
const bool needNormalization = fabs(boundingCap.n.lengthSquared()-1. )>0.00000001; const bool needNormalization = fabs(boundingCap.n.lengthSquared()-1. )>0.00000001;
// Now need to determine the aperture // Now need to determine the aperture
Vec3d e0,e1,e2,e3,e4,e5; Vec3d e0,e1,e2,e3,e4,e5;
const Vec4i& vp = viewportXywh; const Vec4i& vp = viewportXywh;
ok &= unProject(vp[0],vp[1],e0); ok &= unProject(vp[0],vp[1],e0);
ok &= unProject(vp[0]+vp[2],vp[1],e1); ok &= unProject(vp[0]+vp[2],vp[1],e1);
ok &= unProject(vp[0]+vp[2],vp[1]+vp[3],e2); ok &= unProject(vp[0]+vp[2],vp[1]+vp[3],e2);
ok &= unProject(vp[0],vp[1]+vp[3],e3); ok &= unProject(vp[0],vp[1]+vp[3],e3);
ok &= unProject(vp[0],vp[1]+vp[3]/2,e4); ok &= unProject(vp[0],vp[1]+vp[3]/2,e4);
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 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/