Subversion Repositories gelsvn

Rev

Rev 403 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
399 jab 1
/*
2
 *  VisObj.h
3
 *  GEL
4
 *
5
 *  Created by J. Andreas Bærentzen on 20/09/08.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
7
 *
8
 */
9
#ifndef __MESHEDIT_VISOBJ_H__
10
#define __MESHEDIT_VISOBJ_H__
11
 
12
 
13
#include <string>
14
#include <GL/glew.h>
15
#include <HMesh/Manifold.h>
16
#include <GLGraphics/draw.h>
17
#include <GLGraphics/GLViewController.h>
18
#include "harmonics.h"
19
#include "Renderer.h"
20
 
21
extern int WINX;
22
extern int WINY;
23
 
24
class VisObj
25
	{
26
		std::string file;
27
		GLGraphics::GLViewController view_ctrl;
28
		bool create_display_list;
29
		HMesh::Manifold mani;
30
		Harmonics* harmonics;
31
		ManifoldRenderer* renderer;
32
 
33
	public:
34
		VisObj():
35
        file(""), view_ctrl(WINX,WINY, CGLA::Vec3f(0), 1.0), create_display_list(true), harmonics(0) {}
36
 
37
 
38
		HMesh::Manifold& mesh() {return mani;}
39
 
40
		GLGraphics::GLViewController& view_control() {return view_ctrl;}
41
 
42
		bool reload(std::string _file);
43
 
44
		void display(const std::string& display_method , bool smooth);
45
 
46
		void post_create_display_list()
47
		{
48
			create_display_list = true;
49
		}
50
 
51
		void harmonics_analyze_mesh()
52
		{
53
			delete harmonics;
54
			harmonics = new Harmonics(mani);
55
		}
56
 
57
		void harmonics_reset_shape()
58
		{
59
			if(harmonics)
60
				harmonics->reset_shape();
61
		}
62
 
63
		void harmonics_parse_key(unsigned char key)
64
		{
65
			harmonics->parse_key(key);
66
		}
67
 
68
		void harmonics_partial_reconstruct(int eig0, int eig1, float scale)
69
		{
70
			if(harmonics)
71
				harmonics->partial_reconstruct(eig0, eig1, scale);
72
		}
73
 
74
	};
75
 
76
#endif