-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfastm.h
63 lines (49 loc) · 1.7 KB
/
fastm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef FASTM_H
#define FASTM_H
#include <QWidget>
// menu objects
#include <QGroupBox>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <QPushButton>
#include <QLabel>
#include <QFormLayout>
#include "mesh.h"
class Fastm: public QWidget
{
Q_OBJECT
public:
explicit Fastm(Mesh &pmesh, QWidget *parent =0);
// getter funcs for integration parameters
long double lambda() {return m_lambda;}
int initialPoint() {return m_initialPoint;}
// optional menu to interact with widget
QGroupBox *menu();
public slots:
// setter funcs for integration parameters
void setLambda(double val) {m_lambda=val;}
void setInitPoint(int val) {m_initialPoint=val;}
// integrate mesh normals using a fast-marching semi-lagrangian scheme
void execFM();
signals:
void meshUpdated();
private:
Mesh *mesh;
// functions useful for the semilagrangian scheme
void initialize(QVector<Vertex> &vertices,
QVector<QList<unsigned int> > &neighbours,
QVector<bool> &Alive,
QMap<long double,unsigned int> &Close);
void update(Vertex &v, Vertex &v0, QList<Vertex> &neighbours);
long double deltaX(Vertex &v1, Vertex &v2);
long double F(Vertex &v, Vertex &v0);
QList<Vertex> getNeighbours(QVector<Vertex> &vertices,
QList<unsigned int> &neighboursInd);
Vertex getMinNeighbour(QList<Vertex> &neighbours);
long double interpolate(Vertex v0, Vertex v1, long double dist);
// penalization parameter (as suggested in ECCV-Kriegman)
long double m_lambda;
// "boundary" conditions (index of the vertex with fixed value)
unsigned int m_initialPoint;
};
#endif // FASTM_H