mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 17:44:36 +00:00
added base plugin for e57 format
This commit is contained in:
parent
af805651f2
commit
5ab6ca7924
@ -126,6 +126,7 @@ else()
|
||||
meshlabplugins/io_txt
|
||||
meshlabplugins/io_u3d
|
||||
meshlabplugins/io_x3d
|
||||
meshlabplugins/io_e57
|
||||
|
||||
# IORaster plugins
|
||||
meshlabplugins/ioraster_base
|
||||
|
||||
9
src/meshlabplugins/io_e57/CMakeLists.txt
Normal file
9
src/meshlabplugins/io_e57/CMakeLists.txt
Normal file
@ -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})
|
||||
84
src/meshlabplugins/io_e57/io_e57.cpp
Executable file
84
src/meshlabplugins/io_e57/io_e57.cpp
Executable file
@ -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 <Qt>
|
||||
|
||||
#include "io_e57.h"
|
||||
|
||||
//#include <wrap/io_trimesh/export.h>
|
||||
|
||||
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<FileFormat> 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<FileFormat> 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)
|
||||
48
src/meshlabplugins/io_e57/io_e57.h
Executable file
48
src/meshlabplugins/io_e57/io_e57.h
Executable file
@ -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 <QObject>
|
||||
|
||||
#include <common/plugins/interfaces/iomesh_plugin.h>
|
||||
#include <common/ml_document/mesh_model.h>
|
||||
|
||||
class E57IOPlugin : public QObject, public IOMeshPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IOMESH_PLUGIN_IID)
|
||||
Q_INTERFACES(IOMeshPlugin)
|
||||
|
||||
public:
|
||||
QString pluginName() const;
|
||||
std::list<FileFormat> importFormats() const;
|
||||
std::list<FileFormat> 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
|
||||
9
src/meshlabplugins/io_e57/io_e57.pro
Executable file
9
src/meshlabplugins/io_e57/io_e57.pro
Executable file
@ -0,0 +1,9 @@
|
||||
include (../../shared.pri)
|
||||
|
||||
HEADERS +=\
|
||||
io_e57.h \
|
||||
|
||||
SOURCES += \
|
||||
io_e57.cpp \
|
||||
|
||||
TARGET = io_e57
|
||||
Loading…
x
Reference in New Issue
Block a user