Subversion Repositories gelsvn

Rev

Rev 391 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 391 Rev 393
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
#include <CGLA/Vec3d.h>
10
#include <CGLA/Vec3d.h>
11
#include <HMesh/Manifold.h>
11
#include <HMesh/Manifold.h>
12
 
12
 
13
class Harmonics
13
class Harmonics
14
{
14
{
15
	HMesh::Manifold& mani;
15
	HMesh::Manifold& mani;
16
	
16
	
17
	int maximum_eigenvalue;
17
	int maximum_eigenvalue;
18
 
18
 
19
	static bool is_initialized;
19
	static bool is_initialized;
20
	static GLuint prog_P0;
20
	static GLuint prog_P0;
21
	
21
	
22
	std::vector<CGLA::Vec3d> proj;
22
	std::vector<CGLA::Vec3d> proj;
23
	
23
	
24
	LinAlg::CMatrix Q;
24
	LinAlg::CMatrix Q;
25
	LinAlg::CVector V;
25
	LinAlg::CVector V;
26
	std::vector<float> max_eig_values;
26
	std::vector<float> max_eig_values;
27
 
27
 
28
	void make_laplace_operator();
28
	void make_laplace_operator();
29
 
29
 
30
public:
30
public:
31
	
31
	
32
	/// Initialize API (must be called first)
32
	/// Initialize API (must be called first)
33
	static void init();
33
	static void init();
34
	
34
	
35
	/// Initial analysis of harmonics (must be called second)
35
	/// Initial analysis of harmonics (must be called second)
36
	Harmonics(HMesh::Manifold& mani);
36
	Harmonics(HMesh::Manifold& mani);
37
	
37
	
38
	/// Add a frequency to mesh reconstruction
38
	/// Add a frequency to mesh reconstruction
39
	void add_frequency(int f, float scale = 1.0f);
39
	void add_frequency(int f, float scale = 1.0f);
40
	
40
	
41
	/// Reset the shape to use 0 eigenvalues
41
	/// Reset the shape to use 0 eigenvalues
42
	void reset_shape();
42
	void reset_shape();
43
	
43
	
44
	/// Do a partial reconstruct with an interval of eigenvalues
44
	/// Do a partial reconstruct with an interval of eigenvalues
45
	void partial_reconstruct(int E0, int E1, float scale=1.0f);
45
	void partial_reconstruct(int E0, int E1, float scale=1.0f);
46
	
46
	
47
	/// Parse keystrokes that would influence the interactive display
47
	/// Parse keystrokes that would influence the interactive display
48
	void parse_key(unsigned char key);
48
	void parse_key(unsigned char key);
49
	
49
	
50
	/// Draw with eigenvalues
50
	/// Draw with eigenvalues
51
	void draw();
51
	void draw();
52
	
52
	
53
};
53
};
54
 
54
 
55

Generated by GNU Enscript 1.6.6.
55

Generated by GNU Enscript 1.6.6.
56
 
56
 
57
 
57
 
58
 
58