Subversion Repositories gelsvn

Rev

Rev 596 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 596 Rev 618
Line 25... Line 25...
25
using namespace HMesh;
25
using namespace HMesh;
26
using namespace GLGraphics;
26
using namespace GLGraphics;
27
 
27
 
28
int WINX=800, WINY=800;
28
int WINX=800, WINY=800;
29
 
29
 
-
 
30
void VisObj::refit()
-
 
31
{
-
 
32
	bsphere(mani, bsphere_center, bsphere_radius);
-
 
33
    
-
 
34
	view_ctrl.set_centre(Vec3f(bsphere_center));
-
 
35
	view_ctrl.set_eye_dist(2*bsphere_radius);
-
 
36
}
30
 
37
 
31
bool VisObj::reload(string _file)
38
bool VisObj::reload(string _file)
32
{
39
{
33
	if(_file != "") file = _file;
40
	if(_file != "") file = _file;
34
	mani.clear();
41
	mani.clear();
35
	if(!load(file, mani))
42
	if(!load(file, mani))
36
		return false;
43
		return false;
37
	bsphere(mani, bsphere_center, bsphere_radius);
-
 
38
    
44
    refit();
39
	view_ctrl.set_centre(Vec3f(bsphere_center));
-
 
40
	view_ctrl.set_eye_dist(2*bsphere_radius);
-
 
41
	return true;
45
	return true;
42
}
46
}
43
 
47
 
44
bool VisObj::add_mesh(string file)
48
bool VisObj::add_mesh(string file)
45
{
49
{
Line 57... Line 61...
57
{
61
{
58
	if(create_display_list){
62
	if(create_display_list){
59
		create_display_list = false;
63
		create_display_list = false;
60
        
64
        
61
		delete renderer;
65
		delete renderer;
-
 
66
        static Console::variable<float> r(-1);
-
 
67
        r.reg(cs,"display.bsphere_radius","Radius of the bounding sphere of present object");
-
 
68
        if(r<=0)
-
 
69
            r = bsphere_radius;
62
		
70
        
63
		string short_name = display_method.substr(0,3);
71
		string short_name = display_method.substr(0,3);
64
		if(short_name== "wir")
72
		if(short_name== "wir")
65
			renderer = new WireframeRenderer(mani, smooth);
73
			renderer = new WireframeRenderer(mani, smooth);
66
        
74
        
67
		else if(short_name == "har")
75
		else if(short_name == "har")
Line 108... Line 116...
108
            }
116
            }
109
            else
117
            else
110
                curvature_paraboloids(mani,
118
                curvature_paraboloids(mani,
111
                                      min_curv_direction,
119
                                      min_curv_direction,
112
                                      max_curv_direction,
120
                                      max_curv_direction,
113
                                      curvature); 
121
                                      curvature);
114
			
-
 
115
			renderer = new LineFieldRenderer(mani, smooth, lines, bsphere_radius);
122
			renderer = new LineFieldRenderer(mani, smooth, lines, r);
116
		}
123
		}
117
		else if(short_name == "gau"){
124
		else if(short_name == "gau"){
118
            static Console::variable<float> smoothing(2.0f);
125
            static Console::variable<float> smoothing(2.0f);
119
            smoothing.reg(cs, "display.gaussian_curvature_renderer.smoothing", "");
126
            smoothing.reg(cs, "display.gaussian_curvature_renderer.smoothing", "");
120
			VertexAttributeVector<double> scalars(mani.allocated_vertices());
127
			VertexAttributeVector<double> scalars(mani.allocated_vertices());