StelProjector.hpp   StelProjector.hpp 
skipping to change at line 88 skipping to change at line 88
//! regardless of the projection type. This makes it possible to imp lement depth buffer testing in a way independent of the //! regardless of the projection type. This makes it possible to imp lement depth buffer testing in a way independent of the
//! projection type. I would like to return the squared length inste ad of the length because of performance reasons. //! projection type. I would like to return the squared length inste ad of the length because of performance reasons.
//! But then far away objects are not textured any more, perhaps bec ause of a depth buffer overflow although //! But then far away objects are not textured any more, perhaps bec ause of a depth buffer overflow although
//! the depth test is disabled? //! the depth test is disabled?
virtual bool forward(Vec3d &v) const = 0; virtual bool forward(Vec3d &v) const = 0;
//! Apply the transformation in the backward projection in place. //! Apply the transformation in the backward projection in place.
virtual bool backward(Vec3d &v) const = 0; virtual bool backward(Vec3d &v) const = 0;
//! Return the small zoom increment to use at the given FOV for nice movements //! Return the small zoom increment to use at the given FOV for nice movements
virtual double deltaZoom(double fov) const = 0; virtual double deltaZoom(double fov) const = 0;
//! Determine whether a great circle connection p1 and p2 intersects
with a projection discontinuity.
//! For many projections without discontinuity, this should return a
lways false, but for other like
//! cylindrical projection it will return true if the line cuts the
wrap-around line (i.e. at lon=180 if the observer look at lon=0).
bool intersectViewportDiscontinuity(const Vec3d& p1, const Vec3d& p2
) const
{
if (hasDiscontinuity()==false)
return false;
return intersectViewportDiscontinuityInternal(modelViewMatri
x*p1, modelViewMatrix*p2);
}
//! Convert a Field Of View radius value in radians in ViewScalingFa ctor (used internally) //! Convert a Field Of View radius value in radians in ViewScalingFa ctor (used internally)
virtual double fovToViewScalingFactor(double fov) const = 0; virtual double fovToViewScalingFactor(double fov) const = 0;
//! Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians //! Convert a ViewScalingFactor value (used internally) in Field Of View radius in radians
virtual double viewScalingFactorToFov(double vsf) const = 0; virtual double viewScalingFactorToFov(double vsf) const = 0;
//! Get the current state of the flag which decides whether to //! Get the current state of the flag which decides whether to
//! arrage labels so that they are aligned with the bottom of a 2d //! arrage labels so that they are aligned with the bottom of a 2d
//! screen, or a 3d dome. //! screen, or a 3d dome.
bool getFlagGravityLabels() const { return gravityLabels; } bool getFlagGravityLabels() const { return gravityLabels; }
skipping to change at line 117 skipping to change at line 127
//! Get the horizontal viewport offset in pixels. //! Get the horizontal viewport offset in pixels.
int getViewportPosX(void) const {return viewportXywh[0];} int getViewportPosX(void) const {return viewportXywh[0];}
//! Get the vertical viewport offset in pixels. //! Get the vertical viewport offset in pixels.
int getViewportPosY(void) const {return viewportXywh[1];} int getViewportPosY(void) const {return viewportXywh[1];}
//! Get the viewport width in pixels. //! Get the viewport width in pixels.
int getViewportWidth(void) const {return viewportXywh[2];} int getViewportWidth(void) const {return viewportXywh[2];}
//! Get the viewport height in pixels. //! Get the viewport height in pixels.
int getViewportHeight(void) const {return viewportXywh[3];} int getViewportHeight(void) const {return viewportXywh[3];}
//! Return a convex polygon on the sphere which includes the viewpor t in the current frame. //! Return a convex polygon on the sphere which includes the viewpor t in the current frame.
//! @param marginX an extra margin in pixel which extends the polygo //! @param marginX an extra margin in pixel which extends the polygo
n size in the X direction n size in the X direction.
//! @param marginY an extra margin in pixel which extends the polygo //! @param marginY an extra margin in pixel which extends the polygo
n size in the Y direction n size in the Y direction.
//! @TODO Should be unified with unprojectViewport //! @return a ConvexPolygon or the special fullSky ConvexPolygon if
the viewport cannot be
//! represented by a convex polygon (e.g. if aperture > 180 deg).
StelGeom::ConvexPolygon getViewportConvexPolygon(double marginX=0., double marginY=0.) const; StelGeom::ConvexPolygon getViewportConvexPolygon(double marginX=0., double marginY=0.) const;
//! Un-project the entire viewport depending on mapping, maskType,
//! viewportFovDiameter, viewportCenter, and viewport dimensions.
//! @TODO Should be unified with getViewportConvexPolygon
StelGeom::ConvexS unprojectViewport() const;
//! Return a Halfspace containing the whole viewport //! Return a Halfspace containing the whole viewport
StelGeom::HalfSpace getBoundingHalfSpace() const; StelGeom::HalfSpace getBoundingHalfSpace() const;
//! Get size of a radian in pixels at the center of the viewport dis k //! Get size of a radian in pixels at the center of the viewport dis k
double getPixelPerRadAtCenter(void) const {return pixelPerRad;} double getPixelPerRadAtCenter(void) const {return pixelPerRad;}
//! Get the current FOV diameter in degree //! Get the current FOV diameter in degree
double getFov() const {return 360./M_PI*viewScalingFactorToFov(0.5*v iewportFovDiameter/pixelPerRad);} double getFov() const {return 360./M_PI*viewScalingFactorToFov(0.5*v iewportFovDiameter/pixelPerRad);}
//! Get whether front faces need to be oriented in the clockwise dir ection //! Get whether front faces need to be oriented in the clockwise dir ection
skipping to change at line 228 skipping to change at line 234
static const QString maskTypeToString(StelProjectorMaskType type); static const QString maskTypeToString(StelProjectorMaskType type);
//! Get a StelProjectorMaskType from a string description. //! Get a StelProjectorMaskType from a string description.
static StelProjectorMaskType stringToMaskType(const QString &s); static StelProjectorMaskType stringToMaskType(const QString &s);
//! Get the current type of the mask if any. //! Get the current type of the mask if any.
StelProjectorMaskType getMaskType(void) const {return maskType;} StelProjectorMaskType getMaskType(void) const {return maskType;}
protected: protected:
//! Private constructor. Only StelCore can create instances of StelP rojector. //! Private constructor. Only StelCore can create instances of StelP rojector.
StelProjector(const Mat4d& modelViewMat) : modelViewMatrix(modelView Mat) {;} StelProjector(const Mat4d& modelViewMat) : modelViewMatrix(modelView Mat) {;}
//! Return whether the projection presents discontinuities. Used for
optimization.
virtual bool hasDiscontinuity() const =0;
//! Determine whether a great circle connection p1 and p2 intersects
with a projection discontinuity.
//! For many projections without discontinuity, this should return a
lways false, but for other like
//! cylindrical projection it will return true if the line cuts the
wrap-around line (i.e. at lon=180 if the observer look at lon=0).
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1,
const Vec3d& p2) const = 0;
private: private:
//! Initialise the StelProjector from a param instance //! Initialise the StelProjector from a param instance
void init(const StelProjectorParams& param); void init(const StelProjectorParams& param);
StelProjectorMaskType maskType; // The current projector mask StelProjectorMaskType maskType; // The current projector mask
double zNear, oneOverZNearMinusZFar; // Near and far clipping plane s double zNear, oneOverZNearMinusZFar; // Near and far clipping plane s
Vec4i viewportXywh; // Viewport parameters Vec4i viewportXywh; // Viewport parameters
Vec2d viewportCenter; // Viewport center in screen pixel Vec2d viewportCenter; // Viewport center in screen pixel
double viewportFovDiameter; // diameter of the FOV disk in pixel double viewportFovDiameter; // diameter of the FOV disk in pixel
double pixelPerRad; // pixel per rad at the center of the viewport disk double pixelPerRad; // pixel per rad at the center of the viewport disk
 End of changes. 4 change blocks. 
11 lines changed or deleted 33 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/