VR-Engage  2.2
Loading...
Searching...
No Matches
groundJoyTurretController.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file groundJoyTurretController.h
7//! \ingroup vreVrfmodel
8//! \brief Joystick controller for ground vehicle turrets
9//!
10//! This file defines the DtGroundJoyTurretController class which extends
11//! the turret slew controller with joystick input capabilities, allowing
12//! for direct manual control of ground vehicle turrets.
13
14#pragma once
15
16#include "vreVrfmodel/export.h"
17
18#include <vrfmodel/turretSlewController.h>
19#include <vrfmodel/joystickControllerInterface.h>
20#include <vrfobjcore/simRadio.h>
21
22class DtString;
23class DtSimulationServices;
24class DtJoyDeviceControllerDescriptor;
25
26//! \brief Type identifier for the ground turret joystick controller component
27const char DtGroundJoyTurretControllerType[] = "ground-turret-joystick-controller";
28
29namespace makVre
30{
31//! \brief Controller for joystick control of ground vehicle turrets
32//!
33//! DtGroundJoyTurretController extends the turret slew controller with
34//! joystick input capabilities, allowing direct manual control of ground
35//! vehicle turrets. It implements the DtJoystickControllerInterface to
36//! process input from joystick devices and translate it to appropriate
37//! turret control outputs.
38//!
39//! Uses Descriptor Type: DtTurretJoyDeviceControllerDescriptor
40class VREVRFMODEL_DLL DtGroundJoyTurretController : public DtTurretSlewController, public DtJoystickControllerInterface
41{
42public:
43 //! \brief Constructor
44 //! \param name The name of this component
45 //! \param owner The local object that owns this component
46 //! \param simManager The simulation services manager
47 //! \param desc Component descriptor with configuration parameters
48 //! \param parentRegistry Optional parent registry for reader/writer functionality
49 //!
50 //! Creates a new ground turret joystick controller component with the specified parameters.
51 DtGroundJoyTurretController(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
52 DtComponentDescriptor* desc, DtReaderWriterRegistry* parentRegistry = 0);
53
54 //! \brief Virtual destructor
55 //!
56 //! Cleans up resources used by the ground turret joystick controller component.
57 virtual ~DtGroundJoyTurretController() override;
58
59 //! \brief Gets the type identifier for this component
60 //! \return String identifying the component type (DtGroundJoyTurretControllerType)
61 //!
62 //! Implements the DtSimComponent::type() method to return the
63 //! type identifier for this component.
64 virtual const char* type() const override;
65
66 //! \brief Factory method to create a new instance of this component
67 //! \param name The name for the new component
68 //! \param owner The local object that will own this component
69 //! \param simManager The simulation services manager
70 //! \param desc Optional component descriptor
71 //! \param parentRegistry Optional parent registry for reader/writer functionality
72 //! \return Pointer to the newly created component
73 //!
74 //! Static factory method used by the component creation system to instantiate
75 //! new instances of this component type.
76 static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
77 DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
78
79protected:
80 //! \brief Processes joystick input and updates output ports
81 //! \param functionGroup The function group identifier for the input
82 //! \param function The specific function identifier within the group
83 //! \param value The input value from the joystick
84 //! \param repeat Flag indicating if this is a repeated input
85 //!
86 //! Implements the DtJoystickControllerInterface method to process joystick
87 //! input and update the controller's output ports accordingly for turret control.
89 const DtString& functionGroup, const DtString& function, double value, bool repeat) override;
90
91 //! \brief Handles joystick connection event
92 //!
93 //! Called when a joystick is connected to the system.
94 //! Activates joystick control mode for this turret controller.
95 virtual void joystickConnected() override;
96
97 //! \brief Handles joystick disconnection event
98 //!
99 //! Called when a joystick is disconnected from the system.
100 //! Deactivates joystick control mode for this turret controller.
101 virtual void joystickDisconnected() override;
102
103private:
104 //! \brief Default constructor (not implemented)
105 //!
106 //! Default constructor is private and not implemented to prevent
107 //! creation of instances without proper initialization.
109
110 //! \brief Assignment operator (not implemented)
111 //! \return Reference to this object
112 //!
113 //! Assignment operator is private and not implemented to prevent assignment.
115
116 //! \brief Copy constructor (not implemented)
117 //!
118 //! Copy constructor is private and not implemented to prevent
119 //! copy construction.
121};
122} // namespace makVre
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Factory method to create a new instance of this component.
DtGroundJoyTurretController()
Default constructor (not implemented)
virtual void joystickDisconnected() override
Handles joystick disconnection event.
virtual ~DtGroundJoyTurretController() override
Virtual destructor.
virtual void joystickConnected() override
Handles joystick connection event.
DtGroundJoyTurretController & operator=(const DtGroundJoyTurretController &orig)
Assignment operator (not implemented)
DtGroundJoyTurretController(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0)
Constructor.
virtual void calcAndSetPortValues(const DtString &functionGroup, const DtString &function, double value, bool repeat) override
Processes joystick input and updates output ports.
virtual const char * type() const override
Gets the type identifier for this component.
DtGroundJoyTurretController(const DtGroundJoyTurretController &orig)
Copy constructor (not implemented)
const char DtGroundJoyTurretControllerType[]
Type identifier for the ground turret joystick controller component.
Definition groundJoyTurretController.h:27
Defines export macros for the vreVrfmodel library.
#define VREVRFMODEL_DLL
Definition export.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49