summaryrefslogtreecommitdiff
path: root/cad/plugins/NanoVision-1/include/Nanorex/Interface/NXDataImportExportPlugin.h
blob: 240630a6913d810b8881763511d76b50a3c1e25f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2008 Nanorex, Inc.  See LICENSE file for details.

#ifndef NX_DATAIMPORTEXPORTPLUGIN_H
#define NX_DATAIMPORTEXPORTPLUGIN_H

#ifdef WIN32
#	ifdef _MSC_VER
#		pragma warning(disable:4786)
#	endif
#endif

#include <string>
using namespace std;

#include <QtPlugin>

#include "Nanorex/Utility/NXCommandResult.h"
#include "Nanorex/Interface/NXMoleculeSet.h"
#include "Nanorex/Interface/NXDataStoreInfo.h"

namespace Nanorex {


/* CLASS: NXDataImportExportPlugin */
/**
 * Data Import/Export plugin interface.
 * @ingroup NanorexInterface PluginArchitecture
 */
class NXDataImportExportPlugin {
	public:
		virtual ~NXDataImportExportPlugin() {}

		/**
		 * Imports the system from the given file into the given molecule set.
		 *
		 * If frameIndex == 0, populates dataStoreInfo, else, re-uses the file
		 * handle from dataStoreInfo. If opening a multi-frame file, a handle
		 * to it will be stored in the dataStoreInfo for later use (subsequent
		 * importFromFile calls.)
		 *
		 * No modifications to the given moleculeSet will result in deletion
		 * of the frame with the given frameIndex.
		 */
		virtual NXCommandResult* importFromFile
			(NXMoleculeSet* moleculeSet, NXDataStoreInfo* dataStoreInfo,
			 const string& filename, int frameSetId, int frameIndex) = 0;

		/**
		 * Exports the system to the given file from the given molecule set.
		 *
		 * When writing a multi-frame file, caller would set a flag in dataStore
		 * to indicate that, and this function would store a handle to the file
		 * in the dataStore for subsequent use.
		 */
		virtual NXCommandResult* exportToFile
			(NXMoleculeSet* moleculeSet, NXDataStoreInfo* dataStoreInfo,
			 const string& filename, int frameSetId, int frameIndex) = 0;
};

} // Nanorex::

Q_DECLARE_INTERFACE(Nanorex::NXDataImportExportPlugin,
					"com.Nanorex.Interface.NXDataImportExportPlugin/0.1.0")

#endif