VR-Engage  2.2
Loading...
Searching...
No Matches
rfxOcclusionMessage.h
Go to the documentation of this file.
1// ******************************************************************************
2// ** Copyright (c) 2025 MAK Technologies
3// ** All rights reserved.
4// ******************************************************************************
5
6//! \file rfxOcclusionMessage.h
7//! \brief Defines the request and response messages for line-of-sight occlusion tests
8//! \ingroup vreRadarFxShared
9//!
10//! This file contains message classes for requesting line-of-sight occlusion tests
11//! between two points or entities, and receiving the visibility results. Occlusion
12//! tests determine if there is an unobstructed view between the observer and target.
13
14#pragma once
15
16#include "export.h"
17#include "rfxMessage.h"
18
19#include <vlutil/vlString.h>
20#include <matrix/vlVector.h>
21
22namespace makRadarFx
23{
24//! \brief Request message for line-of-sight occlusion tests
25//!
26//! This class encapsulates a request for an occlusion test between an observer position
27//! and a target position. The test determines if there is an unobstructed line of sight
28//! between the two points, taking into account terrain and objects in the simulation.
29//! Both the observer and target can be specified as absolute positions, entities in the
30//! simulation, or using the current observer's position and view.
32{
33public:
34 //! \brief Default constructor
35 //!
36 //! Initializes a new occlusion request message with default settings
38
39 //! \brief Virtual destructor
41
42 //! \brief calling this function causes the message to use the current observer's position and orientation for
43 //! the SAR image setup. The client doees not need to set an ownship location or target location if using this
44 //! method to orient the sensor.
45 virtual void useObserverAsHost();
46
47 //! \brief if the ownship is not hosted in the simulation system, we can explicitly state where we want to
48 //! perform the elevation test from
49 virtual void setOwnshipLocation(DtVector location);
50 virtual DtVector ownshipLocation();
51
52 //! \brief If the ownship is hosted by the simulation system, we can use its global simulation name
53 //! to look it up
54 virtual void setOwnshipEntityId(const std::string& name);
55 virtual std::string ownshipEntityId();
56
57 //! \brief functions to determine how to place the sensor
58 virtual bool isUsingObserverAsHost();
59 virtual bool isUsingEntityAsHost();
61
62 //! \brief calling this function causes the message to use the current observer's view to determine the target for
63 //! the SAR image setup.
64 virtual void useObserverForTarget();
65
66 //! \brief If the ownship is the target of the sensor, we can use its global simulation name
67 //! to look it up
68 virtual void setTargetEntityId(const std::string& name);
69 virtual std::string targetEntityId();
70
71 //! \brief this is the target that we would like to look at. Location format is latitude/longitude/altitude (in
72 //! degrees/meters). the altitude of the target location is not required.
73 virtual void setTargetLocation(DtVector location);
74 virtual DtVector targetLocation();
75
76 //! \brief functions to determine how to place the target
78 virtual bool isUsingEntityForTarget();
80
81
82 //! \brief size of the message
83 virtual int messageSize();
84 //! \brief decode a message. Used by the factory
85 static DtBaseMessage* decode(unsigned char* buffer, int length);
86 //! \brief clone a message. Caller of function is responsible managing this memory
87 virtual DtBaseMessage* clone();
88
89protected:
90 virtual void serialize(DtStreamWriter& writer);
91 virtual void deserialize(DtStreamReader& reader);
92
99
100 std::string myOwnshipName;
101 std::string myTargetName;
104};
105
106//! \brief Response message containing line-of-sight occlusion test results
107//!
108//! This class encapsulates the response to an occlusion test request, providing
109//! information about whether there is an unobstructed line of sight between the
110//! observer position and the target position. If the line of sight is obstructed,
111//! additional information about the obstruction may be included.
113{
114public:
115 //! \brief Default constructor
116 //!
117 //! Initializes a new occlusion response message with default settings
119
120 //! \brief Virtual destructor
122
123 //! \brief Returns whether or not the requesting platform has line of sight of the target location
124 virtual void setOcclusion(bool occluded);
125 virtual bool occluded();
126
127 //! \brief size of the message
128 virtual int messageSize();
129 //! \brief decode a message. Used by the factory
130 static DtBaseMessage* decode(unsigned char* buffer, int length);
131 //! \brief clone a message. Caller of function is responsible managing this memory
133
134
135protected:
136 virtual void serialize(DtStreamWriter& writer);
137 virtual void deserialize(DtStreamReader& reader);
138
140};
141} // namespace makRadarFx
DtBaseMessage()
Default constructor.
virtual bool isUsingObserverAsHost()
functions to determine how to place the sensor
virtual void setOwnshipLocation(DtVector location)
if the ownship is not hosted in the simulation system, we can explicitly state where we want to perfo...
virtual DtVector ownshipLocation()
virtual void setTargetEntityId(const std::string &name)
If the ownship is the target of the sensor, we can use its global simulation name to look it up.
bool myUseObserverAsHost
Definition rfxOcclusionMessage.h:93
DtOcclusionRequest()
Default constructor.
std::string myTargetName
Definition rfxOcclusionMessage.h:101
virtual std::string targetEntityId()
virtual bool isUsingAbsoluteLocation()
virtual ~DtOcclusionRequest()
Virtual destructor.
virtual void setOwnshipEntityId(const std::string &name)
If the ownship is hosted by the simulation system, we can use its global simulation name to look it u...
bool myUseEntityAsTarget
Definition rfxOcclusionMessage.h:97
virtual bool isUsingLocationForTarget()
std::string myOwnshipName
Definition rfxOcclusionMessage.h:100
static DtBaseMessage * decode(unsigned char *buffer, int length)
decode a message. Used by the factory
bool myUseEntityAsHost
Definition rfxOcclusionMessage.h:94
virtual void useObserverForTarget()
calling this function causes the message to use the current observer's view to determine the target f...
bool myUseAbsoluteOwnship
Definition rfxOcclusionMessage.h:95
virtual bool isUsingObserverForTarget()
functions to determine how to place the target
virtual int messageSize()
size of the message
virtual void serialize(DtStreamWriter &writer)
Serializes the message data to a stream writer.
virtual DtBaseMessage * clone()
clone a message. Caller of function is responsible managing this memory
bool myUseAbsoluteTarget
Definition rfxOcclusionMessage.h:98
bool myUseObserverForTarget
Definition rfxOcclusionMessage.h:96
virtual DtVector targetLocation()
virtual std::string ownshipEntityId()
virtual bool isUsingEntityForTarget()
DtVector myOwnshipLocation
Definition rfxOcclusionMessage.h:102
virtual void setTargetLocation(DtVector location)
this is the target that we would like to look at. Location format is latitude/longitude/altitude (in ...
virtual void deserialize(DtStreamReader &reader)
Deserializes message data from a stream reader.
DtVector myTargetLocation
Definition rfxOcclusionMessage.h:103
virtual void useObserverAsHost()
calling this function causes the message to use the current observer's position and orientation for t...
virtual bool isUsingEntityAsHost()
virtual ~DtOcclusionResponse()
Virtual destructor.
virtual int messageSize()
size of the message
virtual void serialize(DtStreamWriter &writer)
Serializes the message data to a stream writer.
virtual void deserialize(DtStreamReader &reader)
Deserializes message data from a stream reader.
bool myOcclusion
Definition rfxOcclusionMessage.h:139
DtOcclusionResponse()
Default constructor.
virtual void setOcclusion(bool occluded)
Returns whether or not the requesting platform has line of sight of the target location.
static DtBaseMessage * decode(unsigned char *buffer, int length)
decode a message. Used by the factory
virtual DtBaseMessage * clone()
clone a message. Caller of function is responsible managing this memory
Stream reader for decoding values from a byte array in little endian format.
Definition byteStream.h:32
Stream writer for encoding values into a byte array in little endian format.
Definition byteStream.h:159
Defines export macros for the RadarFx Shared library.
#define RFX_DLL_SHARED
Export/import macro for non-Windows platforms (empty)
Definition export.h:25
Definition radarFxConnectorDriver.h:21
Defines the base message class for RadarFX client-server communication.