VR-Engage  2.2
Loading...
Searching...
No Matches
vreEventProcessor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreEventProcessor.h
7//! \brief Defines the event processor for handling display channel events
8//!
9//! This file contains the DtVreEventProcessor class which provides functionality
10//! for redirecting events between display channels. It allows events targeted at
11//! one channel to be processed by another, which is useful for creating coordinated
12//! multi-channel displays or for managing event handling in complex visualization setups.
13
14#pragma once
15
17
19
20#include <vrvCore/DtEventProcessorInterface.h>
21
22namespace makVrv
23{
24//! \brief Forward declaration of the display channel class
25class DtChannel;
26
27//! \brief Forward declaration of the channel manager class
28class DtChannelManager;
29}; // namespace makVrv
30
31namespace makVre
32{
33//! \brief Forward declaration of the initialization table class
34class DtInitTable;
35
36//! \brief Forward declaration of the player station class
37class DtPlayerStation;
38
39//! \brief Event processor for handling and redirecting display channel events
40//!
41//! DtVreEventProcessor extends the base event processor interface to provide
42//! the ability to redirect events from one display channel to another. This is
43//! useful in scenarios where multiple channels need coordinated behavior or
44//! when events need to be processed by a different channel than the one they
45//! were originally targeted for. The processor maintains a mapping of channel
46//! associations and routes events accordingly.
47class PLAYERSTATION_DLL DtVreEventProcessor : public makVrv::DtEventProcessorInterface
48{
49public:
50 //! \brief Constructor
51 //! \param de Reference to the display engine
52 //!
53 //! Creates a new event processor associated with the given display engine.
54 DtVreEventProcessor(makVrv::DtDe& de);
55
56 //! \brief Virtual destructor
57 //!
58 //! Ensures proper cleanup of the event processor resources.
59 virtual ~DtVreEventProcessor() override;
60
61 //! \brief Initializes the event processor
62 //! \return True if initialization succeeded, false otherwise
63 //!
64 //! Sets up the event processor, including registering message handlers
65 //! and connecting to signals for channel management.
66 virtual bool init();
67
68 //! \brief Shuts down the event processor
69 //!
70 //! Cleans up resources and disconnects from signals and message handlers.
71 //! This should be called when the event processor is no longer needed.
72 virtual void shutdown();
73
74 //! \brief Gets the target channel for a given source channel
75 //! \param source Pointer to the source channel
76 //! \return Pointer to the target channel, or the source channel if no association exists
77 //!
78 //! Looks up the target channel associated with the given source channel.
79 //! If no association exists, returns the source channel unchanged.
80 virtual makVrv::DtChannel* targetChannel(makVrv::DtChannel* source);
81
82protected:
83 //! \brief Handles messages to add a channel association
84 //! \param msg Pointer to the association message
85 //! \return Message handling result
86 //!
87 //! Processes messages requesting to add an association between two channels,
88 //! updating the channel association map accordingly.
90
91 //! \brief Handles messages to remove a channel association
92 //! \param msg Pointer to the disassociation message
93 //! \return Message handling result
94 //!
95 //! Processes messages requesting to remove an association between two channels,
96 //! removing the entry from the channel association map.
98
99 //! \brief Slot called when a channel is about to be removed
100 //! \param channelManager Pointer to the channel manager (unused)
101 //! \param channel Pointer to the channel being removed
102 //!
103 //! Handles cleanup when a channel is being removed, ensuring any
104 //! associations involving that channel are also removed.
105 virtual void slot_channelToBeRemoved(makVrv::DtChannelManager*, makVrv::DtChannel* channel);
106
107 //! \brief Reference to the display engine
108 //!
109 //! Provides access to display channels and other visualization resources.
110 makVrv::DtDe& myDe;
111
112 //! \brief Map of source channels to destination channels
113 //!
114 //! Maintains the associations between source and target channels.
115 //! When an event targets a source channel, it can be redirected to
116 //! the associated target channel.
117 std::map<makVrv::DtChannel*, makVrv::DtChannel*> myChannelAssociations;
118};
119
120} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
virtual ~DtVreEventProcessor() override
Virtual destructor.
std::map< makVrv::DtChannel *, makVrv::DtChannel * > myChannelAssociations
Map of source channels to destination channels.
Definition vreEventProcessor.h:117
DtVreEventProcessor(makVrv::DtDe &de)
Constructor.
virtual DtVreMessageResult handleRemoveChannelEventProcessorAssociation(DtVreMessage *msg)
Handles messages to remove a channel association.
virtual makVrv::DtChannel * targetChannel(makVrv::DtChannel *source)
Gets the target channel for a given source channel.
virtual bool init()
Initializes the event processor.
makVrv::DtDe & myDe
Reference to the display engine.
Definition vreEventProcessor.h:110
virtual DtVreMessageResult handleAddChannelEventProcessorAssociation(DtVreMessage *msg)
Handles messages to add a channel association.
virtual void slot_channelToBeRemoved(makVrv::DtChannelManager *, makVrv::DtChannel *channel)
Slot called when a channel is about to be removed.
virtual void shutdown()
Shuts down the event processor.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.
Defines the base class for all VREngage messages.