added events for when renderables are enabled/disabled that can be used to link renderables together (#2132)

This commit is contained in:
Micah Acinapura
2022-06-14 12:09:30 -04:00
committed by GitHub
parent 667d3b50e1
commit 7eff6b042e
3 changed files with 87 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ namespace openspace {
class Camera;
class Layer;
class Profile;
class Renderable;
class SceneGraphNode;
class ScreenSpaceRenderable;
class Time;
@@ -74,6 +75,8 @@ struct Event {
LayerRemoved,
SessionRecordingPlayback,
PointSpacecraft,
RenderableEnabled,
RenderableDisabled,
Custom
};
constexpr explicit Event(Type type_) : type(type_) {}
@@ -397,6 +400,32 @@ struct EventPointSpacecraft : public Event {
const double duration;
};
/**
* This event is created whenever a renderable is enabled. By the
* time this event is signalled, the renderable has already been enabled.
*
* \param Node The identifier of the node that contains the renderable
*/
struct EventRenderableEnabled : public Event {
static const Type Type = Event::Type::RenderableEnabled;
explicit EventRenderableEnabled(const SceneGraphNode* node_);
const tstring node;
};
/**
* This event is created whenever a renderable is disabled. By the
* time this event is signalled, the renderable has already been disabled.
*
* \param Node The identifier of that node that contains the renderable
*/
struct EventRenderableDisabled : public Event {
static const Type Type = Event::Type::RenderableDisabled;
explicit EventRenderableDisabled(const SceneGraphNode* node_);
const tstring node;
};
/**
* A custom event type that can be used in a pinch when no explicit event type is
* available. This should only be used in special circumstances and it should be