- Added ColorModes

- ColorModes consistency between different windows
This commit is contained in:
Paolo Cignoni cignoni 2005-12-23 20:21:16 +00:00
parent 9498125125
commit c0718e321f
3 changed files with 61 additions and 5 deletions

View File

@ -23,6 +23,10 @@
/****************************************************************************
History
$Log$
Revision 1.52 2005/12/23 20:21:16 glvertex
- Added ColorModes
- ColorModes consistency between different windows
Revision 1.51 2005/12/22 20:01:23 glvertex
- Added support for more than one shader
- Some methods renamed
@ -130,6 +134,7 @@ private slots:
void setLight();
void setDoubleLighting();
void setFancyLighting();
void setColorMode(QAction *qa);
void applyRenderMode();
void applyColorMode();
void applyEditMode();
@ -226,6 +231,11 @@ private:
QAction *setFancyLightingAct;
QAction *setLightAct;
QAction *backFaceCullAct;
QActionGroup *colorModeGroupAct;
QAction *colorModeNoneAct;
QAction *colorModePerVertexAct;
QAction *colorModePerFaceAct;
///////////Action Menu View ////////////////////////
QAction *fullScreenAct;
QAction *showToolbarStandardAct;

View File

@ -24,6 +24,10 @@
History
$Log$
Revision 1.33 2005/12/23 20:21:16 glvertex
- Added ColorModes
- ColorModes consistency between different windows
Revision 1.32 2005/12/22 20:01:23 glvertex
- Added support for more than one shader
- Some methods renamed
@ -528,18 +532,41 @@ void MainWindow::createMenus()
//////////////////// Menu Render //////////////////////////////////////////////////////////////////////////
renderMenu = menuBar()->addMenu(tr("&Render"));
renderModeMenu=renderMenu->addMenu(tr("Render Mode"));
renderModeMenu=renderMenu->addMenu(tr("Render &Mode"));
renderModeMenu->addAction(backFaceCullAct);
renderModeMenu->addActions(renderModeGroupAct->actions());
renderModeMenu->addAction(renderModeTextureAct);
lightingModeMenu=renderMenu->addMenu(tr("Lighting"));
lightingModeMenu=renderMenu->addMenu(tr("&Lighting"));
lightingModeMenu->addAction(setLightAct);
lightingModeMenu->addAction(setDoubleLightingAct);
lightingModeMenu->addAction(setFancyLightingAct);
colorModeMenu = renderMenu->addMenu(tr("Color"));
shadersMenu = renderMenu->addMenu(tr("Shaders"));
// Color SUBmenu
colorModeMenu = renderMenu->addMenu(tr("&Color"));
colorModeGroupAct = new QActionGroup(this); colorModeGroupAct->setExclusive(true);
colorModeNoneAct = new QAction(QString("&None"),colorModeGroupAct);
colorModeNoneAct->setCheckable(true);
colorModeNoneAct->setChecked(true);
colorModePerVertexAct = new QAction(QString("Per &Vertex"),colorModeGroupAct);
colorModePerVertexAct->setCheckable(true);
colorModePerFaceAct = new QAction(QString("Per &Face"),colorModeGroupAct);
colorModePerFaceAct->setCheckable(true);
colorModeMenu->addAction(colorModeNoneAct);
colorModeMenu->addAction(colorModePerVertexAct);
colorModeMenu->addAction(colorModePerFaceAct);
connect(colorModeGroupAct, SIGNAL(triggered(QAction *)), this, SLOT(setColorMode(QAction *)));
// Shaders SUBmenu
shadersMenu = renderMenu->addMenu(tr("&Shaders"));
shadersMenu->addAction("None",this,SLOT(applyRenderMode()));
//////////////////// Menu View ////////////////////////////////////////////////////////////////////////////

View File

@ -24,6 +24,10 @@
History
$Log$
Revision 1.57 2005/12/23 20:21:16 glvertex
- Added ColorModes
- ColorModes consistency between different windows
Revision 1.56 2005/12/23 02:18:05 buzzelli
setting color mode according to kind of data found into opened file
@ -416,6 +420,14 @@ void MainWindow::updateWindowMenu()
++i;
}
}
void MainWindow::setColorMode(QAction *qa)
{
if(qa->text() == tr("&None")) GLA()->setColorMode(GLW::CMNone);
if(qa->text() == tr("Per &Vertex")) GLA()->setColorMode(GLW::CMPerVert);
if(qa->text() == tr("Per &Face")) GLA()->setColorMode(GLW::CMPerFace);
}
void MainWindow::updateMenus()
{
bool active = (bool)workspace->activeWindow();
@ -455,6 +467,14 @@ void MainWindow::updateMenus()
break;
}
switch (rm.colorMode)
{
case GLW::CMNone: colorModeNoneAct->setChecked(true); break;
case GLW::CMPerVert: colorModePerVertexAct->setChecked(true); break;
case GLW::CMPerFace: colorModePerFaceAct->setChecked(true); break;
}
showLogAct->setChecked(GLA()->isLogVisible());
showInfoPaneAct->setChecked(GLA()->isInfoAreaVisible());
showTrackBallAct->setChecked(GLA()->isTrackBallVisible());
@ -519,7 +539,6 @@ void MainWindow::applyRenderMode()
GLA()->setRenderer(0,0); //vertex and fragment programs not supported
GLA()->log.Log(GLLogStream::Warning,"Shader not supported!");
}
}