mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 11:26:11 +00:00
Updated to remove PluginInfo, to use new MeshEditInterface, and to use new factory way of creating edit tools
This commit is contained in:
parent
539adfbff6
commit
437afddfa9
@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005-2008 \/)\/ *
|
||||
* Visual Computing Lab /\/| *
|
||||
* ISTI - Italian National Research Council | *
|
||||
* \ *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
||||
* for more details. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#include "edit_pickpoints_factory.h"
|
||||
#include "editpickpoints.h"
|
||||
|
||||
EditPickPointsFactory::EditPickPointsFactory()
|
||||
{
|
||||
editPickPoints = new QAction(QIcon(":/images/pickpoints.png"), "PickPoints", this);
|
||||
|
||||
actionList << editPickPoints;
|
||||
|
||||
foreach(QAction *editAction, actionList)
|
||||
editAction->setCheckable(true);
|
||||
}
|
||||
|
||||
//gets a list of actions available from this plugin
|
||||
QList<QAction *> EditPickPointsFactory::actions() const
|
||||
{
|
||||
return actionList;
|
||||
}
|
||||
|
||||
//get the edit tool for the given action
|
||||
MeshEditInterface* EditPickPointsFactory::getMeshEditInterface(QAction *action)
|
||||
{
|
||||
if(action == editPickPoints)
|
||||
{
|
||||
return new EditPickPointsPlugin();
|
||||
} else assert(0); //should never be asked for an action that isnt here
|
||||
}
|
||||
|
||||
const QString EditPickPointsFactory::getEditToolDescription(QAction *)
|
||||
{
|
||||
return EditPickPointsPlugin::Info();
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(EditPickPointsFactory)
|
||||
56
src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h
Normal file
56
src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h
Normal file
@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005-2008 \/)\/ *
|
||||
* Visual Computing Lab /\/| *
|
||||
* ISTI - Italian National Research Council | *
|
||||
* \ *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
||||
* for more details. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef EditPickPointsFactoryPLUGIN_H
|
||||
#define EditPickPointsFactoryPLUGIN_H
|
||||
|
||||
#include <meshlab/interfaces.h>
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
|
||||
class EditPickPointsFactory : public QObject, public MeshEditInterfaceFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(MeshEditInterfaceFactory)
|
||||
|
||||
public:
|
||||
EditPickPointsFactory();
|
||||
virtual ~EditPickPointsFactory() { delete editPickPoints; }
|
||||
|
||||
//gets a list of actions available from this plugin
|
||||
virtual QList<QAction *> actions() const;
|
||||
|
||||
//get the edit tool for the given action
|
||||
virtual MeshEditInterface* getMeshEditInterface(QAction *);
|
||||
|
||||
//get the description for the given action
|
||||
virtual const QString getEditToolDescription(QAction *);
|
||||
|
||||
private:
|
||||
QList <QAction *> actionList;
|
||||
|
||||
QAction *editPickPoints;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user