Commit df0ae468 by Luis Peñaranda

added hidden parameter shrink_for_all=false

1 parent 562c84c4
......@@ -40,6 +40,7 @@ OpenGLCanvas::OpenGLCanvas(QWidget *parent) :
fov_scale_relation = "Naive";
visualization = "Moebius";
auto_fov_max=false;
shrink_for_all=false;
zblambda=.1f; // Zorin-Barr transformation lambda
zbR=1.f; // Zorin-Barr transformation R
......@@ -57,23 +58,27 @@ void OpenGLCanvas::change_fov(double f){
if (fov!=f && f>=1.f && f<=360.f)
fov=f;
if (fov<=fov_max)
if (shrink_for_all || visualization=="Moebius" || visualization=="3D Sphere"){
if (fov<=fov_max)
scale=1.f;
//else if (fov>295.f)
// scale = 0.02f; // TODO: check this value wrt fov_max
else {
if (fov_scale_relation == "Naive")
scale=fov_max/fov;
else if (fov_scale_relation == "Square Root")
scale=sqrtf((360.f-fov_max-fov)/(360.-2*fov_max));
else if (fov_scale_relation == "Linear")
scale=(360.f-fov_max-fov)/(360.f-2.f*fov_max);
else if (fov_scale_relation == "Square Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),2.f);
else if (fov_scale_relation == "Cubic Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),3.f);
else if (fov_scale_relation == "Logarithm")
scale=logf(expf(1.f)+(1.f-expf(1.f))*(fov-fov_max)/(360.f-2.f*fov_max));
}
}else{
scale=1.f;
//else if (fov>295.f)
// scale = 0.02f; // TODO: check this value wrt fov_max
else {
if (fov_scale_relation == "Naive")
scale=fov_max/fov;
else if (fov_scale_relation == "Square Root")
scale=sqrtf((360.f-fov_max-fov)/(360.-2*fov_max));
else if (fov_scale_relation == "Linear")
scale=(360.f-fov_max-fov)/(360.f-2.f*fov_max);
else if (fov_scale_relation == "Square Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),2.f);
else if (fov_scale_relation == "Cubic Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),3.f);
else if (fov_scale_relation == "Logarithm")
scale=logf(expf(1.f)+(1.f-expf(1.f))*(fov-fov_max)/(360.f-2.f*fov_max));
}
// scale = 0.3f;
......@@ -101,23 +106,27 @@ void OpenGLCanvas::change_fov(int new_fov){
void OpenGLCanvas::change_fov_max(int new_fov_max){
if(new_fov_max<=360.f&&new_fov_max>=1)
fov_max=(double)new_fov_max;
if (fov<=fov_max)
if (shrink_for_all || visualization=="Moebius" || visualization=="3D Sphere"){
if (fov<=fov_max)
scale=1.f;
//else if (fov>295.f)
// scale = 0.02f; // TODO: check this value wrt fov_max
else {
if (fov_scale_relation == "Naive")
scale=fov_max/fov;
else if (fov_scale_relation == "Square Root")
scale=sqrtf((360.f-fov_max-fov)/(360.f-2.f*fov_max));
else if (fov_scale_relation == "Linear")
scale=(360.f-fov_max-fov)/(360.f-2.f*fov_max);
else if (fov_scale_relation == "Square Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),2.f);
else if (fov_scale_relation == "Cubic Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),3.f);
else if (fov_scale_relation == "Logarithm")
scale=logf(expf(1.f)+(1.f-expf(1.f))*(fov-fov_max)/(360.f-2.f*fov_max));
}
}else{
scale=1.f;
//else if (fov>295.f)
// scale = 0.02f; // TODO: check this value wrt fov_max
else {
if (fov_scale_relation == "Naive")
scale=fov_max/fov;
else if (fov_scale_relation == "Square Root")
scale=sqrtf((360.f-fov_max-fov)/(360.f-2.f*fov_max));
else if (fov_scale_relation == "Linear")
scale=(360.f-fov_max-fov)/(360.f-2.f*fov_max);
else if (fov_scale_relation == "Square Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),2.f);
else if (fov_scale_relation == "Cubic Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),3.f);
else if (fov_scale_relation == "Logarithm")
scale=logf(expf(1.f)+(1.f-expf(1.f))*(fov-fov_max)/(360.f-2.f*fov_max));
}
fprintf(stderr,"change fov_max, fov=%f, fov_max=%f, new scale=%f\n",fov,fov_max,scale);
emit max_fov_changed((int)fov_max);
......@@ -157,25 +166,29 @@ void OpenGLCanvas::re_center(){
void OpenGLCanvas::change_fov_scale_relation(QString name){
fov_scale_relation = name;
if (fov<fov_max) scale = 1.f;
//else if (fov>295.f) scale = 0.01f;
else{
if (fov_scale_relation == "Naive")
scale=fov_max/fov;
else if (fov_scale_relation == "Square Root")
scale=sqrtf((360.f-fov_max-fov)/(360.f-2.f*fov_max));
else if (fov_scale_relation == "Linear")
scale=(360.f-fov_max-fov)/(360.f-2.f*fov_max);
else if (fov_scale_relation == "Square Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),2.f);
else if (fov_scale_relation == "Cubic Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),3.f);
else if (fov_scale_relation == "Logarithm")
scale=logf(expf(1.f)+(1.f-expf(1.f))*(fov-fov_max)/(360.f-2.f*fov_max));
}
fprintf(stderr,"changed scale relation, scale=%f, fov_max=%f\n",scale,fov_max);
updateGL();
fov_scale_relation = name;
if (shrink_for_all || visualization=="Moebius" || visualization=="3D Sphere"){
if (fov<fov_max) scale = 1.f;
//else if (fov>295.f) scale = 0.01f;
else{
if (fov_scale_relation == "Naive")
scale=fov_max/fov;
else if (fov_scale_relation == "Square Root")
scale=sqrtf((360.f-fov_max-fov)/(360.f-2.f*fov_max));
else if (fov_scale_relation == "Linear")
scale=(360.f-fov_max-fov)/(360.f-2.f*fov_max);
else if (fov_scale_relation == "Square Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),2.f);
else if (fov_scale_relation == "Cubic Power")
scale=powf((360.f-fov_max-fov)/(360.f-2.f*fov_max),3.f);
else if (fov_scale_relation == "Logarithm")
scale=logf(expf(1.f)+(1.f-expf(1.f))*(fov-fov_max)/(360.f-2.f*fov_max));
}
}else{
scale=1.f;
}
fprintf(stderr,"changed scale relation, scale=%f, fov_max=%f\n",scale,fov_max);
updateGL();
}
......
......@@ -71,6 +71,7 @@ private:
QString fov_scale_relation;
QString visualization;
bool auto_fov_max;
bool shrink_for_all;
float zblambda,zbR; // parameters of the Zorin-Barr transformation
Chronos time_time;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!