#include <Iguana/GLBrowsers/interface/IgSceneManagerCategory.h>
Public Member Functions | |
virtual void | browserChanged (Ig3DBaseBrowser *browser) |
IgSceneManagerCategory (IgState *state) | |
~IgSceneManagerCategory () | |
Private Slots | |
virtual void | setBackgroundColor (const SbColor &color) |
virtual void | setBackgroundColor (void) |
virtual void | setRealTimeUpdate (bool option) |
virtual void | setRGBMode (bool option) |
Private Member Functions | |
void | addSceneManagerTab (void) |
IG_DECLARE_STATE_ELEMENT (IgSceneManagerCategory) | |
Private Attributes | |
QFrame * | m_background |
QCheckBox * | m_realTimeUpdate |
QCheckBox * | m_rgbMode |
Definition at line 24 of file IgSceneManagerCategory.h.
IgSceneManagerCategory::IgSceneManagerCategory | ( | IgState * | state | ) |
Definition at line 48 of file IgSceneManagerCategory.cc.
References addSceneManagerTab(), and IgState::put().
00049 : IgCommonViewCategory (state, "Scene Manager"), 00050 m_background (0), 00051 m_rgbMode (0), 00052 m_realTimeUpdate (0) 00053 { 00054 addSceneManagerTab (); 00055 state->put (s_key, this); 00056 }
IgSceneManagerCategory::~IgSceneManagerCategory | ( | void | ) |
Definition at line 58 of file IgSceneManagerCategory.cc.
References IgState::detach(), and IgControlCategory::state().
Definition at line 62 of file IgSceneManagerCategory.cc.
References reco::fitHelper::add(), IgControlCategory::bodyLayout(), IgControlCategory::bottomLayout(), HLT_VtxMuL3::connect, m_background, m_realTimeUpdate, m_rgbMode, IgControlCategory::panel(), setBackgroundColor(), setRealTimeUpdate(), setRGBMode(), IgControlCategory::topArea(), and IgControlCategory::topLayout().
Referenced by IgSceneManagerCategory().
00063 { 00064 QWidget *sceneManagerOptions = new QWidget (topArea ()); 00065 topLayout ()->addWidget (sceneManagerOptions); 00066 00067 QVBoxLayout *sceneManagerVLayout = new QVBoxLayout (sceneManagerOptions); 00068 QGridLayout *sceneManagerLayout = new QGridLayout (sceneManagerVLayout); 00069 00070 QVBoxLayout *bodyLayout = new QVBoxLayout (0, 0, 6, "bodyLayout"); 00071 00072 QHBoxLayout *topLayout = new QHBoxLayout (0, 0, 6, "topLayout"); 00073 00074 //Scene Manager background color 00075 QLabel *bgColLabel = new QLabel (sceneManagerOptions, "bgColLabel"); 00076 bgColLabel->setText (tr ("Background Color")); 00077 topLayout->addWidget (bgColLabel); 00078 00079 m_background = new QFrame (sceneManagerOptions, "m_background"); 00080 m_background->setMinimumSize (QSize (77, 0 )); 00081 m_background->setFrameShape (QFrame::StyledPanel); 00082 m_background->setFrameShadow (QFrame::Sunken); 00083 QSpacerItem* spacer1 = new QSpacerItem (21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 00084 topLayout->addItem (spacer1); 00085 topLayout->addWidget (m_background); 00086 QSpacerItem* spacer2 = new QSpacerItem (21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 00087 topLayout->addItem (spacer2); 00088 00089 QPushButton *selectColor = new QPushButton (sceneManagerOptions, "selectColor" ); 00090 selectColor->setText (tr ("&Select")); 00091 selectColor->setAccel (QKeySequence (tr ("Alt+S"))); 00092 topLayout->addWidget (selectColor); 00093 bodyLayout->addLayout (topLayout); 00094 00095 QVBoxLayout *bottomLayout = new QVBoxLayout (0, 0, 6, "bottomLayout"); 00096 00097 // Scene Manager RGB Mode 00098 m_rgbMode = new QCheckBox (sceneManagerOptions, "m_rgbMode"); 00099 m_rgbMode->setText (tr ("RGB Mode")); 00100 bottomLayout->addWidget (m_rgbMode); 00101 00102 // Real Time Update while animating 00103 m_realTimeUpdate = new QCheckBox (sceneManagerOptions, "m_realTimeUpdate"); 00104 m_realTimeUpdate->setText (tr ("Real Time Update")); 00105 bottomLayout->addWidget (m_realTimeUpdate); 00106 bodyLayout->addLayout (bottomLayout); 00107 00108 sceneManagerLayout->addLayout (bodyLayout, 0, 0); 00109 QSpacerItem *spacer = new QSpacerItem (20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding); 00110 sceneManagerVLayout->addItem (spacer); 00111 00112 connect (selectColor, SIGNAL (clicked (void)), 00113 this, SLOT (setBackgroundColor(void))); 00114 connect (m_rgbMode, SIGNAL (toggled (bool)), 00115 this, SLOT (setRGBMode(bool))); 00116 connect (m_realTimeUpdate, SIGNAL (toggled (bool)), 00117 this, SLOT (setRealTimeUpdate(bool))); 00118 00119 // Add tooltips and what's this information 00120 QWhatsThis::add (bgColLabel, 00121 "Change the back ground color."); 00122 QWhatsThis::add (selectColor, 00123 "Change the back ground color."); 00124 QWhatsThis::add (m_background, 00125 "Change the back ground color."); 00126 QWhatsThis::add (m_rgbMode, 00127 "Turn RGB truecolor mode on or off. If you turn truecolor mode off, " 00128 "colorindex mode will be used instead."); 00129 00130 QWhatsThis::add (m_realTimeUpdate, 00131 "Set whether or not for SoSceneManager instances to \"touch\" the " 00132 "global realTime field after a redraw. If this is not done, redrawing " 00133 "when animating the scene will only happen as fast as the realTime " 00134 "interval goes (which defaults to 12 times a second)."); 00135 QWhatsThis::add (panel (), "Edit 3D scene manager properties"); 00136 QWhatsThis::add (sceneManagerOptions, "Edit 3D scene manager properties"); 00137 }
void IgSceneManagerCategory::browserChanged | ( | Ig3DBaseBrowser * | browser | ) | [virtual] |
Reimplemented from IgCommonViewCategory.
Definition at line 140 of file IgSceneManagerCategory.cc.
References IgCommonViewCategory::browserChanged(), m_background, m_realTimeUpdate, m_rgbMode, and IgCommonViewCategory::m_source.
00141 { 00142 if (source) 00143 { 00144 IgCommonViewCategory::browserChanged (source); 00145 SbColor color (m_source->getSceneManager ()->getBackgroundColor ()); 00146 QColor color1; 00147 color1.setRgb (int (color [0] * 255), 00148 int (color [1] * 255), 00149 int (color [2] * 255)); 00150 m_background->setPaletteBackgroundColor (color1); 00151 m_rgbMode->setChecked (m_source->getSceneManager ()->isRGBMode ()); 00152 m_realTimeUpdate->setChecked (m_source->getSceneManager ()->isRealTimeUpdateEnabled ()); 00153 } 00154 }
IgSceneManagerCategory::IG_DECLARE_STATE_ELEMENT | ( | IgSceneManagerCategory | ) | [private] |
void IgSceneManagerCategory::setBackgroundColor | ( | const SbColor & | color | ) | [private, virtual, slot] |
Definition at line 175 of file IgSceneManagerCategory.cc.
References IgCommonViewCategory::m_source.
00176 { m_source->getSceneManager ()->setBackgroundColor (color); }
Definition at line 158 of file IgSceneManagerCategory.cc.
References m_background, and IgCommonViewCategory::m_source.
Referenced by addSceneManagerTab().
00159 { 00160 QColor color = 00161 QColorDialog::getColor (m_background->paletteBackgroundColor (), 00162 m_source->getShellWidget (), 00163 "Select color"); 00164 if (color.isValid ()) 00165 { 00166 m_background->setPaletteBackgroundColor (color); 00167 setBackgroundColor (SbColor (color.red () / 255., 00168 color.green () / 255., 00169 color.blue () / 255.)); 00170 } 00171 }
Definition at line 187 of file IgSceneManagerCategory.cc.
References IgCommonViewCategory::m_source, and old.
Referenced by addSceneManagerTab().
00188 { 00189 bool old = m_source->getSceneManager ()->isRealTimeUpdateEnabled (); 00190 if (old != option) 00191 m_source->getSceneManager ()->enableRealTimeUpdate (option); 00192 }
Definition at line 179 of file IgSceneManagerCategory.cc.
References IgCommonViewCategory::m_source, and old.
Referenced by addSceneManagerTab().
00180 { 00181 bool old = m_source->getSceneManager ()->isRGBMode (); 00182 if (old != option) 00183 m_source->getSceneManager ()->setRGBMode (option); 00184 }
QFrame* IgSceneManagerCategory::m_background [private] |
Definition at line 45 of file IgSceneManagerCategory.h.
Referenced by addSceneManagerTab(), browserChanged(), and setBackgroundColor().
QCheckBox* IgSceneManagerCategory::m_realTimeUpdate [private] |
Definition at line 47 of file IgSceneManagerCategory.h.
Referenced by addSceneManagerTab(), and browserChanged().
QCheckBox* IgSceneManagerCategory::m_rgbMode [private] |
Definition at line 46 of file IgSceneManagerCategory.h.
Referenced by addSceneManagerTab(), and browserChanged().