Oculars.hpp   Oculars.hpp 
skipping to change at line 23 skipping to change at line 23
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * 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 "StelModule.hpp"
#include "OcularDialog.hpp"
#include "CCD.hpp" #include "CCD.hpp"
#include "Lens.hpp"
#include "Ocular.hpp" #include "Ocular.hpp"
#include "OcularDialog.hpp"
#include "StelModule.hpp"
#include "StelTexture.hpp"
#include "Telescope.hpp" #include "Telescope.hpp"
#include "Lens.hpp" #include "VecMath.hpp"
#include <QFont> #include <QFont>
#include <QSettings> #include <QSettings>
#define MIN_OCULARS_INI_VERSION 0.12 #define MIN_OCULARS_INI_VERSION 2
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QAction;
class QKeyEvent; class QKeyEvent;
class QMenu; 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;
class StelAction;
//! Main class of the Oculars plug-in. //! 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 //BM: Temporary, until the GUI is finalized and some other method of getting
//info from the main class is implemented. //info from the main class is implemented.
friend class OcularsGuiPanel; 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();
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
virtual void draw(StelCore* core, class StelRenderer* renderer); 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);
//! 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) {;}
skipping to change at line 122 skipping to change at line 123
//! Toggles the Telrad sight overlay (overloaded for blind switching ). //! Toggles the Telrad sight overlay (overloaded for blind switching ).
void toggleTelrad(); void toggleTelrad();
void enableGuiPanel(bool enable = true); void enableGuiPanel(bool enable = true);
void setFlagDecimalDegrees(const bool b); void setFlagDecimalDegrees(const bool b);
bool getFlagDecimalDegrees(void) const; bool getFlagDecimalDegrees(void) const;
void setFlagLimitMagnitude(const bool b); void setFlagLimitMagnitude(const bool b);
bool getFlagLimitMagnitude(void) const; bool getFlagLimitMagnitude(void) const;
void setFlagInitFovUsage(const bool b);
bool getFlagInitFovUsage(void) const;
signals: signals:
void selectedCCDChanged(); void selectedCCDChanged();
void selectedOcularChanged(); void selectedOcularChanged();
void selectedTelescopeChanged(); void selectedTelescopeChanged();
void selectedLensChanged(); void selectedLensChanged();
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 retranslateGui();
void setStelStyle(const QString& style); void setStelStyle(const QString& style);
void updateOcularReticle(void);
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.
void paintCCDBounds(class StelRenderer* renderer); void paintCCDBounds();
//! Renders crosshairs into the viewport. //! Renders crosshairs into the viewport.
void paintCrosshairs(class StelRenderer* renderer); void paintCrosshairs();
//! Paint the mask into the viewport. //! Paint the mask into the viewport.
void paintOcularMask(class StelRenderer* renderer); void paintOcularMask(const StelCore * core);
//! Renders the three Telrad circles, but only if not in ocular mode . //! Renders the three Telrad circles, but only if not in ocular mode .
void paintTelrad(class StelRenderer* renderer); 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, StelRenderer* renderer); 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.
skipping to change at line 232 skipping to change at line 237
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 flagLimitMagnitude; //!< Read from the ini file, whether a magnitude is required to be limited. bool flagLimitMagnitude; //!< Read from the ini file, whether a magnitude is required to be limited.
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 //! Display the GUI control panel
bool guiPanelEnabled; bool guiPanelEnabled;
bool flagDecimalDegrees; bool flagDecimalDegrees;
QSignalMapper* ccdRotationSignalMapper; //!< Used to rotate the CCD QSignalMapper * ccdRotationSignalMapper; //!< Used to rotate the CC
. */ D. */
QSignalMapper* ccdsSignalMapper; //!< Used to determine which CCD wa QSignalMapper * ccdsSignalMapper; //!< Used to determine which CCD w
s selected from the popup navigator. */ as selected from the popup navigator. */
QSignalMapper* ocularsSignalMapper; //!< Used to determine which ocu QSignalMapper * ocularsSignalMapper; //!< Used to determine which oc
lar was selected from the popup navigator. */ ular 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. */
QSignalMapper* lenseSignalMapper; //!< Used to determine which lens QSignalMapper * lenseSignalMapper; //!< Used to determine which lens
was selected from the popup navigator */ 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; StelAction * actionShowOcular;
QAction* actionShowCrosshairs; StelAction * actionShowCrosshairs;
QAction* actionShowSensor; StelAction * actionShowSensor;
QAction* actionShowTelrad; StelAction * actionShowTelrad;
QAction* actionConfiguration; StelAction * actionConfiguration;
QAction* actionMenu; StelAction * actionMenu;
QAction* actionTelescopeIncrement; StelAction * actionTelescopeIncrement;
QAction* actionTelescopeDecrement; StelAction * actionTelescopeDecrement;
QAction* actionOcularIncrement; StelAction * actionOcularIncrement;
QAction* actionOcularDecrement; StelAction * actionOcularDecrement;
class OcularsGuiPanel* guiPanel; class OcularsGuiPanel * guiPanel;
//Styles //Styles
QByteArray normalStyleSheet; QByteArray normalStyleSheet;
QByteArray nightStyleSheet; QByteArray nightStyleSheet;
//Reticle
StelTextureSP reticleTexture;
double actualFOV; //!< Holds the FOV of the ocular/tescope/len
s cobination; what the screen is zoomed to.
double initialFOV; //!< Holds the initial FOV
bool flagInitFOVUsage; //!< Flag used to track if we use default in
itial FOV (value at the startup of planetarium).
double reticleRotation;
}; };
#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
class OcularsStelPluginInterface : public QObject, public StelPluginInterfa ce class OcularsStelPluginInterface : public QObject, public StelPluginInterfa ce
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "stellarium.StelGuiPluginInterface/1.0")
Q_INTERFACES(StelPluginInterface) Q_INTERFACES(StelPluginInterface)
public: public:
virtual StelModule* getStelModule() const; virtual StelModule* getStelModule() const;
virtual StelPluginInfo getPluginInfo() const; virtual StelPluginInfo getPluginInfo() const;
}; };
#endif /*_OCULARS_HPP_*/ #endif /*_OCULARS_HPP_*/
 End of changes. 22 change blocks. 
38 lines changed or deleted 52 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/