surface_import.h 1.4 KB
Newer Older
1 2
#ifndef _SURFACE_IMPORT_PLUGIN_H_
#define _SURFACE_IMPORT_PLUGIN_H_
Pierre Kraemer's avatar
Pierre Kraemer committed
3 4 5 6 7 8 9 10

#include "plugin_processing.h"

namespace CGoGN
{

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

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

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

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

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

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

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

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

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

} // namespace SCHNApps

} // namespace CGoGN

#endif