Commit 76397e8c authored by Matthias Möller's avatar Matthias Möller

- icon

- svn props
- some cleanup

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@19816 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 87ad99dc
include (plugin) include (plugin)
openflipper_plugin (OPTDEPS EIGEN3) openflipper_plugin (OPTDEPS EIGEN3 INSTALLDATA Icons)
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
/*===========================================================================*\ /*===========================================================================*\
* * * *
* $Revision: 18129 $ * * $Revision$ *
* $LastChangedBy: moebius $ * * $LastChangedBy$ *
* $Date: 2014-02-05 10:25:53 +0100 (Mi, 05. Feb 2014) $ * * $Date$ *
* * * *
\*===========================================================================*/ \*===========================================================================*/
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "TangentSpace.hh" #include "TangentSpace.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
...@@ -67,7 +68,10 @@ ...@@ -67,7 +68,10 @@
#include <Eigen/SVD> #include <Eigen/SVD>
#endif // ENABLE_EIGEN3 #endif // ENABLE_EIGEN3
#define CMP_EPS 1e-6f #include <limits>
const float cmp_eps = std::numeric_limits<float>::epsilon();
/* /*
...@@ -181,8 +185,8 @@ TangentSpace::pluginsInitialized() ...@@ -181,8 +185,8 @@ TangentSpace::pluginsInitialized()
connect(button,SIGNAL(clicked() ),this,SLOT(slotComputePerVertex())); connect(button,SIGNAL(clicked() ),this,SLOT(slotComputePerVertex()));
connect(buttonH,SIGNAL(clicked() ),this,SLOT(slotComputePerHalfedge())); connect(buttonH,SIGNAL(clicked() ),this,SLOT(slotComputePerHalfedge()));
QIcon* icon = new QIcon(OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator() + "tangent_space_icon.png");
emit addToolbox( tr("TangentSpace") , tool_ ); emit addToolbox( tr("TangentSpace") , tool_ , icon );
} }
...@@ -356,7 +360,7 @@ struct TangentSpace_SmoothingGroupKey ...@@ -356,7 +360,7 @@ struct TangentSpace_SmoothingGroupKey
if (cosTheta > 0.998f) if (cosTheta > 0.998f)
{ {
ACG::Vec2f d = uv - rhs.uv; 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; return true;
} }
...@@ -834,13 +838,13 @@ void TangentSpace::TangentBasis::orthonormalize(int method) ...@@ -834,13 +838,13 @@ void TangentSpace::TangentBasis::orthonormalize(int method)
normalize(); normalize();
// check for linear independence // 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; std::cerr << "warning: degenerated uv mapping" << std::endl;
b = n % t; 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; std::cerr << "warning: degenerated uv mapping" << std::endl;
t = b % n; t = b % n;
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
/*===========================================================================*\ /*===========================================================================*\
* * * *
* $Revision: 18129 $ * * $Revision$ *
* $LastChangedBy: moebius $ * * $LastChangedBy$ *
* $Date: 2014-02-05 10:25:53 +0100 (Mi, 05. Feb 2014) $ * * $Date$ *
* * * *
\*===========================================================================*/ \*===========================================================================*/
...@@ -55,6 +55,8 @@ ...@@ -55,6 +55,8 @@
#include <QMenuBar> #include <QMenuBar>
#include <QLineEdit> #include <QLineEdit>
#include <string>
class TangentSpace : public QObject, BaseInterface, ToolboxInterface class TangentSpace : public QObject, BaseInterface, ToolboxInterface
{ {
Q_OBJECT Q_OBJECT
...@@ -69,8 +71,8 @@ class TangentSpace : public QObject, BaseInterface, ToolboxInterface ...@@ -69,8 +71,8 @@ class TangentSpace : public QObject, BaseInterface, ToolboxInterface
void updatedObject(int, const UpdateType&); void updatedObject(int, const UpdateType&);
// ToolboxInterface // ToolboxInterface
void addToolbox( QString _name , QWidget* _widget ); void addToolbox( QString _name , QWidget* _widget, QIcon* _icon);
private slots: private slots:
void pluginsInitialized(); void pluginsInitialized();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment