Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ if(NOT DEFINED MESHLAB_PLUGINS) # it may be already defined in parent directory
meshlabplugins/edit_referencing
meshlabplugins/edit_quality
meshlabplugins/edit_select
meshlabplugins/edit_cut
)
endif()

Expand Down
1 change: 1 addition & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ set(SOURCES
plugins/containers/render_plugin_container.cpp
plugins/interfaces/meshlab_plugin_logger.cpp
plugins/interfaces/decorate_plugin.cpp
plugins/interfaces/edit_plugin.cpp
plugins/interfaces/filter_plugin.cpp
plugins/interfaces/io_plugin.cpp
plugins/action_searcher.cpp
Expand Down
5 changes: 5 additions & 0 deletions src/common/plugins/interfaces/edit_plugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "edit_plugin.h"

void EditPlugin::initGlobalParameterList(RichParameterList& globalparam)
{
}
8 changes: 8 additions & 0 deletions src/common/plugins/interfaces/edit_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class EditPlugin : public MeshLabPlugin
EditPlugin() {}
virtual ~EditPlugin() {}

virtual void initGlobalParameterList(RichParameterList& defaultGlobalParamSet);

//gets a list of actions available from this plugin
virtual std::list<QAction *> actions() const {return actionList;};

Expand All @@ -117,8 +119,14 @@ class EditPlugin : public MeshLabPlugin
//get the description for the given action
virtual QString getEditToolDescription(const QAction *) = 0;

void setCurrentGlobalParamSet(RichParameterList* cgp)
{
currentGlobalParamSet = cgp;
}

protected:
std::list<QAction*> actionList;
RichParameterList* currentGlobalParamSet;
};

#define EDIT_PLUGIN_IID "vcg.meshlab.EditPlugin/1.0"
Expand Down
5 changes: 5 additions & 0 deletions src/meshlab/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class MainWindow : public QMainWindow
static bool QCallBack(const int pos, const char * str);
//const QString appName() const {return tr("MeshLab v")+appVer(); }
//const QString appVer() const {return tr("1.3.2"); }
RichParameterList& getCurrentParameterList();
MainWindowSetting mwsettings;
public slots:
// callback function to execute a filter
Expand Down Expand Up @@ -373,6 +374,7 @@ private slots:
QToolBar* decoratorToolBar;
QToolBar* editToolBar;
QToolBar* filterToolBar;
QToolBar* dynartToolBar;
QToolBar* searchToolBar;
MLRenderingGlobalToolbar* globrendtoolbar;
///////// Menus ///////////////
Expand Down Expand Up @@ -531,6 +533,9 @@ private slots:
static QString getDecoratedFileName(const QString& name);

MultiViewer_Container* _currviewcontainer;

Q_SIGNALS:
void customSettingsChanged(const RichParameterList &rpl);
};

/// Event filter that is installed to intercept the open events sent directly by the Operative System
Expand Down
17 changes: 17 additions & 0 deletions src/meshlab/mainwindow_Init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ void MainWindow::createToolBars()
editToolBar = addToolBar(tr("Edit"));
editToolBar->addAction(suspendEditModeAct);
for(EditPlugin *iEditFactory: PM.editPluginFactoryIterator()) {
if (iEditFactory->pluginName() == "EditCut") continue;
for(QAction* editAction: iEditFactory->actions()){
if (!editAction->icon().isNull()) {
editToolBar->addAction(editAction);
Expand All @@ -534,6 +535,16 @@ void MainWindow::createToolBars()

updateFilterToolBar();

dynartToolBar = addToolBar(tr("Dynart Tools"));
for(EditPlugin *iEditFactory: PM.editPluginFactoryIterator()) {
if (iEditFactory->pluginName() != "EditCut") continue;
for(QAction* editAction: iEditFactory->actions()){
if (!editAction->icon().isNull()) {
dynartToolBar->addAction(editAction);
}
}
}

QWidget *spacerWidget = new QWidget();
spacerWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
spacerWidget->setVisible(true);
Expand Down Expand Up @@ -922,6 +933,12 @@ void MainWindow::loadDefaultSettingsFromPlugins()
}
}

//edit settings
for (EditPlugin* ep : PM.editPluginFactoryIterator()) {
ep->initGlobalParameterList(defaultGlobalParams);
ep->setCurrentGlobalParamSet(&currentGlobalParams);
}

//io settings
for (IOPlugin* iop : PM.ioPluginIterator()){
for (const FileFormat& ff : iop->importFormats()) {
Expand Down
22 changes: 22 additions & 0 deletions src/meshlab/mainwindow_RunTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ void MainWindow::updateCustomSettings()
{
mwsettings.updateGlobalParameterList(currentGlobalParams);
emit dispatchCustomSettings(currentGlobalParams);

}
RichParameterList& MainWindow::getCurrentParameterList()
{
return currentGlobalParams;
}

void MainWindow::updateWindowMenu()
Expand Down Expand Up @@ -2196,6 +2201,15 @@ void MainWindow::reloadAllMesh()
{
// Discards changes and reloads current file
// save current file name
QMessageBox::StandardButton reply;
reply = QMessageBox::question(
this,
tr("You are reloading all mesh!"),
tr("Are You sure to Reload?"),
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::No) {
return;
}
qb->show();
QElapsedTimer t;
t.start();
Expand Down Expand Up @@ -2244,6 +2258,14 @@ void MainWindow::reload()
return;
// Discards changes and reloads current file
// save current file name
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this,
tr("You are reloading the current mesh"),
tr("Are you sure to reload?"),
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::No) {
return;
}
qb->show();

QString fileName = meshDoc()->mm()->fullName();
Expand Down
5 changes: 5 additions & 0 deletions src/meshlabplugins/edit_align/edit_align_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class EditAlignFactory : public QObject, public EditPlugin
EditAlignFactory();
virtual ~EditAlignFactory() { delete editAlign; }

void initGlobalParameterList(RichParameterList& /*paramList*/)
{
// No global parameters needed for this plugin
}

virtual QString pluginName() const;

//get the edit tool for the given action
Expand Down
12 changes: 12 additions & 0 deletions src/meshlabplugins/edit_cut/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2019-2020, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0

set(SOURCES edit_cut.cpp edit_cut_factory.cpp)

set(HEADERS edit_cut.h edit_cut_factory.h)

set(RESOURCES edit_cut.qrc)

add_meshlab_plugin(edit_cut ${SOURCES} ${HEADERS} ${RESOURCES})

target_link_libraries(edit_cut PRIVATE OpenGL::GLU)
Loading