file reorganization

This commit is contained in:
alemuntoni 2021-01-27 15:30:03 +01:00
parent 295ed7670f
commit 92a6d4e0b1
14 changed files with 33 additions and 98 deletions

View File

@ -8,8 +8,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION")
endif()
set(HEADERS
globals/globals.h
globals/singletons.h
globals.h
interfaces/decorate_plugin_interface.h
interfaces/edit_plugin_interface.h
interfaces/filter_plugin_interface.h
@ -45,8 +44,7 @@ set(HEADERS
searcher.h)
set(SOURCES
globals/globals.cpp
globals/singletons.cpp
globals.cpp
interfaces/decorate_plugin_interface.cpp
interfaces/filter_plugin_interface.cpp
interfaces/plugin_interface.cpp

View File

@ -40,8 +40,7 @@ exists(../../ML_VERSION){
# Input
HEADERS += \
globals/globals.h \
globals/singletons.h \
globals.h \
interfaces/decorate_plugin_interface.h \
interfaces/edit_plugin_interface.h \
interfaces/filter_plugin_interface.h \
@ -74,8 +73,7 @@ HEADERS += \
meshlabdocumentxml.h
SOURCES += \
globals/globals.cpp \
globals/singletons.cpp \
globals.cpp \
interfaces/decorate_plugin_interface.cpp \
interfaces/filter_plugin_interface.cpp \
interfaces/plugin_interface.cpp \

View File

@ -26,13 +26,8 @@
#include <QDir>
#include <qapplication.h>
#include "../parameters/rich_parameter_list.h"
RichParameterList& meshlab::defaultGlobalParameterList()
{
static RichParameterList globalRPS;
return globalRPS;
}
#include "parameters/rich_parameter_list.h"
#include "plugin_manager.h"
QString basePath()
{
@ -107,3 +102,15 @@ QString meshlab::defaultShadersPath()
{
return basePath() + "/shaders";
}
RichParameterList& meshlab::defaultGlobalParameterList()
{
static RichParameterList globalRPS;
return globalRPS;
}
PluginManager& meshlab::pluginManagerInstance(bool verbose)
{
static PluginManager pm(defaultGlobalParameterList(), verbose);
return pm;
}

View File

@ -27,13 +27,16 @@
#include <QString>
class RichParameterList;
class PluginManager;
namespace meshlab {
RichParameterList& defaultGlobalParameterList();
QString defaultPluginPath();
QString defaultShadersPath();
RichParameterList& defaultGlobalParameterList();
PluginManager& pluginManagerInstance(bool verbose = true);
}
#endif // MESHLAB_GLOBALS_H

View File

@ -1,18 +0,0 @@
#include "singletons.h"
#include "../plugin_manager.h"
#include "globals.h"
namespace meshlab {
MeshLabSingletons::MeshLabSingletons()
{
}
PluginManager& MeshLabSingletons::pluginManagerInstance(bool verbose)
{
static PluginManager pm(defaultGlobalParameterList(), verbose);
return pm;
}
} //namespace meshlab

View File

@ -1,52 +0,0 @@
/****************************************************************************
* MeshLab o o *
* A versatile mesh processing toolbox o o *
* _ O _ *
* Copyright(C) 2005-2020 \/)\/ *
* 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 MESHLAB_SINGLETONS_H
#define MESHLAB_SINGLETONS_H
class RichParameterList;
class PluginManager;
namespace meshlab {
/**
* @brief The MeshLabSingletons class
* This class contains all the singleton instances used on MeshLab.
* - pluginManager
* - defaultGlobalParameterList
*/
class MeshLabSingletons
{
public:
/** Singleton Instances **/
static PluginManager& pluginManagerInstance(bool verbose = true);
MeshLabSingletons(MeshLabSingletons const&) = delete;
void operator=(MeshLabSingletons const&) = delete;
private:
MeshLabSingletons();
};
}
#endif // MESHLAB_SINGLETONS_H

View File

@ -29,7 +29,7 @@
#include <vcg/complex/algorithms/create/platonic.h>
#include "mlexception.h"
#include "globals/globals.h"
#include "globals.h"
static QStringList fileNamePluginDLLs() {
QStringList l;

View File

@ -26,8 +26,8 @@
#include "ui_filter_script_dialog.h"
#include "filter_script_dialog.h"
#include "mainwindow.h"
#include "../common/mlexception.h"
#include "../common/globals/singletons.h"
#include <common/mlexception.h>
#include <common/globals.h>
#include "rich_parameter_gui/richparameterlistdialog.h"
FilterScriptDialog::FilterScriptDialog(FilterScript& fs, QWidget * parent):
@ -199,7 +199,7 @@ void FilterScriptDialog::editOldParameters( const int row )
//get a pointer to this action and filter from the main window so we can get the
//description of the parameters from the filter
QAction *action = meshlab::MeshLabSingletons::pluginManagerInstance().filterAction(actionName);
QAction *action = meshlab::pluginManagerInstance().filterAction(actionName);
FilterPluginInterface *iFilter = qobject_cast<FilterPluginInterface *>(action->parent());
if(NULL == iFilter){

View File

@ -39,8 +39,7 @@
#include <common/searcher.h>
#include <common/mlapplication.h>
#include <common/mlexception.h>
#include <common/globals/globals.h>
#include <common/globals/singletons.h>
#include <common/globals.h>
#include "dialogs/options_dialog.h"
#include "dialogs/save_snapshot_dialog.h"
#include "dialogs/congrats_dialog.h"
@ -52,7 +51,7 @@ MainWindow::MainWindow():
httpReq(this),
gpumeminfo(NULL),
defaultGlobalParams(meshlab::defaultGlobalParameterList()),
PM(meshlab::MeshLabSingletons::pluginManagerInstance()),
PM(meshlab::pluginManagerInstance()),
_currviewcontainer(NULL)
{
setContextMenuPolicy(Qt::NoContextMenu);

View File

@ -45,7 +45,7 @@
#include <common/mlapplication.h>
#include <common/filterscript.h>
#include <common/mlexception.h>
#include <common/globals/globals.h>
#include <common/globals.h>
#include "rich_parameter_gui/richparameterlistdialog.h"

View File

@ -24,7 +24,7 @@
#include <meshlab/glarea.h>
#include "decorate_shader.h"
#include "shadow_mapping.h"
#include <common/globals/globals.h>
#include <common/globals.h>
ShadowMapping::ShadowMapping(float intensity):DecorateShader()

View File

@ -24,7 +24,7 @@
#include <meshlab/glarea.h>
#include "ssao.h"
#include <common/globals/globals.h>
#include <common/globals.h>
SSAO::SSAO(float radius):DecorateShader()
{

View File

@ -23,7 +23,7 @@
#include "decorate_shader.h"
#include "variance_shadow_mapping.h"
#include <common/globals/globals.h>
#include <common/globals.h>
#include <meshlab/glarea.h>

View File

@ -24,7 +24,7 @@
#include <meshlab/glarea.h>
#include "decorate_shader.h"
#include "variance_shadow_mapping_blur.h"
#include <common/globals/globals.h>
#include <common/globals.h>
VarianceShadowMappingBlur::VarianceShadowMappingBlur(float intensity):VarianceShadowMapping(intensity)
{