modified edit_vase.h/cpp to use a simpler single action setup. Modified the edit_scan adding a file saver (and a bug report for meshlab as EDITs support layers in read_only) to the gui

This commit is contained in:
Paolo Cignoni cignoni 2010-04-26 04:17:02 +00:00
parent ea41c7b652
commit 1856edacd4
2 changed files with 10 additions and 23 deletions

View File

@ -2,16 +2,11 @@
#include "wrap/gui/trackball.h"
#include "wrap/qt/trackball.h" //QT2VCG trackball function
Vase::Vase(){
action = new QAction(QIcon(":/images/vase.png"),"Volume Aware Surface Extraction", this);
action->setCheckable(true);
bool Vase::StartEdit(MeshModel &m, GLArea* gla){
gui = new VaseWidget( gla->window(), m, gla );
return true;
}
//--- Trackball controls similarly to the ones in non-edit mode
void Vase::mousePressEvent(QMouseEvent* e, MeshModel &, GLArea* gla){
gla->trackball.MouseDown(e->x(),gla->height()-e->y(), QT2VCG(e->button(), e->modifiers() ) );

View File

@ -8,6 +8,9 @@
using namespace vcg;
// This plugin only defines one action
static QAction act(QIcon(":/images/vase.png"),"Volume Aware Surface Extraction", NULL);
class Vase : public QObject, public MeshEditInterface, public MeshEditInterfaceFactory{
Q_OBJECT
Q_INTERFACES(MeshEditInterface)
@ -16,31 +19,20 @@ class Vase : public QObject, public MeshEditInterface, public MeshEditInterfaceF
private:
// Instance of dialog window
VaseWidget* gui;
// Plugin defines this single action
QAction* action;
public:
//--- Dummy implementation of MeshEditInterface, passes all control to Widget
static const QString Info(){ return tr("VASE"); }
virtual bool StartEdit(MeshModel &m, GLArea* gla){
gui = new VaseWidget( gla->window(), m, gla );
// Try to force the widget on the right hand side
//addDockWidget( Qt::RightDockWidgetArea, gui );
return true;
}
virtual bool StartEdit(MeshModel &m, GLArea* gla);
virtual void EndEdit(MeshModel &, GLArea*){ delete gui; }
virtual void Decorate(MeshModel& m, GLArea* gla){ gui->decorate(m,gla); }
virtual void mousePressEvent(QMouseEvent *, MeshModel &, GLArea * );
virtual void mouseMoveEvent(QMouseEvent *, MeshModel &, GLArea* );
virtual void mouseReleaseEvent(QMouseEvent *, MeshModel &, GLArea* );
//--- Dummy implementation of MeshEditInterfaceFactory, passes control to this MeshEditInterface
Vase();
virtual ~Vase(){ delete action; }
virtual QList<QAction *> actions() const{
QList<QAction *> actionList;
return actionList << action;
}
Vase(){};
virtual ~Vase(){}
virtual QList<QAction *> actions() const{ QList<QAction *> actionList; return actionList << &act; }
virtual MeshEditInterface* getMeshEditInterface(QAction* ){ return this; }
virtual QString getEditToolDescription(QAction *){ return this->Info(); }
};