Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
panoramic
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Luis Penaranda
panoramic
Commits
26cacb9d
Commit
26cacb9d
authored
Jun 21, 2013
by
Luis Penaranda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unhide option to control phi_max automatically
parent
f3d6df06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
76 deletions
+116
-76
openglcanvas.cpp
openglcanvas.cpp
+21
-20
openglcanvas.h
openglcanvas.h
+4
-0
panowindow1.ui
panowindow1.ui
+91
-56
No files found.
openglcanvas.cpp
View file @
26cacb9d
...
...
@@ -37,7 +37,7 @@ OpenGLCanvas::OpenGLCanvas(QWidget *parent) :
scale
=
1.0
f
;
center_lambda
=
0.
f
;
center_phi
=
0.
f
;
fov_scale_relation
=
"
Square Root
"
;
fov_scale_relation
=
"
Naive
"
;
visualization
=
"Perspective"
;
auto_fov_max
=
false
;
...
...
@@ -83,17 +83,15 @@ void OpenGLCanvas::change_fov(double f){
}
void
OpenGLCanvas
::
automaxbutton
(
bool
autovalue
){
auto_fov_max
=
autovalue
;
}
void
OpenGLCanvas
::
change_fov
(
int
new_fov
){
if
(
new_fov
<=
360
&&
new_fov
>=
1
)
change_fov
((
double
)
new_fov
);
if
(
auto_fov_max
){
if
(
new_fov
<
60
)
change_fov_max
(
60
);
else
if
(
new_fov
>
180
)
change_fov_max
(
1
);
else
change_fov_max
(
90
-
new_fov
/
2
);
if
(
new_fov
<=
360
&&
new_fov
>=
1
){
change_fov
((
double
)
new_fov
);
if
(
auto_fov_max
)
change_fov_max
(
compute_auto_fov_max
(
new_fov
));
}
}
...
...
@@ -543,6 +541,16 @@ void OpenGLCanvas::define_triangle_indices(unsigned int * indices, int m, int n)
}
// This function computes a new value of the maximum fov and must be called
// when the fov is changed and the auto setting is enabled.
int
OpenGLCanvas
::
compute_auto_fov_max
(
int
new_fov
){
if
(
new_fov
<
60
)
return
60
;
if
(
new_fov
>
180
)
return
1
;
//if(new_fov>60)
return
(
90
-
new_fov
/
2
);
}
void
OpenGLCanvas
::
resizeGL
(
int
w
,
int
h
){
if
(
w
>
h
)
...
...
@@ -666,15 +674,8 @@ void OpenGLCanvas::wheelEvent(QWheelEvent *event){
}
else
{
int
new_fov
=
fov
+
event
->
delta
()
/
30
;
change_fov
((
double
)
new_fov
);
if
(
auto_fov_max
){
if
(
new_fov
<
60
)
change_fov_max
(
60
);
else
if
(
new_fov
>
180
)
change_fov_max
(
1
);
else
change_fov_max
(
90
-
new_fov
/
2
);
}
if
(
auto_fov_max
)
change_fov_max
(
compute_auto_fov_max
(
new_fov
));
}
}
}
...
...
openglcanvas.h
View file @
26cacb9d
...
...
@@ -32,6 +32,9 @@ protected:
float
calculate_extent
(
float
fov_rads
);
void
define_triangle_indices
(
unsigned
int
*
indices
,
int
m
,
int
n
);
private:
int
compute_auto_fov_max
(
int
);
char
*
textFileRead
(
char
*
fn
);
void
setShaders
();
void
mousePressEvent
(
QMouseEvent
*
event
);
...
...
@@ -44,6 +47,7 @@ signals:
void
max_fov_changed
(
int
new_max_fov
);
public
slots
:
void
automaxbutton
(
bool
);
void
change_fov
(
double
f
);
void
change_fov
(
int
new_fov
);
void
change_fov_max
(
int
new_fov_max
);
...
...
panowindow1.ui
View file @
26cacb9d
...
...
@@ -14,7 +14,9 @@
<string
notr=
"true"
>
Panoramic
</string>
</property>
<property
name=
"windowIcon"
>
<iconset
theme=
"view-fullscreen"
/>
<iconset
theme=
"view-fullscreen"
>
<normaloff/>
</iconset>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"2"
column=
"1"
colspan=
"2"
>
...
...
@@ -24,7 +26,7 @@
</property>
</widget>
</item>
<item
row=
"1
4
"
column=
"1"
colspan=
"2"
>
<item
row=
"1
5
"
column=
"1"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"reCenter"
>
<property
name=
"text"
>
<string>
Re-center
</string>
...
...
@@ -38,7 +40,7 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
rowspan=
"1
7
"
>
<item
row=
"0"
column=
"0"
rowspan=
"1
8
"
>
<widget
class=
"OpenGLCanvas"
name=
"GLCanvas"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Preferred"
>
...
...
@@ -54,13 +56,6 @@
</property>
</widget>
</item>
<item
row=
"11"
column=
"1"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
FOV max
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"comboBox"
>
<property
name=
"editable"
>
...
...
@@ -71,12 +66,12 @@
</property>
<item>
<property
name=
"text"
>
<string>
Square Root
</string>
<string>
Naive
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Naive
</string>
<string>
Square Root
</string>
</property>
</item>
<item>
...
...
@@ -101,7 +96,7 @@
</item>
</widget>
</item>
<item
row=
"1
3
"
column=
"1"
alignment=
"Qt::AlignHCenter"
>
<item
row=
"1
4
"
column=
"1"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QSlider"
name=
"changefovmax"
>
<property
name=
"minimum"
>
<number>
1
</number>
...
...
@@ -123,33 +118,14 @@
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"comboBox_2"
>
<item>
<property
name=
"text"
>
<string>
Perspective
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
3D Sphere
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Equi-Rectangular
</string>
</property>
</item>
</widget>
</item>
<item
row=
"15"
column=
"1"
colspan=
"2"
>
<item
row=
"16"
column=
"1"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"chooseFile"
>
<property
name=
"text"
>
<string>
Input Image
</string>
</property>
</widget>
</item>
<item
row=
"1
2
"
column=
"1"
alignment=
"Qt::AlignHCenter"
>
<item
row=
"1
3
"
column=
"1"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QLCDNumber"
name=
"fovmaxled"
>
<property
name=
"frameShape"
>
<enum>
QFrame::NoFrame
</enum>
...
...
@@ -159,14 +135,14 @@
</property>
</widget>
</item>
<item
row=
"1
6
"
column=
"1"
colspan=
"2"
>
<item
row=
"1
7
"
column=
"1"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"pushButton"
>
<property
name=
"text"
>
<string>
Close
</string>
</property>
</widget>
</item>
<item
row=
"1
3
"
column=
"2"
alignment=
"Qt::AlignHCenter"
>
<item
row=
"1
4
"
column=
"2"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QSlider"
name=
"changefov"
>
<property
name=
"minimum"
>
<number>
1
</number>
...
...
@@ -182,7 +158,7 @@
</property>
</widget>
</item>
<item
row=
"1
2
"
column=
"2"
alignment=
"Qt::AlignHCenter"
>
<item
row=
"1
3
"
column=
"2"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QLCDNumber"
name=
"fovled"
>
<property
name=
"frameShape"
>
<enum>
QFrame::NoFrame
</enum>
...
...
@@ -192,13 +168,55 @@
</property>
</widget>
</item>
<item
row=
"1
1
"
column=
"2"
alignment=
"Qt::AlignHCenter"
>
<item
row=
"1
2
"
column=
"2"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
FOV
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"comboBox_2"
>
<item>
<property
name=
"text"
>
<string>
Perspective
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
3D Sphere
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Equi-Rectangular
</string>
</property>
</item>
</widget>
</item>
<item
row=
"12"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
FOV max
</string>
</property>
</widget>
</item>
<item
row=
"11"
column=
"1"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"automax"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Ignored"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Auto FOV max
</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
...
...
@@ -221,6 +239,7 @@
<slot>
change_fov_max(int)
</slot>
<slot>
change_fov(int)
</slot>
<slot>
re_center()
</slot>
<slot>
automaxbutton(bool)
</slot>
</slots>
</customwidget>
</customwidgets>
...
...
@@ -233,8 +252,8 @@
<slot>
close()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
596
</x>
<y>
4
09
</y>
<x>
640
</x>
<y>
4
90
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
629
</x>
...
...
@@ -269,8 +288,8 @@
<y>
106
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
49
6
</x>
<y>
1
23
</y>
<x>
49
2
</x>
<y>
1
32
</y>
</hint>
</hints>
</connection>
...
...
@@ -281,8 +300,8 @@
<slot>
change_input_image()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
566
</x>
<y>
258
</y>
<x>
640
</x>
<y>
457
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
247
</x>
...
...
@@ -329,8 +348,8 @@
<slot>
re_center()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
569
</x>
<y>
4
4
4
</y>
<x>
640
</x>
<y>
4
2
4
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
250
</x>
...
...
@@ -345,8 +364,8 @@
<slot>
change_fov_max(int)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
5
12
</x>
<y>
3
63
</y>
<x>
5
46
</x>
<y>
3
91
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
250
</x>
...
...
@@ -381,8 +400,8 @@
<y>
245
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
6
06
</x>
<y>
380
</y>
<x>
6
29
</x>
<y>
236
</y>
</hint>
</hints>
</connection>
...
...
@@ -397,8 +416,8 @@
<y>
248
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
5
32
</x>
<y>
380
</y>
<x>
5
55
</x>
<y>
236
</y>
</hint>
</hints>
</connection>
...
...
@@ -413,8 +432,8 @@
<y>
249
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
6
06
</x>
<y>
197
</y>
<x>
6
29
</x>
<y>
236
</y>
</hint>
</hints>
</connection>
...
...
@@ -429,8 +448,24 @@
<y>
249
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
532
</x>
<y>
197
</y>
<x>
555
</x>
<y>
236
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
automax
</sender>
<signal>
toggled(bool)
</signal>
<receiver>
GLCanvas
</receiver>
<slot>
automaxbutton(bool)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
504
</x>
<y>
174
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
454
</x>
<y>
172
</y>
</hint>
</hints>
</connection>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment