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

change fov_max with shift+wheel

parent e82cc65b
......@@ -101,6 +101,7 @@ void OpenGLCanvas::change_fov_max(int new_fov_max){
scale=log(exp(1.f)+(1.f-exp(1.f))*(fov-fov_max)/(360.-2*fov_max));
}
fprintf(stderr,"change fov_max=%f, new scale=%f\n",fov_max,scale);
emit max_fov_changed((int)fov_max);
updateGL();
}
......@@ -674,7 +675,11 @@ void OpenGLCanvas::mouseMoveEvent(QMouseEvent *event){
void OpenGLCanvas::wheelEvent(QWheelEvent *event){
if(event->orientation()==Qt::Vertical){
change_fov(fov+((double)event->delta())/60);
if(event->modifiers()==Qt::ControlModifier){
change_fov_max(fov_max+((double)event->delta())/30);
}else{
change_fov(fov+((double)event->delta())/30);
}
}
}
......@@ -725,7 +730,7 @@ void OpenGLCanvas::paintGL(){
time_fps = time_frames/dt;
time_frames = 0;
time_time.reset();
emit fps(QString("%1 fps").arg((int)(time_fps+0.5)));
//emit fps(QString("%1 fps").arg((int)(time_fps+0.5)));
printf("fps = %d ", (int)(time_fps+0.5));
// }
// }
......
......@@ -62,6 +62,7 @@ protected:
signals:
void fps(QString newFPS);
void fov_changed(int new_fov);
void max_fov_changed(int new_max_fov);
public slots:
void change_fov(double f);
......
......@@ -157,10 +157,10 @@
<item row="10" column="1" alignment="Qt::AlignHCenter">
<widget class="QSlider" name="changefovmax">
<property name="minimum">
<number>10</number>
<number>1</number>
</property>
<property name="maximum">
<number>180</number>
<number>359</number>
</property>
<property name="sliderPosition">
<number>60</number>
......@@ -187,6 +187,7 @@
<container>1</container>
<slots>
<signal>fov_changed(int)</signal>
<signal>max_fov_changed(int)</signal>
<slot>change_fov(double)</slot>
<slot>change_scale(double)</slot>
<slot>change_center_lambda(double)</slot>
......@@ -330,5 +331,21 @@
</hint>
</hints>
</connection>
<connection>
<sender>GLCanvas</sender>
<signal>max_fov_changed(int)</signal>
<receiver>changefovmax</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>250</x>
<y>249</y>
</hint>
<hint type="destinationlabel">
<x>532</x>
<y>262</y>
</hint>
</hints>
</connection>
</connections>
</ui>
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