Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
52f0f7b8
Commit
52f0f7b8
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Source stream listings
parent
8f5f3ff3
No related branches found
No related tags found
1 merge request
!23
Feature/gui implements #53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/gui/src/main.cpp
+30
-2
30 additions, 2 deletions
applications/gui/src/main.cpp
applications/reconstruct/src/main.cpp
+4
-1
4 additions, 1 deletion
applications/reconstruct/src/main.cpp
with
34 additions
and
3 deletions
applications/gui/src/main.cpp
+
30
−
2
View file @
52f0f7b8
...
...
@@ -12,6 +12,8 @@
#include
<nanogui/window.h>
#include
<nanogui/layout.h>
#include
<nanogui/imageview.h>
#include
<nanogui/combobox.h>
#include
<nanogui/label.h>
using
ftl
::
config
;
using
std
::
string
;
...
...
@@ -103,6 +105,18 @@ class VirtualCameraView : public nanogui::ImageView {
}
}
bool
keyboardEvent
(
int
key
,
int
scancode
,
int
action
,
int
modifiers
)
{
LOG
(
INFO
)
<<
"Key press"
<<
key
<<
" - "
<<
action
;
if
(
key
==
81
||
key
==
83
)
{
// TODO Should rotate around lookAt object, but requires correct depth
Eigen
::
Quaternion
<
float
>
q
;
q
=
Eigen
::
AngleAxis
<
float
>
((
key
==
81
)
?
0.01
f
:
-
0.01
f
,
up_
);
eye_
=
(
q
*
(
eye_
-
centre_
))
+
centre_
;
}
else
if
(
key
==
84
||
key
==
82
)
{
float
scalar
=
(
key
==
84
)
?
0.99
f
:
1.01
f
;
eye_
=
((
eye_
-
centre_
)
*
scalar
)
+
centre_
;
}
}
void
draw
(
NVGcontext
*
ctx
)
{
//net_->broadcast("grab");
if
(
src_
)
{
...
...
@@ -114,7 +128,6 @@ class VirtualCameraView : public nanogui::ImageView {
src_
->
grab
();
src_
->
getRGBD
(
rgb
,
depth
);
if
(
rgb
.
rows
>
0
)
{
LOG
(
INFO
)
<<
"Update texture"
;
texture_
.
update
(
rgb
);
bindImage
(
texture_
.
texture
());
}
...
...
@@ -148,7 +161,7 @@ class FTLApplication : public nanogui::Screen {
//auto &cam = sources_.emplace_back();
//cam.source = in;
auto
imageWindow
=
new
Window
(
this
,
"Source"
);
auto
imageWindow
=
new
Window
(
this
,
in
->
getURI
()
);
imageWindow
->
setPosition
(
Eigen
::
Vector2i
(
710
,
15
));
imageWindow
->
setLayout
(
new
GroupLayout
());
imageWindow
->
setSize
(
Vector2i
(
400
,
400
));
...
...
@@ -164,6 +177,16 @@ class FTLApplication : public nanogui::Screen {
}
}
auto
window
=
new
Window
(
this
,
"Sources"
);
window
->
setLayout
(
new
GroupLayout
());
new
Label
(
window
,
"Select source"
,
"sans-bold"
);
auto
available
=
net
->
findAll
<
string
>
(
"list_streams"
);
auto
select
=
new
ComboBox
(
window
,
available
);
select
->
setCallback
([
this
,
&
available
](
int
ix
)
{
LOG
(
INFO
)
<<
"Change source: "
<<
ix
;
});
setVisible
(
true
);
performLayout
();
}
...
...
@@ -184,6 +207,11 @@ int main(int argc, char **argv) {
net
.
waitConnections
();
/*auto available = net.findAll<string>("list_streams");
for (auto &a : available) {
std::cout << " -- " << a << std::endl;
}*/
try
{
nanogui
::
init
();
...
...
This diff is collapsed.
Click to expand it.
applications/reconstruct/src/main.cpp
+
4
−
1
View file @
52f0f7b8
...
...
@@ -426,7 +426,10 @@ static void run() {
ftl
::
rgbd
::
Streamer
stream
(
config
,
&
net
);
stream
.
add
(
virt
);
//stream.run();
// Also proxy all inputs
for
(
auto
&
in
:
inputs
)
{
stream
.
add
(
in
.
source
);
}
unsigned
char
frameCount
=
0
;
bool
paused
=
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment