Subversion Repositories gelsvn

Rev

Rev 388 | Rev 399 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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