From 5e12782ee33c7622bd3dca01cf654bc32018fbef Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Mon, 5 Feb 2007 19:27:36 +0000 Subject: [PATCH] Added face selection and smoothing Added smooth borders when painting with the pen Some bugfixes Window should close now --- src/meshlabplugins/editpaint/PaintToolbox.ui | 1860 ++++++++++------- src/meshlabplugins/editpaint/colorwid.h | 7 + src/meshlabplugins/editpaint/editpaint.cpp | 410 ++-- src/meshlabplugins/editpaint/editpaint.h | 82 +- .../editpaint/images/pinsel_select.png | Bin 0 -> 2422 bytes src/meshlabplugins/editpaint/meshlab.qrc | 1 + src/meshlabplugins/editpaint/paintbox.cpp | 117 +- .../editpaint/ui_painttoolbox.h | 919 +++++--- 8 files changed, 2162 insertions(+), 1234 deletions(-) create mode 100644 src/meshlabplugins/editpaint/images/pinsel_select.png diff --git a/src/meshlabplugins/editpaint/PaintToolbox.ui b/src/meshlabplugins/editpaint/PaintToolbox.ui index e162e8ddf..09281d203 100644 --- a/src/meshlabplugins/editpaint/PaintToolbox.ui +++ b/src/meshlabplugins/editpaint/PaintToolbox.ui @@ -5,10 +5,18 @@ 0 0 - 332 - 558 + 284 + 645 + + + 5 + 5 + 0 + 0 + + Vertex Painting @@ -19,441 +27,11 @@ 2 - - - - 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 - - - 25 - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 9 - - - 6 - - - - - backfaces - - - - - - - Pen - - - - - - - Paint on: - - - - - - - - 5 - 0 - 0 - 0 - - - - - pixel - - - - - percentual of bbox diagonal - - - - - percentual of bbox height - - - - - - - - 1 - - - 70.000000000000000 - - - 0.100000000000000 - - - 0.100000000000000 - - - 25.000000000000000 - - - - - - - hidden polygons - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 9 - - - 6 - - - - - Change the opacity of the color (this is not the opengl alpha value) - - - 100 - - - 100 - - - - - - - Opacity - - - - - - - Modus - - - - - - - - Normal - - - - - - - - Change the opacity of the color (this is not the opengl alpha value) - - - 100 - - - 100 - - - Qt::Horizontal - - - - - - - - - - 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=" 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 - - - - - - - - Vertex search: - - - - - - - - + + - 5 - 0 - 0 - 0 - - - - - 70 - 70 - - - - - 16777215 - 70 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - 100 - 10 - 25 - 24 - - - - ... - - - :/images/bw.png - - - - 15 - 15 - - - - true - - - - - - 100 - 40 - 25 - 24 - - - - ... - - - :/images/switch.png - - - - 15 - 15 - - - - true - - - - - - 50 - 20 - 40 - 40 - - - - true - - - - - - 10 - 10 - 40 - 40 - - - - true - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - 60 - 10 - 48 - 48 - - - - - - - :/images/redo.png - - - - 48 - 48 - - - - - - - 10 - 10 - 48 - 48 - - - - - - - :/images/undo.png - - - - 48 - 48 - - - - - - - - - - 5 + 7 7 0 0 @@ -461,320 +39,1128 @@ p, li { white-space: pre-wrap; } - 16 - 120 + 0 + 320 - - QFrame::StyledPanel + + - - QFrame::Raised + + 0 - - - - 110 - 10 - 48 - 48 - - - - Fill with gradients - - - - - - :/images/gradient.png - - - - 48 - 48 - - - - true - - - true - - - false - + + + Painting + + + + 9 + + + 6 + + + + + + 0 + 60 + + + + + + 50 + 10 + 48 + 48 + + + + Fill an area + + + ... + + + :/images/fill.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + + 100 + 10 + 48 + 48 + + + + Fill with gradients + + + + + + :/images/gradient.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + + 150 + 10 + 48 + 48 + + + + Smooth + + + + + + :/images/smooth_me.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + + 200 + 10 + 48 + 48 + + + + Pick a color + + + + + + :/images/pick.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + + 0 + 10 + 48 + 48 + + + + Paint with the pen + + + ... + + + :/images/pinsel2.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 60 + 10 + 48 + 48 + + + + + + + :/images/redo.png + + + + 48 + 48 + + + + + + + 10 + 10 + 48 + 48 + + + + + + + :/images/undo.png + + + + 48 + 48 + + + + + + + + + + 5 + 0 + 0 + 0 + + + + + 70 + 70 + + + + + 16777215 + 70 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 100 + 10 + 25 + 24 + + + + ... + + + :/images/bw.png + + + + 15 + 15 + + + + true + + + + + + 100 + 40 + 25 + 24 + + + + ... + + + :/images/switch.png + + + + 15 + 15 + + + + true + + + + + + 10 + 10 + 40 + 40 + + + + true + + + + + + 50 + 20 + 40 + 40 + + + + true + + + + + + + + + 5 + 5 + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + Type + + + + + + + + Foreground to background (RGB) + + + + + Foreground to transparency + + + + + + + + Form + + + + + + + + Linear + + + + + Circular + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + + Nearest vertex color + + + + + Pixel color + + + + + + + + Picking mode + + + + + + + + + + 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 + + + 50 + + + + + + + backfaces + + + + + + + hidden polygons + + + + + + + Paint on: + + + + + + + 1 + + + 100.000000000000000 + + + 0.100000000000000 + + + 0.100000000000000 + + + 40.000000000000000 + + + + + + + + 5 + 0 + 0 + 0 + + + + + pixel + + + + + percentual of bbox diagonal + + + + + percentual of bbox height + + + + + + + + Pen + + + + + + + <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 + + + + + + + Smooth borders + + + + + + + + + + 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 + + + 25 + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + Change the opacity of the color (this is not the opengl alpha value) + + + 100 + + + 100 + + + + + + + Opacity + + + + + + + Modus + + + + + + + + Normal + + + + + + + + Change the opacity of the color (this is not the opengl alpha value) + + + 100 + + + 100 + + + Qt::Horizontal + + + + + + + - - - - 60 - 10 - 48 - 48 - - - - Fill an area - - - ... - - - :/images/fill.png - - - - 48 - 48 - - - - true - - - true - - - false - + + + Selecting && Editing + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + On: + + + + + + + 1 + + + 100.000000000000000 + + + 0.100000000000000 + + + 0.100000000000000 + + + 40.000000000000000 + + + + + + + Pen + + + + + + + <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 + + + + + + + 100 + + + 50 + + + + + + + Smooth borders + + + + + + + + 5 + 0 + 0 + 0 + + + + + pixel + + + + + percentual of bbox diagonal + + + + + percentual of bbox height + + + + + + + + backfaces + + + true + + + + + + + hidden polygons + + + false + + + + + + + + + + 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 + + + 25 + + + + + + + + + + + 5 + 5 + 0 + 0 + + + + + 0 + 60 + + + + + + 50 + 10 + 48 + 48 + + + + Smooth the mesh + + + ... + + + :/images/smooth_me.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + + 0 + 10 + 48 + 48 + + + + Select faces with the pen + + + ... + + + :/images/pinsel_select.png + + + + 48 + 48 + + + + true + + + true + + + false + + + + + - - - - 10 - 10 - 48 - 48 - - - - Paint with the pen - - - ... - - - :/images/pinsel2.png - - - - 48 - 48 - - - - true - - - true - - - false - - - - - - 10 - 60 - 48 - 48 - - - - Change advanced settings - - - - - - :/images/kcontrol.png - - - - 48 - 48 - - - - true - - - true - - - false - - - - - - 160 - 10 - 48 - 48 - - - - Smooth - - - - - - :/images/smooth_me.png - - - - 48 - 48 - - - - true - - - true - - - false - - - - - - 210 - 10 - 48 - 48 - - - - Pick a color - - - - - - :/images/pick.png - - - - 48 - 48 - - - - true - - - true - - - false - + + + Configuration + + + + 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=" 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 + + + + + + + + Vertex search: + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - - - - QFrame::StyledPanel + + + + Qt::Vertical - - QFrame::Raised + + QSizePolicy::Expanding - - - 9 - - - 6 - - - - - - Nearest vertex color - - - - - Pixel color - - - - - - - - Picking mode - - - - - - - - - - QFrame::StyledPanel + + + 20 + 40 + - - QFrame::Raised - - - - 9 - - - 6 - - - - - Type - - - - - - - - Foreground to background (RGB) - - - - - Foreground to transparency - - - - - - - - Form - - - - - - - - Linear - - - - - Circular - - - - - - + diff --git a/src/meshlabplugins/editpaint/colorwid.h b/src/meshlabplugins/editpaint/colorwid.h index 18c9a4d68..d719fc6de 100644 --- a/src/meshlabplugins/editpaint/colorwid.h +++ b/src/meshlabplugins/editpaint/colorwid.h @@ -1,3 +1,10 @@ +/*************************************************************************** +first version: 0.1 +autor: Gfrei Andreas +date: 07/02/2007 +email: gfrei.andreas@gmx.net +****************************************************************************/ + #ifndef COLORWID_H #define COLORWID_H diff --git a/src/meshlabplugins/editpaint/editpaint.cpp b/src/meshlabplugins/editpaint/editpaint.cpp index 5c451f70b..477c8a8a7 100755 --- a/src/meshlabplugins/editpaint/editpaint.cpp +++ b/src/meshlabplugins/editpaint/editpaint.cpp @@ -23,17 +23,36 @@ /**************************************************************************** //TODO CLEAN ME -//TODO better to vertex painting switch +//TODO bright colors problem +//TODO paint selection selects some wrong piece +//TODO add IsD() check +//TODO opengl line width after gradient //TODO bits instead of hashtables -//TODO PaintToolbox does not close -//TODO lines problem with percentual painting +//TODO PaintToolbox does not close, is in wrong place in windows //TODO optimize undo to not include when new and old colors are the same ------------ SOLVED: ------------ -//TODO first paint hang problem -- PROBALLY SOLVED, not shure -//TODO trackball zbuffer problem OK -version 0.1 gfrei +//TODO remove FF or VF +################################ -****************************************************************************/ +*/ + +/***************************************************************************** +first version: 0.1 +autor: Gfrei Andreas +date: 07/02/2007 +email: gfrei.andreas@gmx.net + +The first version contains: +---------PAINTING------------ +*) Painting with pixel & percentual pen & smooth borders & opacity +*) Fill +*) Gradient with linear and circular fill +*) Color smooth +---------EDITING------------- +*) Face selection with the pen +*) Face smooth with the pen (smooth borders and quantity selectable) +---------CONFIG-------------- +*) fast or slow and accurate face search +*****************************************************************************/ #include #include @@ -46,6 +65,8 @@ version 0.1 gfrei #include #include +//#include + using namespace vcg; EditPaintPlugin::EditPaintPlugin() { @@ -55,7 +76,7 @@ EditPaintPlugin::EditPaintPlugin() { first=true; pressed=0; //color_undo= new ColorUndo(); - actionList << new QAction(QIcon(":/images/pinsel.png"),"Vertex painting", this); + actionList << new QAction(QIcon(":/images/pinsel.png"),"Vertex painting, Face selection and smoothing", this); QAction *editAction; //QObject::connect(editAction, SIGNAL(redo()),this, SLOT(redo())); foreach(editAction, actionList) @@ -78,14 +99,14 @@ QList EditPaintPlugin::actions() const { } const QString EditPaintPlugin::Info(QAction *action) { - if( action->text() != tr("Vertex painting") ) assert (0); - return tr("Colorize the polygons of your mesh"); + if( action->text() != tr("Vertex painting, Face selection and smoothing") ) assert (0); + return tr("Paint on your mesh, select and smooth faces, all with a pen-like tool."); } const PluginInfo &EditPaintPlugin::Info() { static PluginInfo ai; ai.Date=tr(__DATE__); - ai.Version = tr("0.001"); + ai.Version = tr("0.1"); ai.Author = ("Andreas Gfrei"); return ai; } @@ -104,21 +125,23 @@ void EditPaintPlugin::undo(int value) { void EditPaintPlugin::StartEdit(QAction * /*mode*/, MeshModel &m, GLArea * parent) { first=true; pressed=0; - //qDebug() <<"startedit"<< endl; tri::UpdateBounding::Box(m.cm); if (paintbox==0) { - paintbox=new PaintToolbox(parent); + paintbox=new PaintToolbox(parent->window()); + paint_dock=new QDockWidget(parent->window()); + paint_dock->setAllowedAreas(Qt::NoDockWidgetArea); + paint_dock->setWidget(paintbox); + QPoint p=parent->window()->mapToGlobal(QPoint(0,0)); + paint_dock->setGeometry(p.x()+parent->window()->width()-paintbox->width(),p.y(),/*width()*/paintbox->width(),paintbox->height()); + paint_dock->setFloating(true); + //qDebug() << parent->parentWidget()->parentWidget()->window()->windowTitle() << endl; QObject::connect(paintbox, SIGNAL(undo_redo(int)),this, SLOT(undo(int))); } - //paintbox->setGeometry(); - paintbox->setVisible(true); - //paintbox->diag=m.cm.bbox.Diag(); - //m.updateDataMask(MeshModel::MM_FACECOLOR); + paint_dock->setVisible(true); + paint_dock->layout()->update(); m.updateDataMask(MeshModel::MM_FACETOPO); m.updateDataMask(MeshModel::MM_VERTFACETOPO); //TODO !!!! - //m.cm.InitVertexIMark(); - //m.Enable(MeshModel::MM_FACECOLOR); - //parent->setColorMode(vcg::GLW::CMPerVert); + parent->getCurrentRenderMode().colorMode=vcg::GLW::CMPerVert; parent->mm->ioMask|=MeshModel::IOM_VERTCOLOR; parent->mm->ioMask|=MeshModel::IOM_VERTQUALITY; @@ -186,29 +209,30 @@ void EditPaintPlugin::mouseMoveEvent(QAction *,QMouseEvent * event, MeshModel &/ case PICK: { return; } case PEN: {} } - - prev=cur; + + if (!isDragging) prev=cur; /** to prevent losses when two mouseEvents occur befor one decorate */ cur=event->pos(); //pen.pos=cur; + + //qDebug() <<"move: "<< prev << " "<< cur << endl; isDragging = true; // now the management of the update //static int lastMouse=0; static int lastRendering=0;//clock(); - int curT = clock(); + //int curT = clock(); //qDebug("mouseMoveEvent: curt %i last %i",curT,lastRendering); - if(gla->lastRenderingTime() < 50 || (curT - lastRendering) > 1000 ) + /*if(gla->lastRenderingTime() < 50 || (curT - lastRendering) > 1000 ) { - lastRendering=curT; + lastRendering=curT;*/ gla->update(); - //qDebug("mouseMoveEvent: ----"); - } + /*} else { - /*gla->makeCurrent(); + gla->makeCurrent(); glDrawBuffer(GL_FRONT); DrawXORRect(gla,true); glDrawBuffer(GL_BACK); - glFlush();*/ - } + glFlush(); + }*/ //qDebug() << "moveEnd" << endl; } @@ -241,6 +265,15 @@ void EditPaintPlugin::mouseReleaseEvent (QAction *,QMouseEvent * event, MeshMod } +inline void colorize(CVertexO * vertice,const Color4b& newcol,int opac) { + Color4b orig=vertice->C(); + orig[0]=min(255,((newcol[0]-orig[0])*opac+orig[0]*(100))/100); + orig[1]=min(255,((newcol[1]-orig[1])*opac+orig[1]*(100))/100); + orig[2]=min(255,((newcol[2]-orig[2])*opac+orig[2]*(100))/100); + orig[3]=min(255,((newcol[3]-orig[3])*opac+orig[3]*(100))/100); + vertice->C()=orig; +} + inline void calcCoord(float x,float y,float z,double matrix[],double *xr,double *yr,double *zr) { *xr=x*matrix[0]+y*matrix[4]+z*matrix[8]+matrix[12]; *yr=x*matrix[1]+y*matrix[5]+z*matrix[9]+matrix[13]; @@ -254,29 +287,36 @@ void getTranspose(double orig[],double inv[]) { inv[12]=orig[3];inv[13]=orig[7];inv[14]=orig[11]; inv[15]=orig[15]; } -inline int isIn(QPointF p0,QPointF p1,float dx,float dy,float radius) { - //qDebug() << p0 << " " << p1 << endl; +inline int isIn(QPointF p0,QPointF p1,float dx,float dy,float radius,float *dist) { + if (p0!=p1) { /** this must be checked first, because of the color decrease tool */ + float x2=(p1.x()-p0.x()); + float y2=(p1.y()-p0.y()); + //double l=sqrt(x2*x2+y2*y2); + float l_square=x2*x2+y2*y2; + float r=(dx-p0.x())*(p1.x()-p0.x())+(dy-p0.y())*(p1.y()-p0.y()); + //r=r/(l*l); + r=r/l_square; + + float px=p0.x()+r*(p1.x()-p0.x()); + float py=p0.y()+r*(p1.y()-p0.y()); + + px=px-dx; + py=py-dy; + + if (r>0 && r<1 && (px*px+py*py0 && r<1 && (px*px+py*pycurSiz.height()-pix_y; //circle_points[lauf]=QPoint(pix_x,inv_yy); //qDebug() << pix_x << " "<=1)qDebug() <<"OK: "<< pix_x << " "<=0 && (int)pix_xcurSiz.width() && (int)pix_y>=0 && (int)pix_ycurSiz.height()) { - double zz=(GLfloat)pixels[(int)(((int)pix_y)*gla->curSiz.width()+(int)pix_x)]; - if (zz<0.99999 && zz0) { + double zz=999; + if ((int)pix_x>=0 && (int)pix_xcurSiz.width() && (int)pix_y>=0 && (int)pix_ycurSiz.height()) + zz=(GLfloat)pixels[(int)(((int)pix_y)*gla->curSiz.width()+(int)pix_x)]; + da=da/2.0; + db=db/2.0; + dc=dc/2.0; + if (fabsf(zz-pix_z)<0.001) { + circle_points[lauf]=QPoint(pix_x,inv_yy); + break; + } else if (zz>pix_z) { + pix_x+=da; + pix_y+=db; + pix_z+=dc; + } else { + pix_x-=da; + pix_y-=db; + pix_z-=dc; + } + /*if (zz<0.99999 && zz0 ) { circle_points[lauf]=QPoint(pix_x,inv_yy); //lauf2=1000; break; - } - } - if (lauf2==STEPS-1 /*|| pix_z>=1*/) { circle_points[lauf]=QPoint(pix_x,inv_yy); break; } + }*/ + + if (lauf2==STEPS-1) { circle_points[lauf]=QPoint(pix_x,inv_yy); break; } } } @@ -476,19 +526,19 @@ void EditPaintPlugin::DrawXORRect(MeshModel &m,GLArea * gla, bool doubleDraw) { glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); - glEnable(GL_BLEND); + /*glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE); //Color4b co=paintbox->getColor(curr_mouse); //qDebug() << co[0] << " " << co[1] << " " << co[2] << endl; glBegin(GL_TRIANGLES); - glColor4d(1,1,1,0.13); + glColor4d(1,1,1,0.0); for (int lauf=0; laufcurSiz.height()-mid.y()); glVertex2f(circle_points[lauf].x(),circle_points[lauf].y()); glVertex2f(circle_points[(lauf+1)%PEZ].x(),circle_points[(lauf+1)%PEZ].y()); } glEnd(); - glDisable(GL_BLEND); + glDisable(GL_BLEND);*/ glEnable(GL_COLOR_LOGIC_OP); glLogicOp(GL_XOR); glColor3f(1,1,1); @@ -519,9 +569,9 @@ void EditPaintPlugin::DrawXORRect(MeshModel &m,GLArea * gla, bool doubleDraw) { int EditPaintPlugin::paintType() { return paintbox->paintType(); } -void getInternFaces(MeshModel & m,vector *actual,vector * risult, +void getInternFaces(MeshModel & m,vector *actual,vector * risult, vector * face_risult, GLArea * gla,Penn &pen,QPoint &cur, QPoint &prev, GLfloat * pixels, - double mvmatrix[16],double projmatrix[16],int viewport[4]) { + double mvmatrix[16],double projmatrix[16],int viewport[4], int what) { QHash selezionati; @@ -577,10 +627,14 @@ void getInternFaces(MeshModel & m,vector *actual,vectorV(lauf))) { - risult->push_back(fac->V(lauf)); + if (what!=SELECT && !sel_vert.contains(fac->V(lauf))) { + Vert_Data d; + d.v=fac->V(lauf); + d.distance=dist; + risult->push_back(/*fac->V(lauf)*/d); sel_vert.insert(fac->V(lauf),fac->V(lauf)); //qDebug() << tx << " " << ty << " " << tz <<" "<< mid< *actual,vectorpush_back(fac); for (int lauf=0; lauf<3; lauf++) { + //face::Pos ip(fac,lauf); + //ip.FlipF(); CFaceO * nf=(fac)->FFp(lauf); - //qDebug () << "nf" << nf->V(0)->P()[0] << endl; - if (!selezionati.contains(nf)) { + if (nf!=0 && !selezionati.contains(nf)) { //actual->push_back(nf); temp_po.push_back(nf); } } + if (what==SELECT) face_risult->push_back(fac); } } @@ -642,12 +698,15 @@ void getInternFaces(MeshModel & m,vector *actual,vectorgetFov()*0.5; + float fov = 1.0/tan(fo*M_PI/180.0)*0.5; + //qDebug() << fo << " " << fov << endl; for (int lauf2=0; lauf2 melgio ricalcolare mid e mid_prev con mvmatrix ??? double dx,dy,dz; // distance @@ -678,11 +737,15 @@ void getInternFaces(MeshModel & m,vector *actual,vectortrackball.track.sca*/radius)==1) { /** i have NO idea why it works with viewport[3]*0.88 */ - if (isIn(mid,mid_prev,tx,ty,pen.radius*scale_fac*viewport[3]*0.88/distance[lauf])==1) { + float dist; + if (isIn(mid,mid_prev,tx,ty,pen.radius*scale_fac *viewport[3]*fov/distance[lauf],&dist)==1) { //if (isIn(QPoint(0,0),QPoint(0,0),tx,ty,pen.radius)==1) { intern=true; - if (!sel_vert.contains(fac->V(lauf))) { - risult->push_back(fac->V(lauf)); + if (what!=SELECT && !sel_vert.contains(fac->V(lauf))) { + Vert_Data d; + d.v=fac->V(lauf); + d.distance=dist; + risult->push_back(/*fac->V(lauf)*/d); sel_vert.insert(fac->V(lauf),fac->V(lauf)); //qDebug() << tx << " " << ty << " " << tz <<" "<< mid< *actual,vectorpush_back(fac); for (int lauf=0; lauf<3; lauf++) { - CFaceO * nf=(fac)->FFp(lauf); - //qDebug () << "nf" << nf->V(0)->P()[0] << endl; + //face::Pos ip(fac,lauf); + //ip.FlipF(); + CFaceO * nf=fac->FFp(lauf);//ip.f; if (!selezionati.contains(nf)) { //actual->push_back(nf); temp_po.push_back(nf); } + if (what==SELECT) face_risult->push_back(fac); } } } @@ -733,9 +798,12 @@ void EditPaintPlugin::fillFrom(MeshModel & m,CFaceO * face) { } } for (int lauf=0; lauf<3; lauf++) { - if (!visited.contains(fac->FFp(lauf))) { - temp_po.push_back(fac->FFp(lauf)); - visited.insert(fac->FFp(lauf),fac->FFp(lauf)); + //face::Pos ip(fac,lauf); + //ip.FlipF(); + CFaceO * nf=fac->FFp(lauf);//ip.f; + if (!visited.contains(nf)) { + temp_po.push_back(nf); + visited.insert(nf,nf); } } } @@ -799,6 +867,13 @@ inline void mergeColor(double percent,const Color4b& c1,const Color4b& c2,Color4 //qDebug() << (*dest)[0] << " "<< (*dest)[1] << " "<< (*dest)[2]<< "percent: "<curSiz.height()- cur.y()); + int utensil=paintbox->paintUtensil(); if (first) { //worker->waitTillPause(); first=false; @@ -914,7 +990,7 @@ void EditPaintPlugin::Decorate(QAction * ac, MeshModel &m, GLArea * gla) { { isDragging=false; //qDebug() << "decorate" << endl; - switch (paintbox->paintUtensil()) { + switch (utensil) { case FILL: { if (!pressed) return; CFaceO * temp_face; @@ -955,36 +1031,48 @@ void EditPaintPlugin::Decorate(QAction * ac, MeshModel &m, GLArea * gla) { pa.opac=paintbox->getOpacity(); worker->addData(pa);*/ - vector::iterator vpo; - vector newSel; + vector::iterator vpo; + //vector newSel; + vector newSel; + + vector faceSel; if (paintbox->searchMode()==2) curSel.clear(); //GLPickTri::PickFace(mid.x(), mid.y(), m.cm, curSel, pen.width.x(), pen.width.y()); //CFaceO * tmp=0; //if (GLPickTri::PickNearestFace(mid.x(), mid.y(), m.cm, tmp, pen.width.x(), pen.width.y())) - getInternFaces(m,&curSel,&newSel,gla,pen,cur,prev,pixels,mvmatrix,projmatrix,viewport); + getInternFaces(m,&curSel,&newSel,&faceSel,gla,pen,cur,prev,pixels,mvmatrix,projmatrix,viewport,utensil); UndoItem u; - QHash originals; - if (paintbox->paintUtensil()==SMOOTH) { + QHash originals; + if (utensil==SMOOTH || utensil==POLY_SMOOTH) { temporaneo.clear(); Color4b newcol,destCol; int opac=paintbox->getSmoothPercentual(); int c_r,c_g,c_b; + float p_x,p_y,p_z; + float newpos[3],destpos[3]; + int decrease_pos=100-paintbox->getDecreasePercentual(); for(vpo=newSel.begin();vpo!=newSel.end();++vpo) { - if (!temporaneo.contains(*vpo)) { - CVertexO * vert=*vpo; - u.vertex=*vpo; - u.original=(*vpo)->C(); - originals.insert(*vpo,(*vpo)->C()); + CVertexO * v=vpo->v; + //float distence=vpo->distance; + if (!temporaneo.contains(v)) { + Vert_Data_2 ved; ved.distance=0; + //CVertexO * vert=v; + u.vertex=v; + u.original=v->C(); + Vert_Data_3 d; d.color=Color4b(v->C()[0],v->C()[1],v->C()[2],v->C()[3]); d.distance=vpo->distance; + for (int lauf=0; lauf<3; lauf++) d.pos[lauf]=v->P()[lauf]; + originals.insert(v,d); color_undo[current_gla]->addItem(u); - temporaneo.insert(*vpo,(*vpo)->C()); + temporaneo.insert(v,/*v->C()*/ved); //qDebug() << "a" << endl; - CFaceO * f= vert->VFp(); + CFaceO * f= v->VFp(); CFaceO * one_face=f; - int pos=vert->VFi(); + int pos=v->VFi(); c_r=c_g=c_b=0; + p_x=p_y=p_z=0; int count_me=0; //qDebug() << "b: " <V(lauf)->C(); - if (originals.contains(one_face->V(lauf))) tco=originals[one_face->V(lauf)]; + CVertexO * v=one_face->V(lauf); + Color4b tco=v->C(); + if (originals.contains(v)) { + Vert_Data_3 dd=originals[v]; + tco=dd.color; + p_x+=dd.pos[0]; p_y+=dd.pos[1]; p_z+=dd.pos[2]; + } + else if (POLY_SMOOTH){ + p_x+=v->P()[0]; p_y+=v->P()[1]; p_z+=v->P()[2]; + + } c_r+=tco[0]; c_g+=tco[1]; c_b+=tco[2]; + } } pos=one_face->VFi(pos); @@ -1005,30 +1103,97 @@ void EditPaintPlugin::Decorate(QAction * ac, MeshModel &m, GLArea * gla) { one_face=temp; } while (one_face!=f && one_face!=0); if (count_me>0) { + float op=0.0; + //qDebug() << vpo->distance << endl; + if (vpo->distance*100.0>(float)decrease_pos) { + op=(vpo->distance*100.0-(float)decrease_pos)/(float)(100-decrease_pos); + //op=op*op; + } //qDebug() << "coloro" <C(),&destCol); - vert->C()[0]=destCol[0]; - vert->C()[1]=destCol[1]; - vert->C()[2]=destCol[2]; + if (utensil==SMOOTH) { + newcol[0]=c_r/count_me; + newcol[1]=c_g/count_me; + newcol[2]=c_b/count_me; + //qDebug() << "opac"<< (float)opac/100.0<< endl; + mergeColor((float)(opac-op*opac)/100.0,newcol,v->C(),&destCol); + v->C()[0]=destCol[0]; + v->C()[1]=destCol[1]; + v->C()[2]=destCol[2]; + } else { + + newpos[0]=p_x/(float)count_me; + newpos[1]=p_y/(float)count_me; + newpos[2]=p_z/(float)count_me; + float po[3]; for (int lauf=0; lauf<3; lauf++) po[lauf]=v->P()[lauf]; + mergePos((float)(opac-op*opac)/100.0,newpos,po,newpos); + for (int lauf=0; lauf<3; lauf++) v->P()[lauf]=newpos[lauf]; + } } + one_face=f; + pos=v->VFi(); + v->N()[0]=0;v->N()[1]=0;v->N()[2]=0; + do { + CFaceO * temp=one_face->VFp(pos); + //qDebug() << "c:" <<(int)one_face <N()+=one_face->V(lauf)->cN(); + } + face::ComputeNormalizedNormal(*one_face); + pos=one_face->VFi(pos); + //qDebug() << "d" << endl; + } + one_face=temp; + } while (one_face!=f && one_face!=0); + v->N().Normalize(); //colorize(*vpo,newcol,opac); } } + /*for(vpo=newSel.begin();vpo!=newSel.end();++vpo) { + CVertexO * v=vpo->v; + }*/ } else { - int opac=paintbox->getOpacity(); - Color4b newcol=paintbox->getColor(curr_mouse); - for(vpo=newSel.begin();vpo!=newSel.end();++vpo) { - if (!temporaneo.contains(*vpo)) { - u.vertex=*vpo; - u.original=(*vpo)->C(); - color_undo[current_gla]->addItem(u); - temporaneo.insert(*vpo,(*vpo)->C()); - colorize(*vpo,newcol,opac); + if (utensil==SELECT) { + vector::iterator fpo; + bool sel_or_not=(curr_mouse==Qt::LeftButton); + for(fpo=faceSel.begin();fpo!=faceSel.end();++fpo) { + if (sel_or_not) (*fpo)->SetS(); + else (*fpo)->ClearS(); } + } else { + int opac=paintbox->getOpacity(); + int decrease_pos=100-paintbox->getDecreasePercentual(); // 100 .. all opac ; 0 .. nothing opac + Color4b newcol=paintbox->getColor(curr_mouse); + for(vpo=newSel.begin();vpo!=newSel.end();++vpo) { + CVertexO * v=vpo->v; + float op=0.0; + //qDebug() << vpo->distance << endl; + if (vpo->distance*100.0>(float)decrease_pos) { + op=(vpo->distance*100.0-(float)decrease_pos)/(float)(100-decrease_pos); + //op=op*op; + } + if (!temporaneo.contains(v)) { + //qDebug() << "new" << endl; + Vert_Data_2 ved; + ved.distance=opac-op*opac; + ved.color=Color4b(v->C()[0],v->C()[1],v->C()[2],v->C()[3]); + temporaneo.insert(v,/*v->C()*/ved); + u.vertex=v; + u.original=v->C(); + color_undo[current_gla]->addItem(u); + colorize(v,newcol,opac-op*opac); + } else { + if (temporaneo[v].distanceC()[0]=temp[0];v->C()[1]=temp[1];v->C()[2]=temp[2]; + //qDebug() <curSiz.width(),gla->curSiz.height()); + /*QPoint old_size=QPoint(gla->curSiz.width(),gla->curSiz.height()); getInternFaces(*mesh,&curSel,&newSel,gla,data.pen,data.start,data.end,pixels,mvmatrix,projmatrix,viewport); for(vpo=newSel.begin();vpo!=newSel.end();++vpo) { @@ -1128,8 +1293,9 @@ void PaintWorker::run() { colorize(*vpo,data.color,data.opac); } } - if (gla!=0) gla->update(); + if (gla!=0) gla->update();*/ } } + Q_EXPORT_PLUGIN(EditPaintPlugin) diff --git a/src/meshlabplugins/editpaint/editpaint.h b/src/meshlabplugins/editpaint/editpaint.h index e82e9afc4..97102c1fa 100755 --- a/src/meshlabplugins/editpaint/editpaint.h +++ b/src/meshlabplugins/editpaint/editpaint.h @@ -1,3 +1,10 @@ +/*************************************************************************** +first version: 0.1 +autor: Gfrei Andreas +date: 07/02/2007 +email: gfrei.andreas@gmx.net +****************************************************************************/ + #ifndef EDITPAINT_H #define EDITPAINT_H @@ -24,18 +31,8 @@ struct UndoItem; int isIn(QPointF p0,QPointF p1,float dx,float dy,float raduis); -inline void colorize(CVertexO * vertice,const Color4b& newcol,int opac) { - Color4b orig=vertice->C(); - orig[0]=min(255,(newcol[0]*opac+orig[0]*(100-opac))/100); - orig[1]=min(255,(newcol[1]*opac+orig[1]*(100-opac))/100); - orig[2]=min(255,(newcol[2]*opac+orig[2]*(100-opac))/100); - orig[3]=min(255,(newcol[3]*opac+orig[3]*(100-opac))/100); - vertice->C()=orig; -} - - -typedef enum {PEN, FILL, PICK, NONE, GRADIENT, SMOOTH} PaintThing; +typedef enum {PEN, FILL, PICK, NONE, GRADIENT, SMOOTH, SELECT, POLY_SMOOTH} PaintThing; class Penn { public: @@ -56,6 +53,24 @@ struct PaintData{ Penn pen; }; +struct Vert_Data { + CVertexO * v; + float distance; +}; + +struct Vert_Data_2 { + //CVertexO * v; + float distance; + Color4b color; +}; + +struct Vert_Data_3{ + //CVertexO * v; + float distance; + float pos[3]; + Color4b color; +}; + class EditPaintPlugin : public QObject, public MeshEditInterface { Q_OBJECT Q_INTERFACES(MeshEditInterface) @@ -96,15 +111,14 @@ private: int inverse_y; // gla->curSiz.height()-cur.y() TODO probably removable vector tempSel; //to use when needed vector curSel; //the faces i am painting on - QHash temporaneo; //the vertexes i am painting on + QHash temporaneo; //the vertexes i am painting on Penn pen; //contains informations about the painting mode, color, type ... - PaintToolbox* paintbox; //the widget with the painting stuff + PaintToolbox *paintbox; //the widget with the painting stuff + QDockWidget *paint_dock; Qt::MouseButton curr_mouse; // which mouse button is selected - PaintWorker * worker; - + //PaintWorker * worker; GLArea* current_gla; - QHash color_undo; int paintType(); @@ -224,14 +238,17 @@ public: Color4b getColor(Qt::MouseButton); void setColor(Color4b,Qt::MouseButton); void setColor(int,int,int,Qt::MouseButton mouse); - inline double getRadius() { return ui.pen_radius->value(); } - inline int paintType() { /*if (ui.pen_type->currentText()=="pixel") return 1; return 2;*/ return ui.pen_type->currentIndex()+1; } - inline int searchMode() { return ui.search_mode->currentIndex()+1; } - inline int getOpacity() { return ui.deck_slider->value(); } - inline int getSmoothPercentual() { return ui.percentual_slider->value(); } - inline int paintUtensil() { return paint_utensil; } - inline bool getPaintBackface() { return ui.backface_culling->checkState()!=Qt::Unchecked; } - inline bool getPaintInvisible() { return ui.invisible_painting->checkState()!=Qt::Unchecked; } + double getRadius() { if (ui.tabWidget->currentIndex()==1) return ui.pen_radius_2->value(); return ui.pen_radius->value(); } + int paintType() { if (ui.tabWidget->currentIndex()==1) return ui.pen_type_2->currentIndex()+1; return ui.pen_type->currentIndex()+1; } + int searchMode() { return ui.search_mode->currentIndex()+1; } + int getOpacity() { return ui.deck_slider->value(); } + int getSmoothPercentual() { if (ui.tabWidget->currentIndex()==1) return ui.percentual_slider_2->value(); return ui.percentual_slider->value(); } + int getDecreasePercentual() { if (ui.tabWidget->currentIndex()==1) return ui.decrease_slider_2->value(); return ui.decrease_slider->value(); } + int paintUtensil() { if (ui.tabWidget->currentIndex()<2) return paint_utensil[ui.tabWidget->currentIndex()]; else return NONE; } + bool getPaintBackface() { if (ui.tabWidget->currentIndex()==1) return ui.backface_culling_2->checkState()!=Qt::Unchecked; + return ui.backface_culling->checkState()!=Qt::Unchecked; } + bool getPaintInvisible() { if (ui.tabWidget->currentIndex()==1) return ui.invisible_painting_2->checkState()!=Qt::Unchecked; + return ui.invisible_painting->checkState()!=Qt::Unchecked; } inline int getGradientType() { return ui.gradient_type->currentIndex(); } inline int getGradientForm() { return ui.gradient_form->currentIndex(); } @@ -240,7 +257,7 @@ public: void setUndo(bool value) { ui.undo_button->setEnabled(value); } void setRedo(bool value) { ui.redo_button->setEnabled(value); } private: - int paint_utensil; + int paint_utensil[2]; Ui::PaintToolbox ui; private slots: void on_pen_type_currentIndexChanged(QString value); @@ -252,7 +269,7 @@ private slots: void on_pen_button_clicked(); void on_fill_button_clicked(); void on_pick_button_clicked(); - void on_advanced_button_clicked(); + //void on_advanced_button_clicked(); void on_backface_culling_stateChanged(int value); void on_invisible_painting_stateChanged(int value); void on_undo_button_clicked(); @@ -261,6 +278,19 @@ private slots: void on_smooth_button_clicked(); void on_percentual_slider_valueChanged(int value); void on_percentual_box_valueChanged(int value); + void on_tabWidget_currentChanged ( int index ); + void on_select_button_clicked(); + void on_poly_smooth_button_clicked(); + + void on_decrease_slider_valueChanged(int value); + void on_decrease_box_valueChanged(int value); + + void on_percentual_slider_2_valueChanged(int value); + void on_percentual_box_2_valueChanged(int value); + void on_decrease_slider_2_valueChanged(int value); + void on_decrease_box_2_valueChanged(int value); + void on_pen_type_2_currentIndexChanged(QString value); + void on_pen_radius_2_valueChanged(double value); signals: void undo_redo(int value); //void redo(); diff --git a/src/meshlabplugins/editpaint/images/pinsel_select.png b/src/meshlabplugins/editpaint/images/pinsel_select.png new file mode 100644 index 0000000000000000000000000000000000000000..cef78c087b307a27a369eede2c8e742ab53ee5ea GIT binary patch literal 2422 zcmV-+35oWJP)_>Nx%eENB<9W$p#pG_+oiHeQQP%A#SUm5IIi zd}XG<*i`v>iGxSCTuO#2SOi{}MaD=AuZzftp8UQN0_3I2?Gv-O@1bHi&JGbtisU=&1;|g6doCEovL|O?3xwcwD|Wz&GMt5Wwu*?H?mw&raN6WgGe+}^ zKTah*(52^3w~NNWfLmT>ueDblLc5=_Cp!k2JPu2NZ5B=lF;9ENN-iry|xr zlm!qGtINjTm1X2j$e>#e?+u=Iba6RH-OXI%Yu9&sY-6YjAR>NXV2=%WS?mbU+Zs_AJpN$cMtoky_~PA-agwJY62vS zI14h^x%xb^Mi|WU|E$LQWvc2QXdH17pfE%3o8aJ=^IRkv@hd;Z$xVlN_izgrYm@>XQ~^Xpin7d` z&aww*UzM*B6J1Zy{QVHVcaHK*wO1ELHKxH5z?CkS*^>D4)NDE9zd@@wt?is+Z|l=f z6`pa^vb&yD$6ECd(T;0S1Q>0VIe9iVUROx6B>{p8n`+WXF@>0&-AebP$}j>Uc%l-| z$Bq1`(XX$>BDRJEZ#NvpCb#CC7&pHrHA?84xbZX~mpyY8)*A^odFu zDjS&QSN%99K@w#FTrStuX4PdjyWL^S%uM(D{Y`GS`>1%1optLu*pnmd@XG5`sBbfI zc}@$Rsj&7Wq4oQzscdATsy0L|zzB$n03u>5DJb~Ic|}EEfB3GulG8?w0-Fs|Qt1eEXK4Rkm;kl*R$7?M4gY&o?8E#2R(Yp zfPylB0X-LRI-Td{TCFc`Shz52n$rnBAGEfHt+U(#m&+w@@7gQD!s)zxSh_vIDN6Hm zu(AF4V3LOc2#}qf?Q*83ZdrH9CH5S%IWqaqatD%=lX>ygH!wNR*MHZX`t)XdErB{; z=$@#sG5`VcRP~S{ClT}1l9K&vOH1=6jvd>5*heZ`zS#G8ye#^ah)HLk{n#9nDI+ToFh<_zgZ3}7+WPhDs{?^Rd5rn> zi3ETY;5kUY1HP3B6(TY|(#_+?kDpT9)^^2Wzu!3d(?-FzZQELam~3y2;FK(IGbC<; z{A_qHN#u&IpNWXcnUwU*lDfJ?b0;CAGOh{~+@05u$xOba?~5A+l_+K4ECpD)Od z>CL+zqhRCKt-j?ucDO5AT4t(hZ45XJ2;Br|237&L0X@E6*$LGiM?uArBY|c6_SJvr z@jQCS?_UwEQ{1RS!!%SuYe8=X^>n$`FSA-zb8=LRinO-4IJ77;vvGpex}NZnSlr(s z?#({W0!M(ggol2_cS?If6R+=Of?~;5EYkbe>X&I!rtM3Xllo0WP4B@b?IS zS0H#D)YZe4sy)AxGvr`suJ>X4K*vEtI@}WPxovn2h!$FaxzM;Bwlu(xhtj4eBBD70 zy4q^+W`<{0ZoGTBH;b773c49WBj7kNGu}kwB7lNcffhl74VJ~5?4Yaxk#G{21it;S zu3hz(Shr^cG5^6tBXBh|)xkRfSQ+c~3?r7q|1Ho_P@e`ri}z3;)HR?D^w-dm1s?;h zc#|Ad0V+X@;Y23f518Xka8Lz!1lqEo2DmWZ#QJMd`OQ!R@Iz?Y1?BZHUsao;QSYE& opuN5sLOJ1u?%H_w=9jVm0Xbp;hC0YlkpKVy07*qoM6N<$g7gKXbpQYW literal 0 HcmV?d00001 diff --git a/src/meshlabplugins/editpaint/meshlab.qrc b/src/meshlabplugins/editpaint/meshlab.qrc index 9e2f0db44..46105baa4 100755 --- a/src/meshlabplugins/editpaint/meshlab.qrc +++ b/src/meshlabplugins/editpaint/meshlab.qrc @@ -2,6 +2,7 @@ images/smooth_me.png images/pinsel.png + images/pinsel_select.png images/pinsel2.png images/fill.png images/bw.png diff --git a/src/meshlabplugins/editpaint/paintbox.cpp b/src/meshlabplugins/editpaint/paintbox.cpp index 1f11a3faa..bea1f2070 100644 --- a/src/meshlabplugins/editpaint/paintbox.cpp +++ b/src/meshlabplugins/editpaint/paintbox.cpp @@ -1,3 +1,10 @@ +/*************************************************************************** +first version: 0.1 +autor: Gfrei Andreas +date: 07/02/2007 +email: gfrei.andreas@gmx.net +****************************************************************************/ + #include "editpaint.h" #include #include @@ -32,7 +39,7 @@ void ColorWid::mousePressEvent ( QMouseEvent * event ) { update(); } -PaintToolbox::PaintToolbox(/*const QString & title,*/ QWidget * parent, Qt::WindowFlags flags) : QWidget(/*parent*/0,flags | Qt::WindowStaysOnTopHint | Qt::Window) { +PaintToolbox::PaintToolbox(/*const QString & title,*/ QWidget * parent, Qt::WindowFlags flags) : QWidget(/*parent*/0,flags/* | Qt::WindowStaysOnTopHint*/) { ui.setupUi(this); ui.front->setColor(Qt::black); ui.back->setColor(Qt::white); @@ -41,15 +48,28 @@ PaintToolbox::PaintToolbox(/*const QString & title,*/ QWidget * parent, Qt::Wind ui.switch_me->setGeometry(55,10,15,15); ui.set_bw->setGeometry(10,45,15,15); QPoint p=parent->mapToGlobal(QPoint(0,0)); - setGeometry(p.x()+parent->width()-/*width()*/60,p.y(),/*width()*/100,/*height()*/100); + //QDesktopWidget::screenGeometry(); //ui.fill_button->setEnabled(false); ui.pick_frame->setVisible(false); - ui.advanced_frame->setVisible(false); + //ui.advanced_frame->setVisible(false); ui.pen_button->setChecked(true); ui.undo_button->setEnabled(false); ui.redo_button->setEnabled(false); ui.gradient_frame->setVisible(false); ui.smooth_frame->setVisible(false); + //ui.select_widget->setVisible(false); + ui.tabWidget->widget(0)->layout()->setMargin(2); + ui.tabWidget->widget(0)->layout()->setSpacing(2); + ui.tabWidget->widget(1)->layout()->setMargin(2); + ui.tabWidget->widget(1)->layout()->setSpacing(2); + //#################### + setGeometry(p.x()+parent->width()-width(),p.y(),/*width()*/width(),/*height()*/400); + ui.select_button->setChecked(true); + //ui.pen_select_frame->setEnabled(true); + ui.poly_smooth_frame->setVisible(false); + paint_utensil[0]=PEN; + paint_utensil[1]=SELECT; + //this->setWidget(wi); } Color4b PaintToolbox::getColor(Qt::MouseButton mouse) { @@ -75,6 +95,7 @@ void PaintToolbox::on_pen_radius_valueChanged(double value) { } oldval=ui.pen_radius->value(); } + void PaintToolbox::on_switch_me_clicked() { QColor temp=ui.front->getColor(); ui.front->setColor(ui.back->getColor()); @@ -89,6 +110,7 @@ void PaintToolbox::on_set_bw_clicked() { //ui.back->update(); } + void PaintToolbox::on_deck_slider_valueChanged(int value) { if (value!=ui.deck_box->value()) ui.deck_box->setValue(value); } @@ -105,66 +127,129 @@ void PaintToolbox::on_percentual_box_valueChanged(int value) { if (value!=ui.percentual_slider->value()) ui.percentual_box->setValue((int)value); } +void PaintToolbox::on_decrease_slider_valueChanged(int value) { + if (value!=ui.decrease_box->value()) ui.decrease_box->setValue(value); +} + +void PaintToolbox::on_decrease_box_valueChanged(int value) { + if (value!=ui.decrease_slider->value()) ui.decrease_box->setValue((int)value); +} + + void PaintToolbox::on_pen_button_clicked() { - paint_utensil=PEN; + paint_utensil[0]=PEN; ui.pen_frame->setVisible(true); ui.pen_extra_frame->setVisible(true); ui.pick_frame->setVisible(false); - ui.advanced_frame->setVisible(false); + //ui.advanced_frame->setVisible(false); ui.gradient_frame->setVisible(false); ui.smooth_frame->setVisible(false); } void PaintToolbox::on_fill_button_clicked() { - paint_utensil=FILL; + paint_utensil[0]=FILL; ui.pen_frame->setVisible(true); ui.pen_extra_frame->setVisible(false); ui.pick_frame->setVisible(false); - ui.advanced_frame->setVisible(false); + //ui.advanced_frame->setVisible(false); ui.gradient_frame->setVisible(false); ui.smooth_frame->setVisible(false); } void PaintToolbox::on_pick_button_clicked() { - paint_utensil=PICK; + paint_utensil[0]=PICK; ui.pen_frame->setVisible(false); ui.pen_extra_frame->setVisible(false); ui.pick_frame->setVisible(true); - ui.advanced_frame->setVisible(false); + //ui.advanced_frame->setVisible(false); ui.gradient_frame->setVisible(false); ui.smooth_frame->setVisible(false); } -void PaintToolbox::on_advanced_button_clicked() { +/*void PaintToolbox::on_advanced_button_clicked() { paint_utensil=NONE; ui.pen_frame->setVisible(false); ui.pen_extra_frame->setVisible(false); ui.pick_frame->setVisible(false); - ui.advanced_frame->setVisible(true); + //ui.advanced_frame->setVisible(true); ui.gradient_frame->setVisible(false); ui.smooth_frame->setVisible(false); -} +}*/ void PaintToolbox::on_gradient_button_clicked() { - paint_utensil=GRADIENT; + paint_utensil[0]=GRADIENT; ui.pen_frame->setVisible(true); ui.pen_extra_frame->setVisible(false); ui.pick_frame->setVisible(false); - ui.advanced_frame->setVisible(false); + //ui.advanced_frame->setVisible(false); ui.gradient_frame->setVisible(true); ui.smooth_frame->setVisible(false); } void PaintToolbox::on_smooth_button_clicked() { - paint_utensil=SMOOTH; + paint_utensil[0]=SMOOTH; ui.pen_frame->setVisible(false); ui.pen_extra_frame->setVisible(true); ui.pick_frame->setVisible(false); - ui.advanced_frame->setVisible(false); + //ui.advanced_frame->setVisible(false); ui.gradient_frame->setVisible(false); ui.smooth_frame->setVisible(true); } +void PaintToolbox::on_tabWidget_currentChanged ( int index ) { + switch (index) { + /*case 0: { ui.select_widget->setVisible(false); ui.paint_widget->setVisible(true); } break; + case 1: { ui.select_widget->setVisible(true); ui.paint_widget->setVisible(false); } break; + case 2: { ui.select_widget->setVisible(false); ui.paint_widget->setVisible(false); } break;*/ + } + //resize(10,10); +} + +void PaintToolbox::on_select_button_clicked() { + paint_utensil[1]=SELECT; + ui.pen_select_frame->setVisible(true); + ui.poly_smooth_frame->setVisible(false); +} +void PaintToolbox::on_poly_smooth_button_clicked() { + paint_utensil[1]=POLY_SMOOTH; + ui.pen_select_frame->setVisible(true); + ui.poly_smooth_frame->setVisible(true); +} + +void PaintToolbox::on_percentual_slider_2_valueChanged(int value) { + if (value!=ui.percentual_box_2->value()) ui.percentual_box_2->setValue(value); +} + +void PaintToolbox::on_percentual_box_2_valueChanged(int value) { + if (value!=ui.percentual_slider_2->value()) ui.percentual_box_2->setValue((int)value); +} + +void PaintToolbox::on_decrease_slider_2_valueChanged(int value) { + if (value!=ui.decrease_box_2->value()) ui.decrease_box_2->setValue(value); +} + +void PaintToolbox::on_decrease_box_2_valueChanged(int value) { + if (value!=ui.decrease_slider_2->value()) ui.decrease_box_2->setValue((int)value); +} + +void PaintToolbox::on_pen_type_2_currentIndexChanged(QString value) { + on_pen_radius_2_valueChanged( ui.pen_radius_2->value()); +} + +void PaintToolbox::on_pen_radius_2_valueChanged(double value) { + static double oldval=-1; + if (ui.pen_type_2->currentText()=="pixel") { + if ((double)((int)value)!=value) { + if (oldvalsetValue((double)((int)value)+1); + else ui.pen_radius_2->setValue((double)((int)value)); + } + } else { + } + oldval=ui.pen_radius_2->value(); +} + + void PaintToolbox::setColor(Color4b newcol,Qt::MouseButton mouse) { switch (mouse) { case Qt::LeftButton: {ui.front->setColor(toQcolor(newcol)); return; } diff --git a/src/meshlabplugins/editpaint/ui_painttoolbox.h b/src/meshlabplugins/editpaint/ui_painttoolbox.h index 408a68dbe..254bfeea7 100644 --- a/src/meshlabplugins/editpaint/ui_painttoolbox.h +++ b/src/meshlabplugins/editpaint/ui_painttoolbox.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading ui file 'PaintToolbox.ui' ** -** Created: Thu Feb 1 16:57:04 2007 +** Created: Mon Feb 5 18:13:56 2007 ** by: Qt User Interface Compiler version 4.2.1 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! @@ -21,7 +21,9 @@ #include #include #include +#include #include +#include #include #include #include "colorwid.h" @@ -30,215 +32,181 @@ class Ui_PaintToolbox { public: QGridLayout *gridLayout; - QFrame *smooth_frame; + QTabWidget *tabWidget; + QWidget *tab; QGridLayout *gridLayout1; + QWidget *widget; + QToolButton *fill_button; + QToolButton *gradient_button; + QToolButton *smooth_button; + QToolButton *pick_button; + QToolButton *pen_button; + QFrame *frame_3; + QToolButton *redo_button; + QToolButton *undo_button; + QFrame *color_frame; + QToolButton *set_bw; + QToolButton *switch_me; + ColorWid *back; + ColorWid *front; + QFrame *gradient_frame; + QGridLayout *gridLayout2; + QLabel *label_4; + QComboBox *gradient_type; + QLabel *label_3; + QComboBox *gradient_form; + QFrame *pick_frame; + QGridLayout *gridLayout3; + QComboBox *pick_mode; + QLabel *label_pick; + QFrame *pen_extra_frame; + QGridLayout *gridLayout4; + QSpinBox *decrease_box; + QCheckBox *backface_culling; + QCheckBox *invisible_painting; + QLabel *label; + QDoubleSpinBox *pen_radius; + QComboBox *pen_type; + QLabel *label_pen; + QSlider *decrease_slider; + QLabel *label_percentual_3; + QFrame *smooth_frame; + QGridLayout *gridLayout5; QSlider *percentual_slider; QLabel *label_percentual; QSpinBox *percentual_box; - QFrame *pen_extra_frame; - QGridLayout *gridLayout2; - QCheckBox *backface_culling; - QLabel *label_pen; - QLabel *label; - QComboBox *pen_type; - QDoubleSpinBox *pen_radius; - QCheckBox *invisible_painting; QFrame *pen_frame; - QGridLayout *gridLayout3; + QGridLayout *gridLayout6; QSpinBox *deck_box; QLabel *label_deck; QLabel *label_penmodus; QComboBox *pen_modus; QSlider *deck_slider; - QFrame *advanced_frame; - QGridLayout *gridLayout4; + QWidget *tab_2; + QGridLayout *gridLayout7; + QSpacerItem *spacerItem; + QFrame *pen_select_frame; + QGridLayout *gridLayout8; + QLabel *label_5; + QDoubleSpinBox *pen_radius_2; + QLabel *label_pen_2; + QSlider *decrease_slider_2; + QSpinBox *decrease_box_2; + QLabel *label_6; + QComboBox *pen_type_2; + QCheckBox *backface_culling_2; + QCheckBox *invisible_painting_2; + QFrame *poly_smooth_frame; + QGridLayout *gridLayout9; + QSlider *percentual_slider_2; + QLabel *label_percentual_2; + QSpinBox *percentual_box_2; + QWidget *widget_2; + QToolButton *poly_smooth_button; + QToolButton *select_button; + QWidget *tab_3; + QGridLayout *gridLayout10; QComboBox *search_mode; QLabel *label_2; - QFrame *color_frame; - QToolButton *set_bw; - QToolButton *switch_me; - ColorWid *front; - ColorWid *back; - QFrame *frame_3; - QToolButton *redo_button; - QToolButton *undo_button; - QFrame *top_frame; - QToolButton *gradient_button; - QToolButton *fill_button; - QToolButton *pen_button; - QToolButton *advanced_button; - QToolButton *smooth_button; - QToolButton *pick_button; - QFrame *pick_frame; - QGridLayout *gridLayout5; - QComboBox *pick_mode; - QLabel *label_pick; - QFrame *gradient_frame; - QGridLayout *gridLayout6; - QLabel *label_4; - QComboBox *gradient_type; - QLabel *label_3; - QComboBox *gradient_form; + QSpacerItem *spacerItem1; + QSpacerItem *spacerItem2; void setupUi(QWidget *PaintToolbox) { PaintToolbox->setObjectName(QString::fromUtf8("PaintToolbox")); + QSizePolicy sizePolicy(static_cast(5), static_cast(5)); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(PaintToolbox->sizePolicy().hasHeightForWidth()); + PaintToolbox->setSizePolicy(sizePolicy); gridLayout = new QGridLayout(PaintToolbox); gridLayout->setSpacing(2); gridLayout->setMargin(2); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - smooth_frame = new QFrame(PaintToolbox); - smooth_frame->setObjectName(QString::fromUtf8("smooth_frame")); - smooth_frame->setFrameShape(QFrame::StyledPanel); - smooth_frame->setFrameShadow(QFrame::Raised); - gridLayout1 = new QGridLayout(smooth_frame); + tabWidget = new QTabWidget(PaintToolbox); + tabWidget->setObjectName(QString::fromUtf8("tabWidget")); + QSizePolicy sizePolicy1(static_cast(7), static_cast(7)); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(tabWidget->sizePolicy().hasHeightForWidth()); + tabWidget->setSizePolicy(sizePolicy1); + tabWidget->setMinimumSize(QSize(0, 320)); + tab = new QWidget(); + tab->setObjectName(QString::fromUtf8("tab")); + gridLayout1 = new QGridLayout(tab); gridLayout1->setSpacing(6); gridLayout1->setMargin(9); gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - percentual_slider = new QSlider(smooth_frame); - percentual_slider->setObjectName(QString::fromUtf8("percentual_slider")); - percentual_slider->setMaximum(100); - percentual_slider->setValue(25); - percentual_slider->setSliderPosition(25); - percentual_slider->setOrientation(Qt::Horizontal); + widget = new QWidget(tab); + widget->setObjectName(QString::fromUtf8("widget")); + widget->setMinimumSize(QSize(0, 60)); + fill_button = new QToolButton(widget); + fill_button->setObjectName(QString::fromUtf8("fill_button")); + fill_button->setGeometry(QRect(50, 10, 48, 48)); + fill_button->setIcon(QIcon(QString::fromUtf8(":/images/fill.png"))); + fill_button->setIconSize(QSize(48, 48)); + fill_button->setCheckable(true); + fill_button->setAutoExclusive(true); + fill_button->setAutoRaise(false); + gradient_button = new QToolButton(widget); + gradient_button->setObjectName(QString::fromUtf8("gradient_button")); + gradient_button->setGeometry(QRect(100, 10, 48, 48)); + gradient_button->setIcon(QIcon(QString::fromUtf8(":/images/gradient.png"))); + gradient_button->setIconSize(QSize(48, 48)); + gradient_button->setCheckable(true); + gradient_button->setAutoExclusive(true); + gradient_button->setAutoRaise(false); + smooth_button = new QToolButton(widget); + smooth_button->setObjectName(QString::fromUtf8("smooth_button")); + smooth_button->setGeometry(QRect(150, 10, 48, 48)); + smooth_button->setIcon(QIcon(QString::fromUtf8(":/images/smooth_me.png"))); + smooth_button->setIconSize(QSize(48, 48)); + smooth_button->setCheckable(true); + smooth_button->setAutoExclusive(true); + smooth_button->setAutoRaise(false); + pick_button = new QToolButton(widget); + pick_button->setObjectName(QString::fromUtf8("pick_button")); + pick_button->setGeometry(QRect(200, 10, 48, 48)); + pick_button->setIcon(QIcon(QString::fromUtf8(":/images/pick.png"))); + pick_button->setIconSize(QSize(48, 48)); + pick_button->setCheckable(true); + pick_button->setAutoExclusive(true); + pick_button->setAutoRaise(false); + pen_button = new QToolButton(widget); + pen_button->setObjectName(QString::fromUtf8("pen_button")); + pen_button->setGeometry(QRect(0, 10, 48, 48)); + pen_button->setIcon(QIcon(QString::fromUtf8(":/images/pinsel2.png"))); + pen_button->setIconSize(QSize(48, 48)); + pen_button->setCheckable(true); + pen_button->setAutoExclusive(true); + pen_button->setAutoRaise(false); - gridLayout1->addWidget(percentual_slider, 0, 1, 1, 1); + gridLayout1->addWidget(widget, 0, 0, 1, 2); - label_percentual = new QLabel(smooth_frame); - label_percentual->setObjectName(QString::fromUtf8("label_percentual")); + frame_3 = new QFrame(tab); + frame_3->setObjectName(QString::fromUtf8("frame_3")); + frame_3->setFrameShape(QFrame::StyledPanel); + frame_3->setFrameShadow(QFrame::Raised); + redo_button = new QToolButton(frame_3); + redo_button->setObjectName(QString::fromUtf8("redo_button")); + redo_button->setGeometry(QRect(60, 10, 48, 48)); + redo_button->setIcon(QIcon(QString::fromUtf8(":/images/redo.png"))); + redo_button->setIconSize(QSize(48, 48)); + undo_button = new QToolButton(frame_3); + undo_button->setObjectName(QString::fromUtf8("undo_button")); + undo_button->setGeometry(QRect(10, 10, 48, 48)); + undo_button->setIcon(QIcon(QString::fromUtf8(":/images/undo.png"))); + undo_button->setIconSize(QSize(48, 48)); - gridLayout1->addWidget(label_percentual, 0, 0, 1, 1); + gridLayout1->addWidget(frame_3, 1, 1, 1, 1); - percentual_box = new QSpinBox(smooth_frame); - percentual_box->setObjectName(QString::fromUtf8("percentual_box")); - percentual_box->setMaximum(100); - percentual_box->setValue(25); - - gridLayout1->addWidget(percentual_box, 0, 2, 1, 1); - - - gridLayout->addWidget(smooth_frame, 3, 0, 1, 2); - - pen_extra_frame = new QFrame(PaintToolbox); - pen_extra_frame->setObjectName(QString::fromUtf8("pen_extra_frame")); - pen_extra_frame->setFrameShape(QFrame::StyledPanel); - pen_extra_frame->setFrameShadow(QFrame::Raised); - gridLayout2 = new QGridLayout(pen_extra_frame); - gridLayout2->setSpacing(6); - gridLayout2->setMargin(9); - gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); - backface_culling = new QCheckBox(pen_extra_frame); - backface_culling->setObjectName(QString::fromUtf8("backface_culling")); - - gridLayout2->addWidget(backface_culling, 1, 1, 1, 2); - - label_pen = new QLabel(pen_extra_frame); - label_pen->setObjectName(QString::fromUtf8("label_pen")); - - gridLayout2->addWidget(label_pen, 0, 0, 1, 1); - - label = new QLabel(pen_extra_frame); - label->setObjectName(QString::fromUtf8("label")); - - gridLayout2->addWidget(label, 1, 0, 1, 1); - - pen_type = new QComboBox(pen_extra_frame); - pen_type->setObjectName(QString::fromUtf8("pen_type")); - QSizePolicy sizePolicy(static_cast(5), static_cast(0)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(pen_type->sizePolicy().hasHeightForWidth()); - pen_type->setSizePolicy(sizePolicy); - - gridLayout2->addWidget(pen_type, 0, 2, 1, 2); - - pen_radius = new QDoubleSpinBox(pen_extra_frame); - pen_radius->setObjectName(QString::fromUtf8("pen_radius")); - pen_radius->setDecimals(1); - pen_radius->setMaximum(70); - pen_radius->setMinimum(0.1); - pen_radius->setSingleStep(0.1); - pen_radius->setValue(25); - - gridLayout2->addWidget(pen_radius, 0, 1, 1, 1); - - invisible_painting = new QCheckBox(pen_extra_frame); - invisible_painting->setObjectName(QString::fromUtf8("invisible_painting")); - - gridLayout2->addWidget(invisible_painting, 1, 3, 1, 1); - - - gridLayout->addWidget(pen_extra_frame, 4, 0, 1, 2); - - pen_frame = new QFrame(PaintToolbox); - pen_frame->setObjectName(QString::fromUtf8("pen_frame")); - pen_frame->setFrameShape(QFrame::StyledPanel); - pen_frame->setFrameShadow(QFrame::Raised); - gridLayout3 = new QGridLayout(pen_frame); - gridLayout3->setSpacing(6); - gridLayout3->setMargin(9); - gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); - deck_box = new QSpinBox(pen_frame); - deck_box->setObjectName(QString::fromUtf8("deck_box")); - deck_box->setMaximum(100); - deck_box->setValue(100); - - gridLayout3->addWidget(deck_box, 0, 2, 1, 1); - - label_deck = new QLabel(pen_frame); - label_deck->setObjectName(QString::fromUtf8("label_deck")); - - gridLayout3->addWidget(label_deck, 0, 0, 1, 1); - - label_penmodus = new QLabel(pen_frame); - label_penmodus->setObjectName(QString::fromUtf8("label_penmodus")); - - gridLayout3->addWidget(label_penmodus, 1, 0, 1, 1); - - pen_modus = new QComboBox(pen_frame); - pen_modus->setObjectName(QString::fromUtf8("pen_modus")); - - gridLayout3->addWidget(pen_modus, 1, 1, 1, 2); - - deck_slider = new QSlider(pen_frame); - deck_slider->setObjectName(QString::fromUtf8("deck_slider")); - deck_slider->setMaximum(100); - deck_slider->setValue(100); - deck_slider->setOrientation(Qt::Horizontal); - - gridLayout3->addWidget(deck_slider, 0, 1, 1, 1); - - - gridLayout->addWidget(pen_frame, 2, 0, 1, 2); - - advanced_frame = new QFrame(PaintToolbox); - advanced_frame->setObjectName(QString::fromUtf8("advanced_frame")); - advanced_frame->setFrameShape(QFrame::StyledPanel); - advanced_frame->setFrameShadow(QFrame::Raised); - gridLayout4 = new QGridLayout(advanced_frame); - gridLayout4->setSpacing(6); - gridLayout4->setMargin(9); - gridLayout4->setObjectName(QString::fromUtf8("gridLayout4")); - search_mode = new QComboBox(advanced_frame); - search_mode->setObjectName(QString::fromUtf8("search_mode")); - - gridLayout4->addWidget(search_mode, 0, 1, 1, 1); - - label_2 = new QLabel(advanced_frame); - label_2->setObjectName(QString::fromUtf8("label_2")); - - gridLayout4->addWidget(label_2, 0, 0, 1, 1); - - - gridLayout->addWidget(advanced_frame, 6, 0, 1, 2); - - color_frame = new QFrame(PaintToolbox); + color_frame = new QFrame(tab); color_frame->setObjectName(QString::fromUtf8("color_frame")); - QSizePolicy sizePolicy1(static_cast(5), static_cast(0)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(color_frame->sizePolicy().hasHeightForWidth()); - color_frame->setSizePolicy(sizePolicy1); + QSizePolicy sizePolicy2(static_cast(5), static_cast(0)); + sizePolicy2.setHorizontalStretch(0); + sizePolicy2.setVerticalStretch(0); + sizePolicy2.setHeightForWidth(color_frame->sizePolicy().hasHeightForWidth()); + color_frame->setSizePolicy(sizePolicy2); color_frame->setMinimumSize(QSize(70, 70)); color_frame->setMaximumSize(QSize(16777215, 70)); color_frame->setFrameShape(QFrame::StyledPanel); @@ -255,161 +223,453 @@ public: switch_me->setIcon(QIcon(QString::fromUtf8(":/images/switch.png"))); switch_me->setIconSize(QSize(15, 15)); switch_me->setAutoRaise(true); - front = new ColorWid(color_frame); - front->setObjectName(QString::fromUtf8("front")); - front->setGeometry(QRect(50, 20, 40, 40)); - front->setAutoFillBackground(true); back = new ColorWid(color_frame); back->setObjectName(QString::fromUtf8("back")); back->setGeometry(QRect(10, 10, 40, 40)); back->setAutoFillBackground(true); + front = new ColorWid(color_frame); + front->setObjectName(QString::fromUtf8("front")); + front->setGeometry(QRect(50, 20, 40, 40)); + front->setAutoFillBackground(true); - gridLayout->addWidget(color_frame, 1, 0, 1, 1); + gridLayout1->addWidget(color_frame, 1, 0, 1, 1); - frame_3 = new QFrame(PaintToolbox); - frame_3->setObjectName(QString::fromUtf8("frame_3")); - frame_3->setFrameShape(QFrame::StyledPanel); - frame_3->setFrameShadow(QFrame::Raised); - redo_button = new QToolButton(frame_3); - redo_button->setObjectName(QString::fromUtf8("redo_button")); - redo_button->setGeometry(QRect(60, 10, 48, 48)); - redo_button->setIcon(QIcon(QString::fromUtf8(":/images/redo.png"))); - redo_button->setIconSize(QSize(48, 48)); - undo_button = new QToolButton(frame_3); - undo_button->setObjectName(QString::fromUtf8("undo_button")); - undo_button->setGeometry(QRect(10, 10, 48, 48)); - undo_button->setIcon(QIcon(QString::fromUtf8(":/images/undo.png"))); - undo_button->setIconSize(QSize(48, 48)); - - gridLayout->addWidget(frame_3, 1, 1, 1, 1); - - top_frame = new QFrame(PaintToolbox); - top_frame->setObjectName(QString::fromUtf8("top_frame")); - QSizePolicy sizePolicy2(static_cast(5), static_cast(7)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(top_frame->sizePolicy().hasHeightForWidth()); - top_frame->setSizePolicy(sizePolicy2); - top_frame->setMinimumSize(QSize(16, 120)); - top_frame->setFrameShape(QFrame::StyledPanel); - top_frame->setFrameShadow(QFrame::Raised); - gradient_button = new QToolButton(top_frame); - gradient_button->setObjectName(QString::fromUtf8("gradient_button")); - gradient_button->setGeometry(QRect(110, 10, 48, 48)); - gradient_button->setIcon(QIcon(QString::fromUtf8(":/images/gradient.png"))); - gradient_button->setIconSize(QSize(48, 48)); - gradient_button->setCheckable(true); - gradient_button->setAutoExclusive(true); - gradient_button->setAutoRaise(false); - fill_button = new QToolButton(top_frame); - fill_button->setObjectName(QString::fromUtf8("fill_button")); - fill_button->setGeometry(QRect(60, 10, 48, 48)); - fill_button->setIcon(QIcon(QString::fromUtf8(":/images/fill.png"))); - fill_button->setIconSize(QSize(48, 48)); - fill_button->setCheckable(true); - fill_button->setAutoExclusive(true); - fill_button->setAutoRaise(false); - pen_button = new QToolButton(top_frame); - pen_button->setObjectName(QString::fromUtf8("pen_button")); - pen_button->setGeometry(QRect(10, 10, 48, 48)); - pen_button->setIcon(QIcon(QString::fromUtf8(":/images/pinsel2.png"))); - pen_button->setIconSize(QSize(48, 48)); - pen_button->setCheckable(true); - pen_button->setAutoExclusive(true); - pen_button->setAutoRaise(false); - advanced_button = new QToolButton(top_frame); - advanced_button->setObjectName(QString::fromUtf8("advanced_button")); - advanced_button->setGeometry(QRect(10, 60, 48, 48)); - advanced_button->setIcon(QIcon(QString::fromUtf8(":/images/kcontrol.png"))); - advanced_button->setIconSize(QSize(48, 48)); - advanced_button->setCheckable(true); - advanced_button->setAutoExclusive(true); - advanced_button->setAutoRaise(false); - smooth_button = new QToolButton(top_frame); - smooth_button->setObjectName(QString::fromUtf8("smooth_button")); - smooth_button->setGeometry(QRect(160, 10, 48, 48)); - smooth_button->setIcon(QIcon(QString::fromUtf8(":/images/smooth_me.png"))); - smooth_button->setIconSize(QSize(48, 48)); - smooth_button->setCheckable(true); - smooth_button->setAutoExclusive(true); - smooth_button->setAutoRaise(false); - pick_button = new QToolButton(top_frame); - pick_button->setObjectName(QString::fromUtf8("pick_button")); - pick_button->setGeometry(QRect(210, 10, 48, 48)); - pick_button->setIcon(QIcon(QString::fromUtf8(":/images/pick.png"))); - pick_button->setIconSize(QSize(48, 48)); - pick_button->setCheckable(true); - pick_button->setAutoExclusive(true); - pick_button->setAutoRaise(false); - - gridLayout->addWidget(top_frame, 0, 0, 1, 2); - - pick_frame = new QFrame(PaintToolbox); - pick_frame->setObjectName(QString::fromUtf8("pick_frame")); - pick_frame->setFrameShape(QFrame::StyledPanel); - pick_frame->setFrameShadow(QFrame::Raised); - gridLayout5 = new QGridLayout(pick_frame); - gridLayout5->setSpacing(6); - gridLayout5->setMargin(9); - gridLayout5->setObjectName(QString::fromUtf8("gridLayout5")); - pick_mode = new QComboBox(pick_frame); - pick_mode->setObjectName(QString::fromUtf8("pick_mode")); - - gridLayout5->addWidget(pick_mode, 0, 1, 1, 1); - - label_pick = new QLabel(pick_frame); - label_pick->setObjectName(QString::fromUtf8("label_pick")); - - gridLayout5->addWidget(label_pick, 0, 0, 1, 1); - - - gridLayout->addWidget(pick_frame, 5, 0, 1, 2); - - gradient_frame = new QFrame(PaintToolbox); + gradient_frame = new QFrame(tab); gradient_frame->setObjectName(QString::fromUtf8("gradient_frame")); + QSizePolicy sizePolicy3(static_cast(5), static_cast(5)); + sizePolicy3.setHorizontalStretch(0); + sizePolicy3.setVerticalStretch(0); + sizePolicy3.setHeightForWidth(gradient_frame->sizePolicy().hasHeightForWidth()); + gradient_frame->setSizePolicy(sizePolicy3); gradient_frame->setFrameShape(QFrame::StyledPanel); gradient_frame->setFrameShadow(QFrame::Raised); - gridLayout6 = new QGridLayout(gradient_frame); - gridLayout6->setSpacing(6); - gridLayout6->setMargin(9); - gridLayout6->setObjectName(QString::fromUtf8("gridLayout6")); + gridLayout2 = new QGridLayout(gradient_frame); + gridLayout2->setSpacing(6); + gridLayout2->setMargin(9); + gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); label_4 = new QLabel(gradient_frame); label_4->setObjectName(QString::fromUtf8("label_4")); - gridLayout6->addWidget(label_4, 0, 0, 1, 1); + gridLayout2->addWidget(label_4, 0, 0, 1, 1); gradient_type = new QComboBox(gradient_frame); gradient_type->setObjectName(QString::fromUtf8("gradient_type")); - gridLayout6->addWidget(gradient_type, 0, 1, 1, 2); + gridLayout2->addWidget(gradient_type, 0, 1, 1, 2); label_3 = new QLabel(gradient_frame); label_3->setObjectName(QString::fromUtf8("label_3")); - gridLayout6->addWidget(label_3, 1, 0, 1, 2); + gridLayout2->addWidget(label_3, 1, 0, 1, 2); gradient_form = new QComboBox(gradient_frame); gradient_form->setObjectName(QString::fromUtf8("gradient_form")); - gridLayout6->addWidget(gradient_form, 1, 2, 1, 1); + gridLayout2->addWidget(gradient_form, 1, 2, 1, 1); - gridLayout->addWidget(gradient_frame, 7, 0, 1, 2); + gridLayout1->addWidget(gradient_frame, 6, 0, 1, 2); + + pick_frame = new QFrame(tab); + pick_frame->setObjectName(QString::fromUtf8("pick_frame")); + pick_frame->setFrameShape(QFrame::StyledPanel); + pick_frame->setFrameShadow(QFrame::Raised); + gridLayout3 = new QGridLayout(pick_frame); + gridLayout3->setSpacing(6); + gridLayout3->setMargin(9); + gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); + pick_mode = new QComboBox(pick_frame); + pick_mode->setObjectName(QString::fromUtf8("pick_mode")); + + gridLayout3->addWidget(pick_mode, 0, 1, 1, 1); + + label_pick = new QLabel(pick_frame); + label_pick->setObjectName(QString::fromUtf8("label_pick")); + + gridLayout3->addWidget(label_pick, 0, 0, 1, 1); + + + gridLayout1->addWidget(pick_frame, 5, 0, 1, 2); + + pen_extra_frame = new QFrame(tab); + pen_extra_frame->setObjectName(QString::fromUtf8("pen_extra_frame")); + pen_extra_frame->setFrameShape(QFrame::StyledPanel); + pen_extra_frame->setFrameShadow(QFrame::Raised); + gridLayout4 = new QGridLayout(pen_extra_frame); + gridLayout4->setSpacing(6); + gridLayout4->setMargin(9); + gridLayout4->setObjectName(QString::fromUtf8("gridLayout4")); + decrease_box = new QSpinBox(pen_extra_frame); + decrease_box->setObjectName(QString::fromUtf8("decrease_box")); + decrease_box->setMaximum(100); + decrease_box->setValue(50); + + gridLayout4->addWidget(decrease_box, 1, 4, 1, 1); + + backface_culling = new QCheckBox(pen_extra_frame); + backface_culling->setObjectName(QString::fromUtf8("backface_culling")); + + gridLayout4->addWidget(backface_culling, 2, 1, 1, 2); + + invisible_painting = new QCheckBox(pen_extra_frame); + invisible_painting->setObjectName(QString::fromUtf8("invisible_painting")); + + gridLayout4->addWidget(invisible_painting, 2, 3, 1, 2); + + label = new QLabel(pen_extra_frame); + label->setObjectName(QString::fromUtf8("label")); + + gridLayout4->addWidget(label, 2, 0, 1, 1); + + pen_radius = new QDoubleSpinBox(pen_extra_frame); + pen_radius->setObjectName(QString::fromUtf8("pen_radius")); + pen_radius->setDecimals(1); + pen_radius->setMaximum(100); + pen_radius->setMinimum(0.1); + pen_radius->setSingleStep(0.1); + pen_radius->setValue(40); + + gridLayout4->addWidget(pen_radius, 0, 1, 1, 1); + + pen_type = new QComboBox(pen_extra_frame); + pen_type->setObjectName(QString::fromUtf8("pen_type")); + QSizePolicy sizePolicy4(static_cast(5), static_cast(0)); + sizePolicy4.setHorizontalStretch(0); + sizePolicy4.setVerticalStretch(0); + sizePolicy4.setHeightForWidth(pen_type->sizePolicy().hasHeightForWidth()); + pen_type->setSizePolicy(sizePolicy4); + + gridLayout4->addWidget(pen_type, 0, 2, 1, 3); + + label_pen = new QLabel(pen_extra_frame); + label_pen->setObjectName(QString::fromUtf8("label_pen")); + + gridLayout4->addWidget(label_pen, 0, 0, 1, 1); + + decrease_slider = new QSlider(pen_extra_frame); + decrease_slider->setObjectName(QString::fromUtf8("decrease_slider")); + decrease_slider->setMaximum(100); + decrease_slider->setValue(50); + decrease_slider->setSliderPosition(50); + decrease_slider->setOrientation(Qt::Horizontal); + + gridLayout4->addWidget(decrease_slider, 1, 2, 1, 2); + + label_percentual_3 = new QLabel(pen_extra_frame); + label_percentual_3->setObjectName(QString::fromUtf8("label_percentual_3")); + + gridLayout4->addWidget(label_percentual_3, 1, 0, 1, 2); + + + gridLayout1->addWidget(pen_extra_frame, 4, 0, 1, 2); + + smooth_frame = new QFrame(tab); + smooth_frame->setObjectName(QString::fromUtf8("smooth_frame")); + smooth_frame->setFrameShape(QFrame::StyledPanel); + smooth_frame->setFrameShadow(QFrame::Raised); + gridLayout5 = new QGridLayout(smooth_frame); + gridLayout5->setSpacing(6); + gridLayout5->setMargin(9); + gridLayout5->setObjectName(QString::fromUtf8("gridLayout5")); + percentual_slider = new QSlider(smooth_frame); + percentual_slider->setObjectName(QString::fromUtf8("percentual_slider")); + percentual_slider->setMaximum(100); + percentual_slider->setValue(25); + percentual_slider->setSliderPosition(25); + percentual_slider->setOrientation(Qt::Horizontal); + + gridLayout5->addWidget(percentual_slider, 0, 1, 1, 1); + + label_percentual = new QLabel(smooth_frame); + label_percentual->setObjectName(QString::fromUtf8("label_percentual")); + + gridLayout5->addWidget(label_percentual, 0, 0, 1, 1); + + percentual_box = new QSpinBox(smooth_frame); + percentual_box->setObjectName(QString::fromUtf8("percentual_box")); + percentual_box->setMaximum(100); + percentual_box->setValue(25); + + gridLayout5->addWidget(percentual_box, 0, 2, 1, 1); + + + gridLayout1->addWidget(smooth_frame, 3, 0, 1, 2); + + pen_frame = new QFrame(tab); + pen_frame->setObjectName(QString::fromUtf8("pen_frame")); + pen_frame->setFrameShape(QFrame::StyledPanel); + pen_frame->setFrameShadow(QFrame::Raised); + gridLayout6 = new QGridLayout(pen_frame); + gridLayout6->setSpacing(6); + gridLayout6->setMargin(9); + gridLayout6->setObjectName(QString::fromUtf8("gridLayout6")); + deck_box = new QSpinBox(pen_frame); + deck_box->setObjectName(QString::fromUtf8("deck_box")); + deck_box->setMaximum(100); + deck_box->setValue(100); + + gridLayout6->addWidget(deck_box, 0, 2, 1, 1); + + label_deck = new QLabel(pen_frame); + label_deck->setObjectName(QString::fromUtf8("label_deck")); + + gridLayout6->addWidget(label_deck, 0, 0, 1, 1); + + label_penmodus = new QLabel(pen_frame); + label_penmodus->setObjectName(QString::fromUtf8("label_penmodus")); + + gridLayout6->addWidget(label_penmodus, 1, 0, 1, 1); + + pen_modus = new QComboBox(pen_frame); + pen_modus->setObjectName(QString::fromUtf8("pen_modus")); + + gridLayout6->addWidget(pen_modus, 1, 1, 1, 2); + + deck_slider = new QSlider(pen_frame); + deck_slider->setObjectName(QString::fromUtf8("deck_slider")); + deck_slider->setMaximum(100); + deck_slider->setValue(100); + deck_slider->setOrientation(Qt::Horizontal); + + gridLayout6->addWidget(deck_slider, 0, 1, 1, 1); + + + gridLayout1->addWidget(pen_frame, 2, 0, 1, 2); + + tabWidget->addTab(tab, QApplication::translate("PaintToolbox", "Painting", 0, QApplication::UnicodeUTF8)); + tab_2 = new QWidget(); + tab_2->setObjectName(QString::fromUtf8("tab_2")); + gridLayout7 = new QGridLayout(tab_2); + gridLayout7->setSpacing(6); + gridLayout7->setMargin(9); + gridLayout7->setObjectName(QString::fromUtf8("gridLayout7")); + spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout7->addItem(spacerItem, 3, 0, 1, 1); + + pen_select_frame = new QFrame(tab_2); + pen_select_frame->setObjectName(QString::fromUtf8("pen_select_frame")); + pen_select_frame->setFrameShape(QFrame::StyledPanel); + pen_select_frame->setFrameShadow(QFrame::Raised); + gridLayout8 = new QGridLayout(pen_select_frame); + gridLayout8->setSpacing(6); + gridLayout8->setMargin(9); + gridLayout8->setObjectName(QString::fromUtf8("gridLayout8")); + label_5 = new QLabel(pen_select_frame); + label_5->setObjectName(QString::fromUtf8("label_5")); + + gridLayout8->addWidget(label_5, 2, 0, 1, 2); + + pen_radius_2 = new QDoubleSpinBox(pen_select_frame); + pen_radius_2->setObjectName(QString::fromUtf8("pen_radius_2")); + pen_radius_2->setDecimals(1); + pen_radius_2->setMaximum(100); + pen_radius_2->setMinimum(0.1); + pen_radius_2->setSingleStep(0.1); + pen_radius_2->setValue(40); + + gridLayout8->addWidget(pen_radius_2, 0, 1, 1, 2); + + label_pen_2 = new QLabel(pen_select_frame); + label_pen_2->setObjectName(QString::fromUtf8("label_pen_2")); + + gridLayout8->addWidget(label_pen_2, 0, 0, 1, 1); + + decrease_slider_2 = new QSlider(pen_select_frame); + decrease_slider_2->setObjectName(QString::fromUtf8("decrease_slider_2")); + decrease_slider_2->setMaximum(100); + decrease_slider_2->setValue(50); + decrease_slider_2->setSliderPosition(50); + decrease_slider_2->setOrientation(Qt::Horizontal); + + gridLayout8->addWidget(decrease_slider_2, 1, 3, 1, 2); + + decrease_box_2 = new QSpinBox(pen_select_frame); + decrease_box_2->setObjectName(QString::fromUtf8("decrease_box_2")); + decrease_box_2->setMaximum(100); + decrease_box_2->setValue(50); + + gridLayout8->addWidget(decrease_box_2, 1, 5, 1, 1); + + label_6 = new QLabel(pen_select_frame); + label_6->setObjectName(QString::fromUtf8("label_6")); + + gridLayout8->addWidget(label_6, 1, 0, 1, 3); + + pen_type_2 = new QComboBox(pen_select_frame); + pen_type_2->setObjectName(QString::fromUtf8("pen_type_2")); + QSizePolicy sizePolicy5(static_cast(5), static_cast(0)); + sizePolicy5.setHorizontalStretch(0); + sizePolicy5.setVerticalStretch(0); + sizePolicy5.setHeightForWidth(pen_type_2->sizePolicy().hasHeightForWidth()); + pen_type_2->setSizePolicy(sizePolicy5); + + gridLayout8->addWidget(pen_type_2, 0, 3, 1, 3); + + backface_culling_2 = new QCheckBox(pen_select_frame); + backface_culling_2->setObjectName(QString::fromUtf8("backface_culling_2")); + backface_culling_2->setChecked(true); + + gridLayout8->addWidget(backface_culling_2, 2, 2, 1, 2); + + invisible_painting_2 = new QCheckBox(pen_select_frame); + invisible_painting_2->setObjectName(QString::fromUtf8("invisible_painting_2")); + invisible_painting_2->setChecked(false); + + gridLayout8->addWidget(invisible_painting_2, 2, 4, 1, 2); + + + gridLayout7->addWidget(pen_select_frame, 2, 0, 1, 1); + + poly_smooth_frame = new QFrame(tab_2); + poly_smooth_frame->setObjectName(QString::fromUtf8("poly_smooth_frame")); + poly_smooth_frame->setFrameShape(QFrame::StyledPanel); + poly_smooth_frame->setFrameShadow(QFrame::Raised); + gridLayout9 = new QGridLayout(poly_smooth_frame); + gridLayout9->setSpacing(6); + gridLayout9->setMargin(9); + gridLayout9->setObjectName(QString::fromUtf8("gridLayout9")); + percentual_slider_2 = new QSlider(poly_smooth_frame); + percentual_slider_2->setObjectName(QString::fromUtf8("percentual_slider_2")); + percentual_slider_2->setMaximum(100); + percentual_slider_2->setValue(25); + percentual_slider_2->setSliderPosition(25); + percentual_slider_2->setOrientation(Qt::Horizontal); + + gridLayout9->addWidget(percentual_slider_2, 0, 1, 1, 1); + + label_percentual_2 = new QLabel(poly_smooth_frame); + label_percentual_2->setObjectName(QString::fromUtf8("label_percentual_2")); + + gridLayout9->addWidget(label_percentual_2, 0, 0, 1, 1); + + percentual_box_2 = new QSpinBox(poly_smooth_frame); + percentual_box_2->setObjectName(QString::fromUtf8("percentual_box_2")); + percentual_box_2->setMaximum(100); + percentual_box_2->setValue(25); + + gridLayout9->addWidget(percentual_box_2, 0, 2, 1, 1); + + + gridLayout7->addWidget(poly_smooth_frame, 1, 0, 1, 1); + + widget_2 = new QWidget(tab_2); + widget_2->setObjectName(QString::fromUtf8("widget_2")); + QSizePolicy sizePolicy6(static_cast(5), static_cast(5)); + sizePolicy6.setHorizontalStretch(0); + sizePolicy6.setVerticalStretch(0); + sizePolicy6.setHeightForWidth(widget_2->sizePolicy().hasHeightForWidth()); + widget_2->setSizePolicy(sizePolicy6); + widget_2->setMinimumSize(QSize(0, 60)); + poly_smooth_button = new QToolButton(widget_2); + poly_smooth_button->setObjectName(QString::fromUtf8("poly_smooth_button")); + poly_smooth_button->setGeometry(QRect(50, 10, 48, 48)); + poly_smooth_button->setIcon(QIcon(QString::fromUtf8(":/images/smooth_me.png"))); + poly_smooth_button->setIconSize(QSize(48, 48)); + poly_smooth_button->setCheckable(true); + poly_smooth_button->setAutoExclusive(true); + poly_smooth_button->setAutoRaise(false); + select_button = new QToolButton(widget_2); + select_button->setObjectName(QString::fromUtf8("select_button")); + select_button->setGeometry(QRect(0, 10, 48, 48)); + select_button->setIcon(QIcon(QString::fromUtf8(":/images/pinsel_select.png"))); + select_button->setIconSize(QSize(48, 48)); + select_button->setCheckable(true); + select_button->setAutoExclusive(true); + select_button->setAutoRaise(false); + + gridLayout7->addWidget(widget_2, 0, 0, 1, 1); + + tabWidget->addTab(tab_2, QApplication::translate("PaintToolbox", "Selecting && Editing", 0, QApplication::UnicodeUTF8)); + tab_3 = new QWidget(); + tab_3->setObjectName(QString::fromUtf8("tab_3")); + gridLayout10 = new QGridLayout(tab_3); + gridLayout10->setSpacing(6); + gridLayout10->setMargin(9); + gridLayout10->setObjectName(QString::fromUtf8("gridLayout10")); + search_mode = new QComboBox(tab_3); + search_mode->setObjectName(QString::fromUtf8("search_mode")); + + gridLayout10->addWidget(search_mode, 0, 1, 1, 1); + + label_2 = new QLabel(tab_3); + label_2->setObjectName(QString::fromUtf8("label_2")); + + gridLayout10->addWidget(label_2, 0, 0, 1, 1); + + spacerItem1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout10->addItem(spacerItem1, 1, 0, 1, 1); + + tabWidget->addTab(tab_3, QApplication::translate("PaintToolbox", "Configuration", 0, QApplication::UnicodeUTF8)); + + gridLayout->addWidget(tabWidget, 0, 0, 1, 1); + + spacerItem2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(spacerItem2, 1, 0, 1, 1); retranslateUi(PaintToolbox); - QSize size(332, 558); + QSize size(284, 645); size = size.expandedTo(PaintToolbox->minimumSizeHint()); PaintToolbox->resize(size); + tabWidget->setCurrentIndex(0); + + QMetaObject::connectSlotsByName(PaintToolbox); } // setupUi void retranslateUi(QWidget *PaintToolbox) { PaintToolbox->setWindowTitle(QApplication::translate("PaintToolbox", "Vertex Painting", 0, QApplication::UnicodeUTF8)); + tabWidget->setStyleSheet(QString()); + fill_button->setToolTip(QApplication::translate("PaintToolbox", "Fill an area", 0, QApplication::UnicodeUTF8)); + fill_button->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); + gradient_button->setToolTip(QApplication::translate("PaintToolbox", "Fill with gradients", 0, QApplication::UnicodeUTF8)); + gradient_button->setText(QString()); + smooth_button->setToolTip(QApplication::translate("PaintToolbox", "Smooth", 0, QApplication::UnicodeUTF8)); + smooth_button->setText(QString()); + pick_button->setToolTip(QApplication::translate("PaintToolbox", "Pick a color", 0, QApplication::UnicodeUTF8)); + pick_button->setText(QString()); + pen_button->setToolTip(QApplication::translate("PaintToolbox", "Paint with the pen", 0, QApplication::UnicodeUTF8)); + pen_button->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); + redo_button->setText(QString()); + undo_button->setText(QString()); + set_bw->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); + switch_me->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("PaintToolbox", "Type", 0, QApplication::UnicodeUTF8)); + gradient_type->clear(); + gradient_type->addItem(QApplication::translate("PaintToolbox", "Foreground to background (RGB)", 0, QApplication::UnicodeUTF8)); + gradient_type->addItem(QApplication::translate("PaintToolbox", "Foreground to transparency", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("PaintToolbox", "Form", 0, QApplication::UnicodeUTF8)); + gradient_form->clear(); + gradient_form->addItem(QApplication::translate("PaintToolbox", "Linear", 0, QApplication::UnicodeUTF8)); + gradient_form->addItem(QApplication::translate("PaintToolbox", "Circular", 0, QApplication::UnicodeUTF8)); + pick_mode->clear(); + pick_mode->addItem(QApplication::translate("PaintToolbox", "Nearest vertex color", 0, QApplication::UnicodeUTF8)); + pick_mode->addItem(QApplication::translate("PaintToolbox", "Pixel color", 0, QApplication::UnicodeUTF8)); + label_pick->setText(QApplication::translate("PaintToolbox", "Picking mode", 0, QApplication::UnicodeUTF8)); + decrease_box->setToolTip(QApplication::translate("PaintToolbox", "\n" +"

