From 2079824513aeb987141aecec2fa9ee0265e4e232 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Fri, 13 Jan 2017 11:34:05 +0100 Subject: [PATCH] first working draft it simply outputs an image with model rendered from the current camera with creases highlighted --- src/common/pluginmanager.cpp | 2 +- .../edit_CADtexturing/CADtexturingControl.cpp | 1 - .../edit_CADtexturing/CADtexturingControl.h | 2 +- .../edit_CADtexturing/CADtexturingedit.cpp | 97 +- .../edit_CADtexturing/CADtexturingedit.h | 4 +- .../edit_CADtexturing/edit_CADtexturing.pro | 3 +- .../edit_panosample/QualityChecker.ui | 82 + .../edit_panosample/Resource.aps | Bin 0 -> 3280 bytes .../edit_panosample/Resource.rc | Bin 0 -> 3014 bytes .../edit_panosample/bitmap1.bmp | Bin 0 -> 1270 bytes .../edit_panosample/cloneview.h | 105 + .../edit_panosample/colorframe.h | 49 + .../edit_panosample/edit_panosample.cpp | 267 +++ .../edit_panosample/edit_panosample.h | 87 + .../edit_panosample/edit_panosample.pro | 16 + .../edit_panosample_factory.cpp | 58 + .../edit_panosample/edit_panosample_factory.h | 56 + .../edit_panosample/images/icon_align.png | Bin 0 -> 1533 bytes .../edit_panosample/paintbox.ui | 2040 +++++++++++++++++ .../edit_panosample/qualitychecker.cpp | 50 + .../edit_panosample/qualitychecker.h | 66 + .../edit_panosample/resource.h | Bin 0 -> 904 bytes 22 files changed, 2942 insertions(+), 43 deletions(-) create mode 100644 src/plugins_experimental/edit_panosample/QualityChecker.ui create mode 100644 src/plugins_experimental/edit_panosample/Resource.aps create mode 100644 src/plugins_experimental/edit_panosample/Resource.rc create mode 100644 src/plugins_experimental/edit_panosample/bitmap1.bmp create mode 100644 src/plugins_experimental/edit_panosample/cloneview.h create mode 100644 src/plugins_experimental/edit_panosample/colorframe.h create mode 100644 src/plugins_experimental/edit_panosample/edit_panosample.cpp create mode 100644 src/plugins_experimental/edit_panosample/edit_panosample.h create mode 100644 src/plugins_experimental/edit_panosample/edit_panosample.pro create mode 100644 src/plugins_experimental/edit_panosample/edit_panosample_factory.cpp create mode 100644 src/plugins_experimental/edit_panosample/edit_panosample_factory.h create mode 100644 src/plugins_experimental/edit_panosample/images/icon_align.png create mode 100644 src/plugins_experimental/edit_panosample/paintbox.ui create mode 100644 src/plugins_experimental/edit_panosample/qualitychecker.cpp create mode 100644 src/plugins_experimental/edit_panosample/qualitychecker.h create mode 100644 src/plugins_experimental/edit_panosample/resource.h diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 5354055ca..cf6144e5a 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -98,7 +98,7 @@ void PluginManager::loadPlugins(RichParameterSet& defaultGlobal) else { QPluginLoader loader(absfilepath); - QObject *plugin = loader.instance(); + QObject *plugin = loader.instance(); if (plugin) { pluginsLoaded.push_back(fileName); diff --git a/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.cpp b/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.cpp index ca0835d13..17b468c5a 100644 --- a/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.cpp +++ b/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.cpp @@ -34,4 +34,3 @@ CADtexturingControl::CADtexturingControl(QWidget * parent, Qt::WindowFlags flags void CADtexturingControl::on_renderEdges(){ emit(renderEdgesClicked()); } - diff --git a/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.h b/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.h index 5ee34c2fc..ce20d2aff 100644 --- a/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.h +++ b/src/plugins_experimental/edit_CADtexturing/CADtexturingControl.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include diff --git a/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.cpp b/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.cpp index 7ed74fab4..c6fa65d57 100644 --- a/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.cpp +++ b/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.cpp @@ -33,6 +33,7 @@ $Log: meshedit.cpp,v $ #include #include #include +#include using namespace std; using namespace vcg; @@ -89,12 +90,6 @@ void CADtexturingEditPlugin::renderEdges(GLArea * gla){ glViewport(0, 0, winsize, winsize); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(90, 1.0, 0.1, 100); // SISTEMARE NEAR E FAR - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - ctx.bindReadDrawFramebuffer(hFramebuffer); GLW_CHECK_GL_READ_DRAW_FRAMEBUFFER_STATUS; @@ -102,52 +97,64 @@ void CADtexturingEditPlugin::renderEdges(GLArea * gla){ MLSceneGLSharedDataContext::PerMeshRenderingDataMap dt; shared->getRenderInfoPerMeshView(gla->context(), dt); - for (int i = 0; i < meshmodel->cm.vert.size(); ++i){ - CMeshO::CoordType p = meshmodel->cm.vert[i].cP(); - QImage image(int(width), int(height), QImage::Format_ARGB32); + QImage image(int(width), int(height), QImage::Format_ARGB32); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glViewport(0, 0, winsize, winsize); - glPushMatrix(); + glViewport(0, 0, winsize, winsize); + glPushMatrix(); - /* set camera*/ - GlShot::SetView(gla->mvc()->meshDoc.rm()->shot, 1, 100); + + /* set camera*/ + GlShot::SetView(gla->mvc()->meshDoc.rm()->shot, 1, 10000); - /**/ + /**/ - { - MLSceneGLSharedDataContext* datacont = gla->mvc()->sharedDataContext(); - if (datacont == NULL) - return; + { + MLSceneGLSharedDataContext* datacont = gla->mvc()->sharedDataContext(); + if (datacont == NULL) + return; - foreach(MeshModel * mp, gla->md()->meshList){ - MLRenderingData curr; - datacont->getRenderInfoPerMeshView(mp->id(), gla->context(), curr); - MLPerViewGLOptions opts; - curr.get(opts); - //if (curr.get(opts) == false) - // throw MLException(QString("GLArea: invalid MLPerViewGLOptions")); - //gla->setLightingColors(opts); + foreach(MeshModel * mp, gla->md()->meshList){ + MLRenderingData curr; + datacont->getRenderInfoPerMeshView(mp->id(), gla->context(), curr); + MLPerViewGLOptions opts; + curr.get(opts); + //if (curr.get(opts) == false) + // throw MLException(QString("GLArea: invalid MLPerViewGLOptions")); + //gla->setLightingColors(opts); - if (opts._back_face_cull) - glEnable(GL_CULL_FACE); - else - glDisable(GL_CULL_FACE); + glEnable(GL_CULL_FACE); + datacont->setMeshTransformationMatrix(mp->id(), mp->cm.Tr); + + + if (mp->cm.fn){ + glPolygonMode(GL_FRONT, GL_FILL); + glDisable(GL_LIGHTING); + + glCullFace(GL_BACK); + glEnable(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(1.0, 1); + drawer.DrawFill(); + glEnable(GL_LIGHTING); + glCullFace(GL_BACK); + glDisable(GL_POLYGON_OFFSET_FILL); + + drawer.DrawWirePolygonal(); - datacont->setMeshTransformationMatrix(mp->id(), mp->cm.Tr); - if (mp->cm.fn) - datacont->draw(mp->id(), gla->context()); } } - - glReadPixels(0, 0, 3 * winsize, 2 * winsize, GL_RGBA, GL_UNSIGNED_BYTE, image.bits()); - - image.rgbSwapped().mirrored().save("pano_" + QString().setNum(i) + ".jpg"); } + + GlShot::UnsetView(); + + glReadPixels(0, 0, winsize, winsize, GL_RGBA, GL_UNSIGNED_BYTE, image.bits()); + + image.rgbSwapped().mirrored().save("edges.jpg"); + ctx.unbindReadDrawFramebuffer(); ctx.release(); glViewport(vp[0], vp[1], vp[2], vp[3]); @@ -258,5 +265,19 @@ bool CADtexturingEditPlugin::StartEdit(MeshModel & m , GLArea * gla, MLSceneGLSh QObject::connect(control, SIGNAL(renderEdgesClicked()), this, SLOT(on_renderEdges())); drawEdgesTrigger = false; + + m.updateDataMask(MeshModel::MM_FACEFACETOPO); + vcg::tri::UpdateFlags::FaceFauxSignedCrease(m.cm, -M_PI*0.5, M_PI*0.5); + drawer.m = &m.cm; + m.cm.C().SetGrayShade(0.5); + return true; } + +void CADtexturingEditPlugin::EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/){ + + dock->setVisible(false); + delete control; + delete dock; + +}; diff --git a/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.h b/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.h index e5e1deb93..a266c76fc 100644 --- a/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.h +++ b/src/plugins_experimental/edit_CADtexturing/CADtexturingedit.h @@ -28,6 +28,7 @@ #include #include #include "CADtexturingControl.h" +#include class CADtexturingEditPlugin : public QObject, public MeshEditInterface { @@ -41,7 +42,7 @@ public: static const QString Info(); bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/); - void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/){}; + void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/); void Decorate(MeshModel &/*m*/, GLArea * /*parent*/, QPainter *p); void Decorate (MeshModel &/*m*/, GLArea * ){}; void mousePressEvent(QMouseEvent *, MeshModel &, GLArea * ) {}; @@ -50,6 +51,7 @@ public: void keyReleaseEvent(QKeyEvent *, MeshModel &, GLArea *); void renderEdges(GLArea *gla); + vcg::GlTrimesh drawer; private: bool drawEdgesTrigger; diff --git a/src/plugins_experimental/edit_CADtexturing/edit_CADtexturing.pro b/src/plugins_experimental/edit_CADtexturing/edit_CADtexturing.pro index 1b9b28e64..b5d20bc1d 100644 --- a/src/plugins_experimental/edit_CADtexturing/edit_CADtexturing.pro +++ b/src/plugins_experimental/edit_CADtexturing/edit_CADtexturing.pro @@ -5,7 +5,8 @@ HEADERS = edit_CADtexturing_factory.h \ CADtexturingedit.h SOURCES = edit_CADtexturing_factory.cpp \ - CADtexturingedit.cpp + CADtexturingedit.cpp \ + CADtexturingControl.cpp TARGET = CADtexturingedit diff --git a/src/plugins_experimental/edit_panosample/QualityChecker.ui b/src/plugins_experimental/edit_panosample/QualityChecker.ui new file mode 100644 index 000000000..b475e9dcf --- /dev/null +++ b/src/plugins_experimental/edit_panosample/QualityChecker.ui @@ -0,0 +1,82 @@ + + + QualityChecker + + + + 0 + 0 + 567 + 403 + + + + Quality Checker + + + + + + 20 + 50 + 121 + 23 + + + + Take Views + + + false + + + false + + + + + + 20 + 80 + 121 + 23 + + + + Compare + + + false + + + + + + 20 + 10 + 121 + 23 + + + + + + + Use Current Layer + + + + + + true + + + createImageSpace + + + + + + + + diff --git a/src/plugins_experimental/edit_panosample/Resource.aps b/src/plugins_experimental/edit_panosample/Resource.aps new file mode 100644 index 0000000000000000000000000000000000000000..10de321bc97f516ee40f6e7d7178d5125fe9e9ba GIT binary patch literal 3280 zcmeHJ%}x_h6#l?!qGCc^xGu;7VyG>kA{$etgABAYWIFsMlT3zoLYqw6NlSrcAH#)@ z;lhOrmg-v&H#~q#llt8|l$mi5;>ry-xqs*Xo_o(d2LQ6{!(rIDOtcN|X4u!Ui&f6U z;n*d9GIP1W&qsi=V%NQ6&$nA%ui?7~cCTBr1HXURZ1)`RH1N93me)RVecP)ykDS15 zcY1Cs@IBk~dYyi^=Hia6yqY@3Se z>=et}Dhl}m9>(#CQK=O5(j|H+pC?x6M>VUOp*xzsW}twl7}H9MQ?-hgreJoyFo$`JNnSDj;3ZtPY0gPMe3O{C zABMwm-iJre9H5CKwBRD3mK+Ya4kZ0rO3wF`9E(oVbfvsqqO&A+hH~T3g=?XUS5QF@ zWOxfnn_m(Ft_qlFy?xDf8OS^5ZyQpyv23+FBe>BwuJjs26xg?MXk)U-@ZV zIE*dsecnlY%gcywc?%2jjccVETQ@frJ{@a$Ip@aE(E&ztR<->-Yw>Cvw;{e=G%?%gU&P%!Rdf2Lr($N*WwNB@ST ziN)ruT_Ng%UkRFYT_AFuegEHboycz=Z{!I*8_!81OI_T^lg?uz LhfO^Adk*^zRbBLq literal 0 HcmV?d00001 diff --git a/src/plugins_experimental/edit_panosample/Resource.rc b/src/plugins_experimental/edit_panosample/Resource.rc new file mode 100644 index 0000000000000000000000000000000000000000..e80e284f983599befb505ebe3343b3afe2aa0193 GIT binary patch literal 3014 zcmdUx(QeZ~5Jm4Z68~VFmsX&L!WYy@h$5U&HAw|hq^NB$L@H^OI6_E#J8)**rQ6sp zBD@%_oLx_5cV_O~8Sl>@ZM79?sHLv7){QninQ~<3$Tr&QLf5=?^qdjtlRj$2vqqjX zFOaR7ZQqvF73+vMJ8h|3bdK~?Pq5NmrDb)ugV}6H9kff}=eeT=Kgj+JoPcZ#t~V`X;EMrNighgIZc}!inC%qN0Yz)XS7=>cFEpY)Tn+?srC1 zyK}-BXK;3oH?}@>R#R3Zq*La;tq%XS^#D#J)OF%2dq{Pj%J^3|LcKbjP#)_tuzt)<;Sx`7?^scvi~agwh(oj1 zo;QBBI?5jXs+GCdtcXHyLROjlU+*{83m(7UcpO77nzc3$>-oLnre`dF*@X`X*5q?gV2{e? zEI0`8$`LzH6?fsP2jTqPuk+0s@hrBVgJ?iVt@HIBOi+{eJUdTcYx*Bl+}LXQukTji E1oC4vVgLXD literal 0 HcmV?d00001 diff --git a/src/plugins_experimental/edit_panosample/cloneview.h b/src/plugins_experimental/edit_panosample/cloneview.h new file mode 100644 index 000000000..b79543809 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/cloneview.h @@ -0,0 +1,105 @@ +/**************************************************************************** +* MeshLab o o * +* An extendible mesh processor o o * +* _ O _ * +* Copyright(C) 2005, 2009 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef CLONEVIEW_H_ +#define CLONEVIEW_H_ + +#include +#include +#include + +class CloneView : public QGraphicsView +{ + Q_OBJECT + +private : + QPointF last_pos; + QPointF start_pos; + + QGraphicsItem * crosshair; + +public : + QGraphicsItem * scenegroup; + + CloneView(QWidget * parent) : QGraphicsView(parent) + { + setDragMode(QGraphicsView::NoDrag); setMouseTracking(false); + } + + virtual void mousePressEvent(QMouseEvent * event) { + start_pos = QPointF(event->pos()); + last_pos.setX(event->pos().x()); last_pos.setY(event->pos().y()); + + if (event->buttons() == Qt::RightButton) + emit positionReset(); + } + + virtual void mouseMoveEvent ( QMouseEvent * event) + { + if (!(event->buttons() & Qt::LeftButton)) return; + QGraphicsItem * item = itemAt(event->pos()); + if (item != NULL) + if (!crosshair->isAncestorOf(item)) item->moveBy(event->pos().x() - last_pos.x(), event->pos().y() - last_pos.y()); + last_pos.setX(event->pos().x()); last_pos.setY(event->pos().y()); + // emit positionChanged(last_pos.x() - start_pos.x(), last_pos.y() - start_pos.y()); + } + + virtual void mouseReleaseEvent ( QMouseEvent *) + { + emit positionChanged(last_pos.x() - start_pos.x(), last_pos.y() - start_pos.y()); + } + + virtual void wheelEvent(QWheelEvent *) + { + //ignore or move.. + } + + virtual void setScene(QGraphicsScene * scene) + { + QGraphicsView::setScene(scene); + QList gil; + scenegroup = scene->createItemGroup(gil); + crosshair = new QGraphicsItemGroup(scenegroup); + crosshair->setZValue(2); + QPen pen; + pen.setWidth(3); + pen.setColor(QColor(qRgb(255, 255, 255))); + QGraphicsItem * p = scene->addLine(0, 8, 0, -8, pen); + p->setParentItem(crosshair); + QGraphicsItem * c = scene->addLine(8, 0, -8, 0, pen); + c->setParentItem(p); p = c; + pen.setWidth(1); + pen.setColor(QColor(qRgb(0, 0, 0))); + c = scene->addLine(0, 8, 0, -8, pen); + c->setParentItem(p); p = c; + c = scene->addLine(8, 0, -8, 0, pen); + c->setParentItem(p); p = c; + } + +signals: + void positionChanged(double x, double y); + void positionReset(); + +}; + +#endif /*CLONEVIEW_H_*/ diff --git a/src/plugins_experimental/edit_panosample/colorframe.h b/src/plugins_experimental/edit_panosample/colorframe.h new file mode 100644 index 000000000..13544a764 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/colorframe.h @@ -0,0 +1,49 @@ +#ifndef COLORFRAME_H_ +#define COLORFRAME_H_ + +#include +#include + +/* + *A simple widget that displays a color and allows the + * user to choose a new one with a QColorDialog + */ +class Colorframe : public QFrame +{ + Q_OBJECT + +public: + Colorframe(QWidget * parent, Qt::WindowFlags flags = 0) : QFrame(parent, flags){} + + virtual void mousePressEvent ( QMouseEvent *) + { + QPalette palette = Colorframe::palette(); + QColor temp = palette.color(QPalette::Normal, QPalette::Window); + temp = QColorDialog::getColor(temp); + if (temp.isValid()){ + setColor(temp); + update(); + } + } + + QColor getColor(){return Colorframe::palette().color(QPalette::Normal, QPalette::Window);} + +public slots: + + void setColor(QColor c) + { + QPalette palette = Colorframe::palette(); + palette.setColor(QPalette::Normal, QPalette::Window, c); + palette.setColor(QPalette::Disabled, QPalette::Window, c); + palette.setColor(QPalette::Inactive, QPalette::Window, c); + setPalette(palette); + update(); + emit colorChanged(c); + } + +signals: + void colorChanged(QColor c); + +}; + +#endif /*COLORFRAME_H_*/ diff --git a/src/plugins_experimental/edit_panosample/edit_panosample.cpp b/src/plugins_experimental/edit_panosample/edit_panosample.cpp new file mode 100644 index 000000000..cbaeadfd8 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/edit_panosample.cpp @@ -0,0 +1,267 @@ +/**************************************************************************** + * MeshLab o o * + * A versatile mesh processing toolbox o o * + * _ O _ * + * Copyright(C) 2005 \/)\/ * + * Visual Computing Lab /\/| * + * ISTI - Italian National Research Council | * + * \ * + * All rights reserved. * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * + * for more details. * + * * + ****************************************************************************/ +#include "edit_panosample.h" + +#include +#include + + +using namespace std; +using namespace vcg; +using namespace glw; + +EditPanosamplePlugin::EditPanosamplePlugin() +{ + +} + +EditPanosamplePlugin::~EditPanosamplePlugin() {} + +const QString EditPanosamplePlugin::Info() { + return tr("Improved Painting"); +} + + + +bool EditPanosamplePlugin::StartEdit(MeshModel & m, GLArea * parent, MLSceneGLSharedDataContext* /*cont*/) +{ + glarea = parent; + meshmodel = &m; + + GLenum err = glewInit(); + if (err != GLEW_OK) + return false; + + dock1 = new QDockWidget(parent->window()); + this->qualitychecker = new QualityChecker(dock1); + //dock->setAllowedAreas(Qt::NoDockWidgetArea); + //dock->setWidget(paintbox); + //QPoint p = parent->mapToGlobal(QPoint(0, 0)); + //dock->setGeometry(5 + p.x(), p.y() + 5, paintbox->width(), parent->height() - 10); + //dock->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); + dock1->setFloating(true); + dock1->setVisible(true); + + + QObject::connect(qualitychecker, SIGNAL(createImageSpaceClicked()), this, SLOT(on_createImageSpace())); + + QObject::connect(qualitychecker, SIGNAL(layerChosenChanged), this, SLOT(on_layerChosenChanged())); + + + createImageSpaceTrigger = false; + + return true; + + +} + +void EditPanosamplePlugin::EndEdit(MeshModel &/* m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) +{ + glarea->setMouseTracking(false); + delete dock1; +} + +void EditPanosamplePlugin::mousePressEvent(QMouseEvent * event, MeshModel &, GLArea * gla) +{ + gla->update(); +} + +void EditPanosamplePlugin::mouseMoveEvent(QMouseEvent* event, MeshModel & m, GLArea * gla) +{ + if (gla == NULL) + return; + + gla->update(); +} + +void EditPanosamplePlugin::mouseReleaseEvent(QMouseEvent * event, MeshModel &, GLArea * gla) +{ + gla->updateAllSiblingsGLAreas(); +} + + +void EditPanosamplePlugin::drawScene(GLArea * gla){ + MLSceneGLSharedDataContext* datacont = gla->mvc()->sharedDataContext(); + if (datacont == NULL) + return; + + foreach(MeshModel * mp, gla->md()->meshList){ + MLRenderingData curr; + datacont->getRenderInfoPerMeshView(mp->id(), gla->context(), curr); + MLPerViewGLOptions opts; + curr.get(opts); + //if (curr.get(opts) == false) + // throw MLException(QString("GLArea: invalid MLPerViewGLOptions")); + //gla->setLightingColors(opts); + + + if (opts._back_face_cull) + glEnable(GL_CULL_FACE); + else + glDisable(GL_CULL_FACE); + + datacont->setMeshTransformationMatrix(mp->id(), mp->cm.Tr); + + if(mp->cm.fn) + datacont->draw(mp->id(), gla->context()); + } +} + +void EditPanosamplePlugin::panoRender(GLArea * gla){ + int winsize = 512; + int width = winsize * 3; + int height = winsize * 2; + + + glarea = gla; + if (gla->mvc() == NULL) + return; + MLSceneGLSharedDataContext* shared = gla->mvc()->sharedDataContext(); + if (shared == NULL) + return; + + Context ctx; + ctx.acquire(); + + RenderbufferHandle hDepth = createRenderbuffer(ctx, GL_DEPTH_COMPONENT24, width, height); + Texture2DHandle hColor = createTexture2D(ctx, GL_RGBA8, width, height, GL_RGBA, GL_UNSIGNED_BYTE); + FramebufferHandle hFramebuffer = createFramebuffer(ctx, renderbufferTarget(hDepth), texture2DTarget(hColor)); + + GLint vp[4]; + glGetIntegerv(GL_VIEWPORT, vp); + + glViewport(0, 0, winsize, winsize); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(90, 1.0, 0.1, 100); // SISTEMARE NEAR E FAR + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + ctx.bindReadDrawFramebuffer(hFramebuffer); + GLW_CHECK_GL_READ_DRAW_FRAMEBUFFER_STATUS; + + + MLSceneGLSharedDataContext::PerMeshRenderingDataMap dt; + shared->getRenderInfoPerMeshView(gla->context(), dt); + + for (int i = 0; i < meshmodel->cm.vert.size(); ++i){ + CMeshO::CoordType p = meshmodel->cm.vert[i].cP(); + + QImage image(int(width), int(height), QImage::Format_ARGB32); + + + //*** Z+ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glViewport(0, 0, winsize, winsize); + glPushMatrix(); + gluLookAt(p.X(), p.Y(), p.Z(), p.X(), p.Y(), p.Z() + 1, 0, 1, 0); + drawScene(gla); + glPopMatrix(); + + //*** X- + glViewport(winsize, 0, winsize, winsize); + glPushMatrix(); + glViewport(winsize, 0, winsize, winsize); + gluLookAt(p.X(), p.Y(), p.Z(), p.X()-1, p.Y(), p.Z() , 0, 1, 0); + drawScene(gla); + glPopMatrix(); + + //*** Z- + glViewport(winsize * 2, 0, winsize, winsize); + glPushMatrix(); + gluLookAt(p.X(), p.Y(), p.Z(), p.X(), p.Y(), p.Z() - 1, 0, 1, 0); + drawScene(gla); + glPopMatrix(); + + //*** Y+ + glViewport(0, winsize, winsize, winsize); + glPushMatrix(); + gluLookAt(p.X(), p.Y(), p.Z(), p.X(), p.Y()+ 1, p.Z() , 0, 0, 1); + drawScene(gla); + glPopMatrix(); + + //*** X+ + glViewport(winsize, winsize, winsize, winsize); + glPushMatrix(); + gluLookAt(p.X(), p.Y(), p.Z(), p.X() + 1, p.Y(), p.Z(), 0, 0, 1); + drawScene(gla); + glPopMatrix(); + + //*** Y- + glViewport(winsize * 2, winsize, winsize, winsize); + glPushMatrix(); + gluLookAt(p.X(), p.Y(), p.Z(), p.X(), p.Y() - 1, p.Z(), 0, 0, 1); + drawScene(gla); + glPopMatrix(); + + glReadPixels(0, 0, 3 * winsize, 2 * winsize, GL_RGBA, GL_UNSIGNED_BYTE, image.bits()); + + image.rgbSwapped().mirrored().save("pano_"+QString().setNum(i)+".jpg"); + } + ctx.unbindReadDrawFramebuffer(); + ctx.release(); + glViewport(vp[0], vp[1], vp[2], vp[3]); + return; + +} +/** + * Since only on a Decorate call it is possible to obtain correct values + * from OpenGL, all operations are performed during the execution of this + * method and not where mouse events are processed. + * + */ +void EditPanosamplePlugin::Decorate(MeshModel &m, GLArea * gla) +{ + if (createImageSpaceTrigger){ + panoRender(gla); + createImageSpaceTrigger = false; + } +} + + +void EditPanosamplePlugin::on_createImageSpace(){ + createImageSpaceTrigger = true; + update(); +} + + + +void EditPanosamplePlugin::on_layerChosenChanged(){ + createImageSpaceTrigger = true; + update(); +} + + +/** + * Request an async repainting of the glarea + * + * This slot is connected to undo and redo + */ +void EditPanosamplePlugin::update() +{ + glarea->update(); + glarea->updateAllSiblingsGLAreas(); +} + diff --git a/src/plugins_experimental/edit_panosample/edit_panosample.h b/src/plugins_experimental/edit_panosample/edit_panosample.h new file mode 100644 index 000000000..e57159c68 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/edit_panosample.h @@ -0,0 +1,87 @@ +/**************************************************************************** + * MeshLab o o * + * A versatile mesh processing toolbox o o * + * _ O _ * + * Copyright(C) 2005 \/)\/ * + * Visual Computing Lab /\/| * + * ISTI - Italian National Research Council | * + * \ * + * All rights reserved. * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * + * for more details. * + * * + ****************************************************************************/ + +#ifndef EDITPAINT_H +#define EDITPAINT_H + +#include +#include +#include + +#include +#include +#include + +#include "qualitychecker.h" + + + + +/** + * EditPanosample plugin main class (MeshEditing plugin) + */ +class EditPanosamplePlugin : public QObject, public MeshEditInterface { + Q_OBJECT + Q_INTERFACES(MeshEditInterface) + +public: + EditPanosamplePlugin(); + virtual ~EditPanosamplePlugin(); + + static const QString Info(); + + bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/); + void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/); + void Decorate(MeshModel &/*m*/, GLArea * /*parent*/); + void mousePressEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *); + void mouseMoveEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *); + void mouseReleaseEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *); + + +signals: + void setSelectionRendering(bool); + +public slots: + void update(); + void on_createImageSpace(); + void on_layerChosenChanged(); + + //void runPanoSample(); + //void setSamplePoints(); +private: + bool createImageSpaceTrigger; + + + void panoRender(GLArea * gla); + void drawScene(GLArea * gla); + + std::vector panoramas; + QDockWidget* dock1; + QualityChecker * qualitychecker; + MeshModel * meshmodel; + + GLArea * glarea; +}; + + +#endif diff --git a/src/plugins_experimental/edit_panosample/edit_panosample.pro b/src/plugins_experimental/edit_panosample/edit_panosample.pro new file mode 100644 index 000000000..bafb4131d --- /dev/null +++ b/src/plugins_experimental/edit_panosample/edit_panosample.pro @@ -0,0 +1,16 @@ +include (../../shared.pri) + +HEADERS = edit_panosample_factory.h \ + cloneview.h \ + colorframe.h \ + paintbox.h \ + edit_panosample.h + +SOURCES = edit_panosample_factory.cpp \ + ../../meshlab/ml_selection_buffers.cpp \ + paintbox.cpp \ + edit_panosample.cpp \ + +TARGET = edit_panosample +RESOURCES = edit_paint.qrc +FORMS = paintbox.ui diff --git a/src/plugins_experimental/edit_panosample/edit_panosample_factory.cpp b/src/plugins_experimental/edit_panosample/edit_panosample_factory.cpp new file mode 100644 index 000000000..d7f2755a0 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/edit_panosample_factory.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2008 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#include "edit_panosample_factory.h" +#include "edit_panosample.h" + +EditPanosampleFactory::EditPanosampleFactory() +{ + editPanosample = new QAction(QIcon(":/images/paintbrush-22.png"), "Z-painting", this); + + actionList << editPanosample; + + foreach(QAction *editAction, actionList) + editAction->setCheckable(true); +} + +//gets a list of actions available from this plugin +QList EditPanosampleFactory::actions() const +{ + return actionList; +} + +//get the edit tool for the given action +MeshEditInterface* EditPanosampleFactory::getMeshEditInterface(QAction *action) +{ + if (action == editPanosample) + { + return new EditPanosamplePlugin(); + } else assert(0); //should never be asked for an action that isnt here + return NULL; +} + +QString EditPanosampleFactory::getEditToolDescription(QAction *) +{ + return EditPanosamplePlugin::Info(); +} + +MESHLAB_PLUGIN_NAME_EXPORTER(EditPanosampleFactory) diff --git a/src/plugins_experimental/edit_panosample/edit_panosample_factory.h b/src/plugins_experimental/edit_panosample/edit_panosample_factory.h new file mode 100644 index 000000000..d7c46cc14 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/edit_panosample_factory.h @@ -0,0 +1,56 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2008 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + + +#ifndef EditPanosampleFactoryPLUGIN_H +#define EditPanosamplePLUGIN_H +#include + +#include + +class EditPanosampleFactory : public QObject, public MeshEditInterfaceFactory +{ + Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) + Q_INTERFACES(MeshEditInterfaceFactory) + +public: + EditPanosampleFactory(); + virtual ~EditPanosampleFactory() { delete editPanosample; } + + //gets a list of actions available from this plugin + virtual QList actions() const; + + //get the edit tool for the given action + virtual MeshEditInterface* getMeshEditInterface(QAction *); + + //get the description for the given action + virtual QString getEditToolDescription(QAction *); + +private: + QList actionList; + + QAction *editPanosample; +}; + +#endif diff --git a/src/plugins_experimental/edit_panosample/images/icon_align.png b/src/plugins_experimental/edit_panosample/images/icon_align.png new file mode 100644 index 0000000000000000000000000000000000000000..a0cb37a0240bc3d64eaf251c4c1c0c202b6cacc0 GIT binary patch literal 1533 zcmbtU`9IWo9R7TV(ahLHn8q|Vq)~`mE4yT7!XPXXCfAH3$r2*<@8|VA&#%wxNwBse??quz0D!$_rbe~`X6ynX zBKTdWX#D~b4k4M@Ap{qR@Vp_=P>3y=1Xx43ncdKvXh{U%VY28J4KC2gAX7>R0Af#f z0i~;m9Tb={bYn;Q*}x0*a9Xez2oDce^9k?`@t_5HsRagm=g#S40f4)h84>LwT)*cV z1W%m6#2c=v;*If2K~{u|wo`~Q&)o09vHqq=a*?@Eo?M<>n!>6}N3eC&g-N;hcl_SZ z^9C-W!{WX681R>uD1}O;B!p_`a-pyk3W&i06UI0Vv5NuM8U!5$C#3-HM{J{GY??-D z?>(XuZdu9f?A`Kx)}iZzCY_7Krp#c2*MU8Hn>WF;Sm#-lcfMa7`~v9omJB9oN4BDr zhp-OaT5iUzZ~{!d(hYkxUj_E=$wzSw-sr}i?$T|Ofzey$8<$i*#mC15^{tz&BZ3@z z?yVK<6k4oKoyUlh$bdQYVztyRpdhgIf$jD+6Ti>#sod+E@?9x4=EJ(@=nwsTTKiVK zo$6kE97Wix=I$&_E|@$aXiJB?&{Pf%o&}6SPajwJx=-ODK&!T zfysobK@S`}TQz`2&H?rQa2Y38_Zxc4~$11V!&5_WVrM)7NT z@f>7FUw%^?tBTj{ws7vGo+9`BuEy@M80pi}QT)25VQWA}ENCCr-?af3)rCTCt02KJI^q zr5Jtw_B0n!1e6k)zS&I;a-2-f46=B51L{Vy=f=JG&PN+oW!P>ySK6K-d4I~MQPt;3 z)+J=DXi;``Rd22KGF8f&p*}D&Tv`5IsDg=vubU|J-*28;OqQToFv&;RGFB4A#>kba vbtnAV_NnbYmD+wnaE!!{E!F>XhfR&nm3}tkT-u5etT8Y%wlZRos4@QmU + + Paintbox + + + + 0 + 0 + 329 + 1030 + + + + + 0 + 0 + + + + Vertex Painting + + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 6 + + + 0 + + + 3 + + + 0 + + + 3 + + + + + false + + + + 0 + 0 + + + + Undo + + + + :/images/undo-24.png:/images/undo-24.png + + + Qt::ToolButtonTextBesideIcon + + + + + + + false + + + + 0 + 0 + + + + Redo + + + + :/images/redo-24.png:/images/redo-24.png + + + Qt::ToolButtonTextBesideIcon + + + + + + + + + + Qt::Horizontal + + + + + + + true + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 3 + + + 0 + + + 0 + + + 0 + + + + + ... + + + + :/images/paintbrush-22.png:/images/paintbrush-22.png + + + + 24 + 24 + + + + true + + + true + + + true + + + + + + + ... + + + + :/images/bucket-fill-22.png:/images/bucket-fill-22.png + + + + 24 + 24 + + + + true + + + true + + + + + + + ... + + + + :/images/blend-22.png:/images/blend-22.png + + + + 24 + 24 + + + + true + + + true + + + + + + + true + + + ... + + + + :/images/blur-22.png:/images/blur-22.png + + + + 24 + 24 + + + + true + + + true + + + + + + + true + + + ... + + + + :/images/clone-22.png:/images/clone-22.png + + + + 24 + 24 + + + + true + + + true + + + + + + + true + + + ... + + + + :/images/color-picker-22.png:/images/color-picker-22.png + + + + 24 + 24 + + + + true + + + true + + + + + + + ... + + + + :/images/perlin.png:/images/perlin.png + + + + 24 + 24 + + + + true + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + true + + + ... + + + + :/images/pickbrush-22.png:/images/pickbrush-22.png + + + + 24 + 24 + + + + true + + + false + + + true + + + + + + + true + + + ... + + + + :/images/blur-22.png:/images/blur-22.png + + + + 24 + 24 + + + + true + + + true + + + + + + + true + + + ... + + + + :/images/add-24.png:/images/add-24.png + + + + 24 + 24 + + + + true + + + true + + + + + + + Qt::Vertical + + + + 20 + 50 + + + + + + + + + + + + 0 + + + + + + 0 + 90 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 20 + 60 + 25 + 24 + + + + ... + + + + :/images/bw.png:/images/bw.png + + + + 15 + 15 + + + + true + + + + + + 110 + 0 + 25 + 24 + + + + ... + + + + :/images/swap-colors-12.png:/images/swap-colors-12.png + + + + 15 + 15 + + + + false + + + true + + + Qt::NoArrow + + + + + + 60 + 30 + 61 + 41 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + true + + + QFrame::StyledPanel + + + QFrame::Plain + + + 2 + + + + + + 40 + 20 + 61 + 41 + + + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + true + + + QFrame::StyledPanel + + + QFrame::Plain + + + 2 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 34 + 4 + 81 + 81 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + true + + + QGraphicsView::ScrollHandDrag + + + QGraphicsView::DontAdjustForAntialiasing + + + + + + + Load From File + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + Change the opacity of the color (this is not the opengl alpha value) + + + 100 + + + 100 + + + + + + + Opacity + + + + + + + false + + + Modus + + + + + + + false + + + + 0 + 0 + + + + + Normal + + + + + + + + Change the opacity of the color (this is not the opengl alpha value) + + + 100 + + + 100 + + + Qt::Horizontal + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + 100 + + + 25 + + + 25 + + + Qt::Horizontal + + + + + + + Percentual + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + 100 + + + 24 + + + + + + + + + + true + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Displacement + + + + + + + 4 + + + Qt::Horizontal + + + + + + + 3 + + + 4.000000000000000 + + + + + + + Direction + + + + + + + + Averaged Normals + + + + + Per Vertex Normals + + + + + + + + + + + true + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Brush + + + + + + + true + + + + 0 + 0 + + + + false + + + + Circle + + + + + Square + + + + + Pixmap + + + + + + + + Hardness + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + 100 + + + 50 + + + 50 + + + Qt::Horizontal + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + 100 + + + 50 + + + + + + + Size + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + 100 + + + 20 + + + 20 + + + Qt::Horizontal + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + 100 + + + 20 + + + + + + + Units + + + + + + + + 0 + 0 + + + + + pixel + + + + + percentual of bounding box + + + + + + + + Paint on: + + + + + + + backfaces + + + + + + + hidden polygons + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Noise Scale + + + + + + + 2 + + + Qt::Horizontal + + + + + + + 3 + + + 2.000000000000000 + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + + 0 + 0 + + + + + Nearest vertex color + + + + + Pixel color + + + + + + + + Picking mode + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + Type + + + + + + + + 0 + 0 + + + + + Foreground to background (RGB) + + + + + Foreground to transparency + + + + + + + + Form + + + + + + + + Linear + + + + + Circular + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Vertex search: + + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">fast:</span> works better with big meshes, but can loose some vertexes when faces are not direct connected<br /><span style=" font-weight:600;">slow but accurate: </span>sholud be used with small meshes, because it finds every vertex during painting</p></body></html> + + + + fast + + + + + slow but accurate + + + + + + + + + + + true + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Pen pressure maps to: + + + + + + + Opacity + + + + + + + Size + + + + + + + Hardness + + + + + + + Displacement / Smooth % + + + + + + + + + + + + + + Colorframe + QFrame +
colorframe.h
+ 1 +
+ + CloneView + QGraphicsView +
cloneview.h
+
+
+ + + + + + opacity_slider + valueChanged(int) + deck_box + setValue(int) + + + 251 + 399 + + + 308 + 394 + + + + + deck_box + valueChanged(int) + opacity_slider + setValue(int) + + + 308 + 394 + + + 251 + 399 + + + + + percentual_slider + valueChanged(int) + percentual_box + setValue(int) + + + 251 + 480 + + + 308 + 477 + + + + + percentual_box + valueChanged(int) + percentual_slider + setValue(int) + + + 308 + 477 + + + 251 + 480 + + + + + hardness_slider + valueChanged(int) + decrease_box + setValue(int) + + + 248 + 660 + + + 308 + 666 + + + + + decrease_box + valueChanged(int) + hardness_slider + setValue(int) + + + 308 + 666 + + + 248 + 660 + + + + + size_slider + valueChanged(int) + decrease_box_3 + setValue(int) + + + 248 + 692 + + + 308 + 698 + + + + + pen_button + toggled(bool) + pen_frame + setVisible(bool) + + + 36 + 69 + + + 135 + 383 + + + + + pen_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 36 + 69 + + + 139 + 1097 + + + + + pen_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 36 + 69 + + + 137 + 759 + + + + + decrease_box_3 + valueChanged(int) + size_slider + setValue(int) + + + 308 + 698 + + + 248 + 692 + + + + + gradient_button + toggled(bool) + gradient_frame + setVisible(bool) + + + 36 + 135 + + + 209 + 949 + + + + + fill_button + toggled(bool) + pen_frame + setVisible(bool) + + + 36 + 102 + + + 160 + 383 + + + + + gradient_button + toggled(bool) + pen_frame + setVisible(bool) + + + 36 + 135 + + + 216 + 383 + + + + + smooth_button + toggled(bool) + smooth_frame + setVisible(bool) + + + 36 + 168 + + + 267 + 466 + + + + + smooth_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 36 + 168 + + + 250 + 759 + + + + + smooth_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 36 + 168 + + + 272 + 1097 + + + + + pick_button + toggled(bool) + pick_frame + setVisible(bool) + + + 36 + 234 + + + 319 + 868 + + + + + mesh_add_button + toggled(bool) + mesh_displacement_frame + setVisible(bool) + + + 36 + 442 + + + 230 + 587 + + + + + mesh_pick_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 25 + 343 + + + 199 + 759 + + + + + mesh_smooth_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 28 + 376 + + + 179 + 759 + + + + + mesh_smooth_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 24 + 373 + + + 182 + 981 + + + + + mesh_add_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 36 + 442 + + + 122 + 759 + + + + + mesh_add_button + toggled(bool) + mesh_displacement_frame + setVisible(bool) + + + 28 + 442 + + + 122 + 587 + + + + + mesh_smooth_button + toggled(bool) + smooth_frame + setVisible(bool) + + + 19 + 371 + + + 153 + 466 + + + + + mesh_pick_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 31 + 343 + + + 129 + 1097 + + + + + mesh_add_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 36 + 442 + + + 129 + 1097 + + + + + clone_button + toggled(bool) + clone_source_frame + setVisible(bool) + + + 17 + 201 + + + 319 + 136 + + + + + clone_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 33 + 201 + + + 319 + 759 + + + + + clone_button + toggled(bool) + pen_frame + setVisible(bool) + + + 28 + 201 + + + 277 + 383 + + + + + clone_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 27 + 201 + + + 277 + 1097 + + + + + perlin_button + toggled(bool) + pen_frame + setVisible(bool) + + + 36 + 267 + + + 254 + 383 + + + + + perlin_button + toggled(bool) + pen_extra_frame + setVisible(bool) + + + 28 + 267 + + + 259 + 765 + + + + + perlin_button + toggled(bool) + gradient_frame + setVisible(bool) + + + 17 + 267 + + + 188 + 949 + + + + + perlin_button + toggled(bool) + pressure_frame + setVisible(bool) + + + 21 + 267 + + + 166 + 1097 + + + + + perlin_button + toggled(bool) + gradient_form + setDisabled(bool) + + + 17 + 267 + + + 308 + 938 + + + + + gradient_button + toggled(bool) + gradient_form + setEnabled(bool) + + + 29 + 135 + + + 308 + 938 + + + + + perlin_button + toggled(bool) + noise_frame + setVisible(bool) + + + 28 + 267 + + + 197 + 819 + + + + +
diff --git a/src/plugins_experimental/edit_panosample/qualitychecker.cpp b/src/plugins_experimental/edit_panosample/qualitychecker.cpp new file mode 100644 index 000000000..65ff30274 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/qualitychecker.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** + * MeshLab o o * + * A versatile mesh processing toolbox o o * + * _ O _ * + * Copyright(C) 2005 \/)\/ * + * Visual Computing Lab /\/| * + * ISTI - Italian National Research Council | * + * \ * + * All rights reserved. * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * + * for more details. * + * * + ****************************************************************************/ + +#include "qualitychecker.h" +#include + +QualityChecker::QualityChecker(QWidget * parent, Qt::WindowFlags flags) : QDockWidget(parent, flags) +{ + setupUi(this); + + //QObject::connect(clone_source_view, SIGNAL(positionChanged(double, double)), this, SLOT(movePixmapDelta(double, double))); + //QObject::connect(clone_source_view, SIGNAL(positionReset()), this, SLOT(resetPixmapDelta())); + + QObject::connect(this->createImageSpacePushButton, SIGNAL(clicked()), this, SLOT(on_createImageSpace())); + QObject::connect(this->createImageSpacePushButton, SIGNAL(clicked()), this, SLOT(on_compare())); + QObject::connect(this->useCurrentLayerPushButton, SIGNAL(clicked()), this, SLOT(on_layerChosen())); + comparePushButton->setVisible(false); +} + +void QualityChecker::on_createImageSpace(){ + emit(createImageSpaceClicked()); +} + +void QualityChecker::on_compare(){ + emit(compareClicked()); +} + +void QualityChecker::on_layerChosen(){ + emit(layerChosenChanged()); +} diff --git a/src/plugins_experimental/edit_panosample/qualitychecker.h b/src/plugins_experimental/edit_panosample/qualitychecker.h new file mode 100644 index 000000000..276c55160 --- /dev/null +++ b/src/plugins_experimental/edit_panosample/qualitychecker.h @@ -0,0 +1,66 @@ +/**************************************************************************** + * MeshLab o o * + * A versatile mesh processing toolbox o o * + * _ O _ * + * Copyright(C) 2005 \/)\/ * + * Visual Computing Lab /\/| * + * ISTI - Italian National Research Council | * + * \ * + * All rights reserved. * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * + * for more details. * + * * + ****************************************************************************/ + +#ifndef QUALITYCHECKER_H_ +#define QUALITYCHECKER_H_ + +#include + +#include +#include +#include +#include +#include +#include "ui_qualitychecker.h" + + + +/** + * This class manages the user interface and is concerned + * with emitting appropriate signals. It should not be + * concerned with the application logic in any way. + */ +class QualityChecker : public QDockWidget, private Ui::QualityChecker +{ + Q_OBJECT + +private: + +public: + QualityChecker(QWidget * parent = 0, Qt::WindowFlags flags = 0); + + +signals: + + void createImageSpaceClicked(); + void compareClicked(); + void layerChosenChanged(); + +public slots : + void on_compare(); + void on_createImageSpace(); + void on_layerChosen(); +}; + + +#endif diff --git a/src/plugins_experimental/edit_panosample/resource.h b/src/plugins_experimental/edit_panosample/resource.h new file mode 100644 index 0000000000000000000000000000000000000000..9cd049eee823a13a4a08ab7ecd67aa14773fc857 GIT binary patch literal 904 zcmb7?-A=+l5QWdRiSN*aOA`^}3qa`w5n9s<(W^!(H5eiZrT)bD>gqSU5WpzGOt!N# znLTr6PQN~zYU&+}l_*zNk*+wgyTuCCBg*uF9qWkNrUDH#RiTCEsyL;VZpb+}!_xXoNG@`qYWXVe?=x=X-TCVF+#8uOBwYM9&f&u;FTY(-SUbb&V} zFZj8}dgNYETW#Ta-c#y5Uf@_}@EyXw=M?GDb;Ruw9lGvqgBeS(|9+EF+on3%t>7YT8;LhNQ$RVf$r;7b) y`)~tYfNbW~_^I=6ybV2Og4E5sAKiHW2itGbwAhbp+u8g>4b(TqOgXRmZu|`&u6@w} literal 0 HcmV?d00001