mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Add BoolProperty to SpaceModule to control SpiceManager exception handling (closes #661)
Add debugging indices to SceneGraphNodes Rename ImGui indices debugging definition
This commit is contained in:
@@ -124,16 +124,11 @@ SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
glm::dmat3 SpiceRotation::matrix(const Time& time) const {
|
||||
try {
|
||||
return SpiceManager::ref().positionTransformMatrix(
|
||||
_sourceFrame,
|
||||
_destinationFrame,
|
||||
time.j2000Seconds()
|
||||
);
|
||||
}
|
||||
catch (const SpiceManager::SpiceException&) {
|
||||
return glm::dmat3(1.0);
|
||||
}
|
||||
return SpiceManager::ref().positionTransformMatrix(
|
||||
_sourceFrame,
|
||||
_destinationFrame,
|
||||
time.j2000Seconds()
|
||||
);
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -37,14 +37,32 @@
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/rendering/screenspacerenderable.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <openspace/util/spicemanager.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
|
||||
namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo SpiceExceptionInfo = {
|
||||
"ShowExceptions",
|
||||
"Show Exceptions",
|
||||
"If enabled, errors from SPICE will be thrown and show up in the log. If "
|
||||
"disabled, the errors will be ignored silently."
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace openspace {
|
||||
|
||||
ghoul::opengl::ProgramObjectManager SpaceModule::ProgramObjectManager;
|
||||
|
||||
SpaceModule::SpaceModule() : OpenSpaceModule(Name) {}
|
||||
SpaceModule::SpaceModule()
|
||||
: OpenSpaceModule(Name)
|
||||
, _showSpiceExceptions(SpiceExceptionInfo, true)
|
||||
{
|
||||
_showSpiceExceptions.onChange([&t = _showSpiceExceptions](){
|
||||
SpiceManager::ref().setExceptionHandling(SpiceManager::UseException(t));
|
||||
});
|
||||
addProperty(_showSpiceExceptions);
|
||||
}
|
||||
|
||||
void SpaceModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
FactoryManager::ref().addFactory(
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <openspace/util/openspacemodule.h>
|
||||
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <ghoul/opengl/programobjectmanager.h>
|
||||
|
||||
namespace openspace {
|
||||
@@ -44,6 +45,8 @@ public:
|
||||
private:
|
||||
void internalInitialize(const ghoul::Dictionary&) override;
|
||||
void internalDeinitializeGL() override;
|
||||
|
||||
properties::BoolProperty _showSpiceExceptions;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user