surface_import.h 1.43 KB
Newer Older
1 2
#ifndef _SURFACE_IMPORT_PLUGIN_H_
#define _SURFACE_IMPORT_PLUGIN_H_
Pierre Kraemer's avatar
Pierre Kraemer committed
3

4
#include "dll.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
5 6 7 8 9 10 11
#include "plugin_processing.h"

namespace CGoGN
{

namespace SCHNApps
{
Sylvain Thery's avatar
Sylvain Thery committed
12
/**
Sylvain Thery's avatar
Sylvain Thery committed
13
* @brief Plugin for 2D mesh import. Supported mesh file format are: off/obj/ply.
Sylvain Thery's avatar
Sylvain Thery committed
14 15 16
* The import image function allow the creation of a mesh with a face by pixel.
* Image format support is given by Qt.
*/
17
class SURFACE_IMPORT_API Surface_Import_Plugin : public PluginProcessing
Pierre Kraemer's avatar
Pierre Kraemer committed
18 19 20
{
	Q_OBJECT
	Q_INTERFACES(CGoGN::SCHNApps::Plugin)
Sylvain Thery's avatar
Sylvain Thery committed
21 22 23
#if CGOGN_QT_DESIRED_VERSION == 5
	Q_PLUGIN_METADATA(IID "CGoGN.SCHNapps.Plugin")
#endif
Pierre Kraemer's avatar
Pierre Kraemer committed
24 25

public:
26
	Surface_Import_Plugin()
27
	{}
Pierre Kraemer's avatar
Pierre Kraemer committed
28

29
	~Surface_Import_Plugin()
Pierre Kraemer's avatar
Pierre Kraemer committed
30 31 32 33 34 35 36
	{}

private:
	virtual bool enable();
	virtual void disable() {}

public slots:
Sylvain Thery's avatar
Sylvain Thery committed
37
	/**
Sylvain Thery's avatar
Sylvain Thery committed
38
	 * @brief [PYTHON] import a mesh from a file
Sylvain Thery's avatar
Sylvain Thery committed
39 40 41
	 * @param fileName file name of mesh file
	 * @return the new maphandler that handle the mesh
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
42
	MapHandlerGen* importMeshFromFile(const QString& fileName);
Sylvain Thery's avatar
Sylvain Thery committed
43 44

	/**
Sylvain Thery's avatar
Sylvain Thery committed
45
	 * @brief [PYTHON] import a mesh by opening a FileDialog
Sylvain Thery's avatar
Sylvain Thery committed
46
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
47 48
	void importMeshFromFileDialog();

Sylvain Thery's avatar
Sylvain Thery committed
49
	/**
Sylvain Thery's avatar
Sylvain Thery committed
50
	 * @brief [PYTHON] import an image into a mesh from a file
Sylvain Thery's avatar
Sylvain Thery committed
51 52 53
	 * @param fileName file name of mesh file
	 * @return
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
54
	MapHandlerGen* importImageFromFile(const QString& fileName);
Sylvain Thery's avatar
Sylvain Thery committed
55 56

	/**
Sylvain Thery's avatar
Sylvain Thery committed
57
	 * @brief [PYTHON] import image into a mesh by opening a FileDialog
Sylvain Thery's avatar
Sylvain Thery committed
58
	 */
Pierre Kraemer's avatar
Pierre Kraemer committed
59
	void importImageFromFileDialog();
Pierre Kraemer's avatar
Pierre Kraemer committed
60 61

private:
Pierre Kraemer's avatar
Pierre Kraemer committed
62 63
	QAction* importMeshAction;
	QAction* importImageAction;
Pierre Kraemer's avatar
Pierre Kraemer committed
64 65 66 67 68 69 70
};

} // namespace SCHNApps

} // namespace CGoGN

#endif