", 0, QApplication::UnicodeUTF8)); + backface_culling->setText(QApplication::translate("PaintToolbox", "backfaces", 0, QApplication::UnicodeUTF8)); + invisible_painting->setText(QApplication::translate("PaintToolbox", "hidden polygons", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("PaintToolbox", "Paint on:", 0, QApplication::UnicodeUTF8)); + pen_type->clear(); + pen_type->addItem(QApplication::translate("PaintToolbox", "pixel", 0, QApplication::UnicodeUTF8)); + pen_type->addItem(QApplication::translate("PaintToolbox", "percentual of bbox diagonal", 0, QApplication::UnicodeUTF8)); + pen_type->addItem(QApplication::translate("PaintToolbox", "percentual of bbox height", 0, QApplication::UnicodeUTF8)); + label_pen->setText(QApplication::translate("PaintToolbox", "Pen", 0, QApplication::UnicodeUTF8)); + decrease_slider->setToolTip(QApplication::translate("PaintToolbox", "\n" +"

", 0, QApplication::UnicodeUTF8)); + label_percentual_3->setText(QApplication::translate("PaintToolbox", "Smooth borders", 0, QApplication::UnicodeUTF8)); percentual_slider->setToolTip(QApplication::translate("PaintToolbox", "\n" @@ -419,20 +679,40 @@ public: "p, li { white-space: pre-wrap; }\n" "\n" "

