Subversion Repositories gelsvn

Rev

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