diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index ed40c1a1c..3714350f0 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -213,10 +213,10 @@ void GLArea::drawGradient() glDisable(GL_TEXTURE_2D); glBegin(GL_TRIANGLE_STRIP); - glColor(cs.bColorTop); glVertex2f(-1, 1); - glColor(cs.bColorBottom); glVertex2f(-1,-1); - glColor(cs.bColorTop); glVertex2f( 1, 1); - glColor(cs.bColorBottom); glVertex2f( 1,-1); + glColor(glas.backgroundTopColor); glVertex2f(-1, 1); + glColor(glas.backgroundBotColor); glVertex2f(-1,-1); + glColor(glas.backgroundTopColor); glVertex2f( 1, 1); + glColor(glas.backgroundBotColor); glVertex2f( 1,-1); glEnd(); glPopAttrib(); @@ -394,8 +394,7 @@ void GLArea::displayInfo() qFont.setPixelSize(12); glBlendFunc(GL_ONE,GL_SRC_ALPHA); - cs.lColor.V(3) = 128; // set half alpha value - glColor(cs.lColor); + glColor(glas.logAreaColor); int lineNum =4; float lineSpacing = qFont.pixelSize()*1.5f; float barHeight = -1 + 2.0*(lineSpacing*(lineNum+.25))/float(curSiz.height()); @@ -811,8 +810,7 @@ void GLArea::setSelectionRendering(bool enabled) void GLArea::setLightModel() { - glDisable(GL_LIGHTING); - if (rm.lighting) + if (rm.lighting) { glEnable(GL_LIGHTING); @@ -821,27 +819,20 @@ void GLArea::setLightModel() else glDisable(GL_LIGHT1); - if(rm.fancyLighting) - { - glLightfv(GL_LIGHT0, GL_AMBIENT, ls.ambientFancyFront); - glLightfv(GL_LIGHT0, GL_DIFFUSE, ls.diffuseFancyFront); - glLightfv(GL_LIGHT0, GL_SPECULAR, ls.specularFancyFront); + glLightfv(GL_LIGHT0, GL_AMBIENT, Color4f::Construct(glas.baseLightAmbientColor).V()); + glLightfv(GL_LIGHT0, GL_DIFFUSE, Color4f::Construct(glas.baseLightDiffuseColor).V()); + glLightfv(GL_LIGHT0, GL_SPECULAR,Color4f::Construct(glas.baseLightSpecularColor).V()); - glLightfv(GL_LIGHT1, GL_AMBIENT, ls.ambientFancyBack); - glLightfv(GL_LIGHT1, GL_DIFFUSE, ls.diffuseFancyBack); - glLightfv(GL_LIGHT1, GL_SPECULAR, ls.specularFancyBack); - } - else - { - glLightfv(GL_LIGHT0, GL_AMBIENT, ls.ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, ls.diffuse); - glLightfv(GL_LIGHT0, GL_SPECULAR, ls.specular); - - glLightfv(GL_LIGHT1, GL_AMBIENT, ls.ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, ls.diffuse); - glLightfv(GL_LIGHT1, GL_SPECULAR, ls.specular); + glLightfv(GL_LIGHT1, GL_AMBIENT, Color4f::Construct(glas.baseLightAmbientColor).V()); + glLightfv(GL_LIGHT1, GL_DIFFUSE, Color4f::Construct(glas.baseLightDiffuseColor).V()); + glLightfv(GL_LIGHT1, GL_SPECULAR,Color4f::Construct(glas.baseLightSpecularColor).V()); + if(rm.fancyLighting) + { + glLightfv(GL_LIGHT0, GL_DIFFUSE, Color4f::Construct(glas.fancyFLightDiffuseColor).V()); + glLightfv(GL_LIGHT1, GL_DIFFUSE, Color4f::Construct(glas.fancyBLightDiffuseColor).V()); } } + else glDisable(GL_LIGHTING); } void GLArea::setSnapshotSetting(const SnapshotSetting & s) @@ -976,15 +967,11 @@ Point3f GLArea::getViewDir() void GLArea::updateCustomSettingValues( RichParameterSet& rps ) { - cs.bColorBottom = rps.getColor4b(GLArea::BackGroundBotParam()); - cs.bColorTop = rps.getColor4b(GLArea::BackGroundTopParam()); - cs.lColor = rps.getColor4b(GLArea::LogAreaColParam()); - updateGL(); + glas.updateGlobalParameterSet(rps); + this->update(); } void GLArea::initGlobalParameterSet( RichParameterSet * defaultGlobalParamSet) { - defaultGlobalParamSet->addParam(new RichColor(GLArea::BackGroundBotParam(),QColor(128,128,255),"MeshLab GLarea's BackGround Color(bottom corner)","MeshLab GLarea's BackGround Color(bottom corner)")); - defaultGlobalParamSet->addParam(new RichColor(GLArea::BackGroundTopParam(),QColor(0,0,0),"MeshLab GLarea's BackGround Color(top corner)","MeshLab GLarea's BackGround Color(top corner)")); - defaultGlobalParamSet->addParam(new RichColor(GLArea::LogAreaColParam(),QColor(255,32,32),"MeshLab GLarea's BackGround Color(bottom corner)","MeshLab GLarea's BackGround Color(bottom corner)")); + GLAreaSetting::initGlobalParameterSet(defaultGlobalParamSet); } diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 9d4891b9c..bf2d7f1ef 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -40,88 +40,13 @@ #include "interfaces.h" #include "filterscript.h" #include "layerDialog.h" +#include "glarea_setting.h" #define SSHOT_BYTES_PER_PIXEL 4 enum LightingModel{LDOUBLE,LFANCY}; - -class GLLightSetting -{ -public: - - GLfloat ambient[4]; - GLfloat diffuse[4]; - GLfloat specular[4]; - - GLfloat ambientFancyBack[4]; - GLfloat diffuseFancyBack[4]; - GLfloat specularFancyBack[4]; - - GLfloat ambientFancyFront[4]; - GLfloat diffuseFancyFront[4]; - GLfloat specularFancyFront[4]; - - GLLightSetting() - { - // defaults - ambient[0] = 0.2f; ambient[1] = 0.2f; ambient[2] = 0.2f; ambient[3] = 1.0f; - diffuse[0] = 0.8f; diffuse[1] = 0.8f; diffuse[2] = 0.8f; diffuse[3] = 1.0f; - specular[0] = 1.0f; specular[1] = 1.0f; specular[2] = 1.0f; specular[3] = 1.0f; - - ambientFancyBack[0] = 0.0f; - ambientFancyBack[1] = 0.0f; - ambientFancyBack[2] = 0.0f; - ambientFancyBack[3] = 1.0f; - - diffuseFancyBack[0] = 1.0f; - diffuseFancyBack[1] = 0.7f; - diffuseFancyBack[2] = 0.7f; - diffuseFancyBack[3] = 1.0f; - - specularFancyBack[0] = 1.0f; - specularFancyBack[1] = 1.0f; - specularFancyBack[2] = 1.0f; - specularFancyBack[3] = 1.0f; - - ambientFancyFront[0] = 0.0f; - ambientFancyFront[1] = 0.0f; - ambientFancyFront[2] = 0.0f; - ambientFancyFront[3] = 1.0f; - - diffuseFancyFront[0] = 0.7f; - diffuseFancyFront[1] = 0.7f; - diffuseFancyFront[2] = 1.0f; - diffuseFancyFront[3] = 1.0f; - - specularFancyFront[0] = 1.0f; - specularFancyFront[1] = 1.0f; - specularFancyFront[2] = 1.0f; - specularFancyFront[3] = 1.0f; - } -}; - -class ColorSetting -{ -public: - - vcg::Color4b bColorBottom; - vcg::Color4b bColorTop; - vcg::Color4b lColor; - - ColorSetting() - { - //bColorBottom=vcg::Color4b(64,64,128,1); - //bColorTop=vcg::Color4b(0,0,0,1); - //lColor=vcg::Color4b(128,16,16,1); - - //bColorBottom=Color4b(192,192,192,1); - //bColorTop=Color4b(255,255,255,1); - //lColor=Color4b(128,16,16,1); - }; -}; - class SnapshotSetting { public: @@ -150,9 +75,6 @@ public: static void initGlobalParameterSet( RichParameterSet * /*globalparam*/); private: -inline static QString BackGroundBotParam() {return "MeshLab::Appearance::BackGroundBotCol";} -inline static QString BackGroundTopParam() {return "MeshLab::Appearance::BackGroundTopCol";} -inline static QString LogAreaColParam() {return "MeshLab::Appearance::LogAreaCol";} public: LayerDialog *layerDialog; @@ -164,11 +86,10 @@ public: vcg::Trackball trackball_light; GLLogStream log; FilterScript filterHistory; - + GLAreaSetting glas; QSize curSiz; QSize minimumSizeHint() const; QSize sizeHint() const; - //QFont getFont() {return qFont;} QAction *getLastAppliedFilter() {return lastFilterRef;} void setLastAppliedFilter(QAction *qa) {lastFilterRef = qa;} @@ -184,10 +105,8 @@ public: } RenderMode & getCurrentRenderMode() {return rm;} - const ColorSetting& getCustomSetting() const {return cs;} - GLLightSetting getLightSettings(){return ls;} - void setLightSettings(GLLightSetting glls){ls = glls;} - const SnapshotSetting& getSnapshotSetting() {/*ss.dx=vpWidth; ss.dy=vpHeight;*/ return ss;} + + const SnapshotSetting& getSnapshotSetting() {/*ss.dx=vpWidth; ss.dy=vpHeight;*/ return ss;} void updateFps(float deltaTime); void showTrackBall(bool b) {trackBallVisible = b; updateGL();} @@ -361,9 +280,7 @@ private: public: RenderMode rm; - ColorSetting cs; - GLLightSetting ls; - // view setting variables + // view setting variables float fov; float clipRatioFar; float clipRatioNear; diff --git a/src/meshlab/glarea_setting.cpp b/src/meshlab/glarea_setting.cpp new file mode 100644 index 000000000..8e9213490 --- /dev/null +++ b/src/meshlab/glarea_setting.cpp @@ -0,0 +1,33 @@ +#include "glarea.h" +#include "glarea_setting.h" + +void GLAreaSetting::initGlobalParameterSet( RichParameterSet * defaultGlobalParamSet) +{ + defaultGlobalParamSet->addParam(new RichColor(backgroundBotColorParam(),QColor(128,128,255),"MeshLab Bottom BackGround Color ","MeshLab GLarea's BackGround Color(bottom corner)")); + defaultGlobalParamSet->addParam(new RichColor(backgroundTopColorParam(),QColor( 0, 0, 0),"MeshLab Top BackGround Color(top corner)","MeshLab GLarea's BackGround Color(top corner)")); + defaultGlobalParamSet->addParam(new RichColor(logAreaColorParam(), QColor(255, 32, 32),"MeshLab GLarea's Log Area Color(bottom corner)","MeshLab GLarea's BackGround Color(bottom corner)")); + + + defaultGlobalParamSet->addParam(new RichColor(baseLightAmbientColorParam() ,QColor( 32, 32, 32),"MeshLab Base Light Ambient Color","MeshLab GLarea's BackGround Color(bottom corner)")); + defaultGlobalParamSet->addParam(new RichColor(baseLightDiffuseColorParam() ,QColor(204,204,204),"MeshLab Base Light Diffuse Color","MeshLab GLarea's BackGround Color(top corner)")); + defaultGlobalParamSet->addParam(new RichColor(baseLightSpecularColorParam() ,QColor(255,255,255),"MeshLab Base Light Specular Color","MeshLab GLarea's BackGround Color(bottom corner)")); + + defaultGlobalParamSet->addParam(new RichColor(fancyBLightDiffuseColorParam() ,QColor(255,204,204),"MeshLab Base Light Diffuse Color","MeshLab GLarea's BackGround Color(top corner)")); + defaultGlobalParamSet->addParam(new RichColor(fancyFLightDiffuseColorParam() ,QColor(204,204,255),"MeshLab Base Light Diffuse Color","MeshLab GLarea's BackGround Color(top corner)")); +} + + +void GLAreaSetting::updateGlobalParameterSet( RichParameterSet& rps ) +{ + logAreaColor = rps.getColor4b(logAreaColorParam()); + backgroundBotColor = rps.getColor4b(backgroundBotColorParam()); + backgroundTopColor = rps.getColor4b(backgroundTopColorParam()); + + baseLightAmbientColor = rps.getColor4b(baseLightAmbientColorParam() ); + baseLightDiffuseColor = rps.getColor4b(baseLightDiffuseColorParam() ); + baseLightSpecularColor = rps.getColor4b(baseLightSpecularColorParam() ); + + fancyBLightDiffuseColor = rps.getColor4b(fancyBLightDiffuseColorParam()); + fancyFLightDiffuseColor = rps.getColor4b(fancyFLightDiffuseColorParam()); + +} diff --git a/src/meshlab/glarea_setting.h b/src/meshlab/glarea_setting.h new file mode 100644 index 000000000..618b0d838 --- /dev/null +++ b/src/meshlab/glarea_setting.h @@ -0,0 +1,35 @@ +#ifndef GLAREA_SETTING_H +#define GLAREA_SETTING_H + +class GLAreaSetting +{ +public: + + vcg::Color4b baseLightAmbientColor; + vcg::Color4b baseLightDiffuseColor; + vcg::Color4b baseLightSpecularColor; + inline static QString baseLightAmbientColorParam() {return "MeshLab::Appearance::baseLightAmbientColor";} + inline static QString baseLightDiffuseColorParam() {return "MeshLab::Appearance::baseLightDiffuseColor";} + inline static QString baseLightSpecularColorParam() {return "MeshLab::Appearance::baseLightSpecularColor";} + + vcg::Color4b fancyBLightDiffuseColor; + inline static QString fancyBLightDiffuseColorParam() {return "MeshLab::Appearance::fancyBLightDiffuseColor";} + + vcg::Color4b fancyFLightDiffuseColor; + inline static QString fancyFLightDiffuseColorParam() {return "MeshLab::Appearance::fancyFLightDiffuseColor";} + + + vcg::Color4b backgroundBotColor; + vcg::Color4b backgroundTopColor; + vcg::Color4b logAreaColor; + inline static QString backgroundBotColorParam() {return "MeshLab::Appearance::backgroundBotColor";} + inline static QString backgroundTopColorParam() {return "MeshLab::Appearance::backgroundTopColor";} + inline static QString logAreaColorParam() {return "MeshLab::Appearance::logAreaColor";} + + void updateGlobalParameterSet( RichParameterSet& rps ); + static void initGlobalParameterSet( RichParameterSet * defaultGlobalParamSet); + +}; + + +#endif // GLAREA_SETTING_H diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index 290027eb8..8d4e0dc33 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -257,8 +257,7 @@ private slots: void setLight(); void setDoubleLighting(); void setFancyLighting(); - void setLightingProperties(); - void setColorMode(QAction *qa); + void setColorMode(QAction *qa); void applyRenderMode(); //void applyColorMode(); void toggleBackFaceCulling(); @@ -431,8 +430,7 @@ private: QAction *renderModeTextureAct; QAction *setDoubleLightingAct; QAction *setFancyLightingAct; - QAction *setLightingPropertiesAct; - QAction *setLightAct; + QAction *setLightAct; QAction *backFaceCullAct; QAction *setSelectionRenderingAct; diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 1324d7f9b..303e84de6 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -20,166 +20,6 @@ * for more details. * * * ****************************************************************************/ -/**************************************************************************** -History - -$Log$ -Revision 1.93 2008/04/18 17:39:34 cignoni -added menus for the new filter classes (smoothing, normal, quality) - -Revision 1.92 2008/04/10 11:07:42 cignoni -added tooltip to decorations - -Revision 1.91 2008/03/10 09:39:51 cignoni -better disabling of functionalities when no mesh is loaded - -Revision 1.90 2008/03/08 17:25:10 cignoni -added define for disabling auto test of updated versions - -Revision 1.89 2008/02/06 09:56:37 cignoni -Corrected bug in the display of plugins info - -Revision 1.88 2008/01/06 20:44:19 cignoni -added correct paths for QT dynlib loading - -Revision 1.87 2008/01/04 00:46:28 cignoni -Changed the decoration framework. Now it accept a, global, parameter set. Added static calls for finding important directories in a OS independent way. - -Revision 1.86 2007/12/27 09:43:08 cignoni -moved colorize filters to a submenu of the filter menu - -Revision 1.85 2007/12/13 00:18:28 cignoni -added meshCreation class of filter, and the corresponding menu new under file - -Revision 1.84 2007/11/20 11:51:28 cignoni -added layer icon - -Revision 1.83 2007/11/09 11:26:44 cignoni -hide the stddialog at the beginning please. - -Revision 1.82 2007/11/05 13:49:52 cignoni -better managment of the filter parameter dialog (stddialog) - -Revision 1.81 2007/10/23 08:23:10 cignoni -removed reserved shortcut ctrl+s from selection drawing. - -Revision 1.80 2007/10/06 23:29:51 cignoni -corrected management of suspeneded editing actions. Added filter toolbar - -Revision 1.79 2007/10/02 07:59:33 cignoni -New filter interface. Hopefully more clean and easy to use. - -Revision 1.78 2007/07/10 07:19:22 cignoni -** Serious Changes ** -again on the MeshDocument, the management of multiple meshes, layers, and per mesh transformation - -Revision 1.77 2007/05/16 15:02:05 cignoni -Better management of toggling between edit actions and camera movement - -Revision 1.76 2007/05/14 10:46:04 cignoni -Added cngrt dialog - -Revision 1.75 2007/04/16 09:24:37 cignoni -** big change ** -Added Layers managemnt. -Interfaces are changing... - -Revision 1.74 2007/03/27 12:20:16 cignoni -Revamped logging iterface, changed function names in automatic parameters, better selection handling - -Revision 1.73 2007/03/20 16:22:34 cignoni -Big small change in accessing mesh interface. First step toward layers - -Revision 1.72 2007/03/12 15:23:59 cignoni -Safer dir search for plugins for mac - -Revision 1.71 2007/03/03 02:03:25 cignoni -Reformatted lower bar, added number of selected faces. Updated about dialog - -Revision 1.70 2007/02/28 00:05:12 cignoni -Added Bug submitting menu - -Revision 1.69 2007/02/26 12:03:43 cignoni -Added Help online and check for updates - -Revision 1.68 2007/02/26 01:21:46 cignoni -no more snapping dialog, better search for plugins - -Revision 1.67 2007/02/08 16:04:18 cignoni -Corrected behaviour of edit actions - -Revision 1.66 2006/12/13 17:37:02 pirosu -Added standard plugin window support - -Revision 1.65 2006/12/06 00:48:17 cignoni -Improved managment of http answer - -Revision 1.64 2006/11/29 00:53:43 cignoni -Improved logging and added web based version checking - -Revision 1.63 2006/11/09 08:16:23 cignoni -Bug in the http communication - -Revision 1.62 2006/11/08 15:51:56 cignoni -Added kvert to the saved vars - -Revision 1.61 2006/11/08 01:35:59 cignoni -still on the web logging - -Revision 1.60 2006/11/08 01:04:48 cignoni -First version with http communications - -Revision 1.59 2006/10/26 12:07:30 corsini -add lighting properties option - -Revision 1.58 2006/07/08 06:37:47 cignoni -Many small bugs correction (esc crash, info in about, obj loading progress,fullscreen es) - -Revision 1.57 2006/06/18 21:27:49 cignoni -Progress bar redesigned, now integrated in the workspace window - -Revision 1.56 2006/06/15 13:05:57 cignoni -added Filter History Dialogs - -Revision 1.55 2006/06/12 15:20:44 cignoni -Initial Dragdrop support (still not working,,,) - -Revision 1.54 2006/05/26 04:09:52 cignoni -Still debugging 0.7 - -Revision 1.53 2006/05/25 04:57:45 cignoni -Major 0.7 release. A lot of things changed. Colorize interface gone away, Editing and selection start to work. -Optional data really working. Clustering decimation totally rewrote. History start to work. Filters organized in classes. - -Revision 1.52 2006/04/18 06:57:34 zifnab1974 -syntax errors for gcc 3.4.5 resolved - -Revision 1.51 2006/04/12 15:12:18 cignoni -Added Filter classes (cleaning, meshing etc) - -Revision 1.50 2006/02/25 13:43:39 ggangemi -Action "None" is now exported from MeshRenderPlugin - -Revision 1.49 2006/02/24 08:21:00 cignoni -yet another attempt to solve the QProgressDialog issue. Now trying with qt->reset. - -Revision 1.48 2006/02/22 10:20:09 cignoni -Changed progressbar->hide into close to avoid 100% cpu use. - -Revision 1.47 2006/02/17 11:17:23 glvertex -- Moved closeAction in FileMenu -- Minor changes - -Revision 1.46 2006/02/13 16:18:04 cignoni -Minor edits. - -Revision 1.45 2006/02/01 12:44:42 glvertex -- Disabled EDIT menu when no editing tools loaded -- Solved openig bug when running by command line - -Revision 1.44 2006/01/31 15:25:13 davide_portelli -Added short key lastFilter -****************************************************************************/ #include @@ -346,11 +186,6 @@ void MainWindow::createActions() setFancyLightingAct->setShortcut(Qt::CTRL+Qt::Key_F); connect(setFancyLightingAct, SIGNAL(triggered()), this, SLOT(setFancyLighting())); - setLightingPropertiesAct = new QAction(tr("Lighting &Properties"), this); - setLightingPropertiesAct->setShortcutContext(Qt::ApplicationShortcut); - setLightingPropertiesAct->setShortcut(Qt::CTRL+Qt::Key_P); - connect(setLightingPropertiesAct, SIGNAL(triggered()), this, SLOT(setLightingProperties())); - backFaceCullAct = new QAction(tr("BackFace &Culling"),this); backFaceCullAct->setCheckable(true); backFaceCullAct->setShortcutContext(Qt::ApplicationShortcut); @@ -539,7 +374,6 @@ void MainWindow::createMenus() lightingModeMenu->addAction(setLightAct); lightingModeMenu->addAction(setDoubleLightingAct); lightingModeMenu->addAction(setFancyLightingAct); - lightingModeMenu->addAction(setLightingPropertiesAct); // Color SUBmenu colorModeMenu = renderMenu->addMenu(tr("&Color")); @@ -768,7 +602,12 @@ void MainWindow::loadMeshLabSettings() { RichParameterFactory::create(docElem,&rpar); qDebug("param %i,%s loaded from settings",ii,qPrintable(rpar->name)); - currentGlobalParams.addParam(rpar); + if (!defaultGlobalParams.hasParameter(rpar->name)) + { + qDebug("Warning in the saved parameters there were parameters that are not in the HardWired ones.\n" + "This should not happen. Ignored parameter %s",qPrintable(rpar->name)); + } + else currentGlobalParams.addParam(rpar); } } diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 8299e19e0..11b22cead 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -20,165 +20,6 @@ * for more details. * * * ****************************************************************************/ -/**************************************************************************** -History - -$Log: mainwindow_RunTime.cpp,v $ -Revision 1.156 2008/04/11 10:09:13 cignoni -added start decorate call - -Revision 1.155 2008/04/04 10:07:08 cignoni -Solved namespace ambiguities caused by the removal of a silly 'using namespace' in meshmodel.h - -Revision 1.154 2008/03/22 07:38:55 cignoni -To avoid that a filter changes something assumed by the current editing tool, before actually starting the filter we close the current editing tool (if any). - -Revision 1.153 2008/03/14 15:22:28 corsini -fix decoration menu - -Revision 1.152 2008/03/10 09:39:51 cignoni -better disabling of functionalities when no mesh is loaded - -Revision 1.151 2008/02/28 10:33:21 cignoni -Added errorMsg exchange mechaninsm to the interface of filter plugins to allow the passage of error reports between the filter and the framework. - -Revision 1.150 2008/02/12 14:20:33 cignoni -changed the function getParameter into the more meaningful getCustomParameter - -Revision 1.149 2008/02/06 09:56:37 cignoni -Corrected bug in the display of plugins info - -Revision 1.148 2008/02/04 09:34:02 cignoni -better managment of state changes when layer switching and adding files to the current layer set - -Revision 1.147 2008/01/30 11:24:43 sherholz -Fixed Bug in runFilterScript: the log was not set before applying a filter (caused crashes by some filter) - -Revision 1.146 2008/01/28 13:02:00 cignoni -added support for filters on collection of meshes (layer filters) - -Revision 1.145 2008/01/16 01:39:55 cignoni -added two slot for better managing the exit from editing tools - -Revision 1.144 2008/01/06 20:45:11 cignoni -busy cursor when saving - -Revision 1.143 2008/01/04 00:46:28 cignoni -Changed the decoration framework. Now it accept a, global, parameter set. Added static calls for finding important directories in a OS independent way. - -Revision 1.142 2007/12/23 10:50:23 cignoni -disable lighting for point based mesh (with no faces) - -Revision 1.141 2007/12/13 00:18:28 cignoni -added meshCreation class of filter, and the corresponding menu new under file - -Revision 1.140 2007/11/25 09:48:38 cignoni -Changed the interface of the io filters. Now also a default bit set for the capabilities has to specified - -Revision 1.139 2007/11/20 12:00:24 cignoni -added setcurrent slot - -Revision 1.138 2007/11/05 23:45:34 cignoni -automatic closure of stdialog on other filters - -Revision 1.137 2007/11/05 13:49:52 cignoni -better managment of the filter parameter dialog (stddialog) - -Revision 1.136 2007/10/19 21:39:37 cignoni -Avoid recreation of normals for loaded mesh with explicit per vertex normal - -Revision 1.135 2007/10/08 08:55:09 cignoni -moved out code for saving of aln - -Revision 1.134 2007/10/06 23:29:51 cignoni -corrected management of suspeneded editing actions. Added filter toolbar - -Revision 1.133 2007/10/02 07:59:40 cignoni -New filter interface. Hopefully more clean and easy to use. - -Revision 1.132 2007/09/15 09:07:33 cignoni -Added missing return - -Revision 1.131 2007/07/24 07:19:01 cignoni -managed failure in loading of project. Added safe cleaning of meshes with nan coords - -Revision 1.130 2007/07/13 15:18:22 cignoni -Save and load of beloved aln files - -Revision 1.129 2007/07/10 07:19:27 cignoni -** Serious Changes ** -again on the MeshDocument, the management of multiple meshes, layers, and per mesh transformation - -Revision 1.128 2007/05/16 15:02:06 cignoni -Better management of toggling between edit actions and camera movement - -Revision 1.127 2007/04/20 09:57:00 cignoni -Smarter Callback that does not slow down the system when called too frequently - -Revision 1.126 2007/04/16 09:24:37 cignoni -** big change ** -Added Layers managemnt. -Interfaces are changing... - -Revision 1.125 2007/03/27 12:20:17 cignoni -Revamped logging iterface, changed function names in automatic parameters, better selection handling - -Revision 1.124 2007/03/26 08:25:09 zifnab1974 -added eol at the end of the files - -Revision 1.123 2007/03/20 16:22:34 cignoni -Big small change in accessing mesh interface. First step toward layers - -Revision 1.122 2007/03/05 22:31:33 cignoni -V100 Final patch of version checking - -Revision 1.121 2007/03/03 02:03:25 cignoni -Reformatted lower bar, added number of selected faces. Updated about dialog - -Revision 1.120 2007/03/02 15:58:32 cignoni -Progress bar bug removed - -Revision 1.119 2007/03/01 04:56:28 cignoni -Added checks on the existence and readability of input files - -Revision 1.118 2007/02/26 12:03:44 cignoni -Added Help online and check for updates - -Revision 1.117 2007/02/08 23:45:27 pirosu -merged srcpar and par in the GetStdParameters() function - -Revision 1.116 2007/02/08 16:04:18 cignoni -Corrected behaviour of edit actions - -Revision 1.115 2007/01/18 13:35:02 gfrei -Resolved crash when a edit-plugin is selected without a mesh. -Resolves multiple-pushed edit-buttons problem. - -Revision 1.114 2006/12/27 21:41:41 pirosu -Added improvements for the standard plugin window: -split of the apply button in two buttons:ok and apply -added support for parameters with absolute and percentage values - -Revision 1.113 2006/12/13 17:37:02 pirosu -Added standard plugin window support - - -Revision 1.112 2006/11/30 23:23:13 cignoni -Open take care also of updating the bbox - -Revision 1.111 2006/11/29 00:53:43 cignoni -Improved logging and added web based version checking - -Revision 1.110 2006/11/08 15:51:00 cignoni -Corrected bug apply last filter on empty workspace - -Revision 1.109 2006/11/08 01:04:48 cignoni -First version with http communications - -Revision 1.108 2006/11/07 09:15:27 cignoni -Added Drag n drog opening of files (thanks to Valentino Fiorin) - -****************************************************************************/ #include @@ -194,7 +35,6 @@ Added Drag n drog opening of files (thanks to Valentino Fiorin) #include "plugindialog.h" #include "filterScriptDialog.h" #include "customDialog.h" -#include "lightingDialog.h" #include "saveSnapshotDialog.h" #include "ui_aboutDialog.h" #include "savemaskexporter.h" @@ -838,24 +678,6 @@ void MainWindow::setFancyLighting() GLA()->setLightMode(!rm.fancyLighting,LFANCY); } -void MainWindow::setLightingProperties() -{ - // retrieve current lighting settings - GLLightSetting GLlightsetting = GLA()->getLightSettings(); - - // customize them - LightingDialog dlg(GLlightsetting, this); - if (dlg.exec() == QDialog::Accepted) - { - // update light settings - dlg.lightSettingsToGL(GLlightsetting); - GLA()->setLightSettings(GLlightsetting); - - // update lighting model - GLA()->setLightModel(); - } -} - void MainWindow::toggleBackFaceCulling() { RenderMode &rm = GLA()->getCurrentRenderMode(); diff --git a/src/meshlab/meshlab.pro b/src/meshlab/meshlab.pro index 1658e07b8..9413b1a38 100644 --- a/src/meshlab/meshlab.pro +++ b/src/meshlab/meshlab.pro @@ -1,90 +1,88 @@ -VCGDIR = ../../../vcglib +VCGDIR = ../../../vcglib GLEWDIR = ../external/glew-1.5.1 GLEWCODE = $$GLEWDIR/src/glew.c DEFINES *= GLEW_STATIC -CONFIG += debug_and_release precompile_header +CONFIG += debug_and_release \ + precompile_header + # uncomment to try Eigen # DEFINES += VCG_USE_EIGEN # CONFIG += warn_off - -INCLUDEPATH *= ../.. $$VCGDIR $$GLEWDIR/include -DEPENDPATH += $$VCGDIR $$VCGDIR/vcg $$VCGDIR/wrap - +INCLUDEPATH *= ../.. \ + $$VCGDIR \ + $$GLEWDIR/include +DEPENDPATH += $$VCGDIR \ + $$VCGDIR/vcg \ + $$VCGDIR/wrap PRECOMPILED_HEADER = mainwindow.h - -HEADERS = interfaces.h \ - GLLogStream.h \ - mainwindow.h \ - meshmodel.h \ - glarea.h \ - filterscript.h \ - filterparameter.h \ - plugindialog.h \ - customDialog.h \ - lightingDialog.h \ - filterScriptDialog.h \ - plugin_support.h \ - saveSnapshotDialog.h \ - savemaskexporter.h \ - changetexturename.h \ - layerDialog.h \ - stdpardialog.h \ - $$VCGDIR/wrap/gui/trackball.h\ - $$VCGDIR/wrap/gui/trackmode.h\ - $$VCGDIR/wrap/gl/trimesh.h -SOURCES = main.cpp \ - mainwindow_Init.cpp \ - mainwindow_RunTime.cpp\ - meshmodel.cpp \ - GLLogStream.cpp \ - glarea.cpp \ - plugin_support.cpp \ - plugindialog.cpp \ - filterscript.cpp \ - filterparameter.cpp \ - customDialog.cpp \ - lightingDialog.cpp \ - filterScriptDialog.cpp \ - saveSnapshotDialog.cpp \ - layerDialog.cpp \ - savemaskexporter.cpp \ - changetexturename.cpp \ - stdpardialog.cpp \ - $$VCGDIR/wrap/gui/trackball.cpp\ - $$VCGDIR/wrap/gui/trackmode.cpp \ - $$GLEWCODE - -FORMS = ui/layerDialog.ui \ - ui/filterScriptDialog.ui \ - ui/customDialog.ui\ - ui/lightingProperties.ui \ - ui/savesnapshotDialog.ui\ - ui/aboutDialog.ui \ - ui/renametexture.ui \ - ui/savemaskexporter.ui \ - ui/congratsDialog.ui - - -RESOURCES = meshlab.qrc +HEADERS = interfaces.h \ + GLLogStream.h \ + mainwindow.h \ + meshmodel.h \ + glarea.h \ + filterscript.h \ + filterparameter.h \ + plugindialog.h \ + customDialog.h \ + filterScriptDialog.h \ + plugin_support.h \ + saveSnapshotDialog.h \ + savemaskexporter.h \ + changetexturename.h \ + layerDialog.h \ + stdpardialog.h \ + $$VCGDIR/wrap/gui/trackball.h \ + $$VCGDIR/wrap/gui/trackmode.h \ + $$VCGDIR/wrap/gl/trimesh.h \ + glarea_setting.h +SOURCES = main.cpp \ + mainwindow_Init.cpp \ + mainwindow_RunTime.cpp \ + meshmodel.cpp \ + GLLogStream.cpp \ + glarea.cpp \ + plugin_support.cpp \ + plugindialog.cpp \ + filterscript.cpp \ + filterparameter.cpp \ + customDialog.cpp \ + filterScriptDialog.cpp \ + saveSnapshotDialog.cpp \ + layerDialog.cpp \ + savemaskexporter.cpp \ + changetexturename.cpp \ + stdpardialog.cpp \ + $$VCGDIR/wrap/gui/trackball.cpp \ + $$VCGDIR/wrap/gui/trackmode.cpp \ + $$GLEWCODE \ + glarea_setting.cpp +FORMS = ui/layerDialog.ui \ + ui/filterScriptDialog.ui \ + ui/customDialog.ui \ + ui/lightingProperties.ui \ + ui/savesnapshotDialog.ui \ + ui/aboutDialog.ui \ + ui/renametexture.ui \ + ui/savemaskexporter.ui \ + ui/congratsDialog.ui +RESOURCES = meshlab.qrc # to add windows icon RC_FILE = meshlab.rc - -### the xml info list -### the next time the app open a new extension +# ## the xml info list +# ## the next time the app open a new extension QMAKE_INFO_PLIST = ../install/info.plist - # to add MacOS icon ICON = images/meshlab.icns + # note that to add the file icons on the mac the following line does not work. # You have to copy the file by hand into the meshlab.app/Contents/Resources directory. # ICON += images/meshlab_obj.icns - -QT += opengl -QT += xml -QT += network +QT += opengl +QT += xml +QT += network # the following line is needed to avoid mismatch between # the awful min/max macros of windows and the limits max @@ -92,29 +90,25 @@ win32:DEFINES += NOMINMAX # the following line is to hide the hundred of warnings about the deprecated # old printf are all around the code -win32-msvc2005:DEFINES += _CRT_SECURE_NO_DEPRECATE -win32-msvc2008:DEFINES += _CRT_SECURE_NO_DEPRECATE +win32-msvc2005:DEFINES += _CRT_SECURE_NO_DEPRECATE +win32-msvc2008:DEFINES += _CRT_SECURE_NO_DEPRECATE +mac:QMAKE_CXX = g++-4.2 -mac:QMAKE_CXX=g++-4.2 # Uncomment these if you want to experiment with newer gcc compilers # (here using the one provided with macports) # macx-g++:QMAKE_CXX=g++-mp-4.3 # macx-g++:QMAKE_CXXFLAGS_RELEASE -= -Os # macx-g++:QMAKE_CXXFLAGS_RELEASE += -O3 - DEFINES += GLEW_STATIC - -INCLUDEPATH += . .. ../../../vcglib $$GLEWDIR/include +INCLUDEPATH += . \ + .. \ + ../../../vcglib \ + $$GLEWDIR/include CONFIG += stl -# uncomment in your local copy only in emergency cases. +# uncomment in your local copy only in emergency cases. # We should never be too permissive # win32-g++:QMAKE_CXXFLAGS += -fpermissive - # The following define is needed in gcc to remove the asserts win32-g++:DEFINES += NDEBUG -CONFIG(debug, debug|release) { - win32-g++:release:DEFINES -= NDEBUG -} - - +CONFIG(debug, debug|release):win32-g++:release:DEFINES -= NDEBUG