Oculars.hpp   Oculars.hpp 
skipping to change at line 39 skipping to change at line 39
#include <QFont> #include <QFont>
#include <QSettings> #include <QSettings>
#define MIN_OCULARS_INI_VERSION 0.12 #define MIN_OCULARS_INI_VERSION 0.12
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QKeyEvent; class QKeyEvent;
class QMouseEvent; class QMouseEvent;
class QPixmap; class QPixmap;
class QSettings; class QSettings;
class QSignalMapper;
QT_END_NAMESPACE QT_END_NAMESPACE
class StelButton; class StelButton;
//! This is an example of a plug-in which can be dynamically loaded into st ellarium //! This is an example of a plug-in which can be dynamically loaded into st ellarium
class Oculars : public StelModule class Oculars : public StelModule
{ {
Q_OBJECT Q_OBJECT
public: public:
skipping to change at line 63 skipping to change at line 64
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void deinit(); virtual void deinit();
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
virtual void draw(StelCore* core); virtual void draw(StelCore* core);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//! Returns the module-specific style sheet. //! Returns the module-specific style sheet.
//! The main StelStyle instance should be passed. //! The main StelStyle instance should be passed.
virtual const StelStyle getModuleStyleSheet(const StelStyle& style); virtual const StelStyle getModuleStyleSheet(const StelStyle& style);
// virtual void handleKeys(class QKeyEvent* event); //! This method is needed because the MovementMgr classes handleKeys
() method consumes the event.
//! Because we want the ocular view to track, we must intercept & pr
ocess ourselves. Only called
//! while flagShowOculars or flagShowCCD == true.
virtual void handleKeys(class QKeyEvent* event);
virtual void handleMouseClicks(class QMouseEvent* event); virtual void handleMouseClicks(class QMouseEvent* event);
virtual void setStelStyle(const QString& style);
virtual void update(double) {;} virtual void update(double) {;}
public slots: public slots:
//! This method is called with we detect that our hot key is pressed void ccdRotationReset();
. It handles
//! determining if we should do anything - based on a selected objec
t - and painting
//! labes to the screen.
void enableOcular(bool b);
void toggleCrosshair();
void toggleTelrad();
void decrementCCDIndex(); void decrementCCDIndex();
void decrementOcularIndex(); void decrementOcularIndex();
void decrementTelescopeIndex(); void decrementTelescopeIndex();
void displayPopupMenu();
//! This method is called with we detect that our hot key is pressed
. It handles
//! determining if we should do anything - based on a selected objec
t.
void enableOcular(bool b);
void incrementCCDIndex(); void incrementCCDIndex();
void incrementOcularIndex(); void incrementOcularIndex();
void incrementTelescopeIndex(); void incrementTelescopeIndex();
void rotateCCD(QString amount); //<! amount must be a number.
void selectCCDAtIndex(QString indexString); //<! indexString must be
an integer, in the range of -1:ccds.count()
void selectOcularAtIndex(QString indexString); //<! indexString mus
t be an integer, in the range of -1:oculars.count()
void selectTelescopeAtIndex(QString indexString); //<! indexString
must be an integer, in the range of -1:telescopes.count()
void toggleCCD();
void toggleCrosshair();
void toggleTelrad();
signals: signals:
void selectedCCDChanged(); void selectedCCDChanged();
void selectedOcularChanged(); void selectedOcularChanged();
void selectedTelescopeChanged(); void selectedTelescopeChanged();
private slots: private slots:
//! Signifies a change in ocular or telescope. Sets new zoom level. //! Signifies a change in ocular or telescope. Sets new zoom level.
void instrumentChanged(); void instrumentChanged();
void determineMaxEyepieceAngle(); void determineMaxEyepieceAngle();
void setRequireSelection(bool state);
void setScaleImageCircle(bool state); void setScaleImageCircle(bool state);
void setScreenFOVForCCD();
void setStelStyle(const QString& style);
private: private:
//! Renders crosshairs into the viewport.
void drawCrosshairs();
//! Renders the three Telrad circles, but only if not in ocular mode
.
void drawTelrad();
//! Set up the Qt actions needed to activate the plugin. //! Set up the Qt actions needed to activate the plugin.
void initializeActivationActions(); void initializeActivationActions();
//! Set up the Qt actions used while the plugin is active. //! Returns TRUE if at least one bincular is defined.
void initializeActions(); bool isBinocularDefined();
//! This method is needed because the MovementMgr classes handleKeys
() method consumes the event.
//! Because we want the ocular view to track, we must intercept & pr
ocess ourselves. Only called
//! while flagShowOculars == true.
void interceptMovementKey(class QKeyEvent* event);
//! Reneders the CCD bounding box on-screen. A telescope must be se
lected, or this call does nothing.
void paintCCDBounds();
//! Renders crosshairs into the viewport.
void paintCrosshairs();
//! Paint the mask into the viewport. //! Paint the mask into the viewport.
void paintMask(); void paintOcularMask();
//! Renders the three Telrad circles, but only if not in ocular mode
.
void paintTelrad();
//! Paints the text about the current object selections to the upper right hand of the screen. //! Paints the text about the current object selections to the upper right hand of the screen.
//! Should only be called from a 'ready' state; currently from the d raw() method. //! Should only be called from a 'ready' state; currently from the d raw() method.
void paintText(const StelCore* core); void paintText(const StelCore* core);
//! This method is called by the zoom() method, when this plugin is toggled off; it resets to the default view. //! This method is called by the zoom() method, when this plugin is toggled off; it resets to the default view.
void unzoomOcular(); void unzoomOcular();
//! This method is responsible for insuring a valid ini file for the plugin exists. It first checks to see //! This method is responsible for insuring a valid ini file for the plugin exists. It first checks to see
//! if one exists in the expected location. If it does not, a defau lt one is copied into place, and the process //! if one exists in the expected location. If it does not, a defau lt one is copied into place, and the process
//! ends. However, if one does exist, it opens it, and looks for th e oculars_version key. The value (or even //! ends. However, if one does exist, it opens it, and looks for th e oculars_version key. The value (or even
//! presence) is used to determine if the ini file is usable. If no t, it is renamed, and a new one copied over. //! presence) is used to determine if the ini file is usable. If no t, it is renamed, and a new one copied over.
//! It does not ty to cope values over. //! It does not ty to cope values over.
//! Once there is a valid ini file, it is loaded into the settings a ttribute. //! Once there is a valid ini file, it is loaded into the settings a ttribute.
void validateAndLoadIniFile(); void validateAndLoadIniFile();
//! Recordd the state of the GridLinesMgr views beforehand, so that it can be reset afterwords. //! Recordd the state of the GridLinesMgr views beforehand, so that it can be reset afterwords.
//! @param rezoom if true, this zoom operation is starting from an a lready zoomed state. //! @param zoomedIn if true, this zoom operation is starting from an already zoomed state.
//! False for the original state. //! False for the original state.
void zoom(bool rezoom); void zoom(bool zoomedIn);
//! This method is called by the zoom() method, when this plugin is toggled on; it resets the zoomed view. //! This method is called by the zoom() method, when this plugin is toggled on; it resets the zoomed view.
void zoomOcular(); void zoomOcular();
//! A list of all the oculars defined in the ini file. Must have at least one, or module will not run. //! A list of all the oculars defined in the ini file. Must have at least one, or module will not run.
QList<CCD *> ccds; QList<CCD *> ccds;
QList<Ocular *> oculars; QList<Ocular *> oculars;
QList<Telescope *> telescopes; QList<Telescope *> telescopes;
int selectedCCDIndex; int selectedCCDIndex; //<! index of the current CCD, in the range of
int selectedOcularIndex; -1:ccds.count(). -1 means no CCD is selected.
int selectedTelescopeIndex; int selectedOcularIndex; //<! index of the current ocular, in the ra
nge of -1:oculars.count(). -1 means no ocular is selected.
int selectedTelescopeIndex; //<! index of the current telescope, in
the range of -1:telescopes.count(). -1 means none is selected.
QFont font; //!< The font used f or drawing labels. QFont font; //!< The font used f or drawing labels.
bool flagShowCCD; //!< flag used to tr ack f we are in CCD mode.
bool flagShowOculars; //!< flag used to track if we are in ocular mode. bool flagShowOculars; //!< flag used to track if we are in ocular mode.
bool flagShowCrosshairs; //!< flag used to track in crosshair s should be rendered in the ocular view. bool flagShowCrosshairs; //!< flag used to track in crosshair s should be rendered in the ocular view.
bool flagShowTelrad; //!< If true, display the Telrad ove rlay. bool flagShowTelrad; //!< If true, display the Te lrad overlay.
int usageMessageLabelID; //!< the id of the label showing the usage message. -1 means it's not displayed. int usageMessageLabelID; //!< the id of the label showing the usage message. -1 means it's not displayed.
int noEntitiesLabelID; //!< the id of the label showing that there are no telescopes or oclars. -1 means it's not displayed.
bool flagAzimuthalGrid; //!< Flag to track if AzimuthalGrid was displayed at activation. bool flagAzimuthalGrid; //!< Flag to track if AzimuthalGrid was displayed at activation.
bool flagEquatorGrid; //!< Flag to track if EquatorGrid wa s displayed at activation. bool flagEquatorGrid; //!< Flag to track if EquatorGrid wa s displayed at activation.
bool flagEquatorJ2000Grid; //!< Flag to track if EquatorJ2000Gr id was displayed at activation. bool flagEquatorJ2000Grid; //!< Flag to track if EquatorJ2000Gr id was displayed at activation.
bool flagEquatorLine; //!< Flag to track if EquatorLine wa s displayed at activation. bool flagEquatorLine; //!< Flag to track if EquatorLine wa s displayed at activation.
bool flagEclipticLine; //!< Flag to track if EclipticLine w as displayed at activation. bool flagEclipticLine; //!< Flag to track if EclipticLine w as displayed at activation.
bool flagMeridianLine; //!< Flag to track if MeridianLine w as displayed at activation. bool flagMeridianLine; //!< Flag to track if MeridianLine w as displayed at activation.
double ccdRotationAngle; //<! The angle to rotate the CCD bou nding box. */
double maxEyepieceAngle; //!< The maximum aFOV of any eyepiec e. double maxEyepieceAngle; //!< The maximum aFOV of any eyepiec e.
bool requireSelection; //!< Read from the ini file, whether an object is required to be selected to zoom in.
bool useMaxEyepieceAngle; //!< Read from the ini file, whether to scale the mask based aFOV. bool useMaxEyepieceAngle; //!< Read from the ini file, whether to scale the mask based aFOV.
QSignalMapper* ccdRotationSignalMapper; //<! Used to rotate the CCD
. */
QSignalMapper* ccdsSignalMapper; //<! Used to determine which CCD wa
s selected from the popup navigator. */
QSignalMapper* ocularsSignalMapper; //<! Used to determine which ocu
lar was selected from the popup navigator. */
QSignalMapper* telescopesSignalMapper; //<! Used to determine which
telescope was selected from the popup navigator. */
// for toolbar button // for toolbar button
QPixmap* pxmapGlow; QPixmap* pxmapGlow;
QPixmap* pxmapOnIcon; QPixmap* pxmapOnIcon;
QPixmap* pxmapOffIcon; QPixmap* pxmapOffIcon;
StelButton* toolbarButton; StelButton* toolbarButton;
OcularDialog *ocularDialog; OcularDialog *ocularDialog;
bool visible;
bool ready; //!< A flag that determines that this module is usable. If false, we won't open. bool ready; //!< A flag that determines that this module is usable. If false, we won't open.
bool newInstrument; //!< true the first time draw is called for a ne w ocular or telescope, false otherwise.
//Styles //Styles
QByteArray normalStyleSheet; QByteArray normalStyleSheet;
QByteArray nightStyleSheet; QByteArray nightStyleSheet;
}; };
#include "fixx11h.h" #include "fixx11h.h"
#include <QObject> #include <QObject>
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
 End of changes. 23 change blocks. 
38 lines changed or deleted 59 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/