VR-Forces 4.0.4 Class Documentation
include/vrfGuiCoreQt/DtRangeRingsOptionsWidget.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2011 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00008 
00009 #pragma once
00010 
00011 #include <vrvUtil/signalslib.h>
00012 #include <vrfGuiCore/DtRangeRingsSettingsRecord.h>
00013 #include <vrfGuiCoreQt/vrfGuiCoreQt.h>
00014 #include <vrvUtil/DtSignalConnectionManager.h>
00015 
00016 #include <QtGui/QWidget>
00017 
00018 class QVBoxLayout;
00019 class QCheckBox;
00020 class QListWidget;
00021 class QGroupBox;
00022 class QHBoxLayout;
00023 class QPushButton;
00024 class QListWidgetItem;
00025 class QComboBox;
00026 class QLabel;
00027 class QSpinBox;
00028 class QFrame;
00029 
00031 //
00033 
00034 namespace makVrv
00035 {
00036    class DtDe;
00037    class DtPersistenceControlsInterface;
00038 }
00039 
00040 namespace makVrf
00041 {
00042    class DtRangeRingsOptionsWidget;
00043    class DtRangeRingEntry;
00044 
00045    class DT_DLL_VRFGUICOREQT DtRangeRingsOptionsWidgetLogic
00046    {
00047    public:
00049       DtRangeRingsOptionsWidgetLogic(makVrv::DtDe& de, DtRangeRingsOptionsWidget& iFace,
00050          makVrv::DtPersistenceControlsInterface& toolbar);
00051          
00053       virtual ~DtRangeRingsOptionsWidgetLogic();
00054 
00055    protected: //Receive boost signals from interface class
00056       virtual void on_colorChanged(int type, QColor color, const QString& label);
00057       virtual void on_addInstance(int type, int color, const QString& label);
00058       virtual void on_toggleRangeSphere(bool onOff);
00059       virtual void on_toggleWeaponNameLabel( bool onOff );
00060       virtual void on_toggleEntityNameLabel( bool onOff );
00061       virtual void on_toggleRangeValueLabel( bool onOff );
00062 
00063 
00064    protected:
00065       virtual void setupFromOptions(const DtRangeRingsSettingsRecord&);
00066 
00068       virtual void on_import();
00069       virtual void on_export();
00070       virtual void on_defaultsRestored();
00071       virtual void on_importFilePathChosen(const std::string& filePath);
00072       virtual void on_exportFilePathChosen(const std::string& filePath);
00073 
00074    protected:
00075       makVrv::DtDe&                             myDe;
00076       DtRangeRingsOptionsWidget&                myInterface;
00077       makVrv::DtPersistenceControlsInterface&   myToolbarInterface;
00078       makVrv::DtSignalConnectionManager         myConnectionManager;
00079    };
00080 
00081    class DT_DLL_VRFGUICOREQT DtRangeRingsOptionsWidget : public QWidget
00082    {
00083       Q_OBJECT
00084 
00085    public:
00086 
00088       DtRangeRingsOptionsWidget(makVrv::DtDe& de, QWidget* parent = NULL, const Qt::WindowFlags& flags = 0 );
00089 
00091       virtual ~DtRangeRingsOptionsWidget();
00092 
00093       //Accessors & mutators for dialog elements
00094 
00095       virtual void clearRangeRingTypes();
00096       virtual void addRangeRingType(int type, const DtRangeRingsSettingsRecord::ColorOption&);
00097 
00098       virtual bool showRangeSphere();
00099       virtual void setShowRangeSphere( bool onOff );
00100 
00101       virtual bool showWeaponNameLabel();
00102       virtual void setShowWeaponNameLabel( bool onOff );
00103 
00104       virtual bool showEntityNameLabel();
00105       virtual void setShowEntityNameLabel( bool onOff );
00106 
00107       virtual bool showRangeValueLabel();
00108       virtual void setShowRangeValueLabel( bool onOff );
00109 
00110    protected:
00111 
00112       void setupGui();
00113 
00114    public slots: //Qt slots used as intermediaries between Qt signals and Boost signal classes
00115 
00116       virtual void on_colorChanged();
00117       virtual void on_toggleRangeSphere(bool onOff);
00118       virtual void on_toggleWeaponNameLabel( bool onOff );
00119       virtual void on_toggleEntityNameLabel( bool onOff );
00120       virtual void on_toggleRangeValueLabel( bool onOff );
00121 
00122       //Used to re-emit QT signals up to logic class
00123    public:
00124       boost::signal<void (int, QColor, QString)> signal_colorChanged;
00125       boost::signal<void (bool)> signal_toggleRangeSphere;
00126       boost::signal<void (bool)> signal_toggleWeaponNameLabel;
00127       boost::signal<void (bool)> signal_toggleEntityNameLabel;
00128       boost::signal<void (bool)> signal_toggleRangeValueLabel;
00129 
00130    private:
00132       DtRangeRingsOptionsWidget(const DtRangeRingsOptionsWidget& orig);
00133 
00135       DtRangeRingsOptionsWidget& operator=(const DtRangeRingsOptionsWidget& rhs);
00136 
00137       QCheckBox* myToggleRangeSphereCheckBox;
00138       QCheckBox* myShowWeaponNameLabelCheckBox;
00139       QCheckBox* myShowEntityNameLabelCheckBox;
00140       QCheckBox* myShowRangeValueLabelCheckBox;
00141 
00142       QListWidget* myRangeRingTypesList;
00143 
00144       makVrv::DtDe& myDe;
00145    };
00146 
00149 
00150    class DT_DLL_VRFGUICOREQT DtRangeRingEntry : public QWidget
00151    {
00152       Q_OBJECT
00153 
00154    public:
00155 
00157       DtRangeRingEntry( int ringType , const DtRangeRingsSettingsRecord::ColorOption& rangeRingInfo );
00158 
00160       virtual ~DtRangeRingEntry();
00161 
00162    public: //Accessors
00163 
00164       virtual QColor ringColor();
00165       virtual bool useForceColor();
00166       virtual double ringAlphaF();
00167       virtual int rangeRingType();
00168       virtual QString ringLabel();
00169       
00170    signals:
00171       //Signals on changes to RGB value, Alpha or toggling Use Force Color
00172       void signalColorChanged();
00173 
00174    protected:
00175 
00176       void setupGui( QString ringTypeLabel, QColor colorFromRecord );
00177       void setButtonColor();
00178            
00179    public slots: //Qt slots
00180 
00181       //creates a color choosing dialog and populates myUserDefinedRgb with it
00182       virtual void chooseColor();
00183       //updates widget coloring and triggers signal
00184       virtual void slotColorChanged();
00185       
00186    protected:
00187 
00188       int myRangeRingType;
00189       QColor myUserDefinedRgb;
00190 
00191       QHBoxLayout* mainLayout;
00192       QLabel* lineItemLabel;
00193       QComboBox* useForceColorBox;
00194       QPushButton* colorButton;
00195       QSpinBox* alphaSpinBox;
00196       QFrame* colorButtonBackground;
00197    };
00198 
00199 };

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)