Commit df0ae468 authored by Luis Peñaranda's avatar Luis Peñaranda

added hidden parameter shrink_for_all=false

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