Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
67dc883b
Commit
67dc883b
authored
Dec 07, 2015
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added signals slot to block scenegraph updates
parent
5570fba1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
0 deletions
+23
-0
BasePlugin/BaseInterface.hh
BasePlugin/BaseInterface.hh
+11
-0
Core/Core.cc
Core/Core.cc
+7
-0
Core/Core.hh
Core/Core.hh
+3
-0
Core/PluginLoader.cc
Core/PluginLoader.cc
+2
-0
No files found.
BasePlugin/BaseInterface.hh
View file @
67dc883b
...
...
@@ -122,6 +122,17 @@ class BaseInterface {
*/
virtual
void
updateView
()
{};
/** \brief Tell the core to prevent scenegraph updates.
*
* Emit this Signal if you want to skip scenegraph updates. E.g. if you add a large number of objects
* or modify them it's much more efficient to block scenegraph updates until you finished and then
* do only one update run.
*
* The function itself is counting the number of blocks internally to allow multiple plugins for concurrent
* blocks. The function is queued to ensure that it is processed in line with load save operations.
*/
virtual
void
blockScenegraphUpdates
(
bool
_block
)
{};
/** \brief An object has been changed or added by this plugin
*
* Emit this Signal, if you updated any part of an object.\n
...
...
Core/Core.cc
View file @
67dc883b
...
...
@@ -934,7 +934,14 @@ void Core::updateUI() {
QApplication
::
processEvents
();
}
//-----------------------------------------------------------------------------
void
Core
::
blockScenegraphUpdates
(
bool
_block
)
{
if
(
_block
)
OpenFlipper
::
Options
::
blockSceneGraphUpdates
();
else
OpenFlipper
::
Options
::
unblockSceneGraphUpdates
();
}
//-----------------------------------------------------------------------------
...
...
Core/Core.hh
View file @
67dc883b
...
...
@@ -650,6 +650,9 @@ public slots:
/// Called when a plugin requests an update in the viewer
void
updateView
();
/// Called when a plugin wants to lock or unlock scenegraph updates
void
blockScenegraphUpdates
(
bool
_block
);
/// process events during script execution to keep the ui alive
void
updateUI
();
...
...
Core/PluginLoader.cc
View file @
67dc883b
...
...
@@ -875,6 +875,8 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if
(
checkSignal
(
plugin
,
"updateView()"
)
)
connect
(
plugin
,
SIGNAL
(
updateView
()),
this
,
SLOT
(
updateView
()),
Qt
::
AutoConnection
);
if
(
checkSignal
(
plugin
,
"blockScenegraphUpdates(bool)"
)
)
connect
(
plugin
,
SIGNAL
(
blockScenegraphUpdates
(
bool
)),
this
,
SLOT
(
blockScenegraphUpdates
(
bool
)),
Qt
::
QueuedConnection
);
if
(
checkSignal
(
plugin
,
"updatedObject(int)"
)
&&
checkSignal
(
plugin
,
"updatedObject(int,const UpdateType&)"
)
){
...
...
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