diff --git a/Documentation/DeveloperHelpSources/example/CMakeLists.txt b/Documentation/DeveloperHelpSources/example/CMakeLists.txt index a422b9ade525c13d4a01cb7b272810482f634368..8964317ae51f406f92a2a46fa3aca3df0e91a367 100644 --- a/Documentation/DeveloperHelpSources/example/CMakeLists.txt +++ b/Documentation/DeveloperHelpSources/example/CMakeLists.txt @@ -1,2 +1,4 @@ include (plugin) -openflipper_plugin () \ No newline at end of file +openflipper_plugin ( + TYPES TRIANGLEMESH POLYMESH + ) diff --git a/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc b/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc index 358ebd9c5e2a9d411eeb9cc1b8d47515c3e85384..a3c99d85d242046b3fd98586610a75b9c9971294 100644 --- a/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc +++ b/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc @@ -159,7 +159,7 @@ void MouseAndKeyPlugin::slotMouseEvent(QMouseEvent* _event) { // If double click has been performed if (_event->type() == QEvent::MouseButtonDblClick) { - unsigned int node_idx, target_idx; + size_t node_idx, target_idx; OpenMesh::Vec3d hitPoint; // Get picked object's identifier @@ -279,10 +279,10 @@ void MouseAndKeyPlugin::transformMesh(ACG::Matrix4x4d _mat, MeshT& _mesh) { // Iterator over all vertices and transform them by _mat // Update normals for (; v_it != v_end; ++v_it) { - _mesh.set_point(v_it, (typename MeshT::Point) _mat.transform_point( - (OpenMesh::Vec3d)(_mesh.point(v_it)))); - _mesh.set_normal(v_it, (typename MeshT::Point) _mat.transform_vector( - (OpenMesh::Vec3d)(_mesh.normal(v_it)))); + _mesh.set_point(*v_it, (typename MeshT::Point) _mat.transform_point( + (OpenMesh::Vec3d)(_mesh.point(*v_it)))); + _mesh.set_normal(*v_it, (typename MeshT::Point) _mat.transform_vector( + (OpenMesh::Vec3d)(_mesh.normal(*v_it)))); } typename MeshT::FaceIter f_it = _mesh.faces_begin(); @@ -290,8 +290,8 @@ void MouseAndKeyPlugin::transformMesh(ACG::Matrix4x4d _mat, MeshT& _mesh) { // Iterate over all faces and update face normals for (; f_it != f_end; ++f_it) - _mesh.set_normal(f_it, (typename MeshT::Point) _mat.transform_vector( - (OpenMesh::Vec3d)(_mesh.normal(f_it)))); + _mesh.set_normal(*f_it, (typename MeshT::Point) _mat.transform_vector( + (OpenMesh::Vec3d)(_mesh.normal(*f_it)))); } // End transformMesh @@ -330,5 +330,4 @@ void MouseAndKeyPlugin::contextMenuItemSelected(QAction* _action) { } // End contextMenuItemSelected -Q_EXPORT_PLUGIN2( mouseandkeyplugin , MouseAndKeyPlugin ); diff --git a/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh b/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh index 559bbfc394bf2f3dbddd9a1387097e0cc9178a7f..73075dd85580f46e4ef050debed7ddc8e8411234 100644 --- a/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh +++ b/Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh @@ -1,6 +1,7 @@ #ifndef MOUSEANDKEYPLUGIN_HH #define MOUSEANDKEYPLUGIN_HH + #include #include #include @@ -10,6 +11,11 @@ #include #include +#include +#include +#include +#include + class MouseAndKeyPlugin: public QObject, BaseInterface, MouseInterface, @@ -27,6 +33,8 @@ class MouseAndKeyPlugin: public QObject, Q_INTERFACES(ToolboxInterface) Q_INTERFACES(LoggingInterface) + Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.examples.MouseAndKeyPlugin") + signals: //BaseInterface diff --git a/Documentation/DeveloperHelpSources/example/SmootherPlugin.cc b/Documentation/DeveloperHelpSources/example/SmootherPlugin.cc index 14f05b8de53a3a28335de60430f0df9d70666e75..4a95db5d56185418a4f418bb746e999a6770fd1e 100644 --- a/Documentation/DeveloperHelpSources/example/SmootherPlugin.cc +++ b/Documentation/DeveloperHelpSources/example/SmootherPlugin.cc @@ -94,7 +94,7 @@ void SmootherPlugin::simpleLaplace() // Copy original positions to backup ( in vertex property ) TriMesh::VertexIter v_it, v_end = mesh->vertices_end(); for (v_it = mesh->vertices_begin(); v_it != v_end; ++v_it) { - mesh->property(origPositions, v_it) = mesh->point(v_it); + mesh->property(origPositions, *v_it) = mesh->point(*v_it); } // Do one smoothing step (For each point of the mesh ... ) @@ -106,12 +106,12 @@ void SmootherPlugin::simpleLaplace() bool skip = false; // ( .. for each outgoing halfedge .. ) - TriMesh::VertexOHalfedgeIter voh_it(*mesh, v_it); + TriMesh::VertexOHalfedgeIter voh_it(*mesh, *v_it); - for (; voh_it; ++voh_it) { + for (; voh_it.is_valid(); ++voh_it) { // .. add the (original) position of the neighbour ( end of the outgoing halfedge ) - point += mesh->property(origPositions, mesh->to_vertex_handle(voh_it)); + point += mesh->property(origPositions, mesh->to_vertex_handle(*voh_it)); // Check if the current Halfedge is a boundary halfedge // If it is, abort and keep the current vertex position @@ -122,11 +122,11 @@ void SmootherPlugin::simpleLaplace() } // Devide by the valence of the current vertex - point /= mesh->valence(v_it); + point /= mesh->valence(*v_it); if (!skip) { // Set new position for the mesh if its not on the boundary - mesh->point(v_it) = point; + mesh->point(*v_it) = point; } } @@ -155,7 +155,7 @@ void SmootherPlugin::simpleLaplace() // Copy original positions to backup ( in Vertex property ) PolyMesh::VertexIter v_it, v_end = mesh->vertices_end(); for (v_it = mesh->vertices_begin(); v_it != v_end; ++v_it) { - mesh->property(origPositions, v_it) = mesh->point(v_it); + mesh->property(origPositions, *v_it) = mesh->point(*v_it); } // Do one smoothing step (For each point of the mesh ... ) @@ -167,10 +167,10 @@ void SmootherPlugin::simpleLaplace() bool skip = false; // ( .. for each Outoing halfedge .. ) - PolyMesh::VertexOHalfedgeIter voh_it(*mesh, v_it); - for (; voh_it; ++voh_it) { + PolyMesh::VertexOHalfedgeIter voh_it(*mesh, *v_it); + for (; voh_it.is_valid(); ++voh_it) { // .. add the (original) position of the Neighbour ( end of the outgoing halfedge ) - point += mesh->property(origPositions, mesh->to_vertex_handle(voh_it)); + point += mesh->property(origPositions, mesh->to_vertex_handle(*voh_it)); // Check if the current Halfedge is a boundary halfedge // If it is, abort and keep the current vertex position @@ -182,11 +182,11 @@ void SmootherPlugin::simpleLaplace() } // Devide by the valence of the current vertex - point /= mesh->valence(v_it); + point /= mesh->valence(*v_it); if (!skip) { // Set new position for the mesh if its not on the boundary - mesh->point(v_it) = point; + mesh->point(*v_it) = point; } } @@ -207,5 +207,3 @@ void SmootherPlugin::simpleLaplace() } } -Q_EXPORT_PLUGIN2( smootherplugin, SmootherPlugin); - diff --git a/Documentation/DeveloperHelpSources/example/SmootherPlugin.hh b/Documentation/DeveloperHelpSources/example/SmootherPlugin.hh index 8b0864fc1683e25dc5f9cd67d42793896a23c5b6..47c9fcedb016ad86b4b336150029e892839df56a 100644 --- a/Documentation/DeveloperHelpSources/example/SmootherPlugin.hh +++ b/Documentation/DeveloperHelpSources/example/SmootherPlugin.hh @@ -6,12 +6,18 @@ #include #include +#include +#include +#include +#include + class SmootherPlugin : public QObject, BaseInterface, ToolboxInterface, LoggingInterface { Q_OBJECT Q_INTERFACES(BaseInterface) Q_INTERFACES(ToolboxInterface) Q_INTERFACES(LoggingInterface) + Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.examples.SmootherPlugin") signals: //BaseInterface diff --git a/Documentation/DeveloperHelpSources/example/simplePlugin.cc b/Documentation/DeveloperHelpSources/example/simplePlugin.cc index 8af2ff49641c3d9dd30c3020554dcd77826deeec..507ca1085485e07cb9786b74a1ba3fbaa6253fee 100644 --- a/Documentation/DeveloperHelpSources/example/simplePlugin.cc +++ b/Documentation/DeveloperHelpSources/example/simplePlugin.cc @@ -1,4 +1,3 @@ #include "simplePlugin.hh" #include "OpenFlipper/BasePlugin/PluginFunctions.hh" -Q_EXPORT_PLUGIN2( simplePlugin , SimplePlugin ); diff --git a/Documentation/DeveloperHelpSources/example/simplePlugin.hh b/Documentation/DeveloperHelpSources/example/simplePlugin.hh index 5bacbe2ce1d1a3b2fa7fa400274009ea061b6db8..c29e33c829ac8b722167241e80eeb0b4f16723bf 100644 --- a/Documentation/DeveloperHelpSources/example/simplePlugin.hh +++ b/Documentation/DeveloperHelpSources/example/simplePlugin.hh @@ -8,6 +8,7 @@ class SimplePlugin : public QObject, BaseInterface { Q_OBJECT Q_INTERFACES(BaseInterface) +Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.examples.SimplePlugin") public :