Oculars.hpp   Oculars.hpp 
/* /*
* Copyright (C) 2009 Timothy Reaves * Copyright (C) 2009 Timothy Reaves
* Copyright (C) 2011 Bogdan Marinov
* *
* 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.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _OCULARS_HPP_ #ifndef _OCULARS_HPP_
#define _OCULARS_HPP_ #define _OCULARS_HPP_
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelModule.hpp" #include "StelModule.hpp"
#include "OcularDialog.hpp" #include "OcularDialog.hpp"
#include "CCD.hpp" #include "CCD.hpp"
#include "Ocular.hpp" #include "Ocular.hpp"
#include "Telescope.hpp" #include "Telescope.hpp"
#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 QAction;
class QKeyEvent; class QKeyEvent;
class QMenu;
class QMouseEvent; class QMouseEvent;
class QPixmap; class QPixmap;
class QSettings; class QSettings;
class QSignalMapper; 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 //! Main class of the Oculars plug-in.
class Oculars : public StelModule class Oculars : public StelModule
{ {
Q_OBJECT Q_OBJECT
//BM: Temporary, until the GUI is finalized and some other method of
getting
//info from the main class is implemented.
friend class OcularsGuiPanel;
public: public:
Oculars(); Oculars();
virtual ~Oculars(); virtual ~Oculars();
static QSettings* appSettings(); static QSettings* appSettings();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void deinit(); virtual void deinit();
skipping to change at line 72 skipping to change at line 78
//! 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);
//! This method is needed because the MovementMgr classes handleKeys () method consumes the 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 //! Because we want the ocular view to track, we must intercept & pr ocess ourselves. Only called
//! while flagShowOculars or flagShowCCD == true. //! while flagShowOculars or flagShowCCD == true.
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 void update(double) {;} virtual void update(double) {;}
public slots: public slots:
//! Update the ocular, telescope and sensor lists after the removal
of a member.
//! Necessary because of the way model/view management in the Ocular
Dialog
//! is implemented.
void updateLists();
void ccdRotationReset(); void ccdRotationReset();
void decrementCCDIndex(); void decrementCCDIndex();
void decrementOcularIndex(); void decrementOcularIndex();
void decrementTelescopeIndex(); void decrementTelescopeIndex();
void displayPopupMenu(); void displayPopupMenu();
//! This method is called with we detect that our hot key is pressed . It handles //! 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. //! determining if we should do anything - based on a selected objec t.
void enableOcular(bool b); 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 rotateCCD(QString amount); //!< amount must be a number.
void selectCCDAtIndex(QString indexString); //<! indexString must be void selectCCDAtIndex(QString indexString); //!< indexString must be
an integer, in the range of -1:ccds.count() an integer, in the range of -1:ccds.count()
void selectOcularAtIndex(QString indexString); //<! indexString mus void selectOcularAtIndex(QString indexString); //!< indexString mus
t be an integer, in the range of -1:oculars.count() t be an integer, in the range of -1:oculars.count()
void selectTelescopeAtIndex(QString indexString); //<! indexString void selectTelescopeAtIndex(QString indexString); //!< indexString
must be an integer, in the range of -1:telescopes.count() must be an integer, in the range of -1:telescopes.count()
//! Toggles the sensor frame overlay.
void toggleCCD(bool show);
//! Toggles the sensor frame overlay (overloaded for blind switching
).
void toggleCCD(); void toggleCCD();
void toggleCrosshair(); void toggleCrosshairs(bool show = true);
//! Toggles the Telrad sight overlay.
void toggleTelrad(bool show);
//! Toggles the Telrad sight overlay (overloaded for blind switching
).
void toggleTelrad(); void toggleTelrad();
void enableGuiPanel(bool enable = true);
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 setRequireSelection(bool state);
void setScaleImageCircle(bool state); void setScaleImageCircle(bool state);
void setScreenFOVForCCD(); void setScreenFOVForCCD();
void retranslateGui();
void setStelStyle(const QString& style); void setStelStyle(const QString& style);
private: private:
//! Set up the Qt actions needed to activate the plugin. //! Set up the Qt actions needed to activate the plugin.
void initializeActivationActions(); void initializeActivationActions();
//! Returns TRUE if at least one bincular is defined. //! Returns TRUE if at least one bincular is defined.
bool isBinocularDefined(); bool isBinocularDefined();
//! Reneders the CCD bounding box on-screen. A telescope must be se lected, or this call does nothing. //! Reneders the CCD bounding box on-screen. A telescope must be se lected, or this call does nothing.
skipping to change at line 144 skipping to change at line 162
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 zoomedIn if true, this zoom operation is starting from an already 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 zoomedIn); 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();
void hideUsageMessageIfDisplayed();
//! Creates the sub-menu listing telescopes in the pop-up menu.
QMenu* addTelescopeSubmenu(QMenu* parent);
//! 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; //<! index of the current CCD, in the range of int selectedCCDIndex; //!< index of the current CCD, in the range of
-1:ccds.count(). -1 means no CCD is selected. -1:ccds.count(). -1 means no CCD is selected.
int selectedOcularIndex; //<! index of the current ocular, in the ra int selectedOcularIndex; //!< index of the current ocular, in the ra
nge of -1:oculars.count(). -1 means no ocular is selected. nge of -1:oculars.count(). -1 means no ocular is selected.
int selectedTelescopeIndex; //<! index of the current telescope, in int selectedTelescopeIndex; //!< index of the current telescope, in
the range of -1:telescopes.count(). -1 means none is selected. 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 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 Te lrad overlay. 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.
bool flagAzimuthalGrid; //!< Flag to track if AzimuthalGrid was displayed at activation. bool flagAzimuthalGrid; //!< Flag to track if AzimuthalGrid was displayed at activation.
bool flagGalacticGrid; //!< Flag to track if GalacticGrid w as 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.
bool flagHorizonLine; //!< Flag to track if HorizonLine wa
s displayed at activation.
bool flagGalacticPlaneLine; //!< Flag to track if GalacticPlaneL
ine was displayed at activation.
double ccdRotationAngle; //<! The angle to rotate the CCD bou nding box. */ 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 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.
//! Display the GUI control panel
bool guiPanelEnabled;
QSignalMapper* ccdRotationSignalMapper; //<! Used to rotate the CCD QSignalMapper* ccdRotationSignalMapper; //!< Used to rotate the CCD
. */ . */
QSignalMapper* ccdsSignalMapper; //<! Used to determine which CCD wa QSignalMapper* ccdsSignalMapper; //!< Used to determine which CCD wa
s selected from the popup navigator. */ s selected from the popup navigator. */
QSignalMapper* ocularsSignalMapper; //<! Used to determine which ocu QSignalMapper* ocularsSignalMapper; //!< Used to determine which ocu
lar was selected from the popup navigator. */ lar was selected from the popup navigator. */
QSignalMapper* telescopesSignalMapper; //<! Used to determine which QSignalMapper* telescopesSignalMapper; //!< Used to determine which
telescope was selected from the popup navigator. */ 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 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.
QAction* actionShowOcular;
QAction* actionShowCrosshairs;
QAction* actionShowSensor;
QAction* actionShowTelrad;
QAction* actionConfiguration;
QAction* actionMenu;
class OcularsGuiPanel* guiPanel;
//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"
//! This class is used by Qt to manage a plug-in interface //! This class is used by Qt to manage a plug-in interface
 End of changes. 19 change blocks. 
25 lines changed or deleted 69 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/