diff --git a/Plugin-TangentSpace/CMakeLists.txt b/Plugin-TangentSpace/CMakeLists.txt index c31b27970626136a1d47c6c5f1b738546803d68c..c602a5450df23985bbb7769789c9ed96016e86a9 100644 --- a/Plugin-TangentSpace/CMakeLists.txt +++ b/Plugin-TangentSpace/CMakeLists.txt @@ -1,2 +1,2 @@ include (plugin) -openflipper_plugin (OPTDEPS EIGEN3) +openflipper_plugin (OPTDEPS EIGEN3 INSTALLDATA Icons) diff --git a/Plugin-TangentSpace/Icons/tangent_space_icon.png b/Plugin-TangentSpace/Icons/tangent_space_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fa310e98524a058633123d5f95c5d53085aca229 Binary files /dev/null and b/Plugin-TangentSpace/Icons/tangent_space_icon.png differ diff --git a/Plugin-TangentSpace/TangentSpace.cc b/Plugin-TangentSpace/TangentSpace.cc index 341858566d8159a8dcfb10c605a23598d881034e..08eaefdee08be436e93f6955d99d89acd7d62871 100644 --- a/Plugin-TangentSpace/TangentSpace.cc +++ b/Plugin-TangentSpace/TangentSpace.cc @@ -34,9 +34,9 @@ /*===========================================================================*\ * * -* $Revision: 18129 $ * -* $LastChangedBy: moebius $ * -* $Date: 2014-02-05 10:25:53 +0100 (Mi, 05. Feb 2014) $ * +* $Revision$ * +* $LastChangedBy$ * +* $Date$ * * * \*===========================================================================*/ @@ -45,6 +45,7 @@ #include "TangentSpace.hh" +#include #if QT_VERSION >= 0x050000 @@ -67,7 +68,10 @@ #include #endif // ENABLE_EIGEN3 -#define CMP_EPS 1e-6f +#include + + +const float cmp_eps = std::numeric_limits::epsilon(); /* @@ -181,8 +185,8 @@ TangentSpace::pluginsInitialized() connect(button,SIGNAL(clicked() ),this,SLOT(slotComputePerVertex())); connect(buttonH,SIGNAL(clicked() ),this,SLOT(slotComputePerHalfedge())); - - emit addToolbox( tr("TangentSpace") , tool_ ); + QIcon* icon = new QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "tangent_space_icon.png"); + emit addToolbox( tr("TangentSpace") , tool_ , icon ); } @@ -356,7 +360,7 @@ struct TangentSpace_SmoothingGroupKey if (cosTheta > 0.998f) { ACG::Vec2f d = uv - rhs.uv; - if ( fabsf(d[0]) < CMP_EPS && fabsf(d[1]) < CMP_EPS ) + if ( fabsf(d[0]) < cmp_eps && fabsf(d[1]) < cmp_eps ) return true; } @@ -834,13 +838,13 @@ void TangentSpace::TangentBasis::orthonormalize(int method) normalize(); // check for linear independence - if ( fabsf( fabsf(t | b) - 1.0f ) < CMP_EPS ) + if ( fabsf( fabsf(t | b) - 1.0f ) < cmp_eps ) { std::cerr << "warning: degenerated uv mapping" << std::endl; b = n % t; } - if ( fabsf( fabsf(n | t) - 1.0f ) < CMP_EPS ) + if ( fabsf( fabsf(n | t) - 1.0f ) < cmp_eps ) { std::cerr << "warning: degenerated uv mapping" << std::endl; t = b % n; diff --git a/Plugin-TangentSpace/TangentSpace.hh b/Plugin-TangentSpace/TangentSpace.hh index 12c64009695ef0ed2d09a1c7b97262520852035b..77e1302312e40702ab165150f3a1cfcfaf1c5951 100644 --- a/Plugin-TangentSpace/TangentSpace.hh +++ b/Plugin-TangentSpace/TangentSpace.hh @@ -34,9 +34,9 @@ /*===========================================================================*\ * * -* $Revision: 18129 $ * -* $LastChangedBy: moebius $ * -* $Date: 2014-02-05 10:25:53 +0100 (Mi, 05. Feb 2014) $ * +* $Revision$ * +* $LastChangedBy$ * +* $Date$ * * * \*===========================================================================*/ @@ -55,6 +55,8 @@ #include #include +#include + class TangentSpace : public QObject, BaseInterface, ToolboxInterface { Q_OBJECT @@ -69,8 +71,8 @@ class TangentSpace : public QObject, BaseInterface, ToolboxInterface void updatedObject(int, const UpdateType&); - // ToolboxInterface - void addToolbox( QString _name , QWidget* _widget ); + // ToolboxInterface + void addToolbox( QString _name , QWidget* _widget, QIcon* _icon); private slots: void pluginsInitialized();