mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
draft nxs plugin
This commit is contained in:
parent
68551d6fa1
commit
3f8a2913ad
@ -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
|
||||
|
||||
3
src/external/CMakeLists.txt
vendored
3
src/external/CMakeLists.txt
vendored
@ -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)
|
||||
|
||||
|
||||
2
src/external/nexus
vendored
2
src/external/nexus
vendored
@ -1 +1 @@
|
||||
Subproject commit 9ed3c4bb055ef696418152d1d5b20730542f8613
|
||||
Subproject commit 1b7ba1156ac7e296582e9da8e99488ab3bcd2618
|
||||
13
src/external/nexus.cmake
vendored
Normal file
13
src/external/nexus.cmake
vendored
Normal file
@ -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()
|
||||
@ -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()
|
||||
|
||||
17
src/meshlabplugins/io_nxs/CMakeLists.txt
Normal file
17
src/meshlabplugins/io_nxs/CMakeLists.txt
Normal file
@ -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()
|
||||
85
src/meshlabplugins/io_nxs/sampleio.cpp
Normal file
85
src/meshlabplugins/io_nxs/sampleio.cpp
Normal file
@ -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 <common/ml_document/mesh_model.h>
|
||||
#include "sampleio.h"
|
||||
|
||||
QString SampleIOPlugin::pluginName() const
|
||||
{
|
||||
return "IONXS";
|
||||
}
|
||||
|
||||
/*
|
||||
returns the list of the file's type which can be imported
|
||||
*/
|
||||
std::list<FileFormat> SampleIOPlugin::importFormats() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
/*
|
||||
returns the list of the file's type which can be exported
|
||||
*/
|
||||
std::list<FileFormat> 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)
|
||||
64
src/meshlabplugins/io_nxs/sampleio.h
Normal file
64
src/meshlabplugins/io_nxs/sampleio.h
Normal file
@ -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 <common/plugins/interfaces/io_plugin.h>
|
||||
|
||||
class SampleIOPlugin : public QObject, public IOPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_IID)
|
||||
Q_INTERFACES(IOPlugin)
|
||||
|
||||
public:
|
||||
|
||||
QString pluginName() const;
|
||||
|
||||
std::list<FileFormat> importFormats() const;
|
||||
std::list<FileFormat> 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
|
||||
@ -1 +1 @@
|
||||
Subproject commit 8dc26dbe93d10af108e0295c86f83b511bb13cac
|
||||
Subproject commit 721dace0c5882c7c70ff3ea55fe0cb8aabd9553e
|
||||
Loading…
x
Reference in New Issue
Block a user