diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dca91da26..10f5267c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,6 +126,7 @@ else() meshlabplugins/io_txt meshlabplugins/io_u3d meshlabplugins/io_x3d + meshlabplugins/io_e57 # IORaster plugins meshlabplugins/ioraster_base diff --git a/src/meshlabplugins/io_e57/CMakeLists.txt b/src/meshlabplugins/io_e57/CMakeLists.txt new file mode 100644 index 000000000..083d0630a --- /dev/null +++ b/src/meshlabplugins/io_e57/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright 2019-2020, Collabora, Ltd. +# SPDX-License-Identifier: BSL-1.0 + + +set(SOURCES io_e57.cpp) + +set(HEADERS io_e57.h) + +add_meshlab_plugin(io_e57 ${SOURCES} ${HEADERS}) diff --git a/src/meshlabplugins/io_e57/io_e57.cpp b/src/meshlabplugins/io_e57/io_e57.cpp new file mode 100755 index 000000000..83a8926d1 --- /dev/null +++ b/src/meshlabplugins/io_e57/io_e57.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +* MeshLab o o * +* An extendible mesh processor o o * +* _ O _ * +* Copyright(C) 2005, 2006 \/)\/ * +* 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 "io_e57.h" + +//#include + +using namespace vcg; + +void E57IOPlugin::initPreOpenParameter(const QString &format, RichParameterList & parlst) +{ + return; +} + +void E57IOPlugin::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &parlst, CallBackPos * /*cb*/) +{ + if (formatName.toUpper() == tr("E57")) { + throw MLException("Error while opening E57 file."); + } + else { + wrongOpenFormat(formatName); + } +} + +void E57IOPlugin::save(const QString & formatName, const QString & /*fileName*/, MeshModel & /*m*/, const int /*mask*/, const RichParameterList &, vcg::CallBackPos * /*cb*/) +{ + wrongSaveFormat(formatName); +} + +/* + returns the list of the file's type which can be imported +*/ +QString E57IOPlugin::pluginName() const +{ + return QString{"IOE57"}; +} + +std::list E57IOPlugin::importFormats() const +{ + return { + FileFormat("E57 (E57 point cloud)", tr("E57")) + }; +} + +/* + Returns the list of the file's type which can be exported +*/ +std::list E57IOPlugin::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 E57IOPlugin::exportMaskCapability(const QString & /*format*/, int &capability, int &defaultBits) const +{ + capability = defaultBits=0; + return; +} + +MESHLAB_PLUGIN_NAME_EXPORTER(E57IOPlugin) diff --git a/src/meshlabplugins/io_e57/io_e57.h b/src/meshlabplugins/io_e57/io_e57.h new file mode 100755 index 000000000..a5204bae6 --- /dev/null +++ b/src/meshlabplugins/io_e57/io_e57.h @@ -0,0 +1,48 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005 \/)\/ * +* 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 E57IOPLUGIN_H +#define E57IOPLUGIN_H + +#include + +#include +#include + +class E57IOPlugin : public QObject, public IOMeshPlugin +{ + Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(IOMESH_PLUGIN_IID) + Q_INTERFACES(IOMeshPlugin) + +public: + QString pluginName() const; + std::list importFormats() const; + std::list exportFormats() const; + virtual void exportMaskCapability(const QString &format, int &capability, int &defaultBits) const; + virtual void initPreOpenParameter(const QString &/*format*/, RichParameterList & /*par*/); + + void open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0); + void save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb); +}; + +#endif \ No newline at end of file diff --git a/src/meshlabplugins/io_e57/io_e57.pro b/src/meshlabplugins/io_e57/io_e57.pro new file mode 100755 index 000000000..dbbbe739f --- /dev/null +++ b/src/meshlabplugins/io_e57/io_e57.pro @@ -0,0 +1,9 @@ +include (../../shared.pri) + +HEADERS +=\ + io_e57.h \ + +SOURCES += \ + io_e57.cpp \ + +TARGET = io_e57