diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23434ad7f..c6b51552c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,6 +141,7 @@ if(NOT DEFINED MESHLAB_PLUGINS) # it may be already defined in parent directory meshlabplugins/io_ctm meshlabplugins/io_expe meshlabplugins/io_json + meshlabplugins/io_nxs meshlabplugins/io_pdb meshlabplugins/io_tri meshlabplugins/io_txt diff --git a/src/external/CMakeLists.txt b/src/external/CMakeLists.txt index 9d65c00a5..d2a9ec9ee 100644 --- a/src/external/CMakeLists.txt +++ b/src/external/CMakeLists.txt @@ -54,6 +54,9 @@ if ((NOT BUILD_MINI) AND ALLOW_OPTIONAL_EXTERNAL_MESHLAB_LIBRARIES) # muparser - optional, for filter_func include(${CMAKE_CURRENT_SOURCE_DIR}/muparser.cmake) + # nexus - optional. for io_nxs + include(${CMAKE_CURRENT_SOURCE_DIR}/nexus.cmake) + # newuoa - optional and header-only, for several plugins including all that use levmar include(${CMAKE_CURRENT_SOURCE_DIR}/newuoa.cmake) diff --git a/src/external/nexus b/src/external/nexus index 9ed3c4bb0..1b7ba1156 160000 --- a/src/external/nexus +++ b/src/external/nexus @@ -1 +1 @@ -Subproject commit 9ed3c4bb055ef696418152d1d5b20730542f8613 +Subproject commit 1b7ba1156ac7e296582e9da8e99488ab3bcd2618 diff --git a/src/external/nexus.cmake b/src/external/nexus.cmake new file mode 100644 index 000000000..4d41a43bc --- /dev/null +++ b/src/external/nexus.cmake @@ -0,0 +1,13 @@ +# Copyright 2019, 2020, Collabora, Ltd. +# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council +# SPDX-License-Identifier: BSL-1.0 + +option(ALLOW_BUNDLED_NEXUS "Allow use of bundled nexus source" ON) + +if(ALLOW_BUNDLED_NEXUS AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/nexus/CMakeLists.txt") + message(STATUS "- nexus - using bundled source") + set (BUILD_NXS_BUILD OFF) + set (BUILD_NXS_EDIT OFF) + set (BUILD_NXS_VIEW OFF) + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/nexus) +endif() diff --git a/src/meshlabplugins/filter_qhull/CMakeLists.txt b/src/meshlabplugins/filter_qhull/CMakeLists.txt index 4241cedb0..b96399994 100644 --- a/src/meshlabplugins/filter_qhull/CMakeLists.txt +++ b/src/meshlabplugins/filter_qhull/CMakeLists.txt @@ -5,14 +5,14 @@ # Only build if we have qhull if(TARGET external-qhull) - set(SOURCES filter_qhull.cpp qhull_tools.cpp) + set(SOURCES filter_qhull.cpp qhull_tools.cpp) - set(HEADERS filter_qhull.h qhull_tools.h) + set(HEADERS filter_qhull.h qhull_tools.h) add_meshlab_plugin(filter_qhull ${SOURCES} ${HEADERS}) - target_link_libraries(filter_qhull PRIVATE external-qhull) + target_link_libraries(filter_qhull PRIVATE external-qhull) else() - message(STATUS "Skipping filter_qhull - missing qhull") + message(STATUS "Skipping filter_qhull - missing qhull") endif() diff --git a/src/meshlabplugins/io_nxs/CMakeLists.txt b/src/meshlabplugins/io_nxs/CMakeLists.txt new file mode 100644 index 000000000..21f855daa --- /dev/null +++ b/src/meshlabplugins/io_nxs/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright 2019-2020, Collabora, Ltd. +# SPDX-License-Identifier: BSL-1.0 + +# Only build if we have nexus +if (TARGET nexus) + + set(SOURCES sampleio.cpp) + + set(HEADERS sampleio.h) + + add_meshlab_plugin(io_nxs MODULE ${SOURCES} ${HEADERS}) + + target_link_libraries(io_nxs PRIVATE nexus) + +else() + message(STATUS "Skipping io_nxs - missing nexus") +endif() diff --git a/src/meshlabplugins/io_nxs/sampleio.cpp b/src/meshlabplugins/io_nxs/sampleio.cpp new file mode 100644 index 000000000..75f279fb2 --- /dev/null +++ b/src/meshlabplugins/io_nxs/sampleio.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2021 \/)\/ * +* 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 +#include "sampleio.h" + +QString SampleIOPlugin::pluginName() const +{ + return "IONXS"; +} + +/* + returns the list of the file's type which can be imported +*/ +std::list SampleIOPlugin::importFormats() const +{ + return {}; +} + +/* + returns the list of the file's type which can be exported +*/ +std::list SampleIOPlugin::exportFormats() const +{ + return {}; +} + +/* + returns the mask on the basis of the file's type. + otherwise it returns 0 if the file format is unknown +*/ +void SampleIOPlugin::exportMaskCapability( + const QString&, + int &capability, + int &defaultBits) const +{ + capability=defaultBits=0; + return; +} + + +void SampleIOPlugin::open( + const QString& fileFormat, + const QString&fileName, + MeshModel &m, + int& , + const RichParameterList & , + vcg::CallBackPos *) +{ + wrongOpenFormat(fileFormat); +} + +void SampleIOPlugin::save( + const QString& fileFormat, + const QString&fileName, + MeshModel &m, + const int mask, + const RichParameterList &, + vcg::CallBackPos *) +{ + + wrongSaveFormat(fileFormat); +} + +MESHLAB_PLUGIN_NAME_EXPORTER(SampleIOPlugin) diff --git a/src/meshlabplugins/io_nxs/sampleio.h b/src/meshlabplugins/io_nxs/sampleio.h new file mode 100644 index 000000000..c38ae6c82 --- /dev/null +++ b/src/meshlabplugins/io_nxs/sampleio.h @@ -0,0 +1,64 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2021 \/)\/ * +* 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 IO_EXAMPLE_PLUGIN_H +#define IO_EXAMPLE_PLUGIN_H + +#include + +class SampleIOPlugin : public QObject, public IOPlugin +{ + Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_IID) + Q_INTERFACES(IOPlugin) + +public: + + QString pluginName() const; + + std::list importFormats() const; + std::list exportFormats() const; + + void exportMaskCapability( + const QString &format, + int &capability, + int &defaultBits) const; + + void open( + const QString &format, /// the extension of the format e.g. "PLY" + const QString &fileName, /// The name of the file to be opened + MeshModel &m, /// The mesh that is filled with the file content + int &mask, /// a bit mask that will be filled reporting what kind of data we have found in the file (per vertex color, texture coords etc) + const RichParameterList & par, /// The parameters that have been set up in the initPreOpenParameter() + vcg::CallBackPos *cb = nullptr); /// standard callback for reporting progress in the loading + + void save( + const QString &format, // the extension of the format e.g. "PLY" + const QString &fileName, + MeshModel &m, + const int mask,// a bit mask indicating what kind of the data present in the mesh should be saved (e.g. you could not want to save normals in ply files) + const RichParameterList & par, + vcg::CallBackPos *cb = 0); +}; + +#endif diff --git a/src/vcglib b/src/vcglib index 8dc26dbe9..721dace0c 160000 --- a/src/vcglib +++ b/src/vcglib @@ -1 +1 @@ -Subproject commit 8dc26dbe93d10af108e0295c86f83b511bb13cac +Subproject commit 721dace0c5882c7c70ff3ea55fe0cb8aabd9553e