line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78b20bc-200e-11de-bdc9-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::LineOfSightResponse; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
147
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
40
|
|
10
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
11
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
12
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1662
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
require Exporter; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
19
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
20
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# This allows declaration use Rinchi::CIGI::AtmosphereControl ':all'; |
23
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
24
|
|
|
|
|
|
|
# will save memory. |
25
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
) ] ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our @EXPORT = qw( |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Preloaded methods go here. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Rinchi::CIGIPP::LineOfSightResponse - Perl extension for the Common Image |
42
|
|
|
|
|
|
|
Generator Interface - Line Of Sight Response data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::LineOfSightResponse; |
47
|
|
|
|
|
|
|
my $los_resp = Rinchi::CIGIPP::LineOfSightResponse->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $los_resp->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $los_resp->packet_size(); |
51
|
|
|
|
|
|
|
$request_ident = $los_resp->request_ident(23176); |
52
|
|
|
|
|
|
|
$host_frame_number_lsn = $los_resp->host_frame_number_lsn(15); |
53
|
|
|
|
|
|
|
$visible = $los_resp->visible(Rinchi::CIGIPP->Occluded); |
54
|
|
|
|
|
|
|
$entity_ident_valid = $los_resp->entity_ident_valid(Rinchi::CIGIPP->Invalid); |
55
|
|
|
|
|
|
|
$valid = $los_resp->valid(Rinchi::CIGIPP->Invalid); |
56
|
|
|
|
|
|
|
$response_count = $los_resp->response_count(68); |
57
|
|
|
|
|
|
|
$entity_ident = $los_resp->entity_ident(9383); |
58
|
|
|
|
|
|
|
$range = $los_resp->range(45.403); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The Line of Sight Response packet is used in response to both the Line of Sight |
63
|
|
|
|
|
|
|
Segment Request and Line of Sight Vector Request packets. This packet contains |
64
|
|
|
|
|
|
|
the distance from the Line of Sight (LOS) segment or vector source point to the |
65
|
|
|
|
|
|
|
point of intersection with a polygon surface. The packet is sent when the |
66
|
|
|
|
|
|
|
Request Type attribute of the request packet is set to Basic (0). |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
A Line of Sight Response packet will be sent for each intersection along the |
69
|
|
|
|
|
|
|
LOS segment or vector. The Response Count attribute will contain the total |
70
|
|
|
|
|
|
|
number of responses that are being returned. This will allow the Host to |
71
|
|
|
|
|
|
|
determine when all response packets for the given request have been received. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
If the Update Period attribute of the originating Line of Sight Segment Request |
74
|
|
|
|
|
|
|
or Line of Sight Vector Request packet was set to a value greater than zero, |
75
|
|
|
|
|
|
|
then the Host Frame Number LSN attribute of each corresponding Line of Sight |
76
|
|
|
|
|
|
|
Response packet must contain the least significant nybble of the Host Frame |
77
|
|
|
|
|
|
|
Number value last received by the IG before the range is calculated. The Host |
78
|
|
|
|
|
|
|
may correlate this LSN to an eyepoint position or may use the value to |
79
|
|
|
|
|
|
|
determine latency. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 EXPORT |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
None by default. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
#============================================================================== |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item new $los_resp = Rinchi::CIGIPP::LineOfSightResponse->new() |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Constructor for Rinchi::LineOfSightResponse. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub new { |
94
|
1
|
|
|
1
|
1
|
57
|
my $class = shift; |
95
|
1
|
|
33
|
|
|
8
|
$class = ref($class) || $class; |
96
|
|
|
|
|
|
|
|
97
|
1
|
|
|
|
|
15
|
my $self = { |
98
|
|
|
|
|
|
|
'_Buffer' => '', |
99
|
|
|
|
|
|
|
'_ClassIdent' => 'f78b20bc-200e-11de-bdc9-001c25551abc', |
100
|
|
|
|
|
|
|
'_Pack' => 'CCSCCSd', |
101
|
|
|
|
|
|
|
'_Swap1' => 'CCvCCvVV', |
102
|
|
|
|
|
|
|
'_Swap2' => 'CCnCCnNN', |
103
|
|
|
|
|
|
|
'packetType' => 104, |
104
|
|
|
|
|
|
|
'packetSize' => 16, |
105
|
|
|
|
|
|
|
'requestIdent' => 0, |
106
|
|
|
|
|
|
|
'_bitfields1' => 0, # Includes bitfields hostFrameNumberLSN, unused73, visible, entityIdentValid, and valid. |
107
|
|
|
|
|
|
|
'hostFrameNumberLSN' => 0, |
108
|
|
|
|
|
|
|
'visible' => 0, |
109
|
|
|
|
|
|
|
'entityIdentValid' => 0, |
110
|
|
|
|
|
|
|
'valid' => 0, |
111
|
|
|
|
|
|
|
'responseCount' => 0, |
112
|
|
|
|
|
|
|
'entityIdent' => 0, |
113
|
|
|
|
|
|
|
'range' => 0, |
114
|
|
|
|
|
|
|
}; |
115
|
|
|
|
|
|
|
|
116
|
1
|
50
|
|
|
|
5
|
if (@_) { |
117
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
118
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
119
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
120
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
121
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
1
|
|
|
|
|
3
|
bless($self,$class); |
127
|
1
|
|
|
|
|
3
|
return $self; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
#============================================================================== |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item sub packet_type() |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
$value = $los_resp->packet_type(); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Data Packet Identifier. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
This attribute identifies this data packet as the Line of Sight Response |
139
|
|
|
|
|
|
|
packet. The value of this attribute must be 104. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub packet_type() { |
144
|
1
|
|
|
1
|
1
|
7
|
my ($self) = @_; |
145
|
1
|
|
|
|
|
9
|
return $self->{'packetType'}; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
#============================================================================== |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=item sub packet_size() |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
$value = $los_resp->packet_size(); |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Data Packet Size. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
157
|
|
|
|
|
|
|
this attribute must be 16. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=cut |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub packet_size() { |
162
|
1
|
|
|
1
|
1
|
5
|
my ($self) = @_; |
163
|
1
|
|
|
|
|
4
|
return $self->{'packetSize'}; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
#============================================================================== |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item sub request_ident([$newValue]) |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
$value = $los_resp->request_ident($newValue); |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
LOS ID. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
This attribute identifies the LOS response. This value corresponds to the value |
175
|
|
|
|
|
|
|
of the LOS ID attribute in the associated Line of Sight Segment Request packet |
176
|
|
|
|
|
|
|
or Line of Sight Vector Request packet. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=cut |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub request_ident() { |
181
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
182
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
183
|
1
|
|
|
|
|
3
|
$self->{'requestIdent'} = $nv; |
184
|
|
|
|
|
|
|
} |
185
|
1
|
|
|
|
|
3
|
return $self->{'requestIdent'}; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
#============================================================================== |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=item sub host_frame_number_lsn([$newValue]) |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
$value = $los_resp->host_frame_number_lsn($newValue); |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Host Frame Number LSN. |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
This attribute contains the least significant nybble of the Host Frame Number |
197
|
|
|
|
|
|
|
attribute of the last IG Control packet received before the LOS data are |
198
|
|
|
|
|
|
|
calculated. |
199
|
|
|
|
|
|
|
This attribute is ignored if the Update Period attribute of the corresponding |
200
|
|
|
|
|
|
|
Line of Sight Segment Request or Line of Sight Vector Request packet was set to |
201
|
|
|
|
|
|
|
zero (0). |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=cut |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
sub host_frame_number_lsn() { |
206
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
207
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
208
|
1
|
|
|
|
|
2
|
$self->{'hostFrameNumberLSN'} = $nv; |
209
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 4) &0xF0; |
210
|
|
|
|
|
|
|
} |
211
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0xF0) >> 4); |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
#============================================================================== |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=item sub visible([$newValue]) |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
$value = $los_resp->visible($newValue); |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
Visible. |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
This attribute is used in response to a Line of Sight Segment Request packet. |
223
|
|
|
|
|
|
|
It indicates whether the destination point is visible from the source point. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
This value should be ignored if the packet is in response to a Line of Sight |
226
|
|
|
|
|
|
|
Vector Request packet. |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
Note: If the LOS segment destination point is within the body of a target |
229
|
|
|
|
|
|
|
entity model, this attribute will be set to Occluded (0) and the Entity ID |
230
|
|
|
|
|
|
|
attribute will contain the ID of that entity. |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
Occluded 0 |
233
|
|
|
|
|
|
|
Visible 1 |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
sub visible() { |
238
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
239
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
240
|
1
|
50
|
33
|
|
|
14
|
if (($nv==0) or ($nv==1)) { |
241
|
1
|
|
|
|
|
3
|
$self->{'visible'} = $nv; |
242
|
1
|
|
|
|
|
4
|
$self->{'_bitfields1'} |= ($nv << 2) &0x04; |
243
|
|
|
|
|
|
|
} else { |
244
|
0
|
|
|
|
|
0
|
carp "visible must be 0 (Occluded), or 1 (Visible)."; |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
} |
247
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x04) >> 2); |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
#============================================================================== |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=item sub entity_ident_valid([$newValue]) |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
$value = $los_resp->entity_ident_valid($newValue); |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
Entity ID Valid. |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
This attribute indicates whether the LOS test vector or segment intersects with |
259
|
|
|
|
|
|
|
an entity (Valid) or a non-entity (Invalid). |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Invalid 0 |
262
|
|
|
|
|
|
|
Valid 1 |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub entity_ident_valid() { |
267
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
268
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
269
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
270
|
1
|
|
|
|
|
4
|
$self->{'entityIdentValid'} = $nv; |
271
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 1) &0x02; |
272
|
|
|
|
|
|
|
} else { |
273
|
0
|
|
|
|
|
0
|
carp "entity_ident_valid must be 0 (Invalid), or 1 (Valid)."; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} |
276
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0x02) >> 1); |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
#============================================================================== |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=item sub valid([$newValue]) |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
$value = $los_resp->valid($newValue); |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
Valid. |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
This attribute indicates whether the Range attribute is valid. The range will |
288
|
|
|
|
|
|
|
be invalid if no intersection occurs, or if an intersection occurs before the |
289
|
|
|
|
|
|
|
minimum range or beyond the maximum range specified in a LOS vector request. |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Invalid 0 |
292
|
|
|
|
|
|
|
Valid 1 |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=cut |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
sub valid() { |
297
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
298
|
1
|
50
|
|
|
|
10
|
if (defined($nv)) { |
299
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
300
|
1
|
|
|
|
|
3
|
$self->{'valid'} = $nv; |
301
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= $nv &0x01; |
302
|
|
|
|
|
|
|
} else { |
303
|
0
|
|
|
|
|
0
|
carp "valid must be 0 (Invalid), or 1 (Valid)."; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
} |
306
|
1
|
|
|
|
|
4
|
return ($self->{'_bitfields1'} & 0x01); |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
#============================================================================== |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=item sub response_count([$newValue]) |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
$value = $los_resp->response_count($newValue); |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
Response Count. |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
This attribute indicates the total number of Line of Sight Response packets the |
318
|
|
|
|
|
|
|
IG will return for the corresponding request. |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
Note: If Visible is set to Visible (1), then Response Count should be set to 1. |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
=cut |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
sub response_count() { |
325
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
326
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
327
|
1
|
|
|
|
|
2
|
$self->{'responseCount'} = $nv; |
328
|
|
|
|
|
|
|
} |
329
|
1
|
|
|
|
|
4
|
return $self->{'responseCount'}; |
330
|
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
#============================================================================== |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=item sub entity_ident([$newValue]) |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
$value = $los_resp->entity_ident($newValue); |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
Entity ID. |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
This attribute indicates the entity with which an LOS test vector or segment |
341
|
|
|
|
|
|
|
intersects. This attribute should be ignored if Entity ID Valid is set to |
342
|
|
|
|
|
|
|
Invalid (0). |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
=cut |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
sub entity_ident() { |
347
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
348
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
349
|
1
|
|
|
|
|
3
|
$self->{'entityIdent'} = $nv; |
350
|
|
|
|
|
|
|
} |
351
|
1
|
|
|
|
|
3
|
return $self->{'entityIdent'}; |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
#============================================================================== |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
=item sub range([$newValue]) |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
$value = $los_resp->range($newValue); |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
Range. |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
This attribute indicates the distance along the LOS test segment or vector from |
363
|
|
|
|
|
|
|
the source point to the point of intersection with a polygon surface. |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=cut |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
sub range() { |
368
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
369
|
1
|
50
|
|
|
|
11
|
if (defined($nv)) { |
370
|
1
|
|
|
|
|
8
|
$self->{'range'} = $nv; |
371
|
|
|
|
|
|
|
} |
372
|
1
|
|
|
|
|
4
|
return $self->{'range'}; |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
#========================================================================== |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=item sub pack() |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
$value = $los_resp->pack(); |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
Returns the packed data packet. |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=cut |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
sub pack($) { |
386
|
1
|
|
|
1
|
1
|
5
|
my $self = shift ; |
387
|
|
|
|
|
|
|
|
388
|
1
|
|
|
|
|
8
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
389
|
|
|
|
|
|
|
$self->{'packetType'}, |
390
|
|
|
|
|
|
|
$self->{'packetSize'}, |
391
|
|
|
|
|
|
|
$self->{'requestIdent'}, |
392
|
|
|
|
|
|
|
$self->{'_bitfields1'}, # Includes bitfields hostFrameNumberLSN, unused73, visible, entityIdentValid, and valid. |
393
|
|
|
|
|
|
|
$self->{'responseCount'}, |
394
|
|
|
|
|
|
|
$self->{'entityIdent'}, |
395
|
|
|
|
|
|
|
$self->{'range'}, |
396
|
|
|
|
|
|
|
); |
397
|
|
|
|
|
|
|
|
398
|
1
|
|
|
|
|
4
|
return $self->{'_Buffer'}; |
399
|
|
|
|
|
|
|
} |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
#========================================================================== |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=item sub unpack() |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
$value = $los_resp->unpack(); |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
Unpacks the packed data packet. |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=cut |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
sub unpack($) { |
412
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
413
|
|
|
|
|
|
|
|
414
|
0
|
0
|
|
|
|
|
if (@_) { |
415
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
416
|
|
|
|
|
|
|
} |
417
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
418
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
419
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
420
|
0
|
|
|
|
|
|
$self->{'requestIdent'} = $c; |
421
|
0
|
|
|
|
|
|
$self->{'_bitfields1'} = $d; # Includes bitfields hostFrameNumberLSN, unused73, visible, entityIdentValid, and valid. |
422
|
0
|
|
|
|
|
|
$self->{'responseCount'} = $e; |
423
|
0
|
|
|
|
|
|
$self->{'entityIdent'} = $f; |
424
|
0
|
|
|
|
|
|
$self->{'range'} = $g; |
425
|
|
|
|
|
|
|
|
426
|
0
|
|
|
|
|
|
$self->{'hostFrameNumberLSN'} = $self->host_frame_number_lsn(); |
427
|
0
|
|
|
|
|
|
$self->{'visible'} = $self->visible(); |
428
|
0
|
|
|
|
|
|
$self->{'entityIdentValid'} = $self->entity_ident_valid(); |
429
|
0
|
|
|
|
|
|
$self->{'valid'} = $self->valid(); |
430
|
|
|
|
|
|
|
|
431
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
#========================================================================== |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=item sub byte_swap() |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=cut |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
sub byte_swap($) { |
445
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
446
|
|
|
|
|
|
|
|
447
|
0
|
0
|
|
|
|
|
if (@_) { |
448
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
449
|
|
|
|
|
|
|
} else { |
450
|
0
|
|
|
|
|
|
$self->pack(); |
451
|
|
|
|
|
|
|
} |
452
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
453
|
|
|
|
|
|
|
|
454
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$h,$g); |
455
|
0
|
|
|
|
|
|
$self->unpack(); |
456
|
|
|
|
|
|
|
|
457
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
458
|
|
|
|
|
|
|
} |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
1; |
461
|
|
|
|
|
|
|
__END__ |