Subversion Repositories gelsvn

Rev

Rev 646 | Rev 662 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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