Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
OpenSpace
Commits
4214811c
Commit
4214811c
authored
2 years ago
by
Ylva Selling
Browse files
Options
Download
Email Patches
Plain Diff
Add lua function to reload a display copy on a specific node
parent
8f98320b
project/exoplanet-explorer
feature/WSA
feature/geojson
feature/labels-rendering
feature/model-opacity
feature/molecule_rendering
feature/skybrowser-drag-and-drop
feature/skybrowser-reload
feature/various-changes
feature/xbox-update
issue/2029
issue/2093
issue/2133
issue/2207
issue/2212
issue/2259
issue/2261
issue/2266
issue/2269
jenkins/2286
project/2021-wisdome-installation
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
modules/skybrowser/include/browser.h
+1
-0
modules/skybrowser/include/browser.h
modules/skybrowser/skybrowsermodule.cpp
+2
-1
modules/skybrowser/skybrowsermodule.cpp
modules/skybrowser/skybrowsermodule_lua.inl
+27
-0
modules/skybrowser/skybrowsermodule_lua.inl
modules/skybrowser/src/browser.cpp
+4
-0
modules/skybrowser/src/browser.cpp
with
34 additions
and
1 deletion
+34
-1
modules/skybrowser/include/browser.h
+
1
-
0
View file @
4214811c
...
...
@@ -72,6 +72,7 @@ public:
void
update
();
void
updateBrowserSize
();
void
reload
();
glm
::
vec2
browserPixelDimensions
()
const
;
float
browserRatio
()
const
;
...
...
This diff is collapsed.
Click to expand it.
modules/skybrowser/skybrowsermodule.cpp
+
2
-
1
View file @
4214811c
...
...
@@ -524,7 +524,8 @@ scripting::LuaLibrary SkyBrowserModule::luaLibrary() const {
codegen
::
lua
::
ShowAllTargetsAndBrowsers
,
codegen
::
lua
::
PointSpaceCraft
,
codegen
::
lua
::
GetWwtImageCollectionUrl
,
codegen
::
lua
::
StopAnimations
codegen
::
lua
::
StopAnimations
,
codegen
::
lua
::
ReloadDisplayCopyOnNode
}
};
}
...
...
This diff is collapsed.
Click to expand it.
modules/skybrowser/skybrowsermodule_lua.inl
+
27
-
0
View file @
4214811c
...
...
@@ -39,6 +39,33 @@
namespace {
constexpr std::string_view _loggerCat = "SkyBrowserModule";
/**
* Reloads the sky browser display copy for the node index that is sent in.
* .If no ID is sent in, it will reload all display copies on that node.
*/
[[codegen::luawrap]] void reloadDisplayCopyOnNode(int nodeIndex, std::string id = "all") {
using namespace openspace;
if (global::windowDelegate->currentNode() != nodeIndex)
return;
SkyBrowserModule* module = global::moduleEngine->module<SkyBrowserModule>();
if (id != "all") {
TargetBrowserPair* pair = module->pair(id);
if (pair) {
pair->browser()->reload();
}
}
else {
const std::vector<std::unique_ptr<TargetBrowserPair>>& pairs = module->pairs();
for (const std::unique_ptr<TargetBrowserPair>& pair : pairs) {
pair->browser()->reload();
}
}
}
/**
* Takes an index to an image and selects that image in the currently
* selected sky browser.
...
...
This diff is collapsed.
Click to expand it.
modules/skybrowser/src/browser.cpp
+
4
-
0
View file @
4214811c
...
...
@@ -179,6 +179,10 @@ void Browser::updateBrowserSize() {
_browserDimensions
=
_texture
->
dimensions
();
}
void
Browser
::
reload
()
{
_reload
.
set
(
true
);
}
float
Browser
::
browserRatio
()
const
{
return
static_cast
<
float
>
(
_texture
->
dimensions
().
x
)
/
static_cast
<
float
>
(
_texture
->
dimensions
().
y
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help