Subversion Repositories gelsvn

Rev

Rev 403 | Go to most recent revision | Details | Compare with Previous | 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>
403 jab 16
#include <CGLA/Vec3f.h>
399 jab 17
#include <GLGraphics/draw.h>
18
#include <GLGraphics/GLViewController.h>
19
#include "harmonics.h"
20
#include "Renderer.h"
21
 
22
extern int WINX;
23
extern int WINY;
24
 
25
class VisObj
26
	{
27
		std::string file;
28
		GLGraphics::GLViewController view_ctrl;
29
		bool create_display_list;
30
		HMesh::Manifold mani;
31
		Harmonics* harmonics;
32
		ManifoldRenderer* renderer;
403 jab 33
		CGLA::Vec3f bsphere_center;
34
		float bsphere_radius;
399 jab 35
	public:
36
		VisObj():
37
        file(""), view_ctrl(WINX,WINY, CGLA::Vec3f(0), 1.0), create_display_list(true), harmonics(0) {}
38
 
412 jab 39
		float get_bsphere_radius() const { return bsphere_radius;}
399 jab 40
 
41
		HMesh::Manifold& mesh() {return mani;}
42
 
43
		GLGraphics::GLViewController& view_control() {return view_ctrl;}
44
 
45
		bool reload(std::string _file);
46
 
47
		void display(const std::string& display_method , bool smooth);
48
 
49
		void post_create_display_list()
50
		{
51
			create_display_list = true;
52
		}
53
 
54
		void harmonics_analyze_mesh()
55
		{
56
			delete harmonics;
57
			harmonics = new Harmonics(mani);
58
		}
59
 
60
		void harmonics_reset_shape()
61
		{
62
			if(harmonics)
63
				harmonics->reset_shape();
64
		}
65
 
66
		void harmonics_parse_key(unsigned char key)
67
		{
68
			harmonics->parse_key(key);
69
		}
70
 
71
		void harmonics_partial_reconstruct(int eig0, int eig1, float scale)
72
		{
73
			if(harmonics)
74
				harmonics->partial_reconstruct(eig0, eig1, scale);
75
		}
76
 
77
	};
78
 
79
#endif