Subversion Repositories gelsvn

Rev

Rev 647 | Rev 650 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 647 Rev 649
1
/*
1
/*
2
 *  VisObj.h
2
 *  VisObj.h
3
 *  GEL
3
 *  GEL
4
 *
4
 *
5
 *  Created by J. Andreas Bærentzen on 20/09/08.
5
 *  Created by J. Andreas Bærentzen on 20/09/08.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
7
 *
7
 *
8
 */
8
 */
9
#ifndef __MESHEDIT_VISOBJ_H__
9
#ifndef __MESHEDIT_VISOBJ_H__
10
#define __MESHEDIT_VISOBJ_H__
10
#define __MESHEDIT_VISOBJ_H__
11
 
11
 
12
 
12
 
13
#include <string>
13
#include <string>
14
#include <GL/glew.h>
14
#include "../GL/glew.h"
15
#include <HMesh/Manifold.h>
15
#include "../HMesh/Manifold.h"
16
#include <CGLA/Vec3d.h>
16
#include "../CGLA/Vec3d.h"
17
#include <GLGraphics/draw.h>
17
#include "../GLGraphics/draw.h"
18
#include <GLGraphics/Console.h>
18
#include "../GLGraphics/Console.h"
19
#include <GLGraphics/GLViewController.h>
19
#include "../GLGraphics/GLViewController.h"
20
#include <GLGraphics/ManifoldRenderer.h>
20
#include "../GLGraphics/ManifoldRenderer.h"
21
#include "harmonics.h"
21
#include "../HMesh/harmonics.h"
22
 
22
 
23
extern int WINX;
23
extern int WINX;
24
extern int WINY;
24
extern int WINY;
25
 
25
 
26
namespace GLGraphics {
26
namespace GLGraphics {
27
 
27
 
28
class VisObj
28
class VisObj
29
{
29
{
30
    std::string file;
30
    std::string file;
31
    GLGraphics::GLViewController view_ctrl;
31
    GLGraphics::GLViewController view_ctrl;
32
    bool create_display_list;
32
    bool create_display_list;
33
    
33
    
34
    HMesh::Manifold mani;
34
    HMesh::Manifold mani;
35
    HMesh::Manifold old_mani;
35
    HMesh::Manifold old_mani;
36
    HMesh::Harmonics* harm;
36
    HMesh::Harmonics* harm;
37
    GLGraphics::ManifoldRenderer* renderer;
37
    GLGraphics::ManifoldRenderer* renderer;
38
    CGLA::Vec3d bsphere_center;
38
    CGLA::Vec3d bsphere_center;
39
    float bsphere_radius;
39
    float bsphere_radius;
40
public:
40
public:
41
    
41
    
42
    VisObj()
42
    VisObj()
43
    {
43
    {
44
        file = "";
44
        file = "";
45
        view_ctrl = GLGraphics::GLViewController(WINX,WINY, CGLA::Vec3f(0), 1.0);
45
        view_ctrl = GLGraphics::GLViewController(WINX,WINY, CGLA::Vec3f(0), 1.0);
46
        create_display_list =true;
46
        create_display_list =true;
47
        renderer = nullptr;
47
        renderer = nullptr;
48
        
48
        
49
    }
49
    }
50
    
50
    
51
    float get_bsphere_radius() const { return bsphere_radius;}
51
    float get_bsphere_radius() const { return bsphere_radius;}
52
    
52
    
53
    HMesh::Manifold& mesh() {return mani;}
53
    HMesh::Manifold& mesh() {return mani;}
54
    
54
    
55
    void save_old() {old_mani = mani;}
55
    void save_old() {old_mani = mani;}
56
    void restore_old() {mani = old_mani;}
56
    void restore_old() {mani = old_mani;}
57
    
57
    
58
    GLGraphics::GLViewController& view_control() {return view_ctrl;}
58
    GLGraphics::GLViewController& view_control() {return view_ctrl;}
59
    
59
    
60
    void refit();
60
    void refit();
61
    
61
    
62
    bool reload(std::string _file);
62
    bool reload(std::string _file);
63
    
63
    
64
    bool add_mesh(std::string _file);
64
    bool add_mesh(std::string _file);
65
    
65
    
66
    void display(const std::string& display_method , GLGraphics::Console& cs, bool smooth, float gamma);
66
    void display(const std::string& display_method , GLGraphics::Console& cs, bool smooth, float gamma);
67
    
67
    
68
    void post_create_display_list()
68
    void post_create_display_list()
69
    {
69
    {
70
        create_display_list = true;
70
        create_display_list = true;
71
    }
71
    }
72
    
72
    
73
    void harmonics_analyze() {
73
    void harmonics_analyze() {
74
        harm = new HMesh::Harmonics(mani);
74
        harm = new HMesh::Harmonics(mani);
75
    }
75
    }
76
    
76
    
77
};
77
};
78
 
78
 
79
}
79
}
80
#endif
80
#endif
81
 
81