From 943f89bbd1428fb7a0ffb73d695d44b17c63bb6d Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Wed, 7 May 2014 13:01:55 +0000 Subject: [PATCH] Corrected bug in the faux edge setting when loading polygonal meshes. --- src/install/Release Notes.txt | 2 ++ src/meshlabplugins/decorate_base/decorate_base.cpp | 4 +++- src/meshlabplugins/decorate_base/decorate_base.h | 13 ++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/install/Release Notes.txt b/src/install/Release Notes.txt index 8d0294d9a..401484657 100644 --- a/src/install/Release Notes.txt +++ b/src/install/Release Notes.txt @@ -28,4 +28,6 @@ Added support of polygonal meshes in OBJ output. Now meshes with faux edges set 2014 05 07 OFF File Import Corrected bug in the faux edge setting when loading polygonal meshes. +2014 05 07 Faux Edge Decorator +Added line width control to the Non Faux Edge decorator. diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index a9cbe0b55..24573beab 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -251,13 +251,14 @@ void ExtraMeshDecoratePlugin::decorateMesh(QAction *a, MeshModel &m, RichParamet } break; case DP_SHOW_NON_FAUX_EDGE : { + float lineWidth = rm->getFloat(ShowFauxEdgeWidth()); glPushAttrib(GL_ENABLE_BIT|GL_VIEWPORT_BIT| GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_LIGHTING); glDepthFunc(GL_LEQUAL); glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glLineWidth(1.f); + glLineWidth(lineWidth); Color4b cc=Color4b::DarkGray; cc[3]=128; glColor(cc); @@ -1643,6 +1644,7 @@ void ExtraMeshDecoratePlugin::initGlobalParameterSet(QAction *action, RichParame parset.addParam(new RichBool(this->ShowContourRamp(), true, "Ramp Contour","If enabled show a ramp that gives you info about the gradient of the quality field (transparent to opaque means increasing values) ")); } break; case DP_SHOW_NON_FAUX_EDGE :{ + parset.addParam(new RichFloat(ShowFauxEdgeWidth(),1.5,"Line Width","")); parset.addParam(new RichBool(this->ShowSeparatrix(), false, "Show Quad mesh Separatrices","if true the lines connecting extraordinary vertices of a quad mesh are shown")); parset.addParam(new RichBool(this->ShowNonRegular(), false, "Show Non Regular Vertices","if true, vertices with valence not equal to four are shown with red/blue fans")); } break; diff --git a/src/meshlabplugins/decorate_base/decorate_base.h b/src/meshlabplugins/decorate_base/decorate_base.h index 22a44787f..014d2531d 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.h +++ b/src/meshlabplugins/decorate_base/decorate_base.h @@ -65,14 +65,14 @@ class ExtraMeshDecoratePlugin : public QObject, public MeshDecorateInterface private: - float niceRound2(float value,float base); - float niceRound(float value); + float niceRound2(float value,float base); + float niceRound(float value); void drawQuotedLine(const vcg::Point3d &a,const vcg::Point3d &b,float aVal, float bVal,float tickDist,QPainter *painter, QFont qf,float angle =0,bool rightAlign=false); - void chooseX(vcg::Box3f &box,double *modelview,double *projection,GLint *viewport,vcg::Point3d &x1,vcg::Point3d &x2); - void chooseY(vcg::Box3f &box,double *modelview,double *projection,GLint *viewport,vcg::Point3d &y1,vcg::Point3d &y2); - void chooseZ(vcg::Box3f &box,double *modelview,double *projection,GLint *viewport,vcg::Point3d &z1,vcg::Point3d &z2); + void chooseX(vcg::Box3f &box,double *modelview,double *projection,GLint *viewport,vcg::Point3d &x1,vcg::Point3d &x2); + void chooseY(vcg::Box3f &box,double *modelview,double *projection,GLint *viewport,vcg::Point3d &y1,vcg::Point3d &y2); + void chooseZ(vcg::Box3f &box,double *modelview,double *projection,GLint *viewport,vcg::Point3d &z1,vcg::Point3d &z2); void drawHistogram(QGLWidget *gla, CHist &ch); public: @@ -165,6 +165,9 @@ public: inline QString HistAreaParam() const { return "MeshLab::Decoration::AreaHistParam" ; } inline QString HistTypeParam() const { return "MeshLab::Decoration::HistType" ; } + inline QString ShowFauxEdgeWidth() const { return "MeshLab::Decoration::FauxEdgeWidth" ; } + + inline QString ShowContourFreq() const { return "MeshLab::Decoration::ShowContourFreq" ; } inline QString ShowContourAlpha() const { return "MeshLab::Decoration::ShowContourAlpha" ; } inline QString ShowContourWidth() const { return "MeshLab::Decoration::ShowContourWidth" ; }