From 882029317bb117cfce6304b22183cb5d0ca9c8f1 Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Wed, 15 Mar 2017 12:11:42 +0000 Subject: [PATCH] Removed plugins/examples directory. --- .../examples/simple-xyz/CMakeLists.txt | 30 ---- src/plugins/examples/simple-xyz/Makefile.am | 15 -- src/plugins/examples/simple-xyz/xyz.h | 88 ---------- src/plugins/examples/simple-xyz/xyz_funcs.cpp | 157 ------------------ 4 files changed, 290 deletions(-) delete mode 100644 src/plugins/examples/simple-xyz/CMakeLists.txt delete mode 100644 src/plugins/examples/simple-xyz/Makefile.am delete mode 100644 src/plugins/examples/simple-xyz/xyz.h delete mode 100644 src/plugins/examples/simple-xyz/xyz_funcs.cpp diff --git a/src/plugins/examples/simple-xyz/CMakeLists.txt b/src/plugins/examples/simple-xyz/CMakeLists.txt deleted file mode 100644 index 46f35d99d..000000000 --- a/src/plugins/examples/simple-xyz/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -# Meta-Objects -set(xyz_MOC_HDRS - xyz.h -) -QT5_WRAP_CPP(xyz_MOC_SRCS ${xyz_MOC_HDRS} OPTIONS -I${PROJECT_SOURCE_DIR}/src) - -add_library(xyz MODULE - xyz_funcs.cpp - ${xyz_MOC_SRCS} -) -set_target_properties(xyz PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${Aten_BINARY_DIR}/data/plugins - COMPILE_DEFINITIONS "QT_PLUGIN" - PREFIX "" -) - -if(UNIX AND NOT APPLE) -install(TARGETS xyz - RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins -) -endif(UNIX AND NOT APPLE) - -target_include_directories(xyz PRIVATE - ${PROJECT_SOURCE_DIR}/src - ${PROJECT_BINARY_DIR}/src - ${Qt5Core_INCLUDE_DIRS} - ${Qt5Gui_INCLUDE_DIRS} -) - diff --git a/src/plugins/examples/simple-xyz/Makefile.am b/src/plugins/examples/simple-xyz/Makefile.am deleted file mode 100644 index 9329da384..000000000 --- a/src/plugins/examples/simple-xyz/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -pluginexecdir = ${pkglibdir}/plugins -pluginexec_LTLIBRARIES = xyz.la - -%.cpp: %.h - ${QTMOC} -o $*.cpp -I../../../ @ATEN_INCLUDES@ $< - -clean-local: - -rm -f xyz.cpp - -xyz_la_SOURCES = xyz_funcs.cpp xyz.cpp -xyz_la_LDFLAGS = -module -shared -avoid-version - -noinst_HEADERS = xyz.h - -AM_CPPFLAGS = -I${top_srcdir}/src @ATEN_INCLUDES@ @ATEN_CFLAGS@ diff --git a/src/plugins/examples/simple-xyz/xyz.h b/src/plugins/examples/simple-xyz/xyz.h deleted file mode 100644 index 231445ca4..000000000 --- a/src/plugins/examples/simple-xyz/xyz.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - *** XYZ Plugin - *** src/plugins/io_xyz/xyz.h - Copyright T. Youngs 2016-2017 - - This file is part of Aten. - - Aten 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 3 of the License, or - (at your option) any later version. - - Aten 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 for more details. - - You should have received a copy of the GNU General Public License - along with Aten. If not, see . -*/ - -#ifndef ATEN_XYZPLUGIN_H -#define ATEN_XYZPLUGIN_H - -#include "plugins/interfaces/fileplugin.h" - -ATEN_BEGIN_NAMESPACE - -// Forward Declarations -/* none */ - -// XYZ Model Import / Export Plugin -class XYZModelPlugin : public QObject, public FilePluginInterface -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "com.projectaten.Aten.FilePluginInterface.v1") - Q_INTERFACES(AtenSpace::FilePluginInterface) - - - /* - * Core - */ - public: - // Constructor - XYZModelPlugin(); - // Destructor - ~XYZModelPlugin(); - // Return a copy of the plugin object - FilePluginInterface* duplicate(); - - - /* - * Definition - */ - public: - // Return type of plugin - PluginTypes::PluginType type() const; - // Return category of plugin - int category() const; - // Return name of plugin - QString name() const; - // Return nickname of plugin - QString nickname() const; - // Return description (long name) of plugin - QString description() const; - // Return related file extensions - QStringList extensions() const; - // Return exact names - QStringList exactNames() const; - - - /* - * Input / Output - */ - public: - // Return whether this plugin can import data - bool canImport() const; - // Import data via the supplied parser - bool importData(FileParser& parser, const KVMap standardOptions = KVMap()); - // Return whether this plugin can export data - bool canExport() const; - // Export data via the supplied parser - bool exportData(FileParser& parser, const KVMap standardOptions = KVMap()); -}; - -ATEN_END_NAMESPACE - -#endif diff --git a/src/plugins/examples/simple-xyz/xyz_funcs.cpp b/src/plugins/examples/simple-xyz/xyz_funcs.cpp deleted file mode 100644 index acff22f0b..000000000 --- a/src/plugins/examples/simple-xyz/xyz_funcs.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - *** XYZ Plugin Functions - *** src/plugins/io_xyz/xyz_funcs.cpp - Copyright T. Youngs 2016-2017 - - This file is part of Aten. - - Aten 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 3 of the License, or - (at your option) any later version. - - Aten 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 for more details. - - You should have received a copy of the GNU General Public License - along with Aten. If not, see . -*/ - -#include "plugins/io_xyz/xyz.h" -#include "model/model.h" - -// Constructor -XYZModelPlugin::XYZModelPlugin() -{ -} - -// Destructor -XYZModelPlugin::~XYZModelPlugin() -{ -} - -/* - * Core - */ - -// Return a copy of the plugin object -FilePluginInterface* XYZModelPlugin::duplicate() -{ - return new XYZModelPlugin; -} - -/* - * Definition - */ - -// Return category of plugin -int XYZModelPlugin::category() const -{ - return PluginTypes::ModelFilePlugin; -} - -// Name of plugin -QString XYZModelPlugin::name() const -{ - return QString("XYZ Files (XMol Style)"); -} - -// Nickname of plugin -QString XYZModelPlugin::nickname() const -{ - return QString("xyz"); -} - -// Description (long name) of plugin -QString XYZModelPlugin::description() const -{ - return QString("Import/export for XMol-style XYZ coordinate files"); -} - -// Related file extensions -QStringList XYZModelPlugin::extensions() const -{ - return QStringList() << "xyz"; -} - -// Exact names -QStringList XYZModelPlugin::exactNames() const -{ - return QStringList(); -} - -/* - * Input / Output - */ - -// Return whether this plugin can import data -bool XYZModelPlugin::canImport() const -{ - return true; -} - -// Import data from the specified file -bool XYZModelPlugin::importData(FileParser& parser, const KVMap standardOptions) -{ - int nAtoms, n; - QString e, name; - Vec3 r; - Model* targetModel = NULL; - - // Read data - while (!parser.eofOrBlank()) - { - // Read number of atoms from file - if (!parser.readLineAsInteger(nAtoms)) return false; - - // Next line is name of model - if (!parser.readLine(name)) return false; - - // Create a new model now.... - targetModel = createModel(); - targetModel->setName(name); - - // Load atoms for model - for (n=0; naddAtom(ElementMap().find(parser.argc(0)), r); - } - - // Rebond the model - targetModel->calculateBonding(true); - } - return true; -} - -// Return whether this plugin can export data -bool XYZModelPlugin::canExport() const -{ - return true; -} - -// Export data to the specified file -bool XYZModelPlugin::exportData(FileParser& parser, const KVMap standardOptions) -{ - // Get the current model pointer containing the data we are to export - const Model* targetModel = parser.targetModel(); - - // Write number atoms line - parser.writeLineF("%i", targetModel->nAtoms()); - - // Write title line - parser.writeLine(targetModel->name()); - - // Write atom information - for (Atom* i = targetModel->atoms(); i != NULL; i = i->next) - { - parser.writeLineF("%-8s %12.6f %12.6f %12.6f %12.6f", ElementMap().symbol(i->element()), i->r().x, i->r().y, i->r().z, i->charge()); - } - - return true; -}