46 #ifndef ASSIMPPLUGIN_HH
47 #define ASSIMPPLUGIN_HH
64 #include <assimp/Importer.hpp>
65 #include <assimp/Exporter.hpp>
66 #include <assimp/postprocess.h>
67 #include <assimp/scene.h>
82 #if QT_VERSION >= 0x050000
83 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-Assimp")
87 void openedFile(
int _id );
88 void addEmptyObject(
DataType _type,
int& _id);
89 void load(QString _filename,
DataType _type,
int& _id);
90 void save(
int _id , QString _filename );
91 void log(
Logtype _type, QString _message);
92 void log(QString _message);
94 void updatedObject(
int _identifier,
const UpdateType& _type);
96 void deleteObject(
int _id );
99 void pluginExists( QString _pluginName ,
bool& _exists );
102 void addAboutInfo(QString _text, QString _tabName );
106 QString
name() {
return (QString(
"AssimpPlugin")); }
107 QString
description( ) {
return (QString(tr(
"Load/Save Files with the assimp library"))); }
125 bool saveObject(
int _id, QString _filename);
127 QString version() {
return QString(
"1.0"); }
131 void fileOpened(
int ){}
133 void noguiSupported( ) {}
135 void initializePlugin();
158 void mapVertices(PolyMesh* _polyMesh, aiMesh* _mesh);
161 void mapVertices(TriMesh* _triMesh, aiMesh* _mesh);
165 QWidget* loadOptions_;
166 QWidget* saveOptions_;
174 #endif // ASSIMPPLUGIN_HH
Interface to call functions across plugins.
bool convertPolyMeshToAiMesh(PolyMesh *_polyMesh, aiMesh *_mesh)
converts a polymesh to an aiMesh
Interface for all plugins which want to Load or Save files and create Objects.
int loadObject(QString _filename)
Loads Object and converts it to a triangle mesh if possible.
Interface for all Plugins which provide scriptable Functions.
bool convertOpenMeshToAiScene(aiScene *_scene, BaseObjectData *_object)
converts a polymesh or trimesh to an aiScene
Interface for all Plugins which do logging to the logging window of the framework.
int convertAiSceneToOpenMesh(const aiScene *_scene, QString _objectName)
converts an aiScene to a polymesh or trimesh
std::map< unsigned int, OpenMesh::VertexHandle > vertexHandles_
maps indices of vertices in an aiMesh to OpenMesh VertexHandles
QWidget * loadOptionsWidget(QString)
QString name()
Return a name for the plugin.
QWidget * saveOptionsWidget(QString)
void convertAiMeshToTriMesh(TriMesh *_triMesh, aiMesh *_mesh)
converts _mesh into _triMesh
Interface class from which all plugins have to be created.
Logtype
Log types for Message Window.
bool convertTriMeshToAiMesh(TriMesh *_triMesh, aiMesh *_mesh)
converts a trimesh to an aiMesh
Interface class for file handling.
QString description()
Return a description of what the plugin is doing.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void convertAiMeshToPolyMesh(PolyMesh *_polyMesh, aiMesh *_mesh)
converts _mesh into _polyMesh
void mapVertices(PolyMesh *_polyMesh, aiMesh *_mesh)
add a vertex from _mesh to _polyMesh and stores the index to handle mapping