Subversion Repositories gelsvn

Rev

Rev 649 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
646 janba 1
/*
2
 *  harmonics.h
3
 *  GEL
4
 *
5
 *  Created by J. Andreas Bærentzen on 01/09/08.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
7
 *
8
 */
9
 
10
#ifndef __MESHEDIT_HARMONICS_H__
11
#define __MESHEDIT_HARMONICS_H__
12
 
13
#include <CGLA/Vec3d.h>
14
#include <HMesh/Manifold.h>
15
#include <HMesh/AttributeVector.h>
16
#include <LinAlg/Matrix.h>
17
#include <LinAlg/Vector.h>
18
 
19
namespace  HMesh {
20
 
21
    class Harmonics
22
    {
23
        HMesh::Manifold& mani;
24
        HMesh::VertexAttributeVector<int> vtouched;
25
 
26
        int maximum_eigenvalue;
27
 
28
        bool is_initialized;
29
 
30
        std::vector<CGLA::Vec3d> proj;
31
 
32
        LinAlg::CMatrix Q;
33
        LinAlg::CVector qnorm;
34
        LinAlg::CVector V;
35
        LinAlg::CVector S;
36
 
37
        std::vector<float> max_eig_values;
38
 
39
        void make_laplace_operator();
40
        void make_laplace_operator_sparse();
41
 
42
    public:
43
 
44
        /// Initial analysis of harmonics
45
        Harmonics(HMesh::Manifold& mani);
46
 
47
        /// Add a frequency to mesh reconstruction
48
        void add_frequency(int f, float scale = 1.0f);
49
 
50
        /// Reset the shape to use 0 eigenvalues
51
        void reset_shape();
52
 
53
        /// Do a partial reconstruct with an interval of eigenvalues
54
        void partial_reconstruct(int E0, int E1, float scale=1.0f);
55
 
56
        double compute_adf(HMesh::VertexAttributeVector<double>& adf, double t);
57
 
58
    };
59
 
60
}
61
#endif
62