", 0, QApplication::UnicodeUTF8)); - backface_culling->setText(QApplication::translate("PaintToolbox", "backfaces", 0, QApplication::UnicodeUTF8)); - label_pen->setText(QApplication::translate("PaintToolbox", "Pen", 0, QApplication::UnicodeUTF8)); - label->setText(QApplication::translate("PaintToolbox", "Paint on:", 0, QApplication::UnicodeUTF8)); - pen_type->clear(); - pen_type->addItem(QApplication::translate("PaintToolbox", "pixel", 0, QApplication::UnicodeUTF8)); - pen_type->addItem(QApplication::translate("PaintToolbox", "percentual of bbox diagonal", 0, QApplication::UnicodeUTF8)); - pen_type->addItem(QApplication::translate("PaintToolbox", "percentual of bbox height", 0, QApplication::UnicodeUTF8)); - invisible_painting->setText(QApplication::translate("PaintToolbox", "hidden polygons", 0, QApplication::UnicodeUTF8)); deck_box->setToolTip(QApplication::translate("PaintToolbox", "Change the opacity of the color (this is not the opengl alpha value)", 0, QApplication::UnicodeUTF8)); label_deck->setText(QApplication::translate("PaintToolbox", "Opacity", 0, QApplication::UnicodeUTF8)); label_penmodus->setText(QApplication::translate("PaintToolbox", "Modus", 0, QApplication::UnicodeUTF8)); pen_modus->clear(); pen_modus->addItem(QApplication::translate("PaintToolbox", "Normal", 0, QApplication::UnicodeUTF8)); deck_slider->setToolTip(QApplication::translate("PaintToolbox", "Change the opacity of the color (this is not the opengl alpha value)", 0, QApplication::UnicodeUTF8)); + tabWidget->setTabText(tabWidget->indexOf(tab), QApplication::translate("PaintToolbox", "Painting", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("PaintToolbox", "On:", 0, QApplication::UnicodeUTF8)); + label_pen_2->setText(QApplication::translate("PaintToolbox", "Pen", 0, QApplication::UnicodeUTF8)); + decrease_slider_2->setToolTip(QApplication::translate("PaintToolbox", "\n" +"

", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("PaintToolbox", "Smooth borders", 0, QApplication::UnicodeUTF8)); + pen_type_2->clear(); + pen_type_2->addItem(QApplication::translate("PaintToolbox", "pixel", 0, QApplication::UnicodeUTF8)); + pen_type_2->addItem(QApplication::translate("PaintToolbox", "percentual of bbox diagonal", 0, QApplication::UnicodeUTF8)); + pen_type_2->addItem(QApplication::translate("PaintToolbox", "percentual of bbox height", 0, QApplication::UnicodeUTF8)); + backface_culling_2->setText(QApplication::translate("PaintToolbox", "backfaces", 0, QApplication::UnicodeUTF8)); + invisible_painting_2->setText(QApplication::translate("PaintToolbox", "hidden polygons", 0, QApplication::UnicodeUTF8)); + percentual_slider_2->setToolTip(QApplication::translate("PaintToolbox", "\n" +"

", 0, QApplication::UnicodeUTF8)); + label_percentual_2->setText(QApplication::translate("PaintToolbox", "Percentual", 0, QApplication::UnicodeUTF8)); + percentual_box_2->setToolTip(QApplication::translate("PaintToolbox", "\n" +"

", 0, QApplication::UnicodeUTF8)); + poly_smooth_button->setToolTip(QApplication::translate("PaintToolbox", "Smooth the mesh", 0, QApplication::UnicodeUTF8)); + poly_smooth_button->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); + select_button->setToolTip(QApplication::translate("PaintToolbox", "Select faces with the pen", 0, QApplication::UnicodeUTF8)); + select_button->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); + tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("PaintToolbox", "Selecting && Editing", 0, QApplication::UnicodeUTF8)); search_mode->clear(); search_mode->addItem(QApplication::translate("PaintToolbox", "fast", 0, QApplication::UnicodeUTF8)); search_mode->addItem(QApplication::translate("PaintToolbox", "slow but accurate", 0, QApplication::UnicodeUTF8)); @@ -441,34 +721,7 @@ public: "\n" "

