Subversion Repositories gelsvn

Rev

Rev 388 | Rev 399 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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