AngleMeasure.hpp   AngleMeasure.hpp 
/* /*
* Copyright (C) 2009 Matthew Gates * Copyright (C) 2009 Matthew Gates
* Copyright (C) 2014 Georg Zotti
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 28 skipping to change at line 29
#ifndef ANGLEMEASURE_HPP_ #ifndef ANGLEMEASURE_HPP_
#define ANGLEMEASURE_HPP_ #define ANGLEMEASURE_HPP_
#include "config.h" #include "config.h"
#include <QFont> #include <QFont>
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelModule.hpp" #include "StelModule.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelCore.hpp"
class QTimer; class QTimer;
class QPixmap; class QPixmap;
class StelButton; class StelButton;
class AngleMeasureDialog; class AngleMeasureDialog;
//! Main class of the Angle Measure plug-in. //! Main class of the Angle Measure plug-in.
//! Provides an on-screen angle measuring tool. //! Provides an on-screen angle measuring tool.
//! GZ extended in 2014-09, enough to call it V4.0
//! Equatorial Mode (original): mark start,end: distance/position angle in
the sky, line rotates with sky, spherical angles influenced by refraction (
numbers given on celestial sphere).
//! Horizontal Mode: mark start,end: distance/position angle in alt/azimuth
al coordinates, line stays fixed in alt-az system. Angle may be different n
ear to horizon because of refraction!
//! It is possible to link start and/or end to the sky. Distance/position a
ngle still always in alt/azimuthal coordinates.
class AngleMeasure : public StelModule class AngleMeasure : public StelModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool enabled Q_PROPERTY(bool enabled
READ isEnabled READ isEnabled
WRITE enableAngleMeasure) WRITE enableAngleMeasure)
Q_PROPERTY(bool dmsFormat Q_PROPERTY(bool dmsFormat
READ isDmsFormat READ isDmsFormat
WRITE useDmsFormat) WRITE useDmsFormat)
Q_PROPERTY(bool paDisplayed Q_PROPERTY(bool paDisplayed
skipping to change at line 65 skipping to change at line 71
virtual void update(double deltaTime); virtual void update(double deltaTime);
virtual void draw(StelCore* core); virtual void draw(StelCore* core);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
virtual void handleKeys(class QKeyEvent* event); virtual void handleKeys(class QKeyEvent* event);
virtual void handleMouseClicks(class QMouseEvent* event); virtual void handleMouseClicks(class QMouseEvent* event);
virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b); virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b);
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
bool isEnabled() const {return flagShowAngleMeasure;} bool isEnabled() const {return flagShowAngleMeasure;}
bool isDmsFormat() const { return flagUseDmsFormat; } bool isDmsFormat() const { return flagUseDmsFormat; }
bool isPaDisplayed() const { return flagShowPA; } bool isPaDisplayed() const { return flagShowPA; }
bool isEquatorial() const { return flagShowEquatorial; }
bool isHorizontal() const { return flagShowHorizontal; }
bool isHorizontalStartSkylinked() const { return flagShowHorizontalS
tartSkylinked; }
bool isHorizontalEndSkylinked() const { return flagShowHorizontalEnd
Skylinked; }
bool isHorPaDisplayed() const { return flagShowHorizontalPA; }
//! Restore the plug-in's settings to the default state. //! Restore the plug-in's settings to the default state.
//! Replace the plug-in's settings in Stellarium's configuration fil e //! Replace the plug-in's settings in Stellarium's configuration fil e
//! with the default values and re-load them. //! with the default values and re-load them.
//! Uses internally loadSettings() and saveSettings(). //! Uses internally loadSettings() and saveSettings().
void restoreDefaultSettings(); void restoreDefaultSettings();
//! Load the plug-in's settings from the configuration file. //! Load the plug-in's settings from the configuration file.
//! Settings are kept in the "AngleMeasure" section in Stellarium's //! Settings are kept in the "AngleMeasure" section in Stellarium's
//! configuration file. If no such section exists, it will load defa ult //! configuration file. If no such section exists, it will load defa ult
skipping to change at line 91 skipping to change at line 102
//! they can't be changed by the user in-program. //! they can't be changed by the user in-program.
//! @todo find a way to save color values without "rounding drift" //! @todo find a way to save color values without "rounding drift"
//! (this is especially important for restoring default color values ). //! (this is especially important for restoring default color values ).
//! @see loadSettings(), restoreSettings() //! @see loadSettings(), restoreSettings()
void saveSettings(); void saveSettings();
public slots: public slots:
void enableAngleMeasure(bool b); void enableAngleMeasure(bool b);
void useDmsFormat(bool b); void useDmsFormat(bool b);
void showPositionAngle(bool b); void showPositionAngle(bool b);
void showPositionAngleHor(bool b);
void showEquatorial(bool b);
void showHorizontal(bool b);
void showHorizontalStartSkylinked(bool b);
void showHorizontalEndSkylinked(bool b);
private slots: private slots:
void updateMessageText(); void updateMessageText();
void clearMessage(); void clearMessage();
private: private:
QFont font; QFont font;
bool flagShowAngleMeasure; bool flagShowAngleMeasure;
LinearFader lineVisible; LinearFader lineVisible;
LinearFader messageFader; LinearFader messageFader;
skipping to change at line 118 skipping to change at line 134
Vec3d endPoint; Vec3d endPoint;
Vec3d perp1StartPoint; Vec3d perp1StartPoint;
Vec3d perp1EndPoint; Vec3d perp1EndPoint;
Vec3d perp2StartPoint; Vec3d perp2StartPoint;
Vec3d perp2EndPoint; Vec3d perp2EndPoint;
Vec3f textColor; Vec3f textColor;
Vec3f lineColor; Vec3f lineColor;
double angle; double angle;
bool flagUseDmsFormat; bool flagUseDmsFormat;
bool flagShowPA; bool flagShowPA;
bool flagShowEquatorial;
bool flagShowHorizontal;
bool flagShowHorizontalPA;
bool flagShowHorizontalStartSkylinked;
bool flagShowHorizontalEndSkylinked;
Vec3f horTextColor;
Vec3f horLineColor;
Vec3d startPointHor;
Vec3d endPointHor;
Vec3d perp1StartPointHor;
Vec3d perp1EndPointHor;
Vec3d perp2StartPointHor;
Vec3d perp2EndPointHor;
double angleHor;
StelButton* toolbarButton; StelButton* toolbarButton;
void calculateEnds(); void calculateEnds();
QString calculateAngle(void) const; void calculateEndsOneLine(const Vec3d start, const Vec3d end, Vec3d
&perp1Start, Vec3d &perp1End, Vec3d &perp2Start, Vec3d &perp2End, double &a
ngle);
QString calculateAngle(bool horizontal=false) const;
QString calculatePositionAngle(const Vec3d p1, const Vec3d p2) const ; QString calculatePositionAngle(const Vec3d p1, const Vec3d p2) const ;
void drawOne(StelCore *core, const StelCore::FrameType frameType, co nst StelCore::RefractionMode refractionMode, const Vec3f txtColor, const Ve c3f lineColor);
QSettings* conf; QSettings* conf;
// GUI // GUI
AngleMeasureDialog* configDialog; AngleMeasureDialog* configDialog;
}; };
#include <QObject> #include <QObject>
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
 End of changes. 8 change blocks. 
1 lines changed or deleted 43 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/