Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gepetto-viewer-corba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Guilhem Saurel
gepetto-viewer-corba
Commits
ac7d57a6
Commit
ac7d57a6
authored
6 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Clean creation on new OSG window
parent
0de1e083
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/gepetto/gui/mainwindow.hh
+0
-4
0 additions, 4 deletions
include/gepetto/gui/mainwindow.hh
src/gui/mainwindow.cc
+10
-17
10 additions, 17 deletions
src/gui/mainwindow.cc
src/gui/windows-manager.cc
+7
-1
7 additions, 1 deletion
src/gui/windows-manager.cc
with
17 additions
and
22 deletions
include/gepetto/gui/mainwindow.hh
+
0
−
4
View file @
ac7d57a6
...
@@ -109,9 +109,6 @@ namespace gepetto {
...
@@ -109,9 +109,6 @@ namespace gepetto {
signals
:
signals
:
void
sendToBackground
(
WorkItem
*
item
);
void
sendToBackground
(
WorkItem
*
item
);
/// You should not need to call this function.
/// Use MainWindow::createView(const std::string&)
void
createViewOnMainThread
(
const
std
::
string
&
name
);
/// Triggered when an OSGWidget is created.
/// Triggered when an OSGWidget is created.
void
viewCreated
(
OSGWidget
*
widget
);
void
viewCreated
(
OSGWidget
*
widget
);
void
refresh
();
void
refresh
();
...
@@ -268,7 +265,6 @@ signals:
...
@@ -268,7 +265,6 @@ signals:
ActionSearchBar
*
actionSearchBar_
;
ActionSearchBar
*
actionSearchBar_
;
QMutex
delayedCreateView_
;
QStringList
robotNames_
;
QStringList
robotNames_
;
QStringList
lastBodiesInCollision_
;
QStringList
lastBodiesInCollision_
;
...
...
This diff is collapsed.
Click to expand it.
src/gui/mainwindow.cc
+
10
−
17
View file @
ac7d57a6
...
@@ -76,8 +76,6 @@ namespace gepetto {
...
@@ -76,8 +76,6 @@ namespace gepetto {
osg
()
->
createScene
(
"hpp-gui"
);
osg
()
->
createScene
(
"hpp-gui"
);
// Setup the main OSG widget
// Setup the main OSG widget
connect
(
this
,
SIGNAL
(
createViewOnMainThread
(
std
::
string
)),
SLOT
(
createView
(
std
::
string
)));
connect
(
ui_
->
actionRefresh
,
SIGNAL
(
triggered
()),
SLOT
(
requestRefresh
()));
connect
(
ui_
->
actionRefresh
,
SIGNAL
(
triggered
()),
SLOT
(
requestRefresh
()));
connect
(
&
backgroundQueue_
,
SIGNAL
(
done
(
int
)),
this
,
SLOT
(
handleWorkerDone
(
int
)));
connect
(
&
backgroundQueue_
,
SIGNAL
(
done
(
int
)),
this
,
SLOT
(
handleWorkerDone
(
int
)));
...
@@ -227,23 +225,18 @@ namespace gepetto {
...
@@ -227,23 +225,18 @@ namespace gepetto {
OSGWidget
*
MainWindow
::
createView
(
const
std
::
string
&
name
)
OSGWidget
*
MainWindow
::
createView
(
const
std
::
string
&
name
)
{
{
if
(
thread
()
!=
QThread
::
currentThread
())
{
if
(
thread
()
!=
QThread
::
currentThread
())
{
delayedCreateView_
.
lock
();
qDebug
()
<<
"createView must be called from the main thread."
;
emit
createViewOnMainThread
(
name
);
throw
std
::
runtime_error
(
"Cannot create a new window."
);
delayedCreateView_
.
lock
();
}
delayedCreateView_
.
unlock
();
OSGWidget
*
osgWidget
=
new
OSGWidget
(
osgViewerManagers_
,
name
,
this
,
0
return
osgWindows_
.
last
();
}
else
{
OSGWidget
*
osgWidget
=
new
OSGWidget
(
osgViewerManagers_
,
name
,
this
,
0
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
,
osgViewer
::
Viewer
::
SingleThreaded
,
osgViewer
::
Viewer
::
SingleThreaded
#endif
#endif
);
);
osgWidget
->
setObjectName
(
name
.
c_str
());
osgWidget
->
setObjectName
(
name
.
c_str
());
addOSGWidget
(
osgWidget
);
addOSGWidget
(
osgWidget
);
emit
viewCreated
(
osgWidget
);
emit
viewCreated
(
osgWidget
);
delayedCreateView_
.
unlock
();
return
osgWidget
;
return
osgWidget
;
}
}
}
void
MainWindow
::
requestRefresh
()
void
MainWindow
::
requestRefresh
()
...
...
This diff is collapsed.
Click to expand it.
src/gui/windows-manager.cc
+
7
−
1
View file @
ac7d57a6
...
@@ -38,7 +38,13 @@ namespace gepetto {
...
@@ -38,7 +38,13 @@ namespace gepetto {
WindowsManager
::
WindowID
WindowsManager
::
createWindow
(
const
std
::
string
&
windowName
)
WindowsManager
::
WindowID
WindowsManager
::
createWindow
(
const
std
::
string
&
windowName
)
{
{
return
MainWindow
::
instance
()
->
createView
(
windowName
)
->
windowID
();
MainWindow
*
main
=
MainWindow
::
instance
();
OSGWidget
*
widget
;
QMetaObject
::
invokeMethod
(
main
,
"createView"
,
Qt
::
BlockingQueuedConnection
,
Q_RETURN_ARG
(
OSGWidget
*
,
widget
),
Q_ARG
(
std
::
string
,
windowName
));
return
widget
->
windowID
();
}
}
WindowsManager
::
WindowID
WindowsManager
::
createWindow
(
const
std
::
string
&
windowName
,
WindowsManager
::
WindowID
WindowsManager
::
createWindow
(
const
std
::
string
&
windowName
,
...
...
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