Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
4e4cbe13
Commit
4e4cbe13
authored
Mar 08, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'docs-fix-plugin-build' into 'master'
docs: fix compilation of example plugins. See merge request
!140
parents
f8e2e049
277c9564
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
24 deletions
+37
-24
Documentation/DeveloperHelpSources/example/CMakeLists.txt
Documentation/DeveloperHelpSources/example/CMakeLists.txt
+3
-1
Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc
...ntation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc
+7
-8
Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh
...ntation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh
+8
-0
Documentation/DeveloperHelpSources/example/SmootherPlugin.cc
Documentation/DeveloperHelpSources/example/SmootherPlugin.cc
+12
-14
Documentation/DeveloperHelpSources/example/SmootherPlugin.hh
Documentation/DeveloperHelpSources/example/SmootherPlugin.hh
+6
-0
Documentation/DeveloperHelpSources/example/simplePlugin.cc
Documentation/DeveloperHelpSources/example/simplePlugin.cc
+0
-1
Documentation/DeveloperHelpSources/example/simplePlugin.hh
Documentation/DeveloperHelpSources/example/simplePlugin.hh
+1
-0
No files found.
Documentation/DeveloperHelpSources/example/CMakeLists.txt
View file @
4e4cbe13
include
(
plugin
)
openflipper_plugin
()
\ No newline at end of file
openflipper_plugin
(
TYPES TRIANGLEMESH POLYMESH
)
Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.cc
View file @
4e4cbe13
...
...
@@ -159,7 +159,7 @@ void MouseAndKeyPlugin::slotMouseEvent(QMouseEvent* _event) {
// If double click has been performed
if
(
_event
->
type
()
==
QEvent
::
MouseButtonDblClick
)
{
unsigned
in
t
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
);
Documentation/DeveloperHelpSources/example/MouseAndKeyPlugin.hh
View file @
4e4cbe13
#ifndef MOUSEANDKEYPLUGIN_HH
#define MOUSEANDKEYPLUGIN_HH
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/MouseInterface.hh>
#include <OpenFlipper/BasePlugin/PickingInterface.hh>
...
...
@@ -10,6 +11,11 @@
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/common/Types.hh>
#include <QPushButton>
#include <QLabel>
#include <QGridLayout>
#include <QMenu>
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
...
...
Documentation/DeveloperHelpSources/example/SmootherPlugin.cc
View file @
4e4cbe13
...
...
@@ -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
);
Documentation/DeveloperHelpSources/example/SmootherPlugin.hh
View file @
4e4cbe13
...
...
@@ -6,12 +6,18 @@
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/common/Types.hh>
#include <QPushButton>
#include <QLabel>
#include <QGridLayout>
#include <QSpinBox>
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
...
...
Documentation/DeveloperHelpSources/example/simplePlugin.cc
View file @
4e4cbe13
#include "simplePlugin.hh"
#include "OpenFlipper/BasePlugin/PluginFunctions.hh"
Q_EXPORT_PLUGIN2
(
simplePlugin
,
SimplePlugin
);
Documentation/DeveloperHelpSources/example/simplePlugin.hh
View file @
4e4cbe13
...
...
@@ -8,6 +8,7 @@ class SimplePlugin : public QObject, BaseInterface
{
Q_OBJECT
Q_INTERFACES
(
BaseInterface
)
Q_PLUGIN_METADATA
(
IID
"org.OpenFlipper.Plugins.examples.SimplePlugin"
)
public
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment