Merge branch 'master' into feature/horizons-framework

This commit is contained in:
Malin Ejdbo
2022-01-31 13:47:58 +01:00
96 changed files with 1327 additions and 1323 deletions
@@ -382,6 +382,23 @@ void LauncherWindow::populateProfilesList(std::string preset) {
}
}
// Returns 'true' if the file was a configuration file, 'false' otherwise
bool handleConfigurationFile(QComboBox& box, const std::filesystem::directory_entry& p) {
const bool isXml = p.path().extension() == ".xml";
const bool isJson = p.path().extension() == ".json";
if (!isXml && !isJson) {
return false;
}
box.addItem(QString::fromStdString(p.path().filename().string()));
// For now, mark the XML configuration files to show that they are deprecated
if (isXml) {
box.setItemData(box.count() - 1, QBrush(Qt::darkYellow), Qt::ForegroundRole);
}
return true;
}
void LauncherWindow::populateWindowConfigsList(std::string preset) {
namespace fs = std::filesystem;
@@ -389,28 +406,32 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) {
_userConfigCount = 0;
_windowConfigBox->addItem(QString::fromStdString("--- User Configurations ---"));
const QStandardItemModel* model = qobject_cast<const QStandardItemModel*>(_windowConfigBox->model());
const QStandardItemModel* model =
qobject_cast<const QStandardItemModel*>(_windowConfigBox->model());
model->item(_userConfigCount)->setEnabled(false);
++_userConfigCount;
// Add all the files with the .xml extension to the dropdown
bool hasXmlConfig = false;
// Add all the files with the .xml or .json extension to the dropdown
for (const fs::directory_entry& p : fs::directory_iterator(_userConfigPath)) {
if (p.path().extension() != ".xml") {
continue;
bool isConfigFile = handleConfigurationFile(*_windowConfigBox, p);
if (isConfigFile) {
++_userConfigCount;
}
_windowConfigBox->addItem(QString::fromStdString(p.path().stem().string()));
++_userConfigCount;
hasXmlConfig |= p.path().extension() == ".xml";
}
_windowConfigBox->addItem(QString::fromStdString("--- OpenSpace Configurations ---"));
model = qobject_cast<const QStandardItemModel*>(_windowConfigBox->model());
model->item(_userConfigCount)->setEnabled(false);
if (std::filesystem::exists(_configPath)) {
// Add all the files with the .xml extension to the dropdown
// Add all the files with the .xml or .json extension to the dropdown
for (const fs::directory_entry& p : fs::directory_iterator(_configPath)) {
if (p.path().extension() != ".xml") {
continue;
}
_windowConfigBox->addItem(QString::fromStdString(p.path().stem().string()));
handleConfigurationFile(*_windowConfigBox, p);
hasXmlConfig |= p.path().extension() == ".xml";
}
}
else {
@@ -420,6 +441,17 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) {
);
}
if (hasXmlConfig) {
// At least one XML configuration file is present, so we should show the tooltip
// informing the user that files will be deprecated
_windowConfigBox->setToolTip(
"Support for XML-based configuration files will be removed in the next "
"version of OpenSpace. Please convert the files to the new JSON format or "
"run the Node tool at "
"https://github.com/sgct/sgct/tree/master/support/config-converter"
);
}
// Try to find the requested configuration file and set it as the current one. As we
// have support for function-generated configuration files that will not be in the
// list we need to add a preset that doesn't exist a file for
@@ -434,7 +466,7 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) {
}
}
void LauncherWindow::openProfileEditor(const std::string& profile, const bool isUserProfile) {
void LauncherWindow::openProfileEditor(const std::string& profile, bool isUserProfile) {
std::optional<Profile> p;
std::string saveProfilePath = isUserProfile ? _userProfilePath : _profilePath;
if (profile.empty()) {
+24 -9
View File
@@ -989,8 +989,7 @@ std::string setWindowConfigPresetForGui(const std::string labelFromCfgFile,
std::string selectedSgctProfileFromLauncher(LauncherWindow& lw, bool hasCliSGCTConfig,
std::string windowConfiguration,
const std::string& labelFromCfgFile,
const std::string& xmlExt)
const std::string& labelFromCfgFile)
{
std::string config = windowConfiguration;
if (!hasCliSGCTConfig) {
@@ -1004,13 +1003,31 @@ std::string selectedSgctProfileFromLauncher(LauncherWindow& lw, bool hasCliSGCTC
}
}
else {
if (std::filesystem::path(config).extension() == ".xml") {
//user customzied sgct config
std::filesystem::path c = absPath(config);
std::filesystem::path cj = c;
cj.replace_extension(".json");
std::filesystem::path cx = c;
cx.replace_extension(".xml");
if (c.extension().empty()) {
if (std::filesystem::exists(cj)) {
config += ".json";
}
else if (std::filesystem::exists(cx)) {
config += ".xml";
}
else {
throw ghoul::RuntimeError(fmt::format(
"Error loading configuration file {}. File could not be found",
config
));
}
}
else {
config += xmlExt;
// user customzied sgct config
}
}
global::configuration->windowConfiguration = config;
}
@@ -1163,7 +1180,6 @@ int main(int argc, char* argv[]) {
// Call profile GUI
const std::string labelFromCfgFile = " (from .cfg)";
const std::string xmlExt = ".xml";
std::string windowCfgPreset = setWindowConfigPresetForGui(
labelFromCfgFile,
hasSGCTConfig,
@@ -1211,8 +1227,7 @@ int main(int argc, char* argv[]) {
win,
hasSGCTConfig,
windowConfiguration,
labelFromCfgFile,
xmlExt
labelFromCfgFile
);
} else {
glfwInit();
+58
View File
@@ -0,0 +1,58 @@
{
"version": 1,
"masteraddress": "localhost",
"externalcontrolport": 20500,
"settings": {
"display": {
"swapinterval": 0
}
},
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"name": "OpenSpace",
"fullscreen": false,
"draw2d": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "EquirectangularProjection",
"quality": "1k"
}
}
]
},
{
"name": "GUI",
"tags": [ "GUI" ],
"fullscreen": false,
"draw3d": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 }
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace" draw2d="false">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<EquirectangularProjection quality="1k" />
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI" draw3d="false">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+47
View File
@@ -0,0 +1,47 @@
{
"version": 1,
"masteraddress": "localhost",
"externalcontrolport": 20500,
"settings": {
"display": {
"swapinterval": 0
}
},
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"fullscreen": true,
"name": "OpenSpace",
"msaa": 4,
"stereo": "none",
"pos": { "x": 0, "y": 0 },
"size": { "x": 1920, "y": 1080 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullscreen="true" numberOfSamples="4" name="OpenSpace">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+64
View File
@@ -0,0 +1,64 @@
{
"version": 1,
"masteraddress": "localhost",
"externalcontrolport": 20500,
"settings": {
"display": {
"swapinterval": 0
}
},
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"fullscreen": true,
"monitor": 1,
"name": "OpenSpace",
"draw2d": false,
"stereo": "none",
"pos": { "x": 0, "y": 0 },
"size": { "x": 1920, "y": 1080 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
},
{
"fullscreen": false,
"border": false,
"name": "GUI",
"tags": [ "GUI" ],
"draw3d": false,
"stereo": "none",
"pos": { "x": 0, "y": 0 },
"size": { "x": 1920, "y": 1080 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 }
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-33
View File
@@ -1,33 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullscreen="true" monitor="1" name="OpenSpace" draw2d="false">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullscreen="false" border="false" name="GUI" tags="GUI" draw3D="false">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
-23
View File
@@ -1,23 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- Res is equal to the Recommend target size -->
<Size x="1332" y="840" />
<Res x="3024" y="1680" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Projectionplane>
<!-- Lower left -->
<Pos x="-1.7156" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.7156" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.7156" y="0.965" z="0.0" />
</Projectionplane>
</Viewport>
</Window>
</Node>
</Cluster>
-23
View File
@@ -1,23 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- Res is equal to the Recommend target size -->
<Size x="1332" y="793" />
<Res x="2664" y="1586" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Projectionplane>
<!-- Lower left -->
<Pos x="-1.7156" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.7156" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.7156" y="0.965" z="0.0" />
</Projectionplane>
</Viewport>
</Window>
</Node>
</Cluster>
+46
View File
@@ -0,0 +1,46 @@
{
"version": 1,
"masteraddress": "localhost",
"externalcontrolport": 20500,
"settings": {
"display": {
"swapinterval": 0
}
},
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"name": "OpenSpace",
"fullscreen": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+37
View File
@@ -0,0 +1,37 @@
{
"version": 1,
"masteraddress": "localhost",
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"name": "OpenSpace",
"fullscreen": false,
"stereo": "none",
"size": { "x": 1024, "y": 1024 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "FisheyeProjection",
"fov": 180.0,
"quality": "1k",
"tilt": 27.0,
"background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.06,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-37
View File
@@ -1,37 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+61
View File
@@ -0,0 +1,61 @@
{
"version": 1,
"masteraddress": "localhost",
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"name": "OpenSpace",
"fullscreen": false,
"draw2d": false,
"stereo": "none",
"size": { "x": 1024, "y": 1024 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "FisheyeProjection",
"fov": 180.0,
"quality": "1k",
"tilt": 27.0,
"background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 }
}
}
]
},
{
"name": "GUI",
"tags": [ "GUI" ],
"fullscreen": false,
"draw3d": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1024, "y": 1024 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.06,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-53
View File
@@ -1,53 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace" draw2d="false">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI" draw3d="false">
<Stereo type="none" />
<Size x="1024" y="1024" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+70
View File
@@ -0,0 +1,70 @@
{
"version": 1,
"masteraddress": "localhost",
"externalcontrolport": 20500,
"settings": {
"display": {
"swapinterval": 0
}
},
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"name": "OpenSpace",
"fullscreen": false,
"draw2d": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
},
{
"name": "GUI",
"tags": [ "GUI" ],
"fullscreen": false,
"draw3d": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-37
View File
@@ -1,37 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace" draw2d="false">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI" draw3d="false">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+46
View File
@@ -0,0 +1,46 @@
{
"version": 1,
"masteraddress": "localhost",
"externalcontrolport": 20500,
"settings": {
"display": {
"swapinterval": 0
}
},
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"name": "OpenSpace",
"fullscreen": false,
"stereo": "side_by_side",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+59
View File
@@ -0,0 +1,59 @@
{
"version": 1,
"masteraddress": "127.0.0.1",
"nodes": [
{
"address": "127.0.0.1",
"port": 20401,
"windows": [
{
"border": true,
"fullscreen": false,
"pos": { "x": 10, "y": 100 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
},
{
"border": true,
"fullscreen": false,
"pos": { "x": 340, "y": 100 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 4.0 }
}
]
}
-32
View File
@@ -1,32 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false" border="true">
<Pos x="10" y="100" />
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" border="true">
<Pos x="340" y="100" />
<Size x="1280" y="720" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
+40
View File
@@ -0,0 +1,40 @@
{
"version": 1,
"masteraddress": "127.0.0.1",
"nodes": [
{
"address": "127.0.0.1",
"port": 20401,
"windows": [
{
"fullscreen": false,
"name": "Spherical Projection",
"stereo": "none",
"pos": { "x": 0, "y": 100 },
"size": { "x": 1280, "y": 720 },
"res": { "x": 2048, "y": 2048 },
"viewports": [
{
"mesh": "mesh/standard_16x9.data",
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "FisheyeProjection",
"fov": 180.0,
"quality": "2k",
"tilt": 30.0,
"background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.06,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-34
View File
@@ -1,34 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullscreen="false" name="Spherical Projection">
<Stereo type="none" />
<Pos x="0" y="100" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Res x="2048" y="2048" />
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<!-- mesh path is relative to working directory-->
<!-- NOTE, if no working directory is set, mesh must be absolute path -->
<Viewport name="warped fisheye" mesh="mesh/standard_16x9.data">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="2k" tilt="30.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+65
View File
@@ -0,0 +1,65 @@
{
"version": 1,
"masteraddress": "127.0.0.1",
"nodes": [
{
"address": "127.0.0.1",
"port": 20401,
"windows": [
{
"fullscreen": false,
"name": "Spherical Projection",
"stereo": "none",
"draw2d": false,
"pos": { "x": 0, "y": 100 },
"size": { "x": 1280, "y": 720 },
"res": { "x": 2048, "y": 2048 },
"viewports": [
{
"mesh": "mesh/standard_16x9.data",
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "FisheyeProjection",
"fov": 180.0,
"quality": "2k",
"tilt": 30.0,
"background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 }
}
}
]
},
{
"fullscreen": false,
"name": "GUI",
"tags": [ "GUI" ],
"draw3d": false,
"stereo": "none",
"pos": { "x": 50, "y": 50 },
"size": { "x": 1280, "y": 720 },
"res": { "x": 2048, "y": 2048 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.06,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullscreen="false" name="Spherical Projection">
<Stereo type="none" />
<Pos x="0" y="100" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Res x="2048" y="2048" />
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<!-- mesh path is relative to working directory-->
<!-- NOTE, if no working directory is set, mesh must be absolute path -->
<Viewport name="warped fisheye" mesh="mesh/standard_16x9.data" draw2d="false">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="2k" tilt="30.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
<Window fullscreen="false" name="GUI" tags="GUI" draw3d="false">
<Stereo type="none" />
<Size x="1280" y="720" />
<Res x="2048" y="2048" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+36
View File
@@ -0,0 +1,36 @@
{
"version": 1,
"masteraddress": "localhost",
"nodes": [
{
"address": "localhost",
"port": 20401,
"windows": [
{
"fullscreen": false,
"name": "OpenSpace",
"stereo": "none",
"size": { "x": 1024, "y": 1024 },
"viewports": [
{
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "SpoutOutputProjection",
"quality": "1k",
"mappingspoutname": "OpenSpace",
"background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.06,
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
}
]
}
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window fullscreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1024" y="1024" />
<Viewport name="Spout">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<SpoutOutputProjection quality="1k" mappingSpoutName="OpenSpace">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</SpoutOutputProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+64
View File
@@ -0,0 +1,64 @@
{
"version": 1,
"masteraddress": "127.0.0.1",
"nodes": [
{
"address": "127.0.0.1",
"port": 20401,
"windows": [
{
"fullscreen": false,
"pos": { "x": 0, "y": 300 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
},
{
"address": "127.0.0.2",
"port": 20402,
"windows": [
{
"fullscreen": false,
"pos": { "x": 640, "y": 300 },
"size": { "x": 1280, "y": 720 },
"viewports": [
{
"tracked": true,
"pos": { "x": 0.0, "y": 0.0 },
"size": { "x": 1.0, "y": 1.0 },
"projection": {
"type": "PlanarProjection",
"fov": {
"hfov": 80.0,
"vfov": 50.534015846724
},
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
}
}
]
}
]
}
],
"users": [
{
"eyeseparation": 0.065,
"pos": { "x": 0.0, "y": 0.0, "z": 4.0 }
}
]
}
-36
View File
@@ -1,36 +0,0 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullscreen="false">
<Pos x="0" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20402">
<Window fullscreen="false">
<Pos x="640" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
@@ -20,7 +20,7 @@ asset.require("./layers/colorlayers/hirisels")
-- Height layers
asset.require("./layers/heightlayers/mola_sweden")
asset.require("./layers/heightlayers/mola_utah")
local heightLayer = asset.require("./layers/heightlayers/mdem200m")
local heightLayer = asset.require("./layers/heightlayers/MDEM200M")
asset.require("./layers/heightlayers/hirisels")
-- Overlays
+1 -1
View File
@@ -3,7 +3,7 @@ asset.require("./static_server")
local guiCustomization = asset.require("customization/gui")
-- Select which commit hashes to use for the frontend and backend
local frontendHash = "4fe18eea379c8493dbcb2cea6798d09a85819912"
local frontendHash = "7e513ba86b0bb989b72f22712ebf0bb5a626ba06"
local dataProvider = "data.openspaceproject.com/files/webgui"
local frontend = asset.syncedResource({
@@ -148,6 +148,7 @@ private:
// Reset camera direction to the aim node.
properties::TriggerProperty _retargetAim;
properties::BoolProperty _followAnchorNodeRotation;
properties::FloatProperty _followAnchorNodeRotationDistance;
properties::FloatProperty _minimumAllowedDistance;
@@ -81,6 +81,8 @@ public:
static scripting::LuaLibrary luaLibrary();
private:
void handlePathEnd();
/**
* Populate list of nodes that are relevant for collision checks, etc
*/
@@ -90,6 +92,7 @@ private:
std::unique_ptr<Path> _currentPath = nullptr;
bool _isPlaying = false;
bool _startSimulationTimeOnFinish = false;
properties::OptionProperty _defaultPathType;
properties::BoolProperty _includeRoll;
+6
View File
@@ -25,6 +25,7 @@
#include <modules/atmosphere/atmospheremodule.h>
#include <modules/atmosphere/rendering/renderableatmosphere.h>
#include <openspace/documentation/documentation.h>
#include <openspace/rendering/renderable.h>
#include <openspace/util/factorymanager.h>
#include <ghoul/misc/assert.h>
@@ -40,4 +41,9 @@ void AtmosphereModule::internalInitialize(const ghoul::Dictionary&) {
fRenderable->registerClass<RenderableAtmosphere>("RenderableAtmosphere");
}
std::vector<documentation::Documentation> AtmosphereModule::documentations() const {
return {
RenderableAtmosphere::Documentation()
};
}
} // namespace openspace
+2
View File
@@ -35,6 +35,8 @@ public:
AtmosphereModule();
std::vector<documentation::Documentation> documentations() const override;
private:
void internalInitialize(const ghoul::Dictionary&) override;
};
+7 -2
View File
@@ -197,11 +197,16 @@ std::vector<documentation::Documentation> BaseModule::documentations() const {
DashboardItemDistance::Documentation(),
DashboardItemFramerate::Documentation(),
DashboardItemMission::Documentation(),
DashboardItemParallelConnection::Documentation(),
DashboardItemPropertyValue::Documentation(),
DashboardItemSimulationIncrement::Documentation(),
DashboardItemSpacing::Documentation(),
DashboardItemText::Documentation(),
DashboardItemVelocity::Documentation(),
RenderableBoxGrid::Documentation(),
RenderableCartesianAxes::Documentation(),
RenderableDisc::Documentation(),
RenderableGrid::Documentation(),
RenderableLabels::Documentation(),
RenderableModel::Documentation(),
@@ -210,8 +215,8 @@ std::vector<documentation::Documentation> BaseModule::documentations() const {
RenderablePlaneImageLocal::Documentation(),
RenderablePlaneImageOnline::Documentation(),
RenderablePlaneTimeVaryingImage::Documentation(),
RenderablePrism::Documentation(),
RenderableRadialGrid::Documentation(),
RenderableDisc::Documentation(),
RenderableSphere::Documentation(),
RenderableSphericalGrid::Documentation(),
RenderableTimeVaryingSphere::Documentation(),
@@ -241,8 +246,8 @@ std::vector<documentation::Documentation> BaseModule::documentations() const {
TimeFrameInterval::Documentation(),
TimeFrameUnion::Documentation(),
SceneGraphLightSource::Documentation(),
CameraLightSource::Documentation(),
SceneGraphLightSource::Documentation()
};
}
@@ -55,6 +55,12 @@ namespace {
namespace openspace {
documentation::Documentation DashboardItemMission::Documentation() {
documentation::Documentation doc = DashboardTextItem::Documentation();
doc.id = "base_dashboarditem_mission";
return doc;
}
DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary)
: DashboardTextItem(dictionary, 15.f)
{}
@@ -39,6 +39,8 @@ public:
void render(glm::vec2& penPosition) override;
glm::vec2 size() const override;
static documentation::Documentation Documentation();
};
} // namespace openspace
@@ -38,6 +38,12 @@
namespace openspace {
documentation::Documentation DashboardItemParallelConnection::Documentation() {
documentation::Documentation doc = DashboardTextItem::Documentation();
doc.id = "base_dashboarditem_parallelconnection";
return doc;
}
DashboardItemParallelConnection::DashboardItemParallelConnection(
const ghoul::Dictionary& dictionary)
: DashboardTextItem(dictionary)
@@ -39,6 +39,8 @@ public:
void render(glm::vec2& penPosition) override;
glm::vec2 size() const override;
static documentation::Documentation Documentation();
};
} // namespace openspace
@@ -25,6 +25,7 @@
#include <modules/fieldlinessequence/fieldlinessequencemodule.h>
#include <modules/fieldlinessequence/rendering/renderablefieldlinessequence.h>
#include <openspace/documentation/documentation.h>
#include <openspace/util/factorymanager.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/misc/assert.h>
@@ -65,4 +66,10 @@ void FieldlinesSequenceModule::internalInitialize(const ghoul::Dictionary&) {
factory->registerClass<RenderableFieldlinesSequence>("RenderableFieldlinesSequence");
}
std::vector<documentation::Documentation> FieldlinesSequenceModule::documentations() const {
return {
RenderableFieldlinesSequence::Documentation()
};
}
} // namespace openspace
@@ -35,6 +35,8 @@ public:
FieldlinesSequenceModule();
std::vector<documentation::Documentation> documentations() const override;
static std::string DefaultTransferFunctionFile;
private:
+9
View File
@@ -27,6 +27,7 @@
#include <modules/galaxy/rendering/renderablegalaxy.h>
#include <modules/galaxy/tasks/milkywayconversiontask.h>
#include <modules/galaxy/tasks/milkywaypointsconversiontask.h>
#include <openspace/documentation/documentation.h>
#include <openspace/rendering/renderable.h>
#include <openspace/util/factorymanager.h>
#include <ghoul/misc/assert.h>
@@ -47,4 +48,12 @@ void GalaxyModule::internalInitialize(const ghoul::Dictionary&) {
fTask->registerClass<MilkywayPointsConversionTask>("MilkywayPointsConversionTask");
}
std::vector<documentation::Documentation> GalaxyModule::documentations() const {
return {
RenderableGalaxy::Documentation(),
MilkywayConversionTask::Documentation(),
MilkywayPointsConversionTask::Documentation()
};
}
} // namespace openspace
+2
View File
@@ -35,6 +35,8 @@ public:
GalaxyModule();
std::vector<documentation::Documentation> documentations() const override;
private:
void internalInitialize(const ghoul::Dictionary&) override;
};
+26 -12
View File
@@ -55,7 +55,7 @@
namespace {
constexpr int8_t CurrentCacheVersion = 1;
constexpr const char* _loggerCat = "Renderable Galaxy";
constexpr const char* _loggerCat = "RenderableGalaxy";
enum StarRenderingMethod {
Points,
@@ -75,37 +75,45 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo VolumeRenderingEnabledInfo = {
"VolumeRenderingEnabled",
"Volume Rendering",
"" // @TODO Missing documentation
"If this value is enabled, the volume rendering component of the galaxy "
"rendering is turned on. Otherwise, the volume rendering is skipped"
};
constexpr openspace::properties::Property::PropertyInfo StarRenderingEnabledInfo = {
"StarRenderingEnabled",
"Star Rendering",
"" // @TODO Missing documentation
"If this value is enabled, the point-based star rendering component of the "
"galaxy rendering is turned on. Otherwise, the volume rendering is skipped"
};
constexpr openspace::properties::Property::PropertyInfo StepSizeInfo = {
"StepSize",
"Step Size",
"" // @TODO Missing documentation
"Determines the distance between steps taken in the volume rendering. The lower "
"the number is, the better the rendering looks, but also takes more "
"computational resources to render"
};
constexpr openspace::properties::Property::PropertyInfo AbsorptionMultiplyInfo = {
"AbsorptionMultiply",
"Absorption Multiplier",
"" // @TODO Missing documentation
"A unit-less scale factor for the probability of dust absorbing a light "
"particle. The amount of absorption determines the spectrum of the light that is "
"emitted from the galaxy"
};
constexpr openspace::properties::Property::PropertyInfo EmissionMultiplyInfo = {
"EmissionMultiply",
"Emission Multiplier",
"" // @TODO Missing documentation
"A unit-less scale factor for the amount of light being emitted by dust in the "
"galaxy."
};
constexpr openspace::properties::Property::PropertyInfo RotationInfo = {
"Rotation",
"Euler rotation",
"" // @TODO Missing documentation
"The internal rotation of the volume rendering in Euler angles",
openspace::properties::Property::Visibility::Developer
};
constexpr openspace::properties::Property::PropertyInfo StarRenderingMethodInfo = {
@@ -118,15 +126,17 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo EnabledPointsRatioInfo = {
"EnabledPointsRatio",
"Enabled points",
"" // @TODO Missing documentation
"The ratio of point-like stars that are rendered to produce the overall galaxy "
"image. At a value of 0, no stars are rendered, at a value of 1 all points "
"contained in the dataset are rendered. The specific value chosen is a "
"compromise between image fidelity and rendering performance."
};
constexpr openspace::properties::Property::PropertyInfo DownscaleVolumeRenderingInfo =
{
"Downscale",
"Downscale Factor Volume Rendering",
"This value set the downscaling factor"
" when rendering the current volume."
"This value sets the downscaling factor when rendering the current volume."
};
constexpr openspace::properties::Property::PropertyInfo NumberOfRayCastingStepsInfo =
@@ -229,13 +239,17 @@ namespace {
namespace openspace {
documentation::Documentation RenderableGalaxy::Documentation() {
return codegen::doc<Parameters>("galaxy_renderablegalaxy");
}
RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _volumeRenderingEnabled(VolumeRenderingEnabledInfo, true)
, _starRenderingEnabled(StarRenderingEnabledInfo, true)
, _stepSize(StepSizeInfo, 0.01f, 0.001f, 0.05f, 0.001f)
, _absorptionMultiply(AbsorptionMultiplyInfo, 40.f, 0.0f, 200.0f)
, _emissionMultiply(EmissionMultiplyInfo, 200.f, 0.0f, 1000.0f)
, _absorptionMultiply(AbsorptionMultiplyInfo, 40.f, 0.f, 200.0f)
, _emissionMultiply(EmissionMultiplyInfo, 200.f, 0.f, 1000.0f)
, _starRenderingMethod(
StarRenderingMethodInfo,
properties::OptionProperty::DisplayType::Dropdown
@@ -54,6 +54,8 @@ public:
void render(const RenderData& data, RendererTasks& tasks) override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
private:
void renderPoints(const RenderData& data);
void renderBillboards(const RenderData& data);
@@ -107,7 +107,7 @@ void MilkywayConversionTask::perform(const Task::ProgressCallback& onProgress) {
rawWriter.write(sampleFunction, onProgress);
}
documentation::Documentation MilkywayConversionTask::documentation() {
documentation::Documentation MilkywayConversionTask::Documentation() {
return documentation::Documentation();
}
@@ -45,7 +45,7 @@ public:
std::string description() override;
void perform(const Task::ProgressCallback& onProgress) override;
static documentation::Documentation documentation();
static documentation::Documentation Documentation();
private:
std::string _inFilenamePrefix;
@@ -90,7 +90,7 @@ void MilkywayPointsConversionTask::perform(const Task::ProgressCallback& progres
out.close();
}
documentation::Documentation MilkywayPointsConversionTask::documentation() {
documentation::Documentation MilkywayPointsConversionTask::Documentation() {
return documentation::Documentation();
}
@@ -47,7 +47,7 @@ public:
std::string description() override;
void perform(const Task::ProgressCallback& progressCallback) override;
static documentation::Documentation documentation();
static documentation::Documentation Documentation();
private:
std::string _inFilename;
@@ -483,7 +483,15 @@ std::vector<documentation::Documentation> GlobeBrowsingModule::documentations()
globebrowsing::LayerAdjustment::Documentation(),
globebrowsing::LayerManager::Documentation(),
globebrowsing::GlobeTranslation::Documentation(),
globebrowsing::GlobeRotation::Documentation(),
globebrowsing::RenderableGlobe::Documentation(),
globebrowsing::DefaultTileProvider::Documentation(),
globebrowsing::ImageSequenceTileProvider::Documentation(),
globebrowsing::SingleImageProvider::Documentation(),
globebrowsing::SizeReferenceTileProvider::Documentation(),
globebrowsing::TemporalTileProvider::Documentation(),
globebrowsing::TileProviderByIndex::Documentation(),
globebrowsing::TileProviderByLevel::Documentation(),
GlobeLabelsComponent::Documentation(),
RingsComponent::Documentation(),
ShadowComponent::Documentation()
@@ -74,7 +74,7 @@ documentation::Documentation LayerAdjustment::Documentation() {
}
LayerAdjustment::LayerAdjustment()
: properties::PropertyOwner({ "adjustment" })
: properties::PropertyOwner({ "Adjustment" })
, _chromaKeyColor(ChromaKeyColorInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f))
, _chromaKeyTolerance(ChromaKeyToleranceInfo, 0.f, 0.f, 1.f)
, _typeOption(TypeInfo, properties::OptionProperty::DisplayType::Dropdown)
+1 -1
View File
@@ -185,7 +185,6 @@ void LayerGroup::deleteLayer(const std::string& layerName) {
std::string name = layerName;
removePropertySubOwner(it->get());
(*it)->deinitialize();
_layers.erase(it);
properties::PropertyOwner* layerGroup = it->get()->owner();
properties::PropertyOwner* layerManager = layerGroup->owner();
properties::PropertyOwner* globe = layerManager->owner();
@@ -195,6 +194,7 @@ void LayerGroup::deleteLayer(const std::string& layerName) {
layerGroup->identifier(),
it->get()->identifier()
);
_layers.erase(it);
update();
if (_onChangeCallback) {
_onChangeCallback(nullptr);
@@ -98,6 +98,16 @@ Layer* LayerManager::addLayer(layergroupid::GroupID groupId,
try {
return _layerGroups[groupId]->addLayer(layerDict);
}
catch (const documentation::SpecificationError& e) {
LERRORC(e.component, e.message);
for (const documentation::TestResult::Offense& o : e.result.offenses) {
LERRORC(o.offender, ghoul::to_string(o.reason));
}
for (const documentation::TestResult::Warning& w : e.result.warnings) {
LWARNINGC(w.offender, ghoul::to_string(w.reason));
}
return nullptr;
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
return nullptr;
@@ -76,6 +76,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation DefaultTileProvider::Documentation() {
return codegen::doc<Parameters>("globebrowsing_defaulttileprovider");
}
DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary)
: _filePath(FilePathInfo, "")
, _tilePixelSize(TilePixelSizeInfo, 32, 32, 2048)
@@ -44,6 +44,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
void initAsyncTileDataReader(TileTextureInitData initData);
@@ -61,6 +61,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation ImageSequenceTileProvider::Documentation() {
return codegen::doc<Parameters>("globebrowsing_imagesequencetileprovider");
}
ImageSequenceTileProvider::ImageSequenceTileProvider(const ghoul::Dictionary& dictionary)
: _index(IndexInfo, 0)
, _currentImage(CurrentImageInfo)
@@ -43,6 +43,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
std::unique_ptr<DefaultTileProvider> _currentTileProvider = nullptr;
@@ -44,6 +44,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation SingleImageProvider::Documentation() {
return codegen::doc<Parameters>("globebrowsing_singleimageprovider");
}
SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary)
: _filePath(FilePathInfo)
{
@@ -27,6 +27,8 @@
#include <modules/globebrowsing/src/tileprovider/tileprovider.h>
namespace openspace { struct Documentation; }
namespace openspace::globebrowsing {
class SingleImageProvider : public TileProvider {
@@ -41,6 +43,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
properties::StringProperty _filePath;
@@ -40,6 +40,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation SizeReferenceTileProvider::Documentation() {
return codegen::doc<Parameters>("globebrowsing_sizereferencetileprovider");
}
SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& dictionary)
: TextTileProvider(tileTextureInitData(layergroupid::GroupID::ColorLayers, false))
{
@@ -40,6 +40,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
Ellipsoid _ellipsoid;
};
@@ -165,6 +165,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation TemporalTileProvider::Documentation() {
return codegen::doc<Parameters>("globebrowsing_temporaltileprovider");
}
TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary)
: _initDict(dictionary)
, _useFixedTime(UseFixedTimeInfo, false)
@@ -54,6 +54,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
enum class Mode {
Prototype,
@@ -116,7 +116,7 @@ void TileProvider::deinitializeDefaultTile() {
DefaultTileTexture = nullptr;
}
TileProvider::TileProvider() : properties::PropertyOwner({ "tileProvider" }) {}
TileProvider::TileProvider() : properties::PropertyOwner({ "TileProvider" }) {}
void TileProvider::initialize() {
ZoneScoped
@@ -51,6 +51,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation TileProviderByIndex::Documentation() {
return codegen::doc<Parameters>("globebrowsing_tileproviderbyindex");
}
TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) {
ZoneScoped
@@ -41,6 +41,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
std::unordered_map<TileIndex::TileHashKey, std::unique_ptr<TileProvider>> _providers;
std::unique_ptr<TileProvider> _defaultTileProvider;
@@ -41,6 +41,10 @@ namespace {
namespace openspace::globebrowsing {
documentation::Documentation TileProviderByLevel::Documentation() {
return codegen::doc<Parameters>("globebrowsing_tileproviderbylevel");
}
TileProviderByLevel::TileProviderByLevel(const ghoul::Dictionary& dictionary) {
ZoneScoped
@@ -41,6 +41,8 @@ public:
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
std::vector<int> _providerIndices;
std::vector<std::unique_ptr<TileProvider>> _levelTileProviders;
+5 -5
View File
@@ -124,6 +124,9 @@ void SpaceModule::internalDeinitializeGL() {
std::vector<documentation::Documentation> SpaceModule::documentations() const {
return {
HorizonsTranslation::Documentation(),
KeplerTranslation::Documentation(),
planetgeometry::PlanetGeometry::Documentation(),
RenderableConstellationBounds::Documentation(),
RenderableFluxNodes::Documentation(),
RenderableHabitableZone::Documentation(),
@@ -132,13 +135,10 @@ std::vector<documentation::Documentation> SpaceModule::documentations() const {
RenderableSmallBody::Documentation(),
RenderableStars::Documentation(),
RenderableTravelSpeed::Documentation(),
planetgeometry::SimpleSphereGeometry::Documentation(),
SpiceRotation::Documentation(),
SpiceTranslation::Documentation(),
KeplerTranslation::Documentation(),
TLETranslation::Documentation(),
HorizonsTranslation::Documentation(),
planetgeometry::PlanetGeometry::Documentation(),
planetgeometry::SimpleSphereGeometry::Documentation()
TLETranslation::Documentation()
};
}
@@ -73,7 +73,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderableCrawlingLine::Documentation() {
return codegen::doc<Parameters>("newhorizons_renderable_crawlingline");
return codegen::doc<Parameters>("spacecraftinstruments_renderablecrawlingline");
}
RenderableCrawlingLine::RenderableCrawlingLine(const ghoul::Dictionary& dictionary)
@@ -196,7 +196,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderableFov::Documentation() {
return codegen::doc<Parameters>("newhorizons_renderable_fieldofview");
return codegen::doc<Parameters>("spacecraftinstruments_renderablefieldofview");
}
RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
@@ -90,7 +90,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderableModelProjection::Documentation() {
return codegen::doc<Parameters>("newhorizons_renderable_modelprojection");
return codegen::doc<Parameters>("spacecraftinstruments_renderablemodelprojection");
}
RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& dictionary)
@@ -45,6 +45,7 @@ namespace {
constexpr const char* _loggerCat = "RenderablePlaneProjection";
constexpr const char* GalacticFrame = "GALACTIC";
// @TODO (emmbr 2022-01-20) Add documentation
struct [[codegen::Dictionary(RenderablePlaneProjection)]] Parameters {
std::optional<std::string> spacecraft;
std::optional<std::string> instrument;
@@ -58,6 +59,10 @@ namespace {
namespace openspace {
documentation::Documentation RenderablePlaneProjection::Documentation() {
return codegen::doc<Parameters>("spacecraftinstruments_renderableorbitdisc");
}
RenderablePlaneProjection::RenderablePlaneProjection(const ghoul::Dictionary& dict)
: Renderable(dict)
{
@@ -56,6 +56,8 @@ public:
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
private:
void loadTexture();
void updatePlane(const Image& img, double currentTime);
@@ -162,7 +162,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderablePlanetProjection::Documentation() {
return codegen::doc<Parameters>("newhorizons_renderable_planetprojection");
return codegen::doc<Parameters>("spacecraftinstruments_renderableplanetprojection");
}
RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& dict)
@@ -143,7 +143,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderableShadowCylinder::Documentation() {
return codegen::doc<Parameters>("newhorizons_renderable_shadowcylinder");
return codegen::doc<Parameters>("spacecraftinstruments_renderableshadowcylinder");
}
RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dictionary)
@@ -61,12 +61,12 @@ void SpacecraftInstrumentsModule::internalInitialize(const ghoul::Dictionary&) {
auto fRenderable = FactoryManager::ref().factory<Renderable>();
ghoul_assert(fRenderable, "No renderable factory existed");
fRenderable->registerClass<RenderableShadowCylinder>("RenderableShadowCylinder");
fRenderable->registerClass<RenderableCrawlingLine>("RenderableCrawlingLine");
fRenderable->registerClass<RenderableFov>("RenderableFov");
fRenderable->registerClass<RenderableModelProjection>("RenderableModelProjection");
fRenderable->registerClass<RenderablePlaneProjection>("RenderablePlaneProjection");
fRenderable->registerClass<RenderablePlanetProjection>("RenderablePlanetProjection");
fRenderable->registerClass<RenderableModelProjection>("RenderableModelProjection");
fRenderable->registerClass<RenderableShadowCylinder>("RenderableShadowCylinder");
auto fDecoder = FactoryManager::ref().factory<Decoder>();
fDecoder->registerClass<InstrumentDecoder>("Instrument");
@@ -85,9 +85,12 @@ std::vector<documentation::Documentation>
SpacecraftInstrumentsModule::documentations() const
{
return {
RenderableCrawlingLine::Documentation(),
RenderableFov::Documentation(),
RenderableModelProjection::Documentation(),
RenderablePlaneProjection::Documentation(),
RenderablePlanetProjection::Documentation(),
RenderableShadowCylinder::Documentation(),
ProjectionComponent::Documentation()
};
}
@@ -162,7 +162,7 @@ namespace {
namespace openspace {
documentation::Documentation ProjectionComponent::Documentation() {
return codegen::doc<Parameters>("newhorizons_projectioncomponent");
return codegen::doc<Parameters>("spacecraftinstruments_projectioncomponent");
}
ProjectionComponent::ProjectionComponent()
@@ -32,7 +32,7 @@
#include <ghoul/logging/logmanager.h>
namespace {
constexpr const char* _loggerCat = "Renderable ToyVolume";
constexpr const char* _loggerCat = "RenderableToyVolume";
constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
"Size",
"Size",
@@ -37,8 +37,8 @@ public:
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
private:
private:
properties::StringProperty _nodelineId;
properties::IntProperty _distanceUnit;
properties::StringProperty _customUnitDescriptor;
+7
View File
@@ -25,6 +25,7 @@
#include <modules/vislab/vislabmodule.h>
#include <modules/vislab/rendering/renderabledistancelabel.h>
#include <openspace/documentation/documentation.h>
#include <openspace/util/factorymanager.h>
#include <ghoul/misc/assert.h>
#include <ghoul/misc/templatefactory.h>
@@ -40,4 +41,10 @@ void VisLabModule::internalInitialize(const ghoul::Dictionary&) {
renderableFactory->registerClass<RenderableDistanceLabel>("RenderableDistanceLabel");
}
std::vector<documentation::Documentation>VisLabModule::documentations() const {
return {
RenderableDistanceLabel::Documentation()
};
}
} // namespace openspace
+3
View File
@@ -35,6 +35,9 @@ public:
VisLabModule();
std::vector<documentation::Documentation> documentations() const override;
private:
void internalInitialize(const ghoul::Dictionary&) override;
};
@@ -71,7 +71,7 @@ namespace {
namespace openspace::volume {
documentation::Documentation GenerateRawVolumeTask::documentation() {
documentation::Documentation GenerateRawVolumeTask::Documentation() {
return codegen::doc<Parameters>("generate_raw_volume_task");
}
+1 -1
View File
@@ -38,7 +38,7 @@ public:
GenerateRawVolumeTask(const ghoul::Dictionary& dictionary);
std::string description() override;
void perform(const Task::ProgressCallback& progressCallback) override;
static documentation::Documentation documentation();
static documentation::Documentation Documentation();
private:
std::filesystem::path _rawVolumeOutputPath;
+7
View File
@@ -26,6 +26,7 @@
#include <modules/volume/rendering/renderabletimevaryingvolume.h>
#include <modules/volume/tasks/generaterawvolumetask.h>
#include <openspace/documentation/documentation.h>
#include <openspace/rendering/renderable.h>
#include <openspace/util/task.h>
#include <openspace/util/factorymanager.h>
@@ -46,7 +47,13 @@ void VolumeModule::internalInitialize(const ghoul::Dictionary&) {
auto tFactory = FactoryManager::ref().factory<Task>();
ghoul_assert(tFactory, "No task factory existed");
tFactory->registerClass<GenerateRawVolumeTask>("GenerateRawVolumeTask");
}
std::vector<documentation::Documentation> VolumeModule::documentations() const {
return {
RenderableTimeVaryingVolume::Documentation(),
GenerateRawVolumeTask::Documentation()
};
}
} // namespace openspace
+2
View File
@@ -36,6 +36,8 @@ public:
VolumeModule();
void internalInitialize(const ghoul::Dictionary&) override;
std::vector<documentation::Documentation> documentations() const override;
};
} // namespace openspace
File diff suppressed because it is too large Load Diff
+23 -12
View File
@@ -134,24 +134,33 @@ namespace {
};
constexpr openspace::properties::Property::PropertyInfo FollowAnchorNodeInfo = {
"FollowAnchorNodeRotation",
"Follow Anchor Node Rotation",
"If true, the camera will rotate with the current achor node if within a "
"certain distance from it. When this happens, the object will appear fixed in "
"relation to the camera. The distance at which the change happens is controlled "
"through another property."
};
constexpr openspace::properties::Property::PropertyInfo
FollowAnchorNodeDistanceInfo = {
"FollowAnchorNodeRotationDistance",
"Follow anchor node rotation distance",
"Follow Anchor Node Rotation Distance",
"A factor used to determine the distance at which the camera starts rotating "
"with the anchor node. When this happends, a the object will appear fixed in "
"relation to the camera. The actual distance will be computed by multiplying "
"with the anchor node. The actual distance will be computed by multiplying "
"this factor with the approximate radius of the node."
};
constexpr openspace::properties::Property::PropertyInfo MinimumDistanceInfo = {
"MinimumAllowedDistance",
"Minimum allowed distance",
"Minimum Allowed Distance",
"Limits how close the camera can get to an object. The distance is given in "
"meters above the surface."
};
constexpr openspace::properties::Property::PropertyInfo VelocityZoomControlInfo = {
"VelocityZoomControl",
"Velocity zoom control",
"Velocity Zoom Control",
"Controls the velocity of the camera motion when zooming in to the focus node "
"on a linear flight. The higher the value the faster the camera will move "
"towards the focus."
@@ -180,7 +189,7 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo
StereoInterpolationTimeInfo = {
"StereoInterpolationTime",
"Stereo interpolation time",
"Stereo Interpolation Time",
"The time to interpolate to a new stereoscopic depth "
"when the anchor node is changed, in seconds."
};
@@ -188,7 +197,7 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo
RetargetInterpolationTimeInfo = {
"RetargetAnchorInterpolationTime",
"Retarget interpolation time",
"Retarget Interpolation Time",
"The time to interpolate the camera rotation "
"when the anchor or aim node is changed, in seconds."
};
@@ -196,13 +205,13 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo
FollowRotationInterpTimeInfo = {
"FollowRotationInterpolationTime",
"Follow rotation interpolation time",
"Follow Rotation Interpolation Time",
"The interpolation time when toggling following focus node rotation."
};
constexpr openspace::properties::Property::PropertyInfo InvertMouseButtons = {
"InvertMouseButtons",
"Invert left and right mouse buttons",
"Invert Left and Right Mouse Buttons",
"If this value is 'false', the left mouse button causes the camera to rotate "
"around the object and the right mouse button causes the zooming motion. If this "
"value is 'true', these two functionalities are reversed."
@@ -229,7 +238,7 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo
StereoscopicDepthOfFocusSurfaceInfo = {
"StereoscopicDepthOfFocusSurface",
"Stereoscopic depth of the surface in focus",
"Stereoscopic Depth of the Surface in Focus",
"Set the stereoscopically perceived distance (in meters) to the closest "
"point out of the surface of the anchor and the center of the aim node. "
"Only used if UseAdaptiveStereoscopicDepthInfo is set to true."
@@ -331,7 +340,8 @@ OrbitalNavigator::OrbitalNavigator()
, _aim(AimInfo)
, _retargetAnchor(RetargetAnchorInfo)
, _retargetAim(RetargetAimInfo)
, _followAnchorNodeRotationDistance(FollowAnchorNodeInfo, 5.f, 0.f, 20.f)
, _followAnchorNodeRotation(FollowAnchorNodeInfo, true)
, _followAnchorNodeRotationDistance(FollowAnchorNodeDistanceInfo, 5.f, 0.f, 20.f)
, _minimumAllowedDistance(MinimumDistanceInfo, 10.0f, 0.0f, 10000.f)
, _mouseSensitivity(MouseSensitivityInfo, 15.f, 1.f, 50.f)
, _joystickSensitivity(JoystickSensitivityInfo, 10.f, 1.0f, 50.f)
@@ -491,6 +501,7 @@ OrbitalNavigator::OrbitalNavigator()
addProperty(_aim);
addProperty(_retargetAnchor);
addProperty(_retargetAim);
addProperty(_followAnchorNodeRotation);
addProperty(_followAnchorNodeRotationDistance);
addProperty(_minimumAllowedDistance);
@@ -954,7 +965,7 @@ void OrbitalNavigator::setRetargetInterpolationTime(float durationInSeconds) {
bool OrbitalNavigator::shouldFollowAnchorRotation(const glm::dvec3& cameraPosition) const
{
if (!_anchorNode) {
if (!_anchorNode || !_followAnchorNodeRotation) {
return false;
}
+28 -14
View File
@@ -200,7 +200,7 @@ void PathNavigator::updateCamera(double deltaTime) {
if (_currentPath->hasReachedEnd()) {
LINFO("Reached end of path");
_isPlaying = false;
handlePathEnd();
if (_applyIdleBehaviorOnFinish) {
constexpr const char* ApplyIdleBehaviorScript =
@@ -263,10 +263,16 @@ void PathNavigator::startPath() {
return;
}
//OBS! Until we can handle simulation time: early out if not paused
// Always pause the simulation time when flying, to aovid problem with objects
// moving. However, keep track of whether the time was running before the path
// was started, so we can reset it on finish
if (!global::timeManager->isPaused()) {
LERROR("Simulation time must be paused to run a camera path");
return;
global::timeManager->setPause(true);
_startSimulationTimeOnFinish = true;
LINFO(
"Pausing time simulation during path traversal. "
"Will unpause once the camera path is finished"
);
}
LINFO("Starting path");
@@ -280,9 +286,7 @@ void PathNavigator::abortPath() {
LWARNING("No camera path is playing");
return;
}
_isPlaying = false;
clearPath(); // TODO: instead of clearing this could be handled better
handlePathEnd();
LINFO("Aborted camera path");
}
@@ -329,6 +333,16 @@ const std::vector<SceneGraphNode*>& PathNavigator::relevantNodes() {
return _relevantNodes;
}
void PathNavigator::handlePathEnd() {
_isPlaying = false;
if (_startSimulationTimeOnFinish) {
global::timeManager->setPause(false);
}
_startSimulationTimeOnFinish = false;
clearPath();
}
void PathNavigator::findRelevantNodes() {
const std::vector<SceneGraphNode*>& allNodes =
global::renderEngine->scene()->allSceneGraphNodes();
@@ -413,8 +427,8 @@ scripting::LuaLibrary PathNavigator::luaLibrary() {
"Stops a path, if one is being played"
},
{
"goTo",
&luascriptfunctions::goTo,
"flyTo",
&luascriptfunctions::flyTo,
"string [, bool, double]",
"Move the camera to the node with the specified identifier. The optional "
"double specifies the duration of the motion. If the optional bool is "
@@ -422,8 +436,8 @@ scripting::LuaLibrary PathNavigator::luaLibrary() {
"node. Either of the optional parameters can be left out."
},
{
"goToHeight",
&luascriptfunctions::goToHeight,
"flyToHeight",
&luascriptfunctions::flyToHeight,
"string, double [, bool, double]",
"Move the camera to the node with the specified identifier. The second "
"argument is the desired target height above the target node's bounding "
@@ -433,8 +447,8 @@ scripting::LuaLibrary PathNavigator::luaLibrary() {
"parameters can be left out."
},
{
"goToNavigationState",
&luascriptfunctions::goToNavigationState,
"flyToNavigationState",
&luascriptfunctions::flyToNavigationState,
"table, [double]",
"Create a path to the navigation state described by the input table. "
"The optional double specifies the target duration of the motion. Note "
@@ -445,7 +459,7 @@ scripting::LuaLibrary PathNavigator::luaLibrary() {
"createPath",
&luascriptfunctions::createPath,
"table",
"Create the path as described by the lua table input argument"
"Create a camera path as described by the lua table input argument"
},
}
};
+7 -7
View File
@@ -68,8 +68,8 @@ int stopPath(lua_State* L) {
return 0;
}
int goTo(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, { 1, 3 }, "lua::goTo");
int flyTo(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, { 1, 3 }, "lua::flyTo");
auto [nodeIdentifier, useUpFromTargetOrDuration, duration] = ghoul::lua::values<
std::string, std::optional<std::variant<bool, double>>, std::optional<double>
>(L);
@@ -120,8 +120,8 @@ int goTo(lua_State* L) {
return 0;
}
int goToHeight(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, { 2, 4 }, "lua::goToHeight");
int flyToHeight(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, { 2, 4 }, "lua::flyToHeight");
auto [nodeIdentifier, height, useUpFromTargetOrDuration, duration] =
ghoul::lua::values<
std::string, double, std::optional<std::variant<bool, double>>,
@@ -169,8 +169,8 @@ int goToHeight(lua_State* L) {
return 0;
}
int goToNavigationState(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, { 1, 2 }, "lua::goToNavigationState");
int flyToNavigationState(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, { 1, 2 }, "lua::flyToNavigationState");
auto [navigationState, duration] =
ghoul::lua::values<ghoul::Dictionary, std::optional<double>>(L);
@@ -182,7 +182,7 @@ int goToNavigationState(lua_State* L) {
);
}
catch (documentation::SpecificationError& e) {
LERRORC("goToNavigationState", ghoul::to_string(e.result));
LERRORC("flyToNavigationState", ghoul::to_string(e.result));
return ghoul::lua::luaError(
L, fmt::format("Unable to create a path: {}", e.what())
);
+1 -1
View File
@@ -127,8 +127,8 @@ void AssetManager::deinitialize() {
for (Asset* asset : _rootAssets) {
if (!asset->hasInitializedParent()) {
asset->deinitialize();
asset->unload();
}
asset->unload();
}
_toBeDeleted.clear();
}
+4
View File
@@ -300,6 +300,10 @@ int unzipFile(lua_State* L) {
dest = absPath(dest).string();
deleteSource = deleteSource.value_or(false);
if (!std::filesystem::exists(source)) {
return luaL_error(L, "Source file was not found");
}
int arg = 2;
zip_extract(source.c_str(), dest.c_str(), [](const char*, void*) { return 0; }, &arg);