fast: works better with big meshes, but can loose some vertexes when faces are not direct connected
slow but accurate: sholud be used with small meshes, because it finds every vertex during painting

", 0, QApplication::UnicodeUTF8)); label_2->setText(QApplication::translate("PaintToolbox", "Vertex search:", 0, QApplication::UnicodeUTF8)); - set_bw->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); - switch_me->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); - redo_button->setText(QString()); - undo_button->setText(QString()); - gradient_button->setToolTip(QApplication::translate("PaintToolbox", "Fill with gradients", 0, QApplication::UnicodeUTF8)); - gradient_button->setText(QString()); - fill_button->setToolTip(QApplication::translate("PaintToolbox", "Fill an area", 0, QApplication::UnicodeUTF8)); - fill_button->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); - pen_button->setToolTip(QApplication::translate("PaintToolbox", "Paint with the pen", 0, QApplication::UnicodeUTF8)); - pen_button->setText(QApplication::translate("PaintToolbox", "...", 0, QApplication::UnicodeUTF8)); - advanced_button->setToolTip(QApplication::translate("PaintToolbox", "Change advanced settings", 0, QApplication::UnicodeUTF8)); - advanced_button->setText(QString()); - smooth_button->setToolTip(QApplication::translate("PaintToolbox", "Smooth", 0, QApplication::UnicodeUTF8)); - smooth_button->setText(QString()); - pick_button->setToolTip(QApplication::translate("PaintToolbox", "Pick a color", 0, QApplication::UnicodeUTF8)); - pick_button->setText(QString()); - pick_mode->clear(); - pick_mode->addItem(QApplication::translate("PaintToolbox", "Nearest vertex color", 0, QApplication::UnicodeUTF8)); - pick_mode->addItem(QApplication::translate("PaintToolbox", "Pixel color", 0, QApplication::UnicodeUTF8)); - label_pick->setText(QApplication::translate("PaintToolbox", "Picking mode", 0, QApplication::UnicodeUTF8)); - label_4->setText(QApplication::translate("PaintToolbox", "Type", 0, QApplication::UnicodeUTF8)); - gradient_type->clear(); - gradient_type->addItem(QApplication::translate("PaintToolbox", "Foreground to background (RGB)", 0, QApplication::UnicodeUTF8)); - gradient_type->addItem(QApplication::translate("PaintToolbox", "Foreground to transparency", 0, QApplication::UnicodeUTF8)); - label_3->setText(QApplication::translate("PaintToolbox", "Form", 0, QApplication::UnicodeUTF8)); - gradient_form->clear(); - gradient_form->addItem(QApplication::translate("PaintToolbox", "Linear", 0, QApplication::UnicodeUTF8)); - gradient_form->addItem(QApplication::translate("PaintToolbox", "Circular", 0, QApplication::UnicodeUTF8)); + tabWidget->setTabText(tabWidget->indexOf(tab_3), QApplication::translate("PaintToolbox", "Configuration", 0, QApplication::UnicodeUTF8)); Q_UNUSED(PaintToolbox); } // retranslateUi