File Coverage

blib/lib/Rinchi/CIGIPP/LineOfSightExtendedResponse.pm
Criterion Covered Total %
statement 122 166 73.4
branch 27 64 42.1
condition 5 15 33.3
subroutine 30 32 93.7
pod 28 28 100.0
total 212 305 69.5


line stmt bran cond sub pod time code
1             #
2             # Rinchi Common Image Generator Interface for Perl
3             # Class Identifier: f78b2364-200e-11de-bdca-001c25551abc
4             # Author: Brian M. Ames
5             #
6              
7             package Rinchi::CIGIPP::LineOfSightExtendedResponse;
8              
9 1     1   19 use 5.006;
  1         4  
  1         39  
10 1     1   6 use strict;
  1         3  
  1         30  
11 1     1   6 use warnings;
  1         2  
  1         239  
12 1     1   5 use Carp;
  1         2  
  1         3572  
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.02';
36              
37             # Preloaded methods go here.
38              
39             =head1 NAME
40              
41             Rinchi::CIGIPP::LineOfSightExtendedResponse - Perl extension for the Common
42             Image Generator Interface - Line Of Sight Extended Response data packet.
43             data packet.
44             =head1 SYNOPSIS
45              
46             use Rinchi::CIGIPP::LineOfSightExtendedResponse;
47             my $los_xresp = Rinchi::CIGIPP::LineOfSightExtendedResponse->new();
48              
49             $packet_type = $los_xresp->packet_type();
50             $packet_size = $los_xresp->packet_size();
51             $request_ident = $los_xresp->request_ident(57);
52             $host_frame_number_lsn = $los_xresp->host_frame_number_lsn(4);
53             $visible = $los_xresp->visible(Rinchi::CIGIPP->Occluded);
54             $range_valid = $los_xresp->range_valid(Rinchi::CIGIPP->Invalid);
55             $entity_ident_valid = $los_xresp->entity_ident_valid(Rinchi::CIGIPP->Invalid);
56             $valid = $los_xresp->valid(Rinchi::CIGIPP->Valid);
57             $response_count = $los_xresp->response_count(217);
58             $entity_ident = $los_xresp->entity_ident(41000);
59             $range = $los_xresp->range(17.74);
60             $latitude = $los_xresp->latitude(19.293);
61             $x_offset = $los_xresp->x_offset(14.649);
62             $longitude = $los_xresp->longitude(57.589);
63             $y_offset = $los_xresp->y_offset(47.628);
64             $altitude = $los_xresp->altitude(9.33);
65             $z_offset = $los_xresp->z_offset(43.407);
66             $red = $los_xresp->red(89);
67             $green = $los_xresp->green(122);
68             $blue = $los_xresp->blue(160);
69             $alpha = $los_xresp->alpha(242);
70             $material_code = $los_xresp->material_code(22573);
71             $normal_vector_azimuth = $los_xresp->normal_vector_azimuth(35.653);
72             $normal_vector_elevation = $los_xresp->normal_vector_elevation(41.678);
73              
74             =head1 DESCRIPTION
75              
76             The Line of Sight Extended Response packet is used in response to both Line of
77             Sight Segment Request and Line of Sight Vector Request packets. This packet
78             contains positional data describing the Line of Sight (LOS) intersection point.
79             In addition, it contains the material code and surface-normal unit vector of
80             the polygon at the point of intersection. The packet is sent when the Request
81             Type attribute of the request packet is set to Extended (1).
82              
83             A Line of Sight Extended Response packet will be sent for each intersection
84             along the LOS segment or vector. The Response Count attribute will contain the
85             total number of responses that are being returned. This will allow the Host to
86             determine when all response packets for the given request have been received.
87              
88             For responses to Line of Sight Segment Request packets, the Range, Altitude,
89             Latitude, and Longitude attributes specify the range to and position of the
90             intersection point along the LOS test segment. If the destination point
91             specified in the request is occulted, these attributes specify the range to and
92             position of a point on the surface occulting the destination. If the
93             destination point is not occluded, these attributes simply provide the range to
94             and position of the destination point.
95              
96             For responses to Line of Sight Vector Request packets, the Range, Altitude,
97             Latitude, and Longitude attributes specify the range to and position of the
98             point of intersection between the test vector and a surface. If no intersection
99             occurs within the valid range specified in the request, the Valid attribute is
100             set to Invalid (0).
101              
102             =head2 EXPORT
103              
104             None by default.
105              
106             #==============================================================================
107              
108             =item new $los_xresp = Rinchi::CIGIPP::LineOfSightExtendedResponse->new()
109              
110             Constructor for Rinchi::LineOfSightExtendedResponse.
111              
112             =cut
113              
114             sub new {
115 1     1 1 53 my $class = shift;
116 1   33     9 $class = ref($class) || $class;
117              
118 1         20 my $self = {
119             '_Buffer' => '',
120             '_ClassIdent' => 'f78b2364-200e-11de-bdca-001c25551abc',
121             '_Pack' => 'CCSCCSddddCCCCIff',
122             '_Swap1' => 'CCvCCvVVVVVVVVCCCCVVV',
123             '_Swap2' => 'CCnCCnNNNNNNNNCCCCNNN',
124             'packetType' => 105,
125             'packetSize' => 56,
126             'requestIdent' => 0,
127             '_bitfields1' => 0, # Includes bitfields hostFrameNumberLSN, visible, rangeValid, entityIdentValid, and valid.
128             'hostFrameNumberLSN' => 0,
129             'visible' => 0,
130             'rangeValid' => 0,
131             'entityIdentValid' => 0,
132             'valid' => 0,
133             'responseCount' => 0,
134             'entityIdent' => 0,
135             'range' => 0,
136             'latitude_xOffset' => 0,
137             'longitude_yOffset' => 0,
138             'altitude_zOffset' => 0,
139             'red' => 0,
140             'green' => 0,
141             'blue' => 0,
142             'alpha' => 0,
143             'materialCode' => 0,
144             'normalVectorAzimuth' => 0,
145             'normalVectorElevation' => 0,
146             };
147              
148 1 50       3 if (@_) {
149 0 0       0 if (ref($_[0]) eq 'ARRAY') {
    0          
150 0         0 $self->{'_Buffer'} = $_[0][0];
151             } elsif (ref($_[0]) eq 'HASH') {
152 0         0 foreach my $attr (keys %{$_[0]}) {
  0         0  
153 0 0       0 $self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/);
154             }
155             }
156             }
157              
158 1         4 bless($self,$class);
159 1         3 return $self;
160             }
161              
162             #==============================================================================
163              
164             =item sub packet_type()
165              
166             $value = $los_xresp->packet_type();
167              
168             Data Packet Identifier.
169              
170             This attribute identifies this data packet as the Line of Sight Extended
171             Response packet. The value of this attribute must be 105.
172              
173             =cut
174              
175             sub packet_type() {
176 1     1 1 8 my ($self) = @_;
177 1         10 return $self->{'packetType'};
178             }
179              
180             #==============================================================================
181              
182             =item sub packet_size()
183              
184             $value = $los_xresp->packet_size();
185              
186             Data Packet Size.
187              
188             This attribute indicates the number of bytes in this data packet. The value of
189             this attribute must be 56.
190              
191             =cut
192              
193             sub packet_size() {
194 1     1 1 14 my ($self) = @_;
195 1         3 return $self->{'packetSize'};
196             }
197              
198             #==============================================================================
199              
200             =item sub request_ident([$newValue])
201              
202             $value = $los_xresp->request_ident($newValue);
203              
204             LOS ID.
205              
206             This attribute corresponds to the value of the LOS ID attribute in the
207             associated Line of Sight Segment Request or Line of Sight Vector Request packet.
208              
209             =cut
210              
211             sub request_ident() {
212 1     1 1 5 my ($self,$nv) = @_;
213 1 50       4 if (defined($nv)) {
214 1         2 $self->{'requestIdent'} = $nv;
215             }
216 1         2 return $self->{'requestIdent'};
217             }
218              
219             #==============================================================================
220              
221             =item sub host_frame_number_lsn([$newValue])
222              
223             $value = $los_xresp->host_frame_number_lsn($newValue);
224              
225             Host Frame Number LSN.
226              
227             This attribute contains the least significant nybble of the Host Frame Number
228             attribute of the last IG Control packet received before the LOS data are
229             calculated.
230             This attribute is ignored if the Update Period attribute of the corresponding
231             Line of Sight Segment Request or Line of Sight Vector Request packet was set to
232             zero (0).
233              
234             =cut
235              
236             sub host_frame_number_lsn() {
237 1     1 1 5 my ($self,$nv) = @_;
238 1 50       3 if (defined($nv)) {
239 1         2 $self->{'hostFrameNumberLSN'} = $nv;
240 1         2 $self->{'_bitfields1'} |= ($nv << 4) &0xF0;
241             }
242 1         3 return (($self->{'_bitfields1'} & 0xF0) >> 4);
243             }
244              
245             #==============================================================================
246              
247             =item sub visible([$newValue])
248              
249             $value = $los_xresp->visible($newValue);
250              
251             Visible.
252              
253             This attribute is used in response to a Line of Sight Segment Request packet
254             and indicates whether the destination point is visible from the source point.
255             This value should be ignored if the packet is in response to a Line of Sight
256             Vector Request packet.
257              
258             Note: If the LOS segment destination point is within the body of a target
259             entity model, this attribute will be set to Occluded (0) and the Entity ID
260             attribute will contain the ID of that entity.
261              
262             Occluded 0
263             Visible 1
264              
265             =cut
266              
267             sub visible() {
268 1     1 1 15 my ($self,$nv) = @_;
269 1 50       4 if (defined($nv)) {
270 1 50 33     12 if (($nv==0) or ($nv==1)) {
271 1         3 $self->{'visible'} = $nv;
272 1         2 $self->{'_bitfields1'} |= ($nv << 3) &0x08;
273             } else {
274 0         0 carp "visible must be 0 (Occluded), or 1 (Visible).";
275             }
276             }
277 1         4 return (($self->{'_bitfields1'} & 0x08) >> 3);
278             }
279              
280             #==============================================================================
281              
282             =item sub range_valid([$newValue])
283              
284             $value = $los_xresp->range_valid($newValue);
285              
286             Range Valid.
287              
288             This attribute indicates whether the Range attribute is valid. The range will
289             be invalid if an intersection occurs before the minimum range or beyond the
290             maximum range specified in an LOS vector request. The range will also be
291             invalid if this packet is in response to an LOS segment request.
292              
293             If Valid is set to Invalid (0), this attribute will also be set to Invalid (0).
294              
295             Invalid 0
296             Valid 1
297              
298             =cut
299              
300             sub range_valid() {
301 1     1 1 3 my ($self,$nv) = @_;
302 1 50       4 if (defined($nv)) {
303 1 50 33     5 if (($nv==0) or ($nv==1)) {
304 1         3 $self->{'rangeValid'} = $nv;
305 1         3 $self->{'_bitfields1'} |= ($nv << 2) &0x04;
306             } else {
307 0         0 carp "range_valid must be 0 (Invalid), or 1 (Valid).";
308             }
309             }
310 1         5 return (($self->{'_bitfields1'} & 0x04) >> 2);
311             }
312              
313             #==============================================================================
314              
315             =item sub entity_ident_valid([$newValue])
316              
317             $value = $los_xresp->entity_ident_valid($newValue);
318              
319             Entity Ident Valid.
320              
321             This attribute indicates whether the LOS test vector or segment intersects with
322             an entity (Valid) or a non-entity (Invalid).
323              
324             Invalid 0
325             Valid 1
326              
327             =cut
328              
329             sub entity_ident_valid() {
330 1     1 1 3 my ($self,$nv) = @_;
331 1 50       3 if (defined($nv)) {
332 1 50 33     5 if (($nv==0) or ($nv==1)) {
333 1         2 $self->{'entityIdentValid'} = $nv;
334 1         2 $self->{'_bitfields1'} |= ($nv << 1) &0x02;
335             } else {
336 0         0 carp "entity_ident_valid must be 0 (Invalid), or 1 (Valid).";
337             }
338             }
339 1         4 return (($self->{'_bitfields1'} & 0x02) >> 1);
340             }
341              
342             #==============================================================================
343              
344             =item sub valid([$newValue])
345              
346             $value = $los_xresp->valid($newValue);
347              
348             Valid.
349              
350             This attribute indicates whether this packet contains valid data. A value of
351             Invalid (0) indicates that the LOS test segment or vector did not intersect any geometry.
352              
353             Invalid 0
354             Valid 1
355              
356             =cut
357              
358             sub valid() {
359 1     1 1 3 my ($self,$nv) = @_;
360 1 50       3 if (defined($nv)) {
361 1 50 33     38 if (($nv==0) or ($nv==1)) {
362 1         9 $self->{'valid'} = $nv;
363 1         3 $self->{'_bitfields1'} |= $nv &0x01;
364             } else {
365 0         0 carp "valid must be 0 (Invalid), or 1 (Valid).";
366             }
367             }
368 1         4 return ($self->{'_bitfields1'} & 0x01);
369             }
370              
371             #==============================================================================
372              
373             =item sub response_count([$newValue])
374              
375             $value = $los_xresp->response_count($newValue);
376              
377             Response Count.
378              
379             This attribute indicates the total number of Line of Sight Extended Response
380             packets the IG will return for the corresponding request.
381              
382             Note: If Visible is set to Visible (1), then Response Count should be set to 1.
383              
384             =cut
385              
386             sub response_count() {
387 1     1 1 5 my ($self,$nv) = @_;
388 1 50       4 if (defined($nv)) {
389 1         3 $self->{'responseCount'} = $nv;
390             }
391 1         2 return $self->{'responseCount'};
392             }
393              
394             #==============================================================================
395              
396             =item sub entity_ident([$newValue])
397              
398             $value = $los_xresp->entity_ident($newValue);
399              
400             Entity Identifier.
401              
402             This attribute indicates the entity with which a LOS test vector or segment
403             intersects. This attribute should be ignored if Entity ID Valid is set to
404             Invalid (0).
405              
406             =cut
407              
408             sub entity_ident() {
409 1     1 1 5 my ($self,$nv) = @_;
410 1 50       3 if (defined($nv)) {
411 1         2 $self->{'entityIdent'} = $nv;
412             }
413 1         4 return $self->{'entityIdent'};
414             }
415              
416             #==============================================================================
417              
418             =item sub range([$newValue])
419              
420             $value = $los_xresp->range($newValue);
421              
422             Range.
423              
424             This attribute represents the distance along the LOS test segment or vector
425             from the source point to the point of intersection with a polygon surface.
426              
427             =cut
428              
429             sub range() {
430 1     1 1 5 my ($self,$nv) = @_;
431 1 50       4 if (defined($nv)) {
432 1         8 $self->{'range'} = $nv;
433             }
434 1         3 return $self->{'range'};
435             }
436              
437             #==============================================================================
438              
439             =item sub latitude([$newValue])
440              
441             $value = $los_xresp->latitude($newValue);
442              
443             Latitude.
444              
445             If the Entity ID Valid attribute is set to Invalid (0) or if Response
446             Coordinate System in the request packet was set to Geodetic (0), this attribute
447             indicates the geodetic latitude of the point of intersection along the LOS test
448             segment or vector.
449              
450             If this packet is in response to an LOS segment request and Visible is set to
451             Occluded (0), this point is on the occulting surface. If this packet is in
452             response to an LOS segment request and Visible is set to Visible (1), this
453             point is simply the destination point.
454              
455             =cut
456              
457             sub latitude() {
458 1     1 1 5 my ($self,$nv) = @_;
459 1 50       4 if (defined($nv)) {
460 1         3 $self->{'latitude_xOffset'} = $nv;
461             }
462 1         3 return $self->{'latitude_xOffset'};
463             }
464              
465             #==============================================================================
466              
467             =item sub x_offset([$newValue])
468              
469             $value = $los_xresp->x_offset($newValue);
470              
471             X Offset.
472              
473             If the Entity ID Valid attribute is set to Valid (1) and Response Coordinate
474             System in the request packet was set to Entity (1), this attribute specifies
475             the offset of the point of intersection of the LOS test segment or vector along
476             the intersected entity's X axis.
477              
478             =cut
479              
480             sub x_offset() {
481 1     1 1 4 my ($self,$nv) = @_;
482 1 50       3 if (defined($nv)) {
483 1         3 $self->{'latitude_xOffset'} = $nv;
484             }
485 1         8 return $self->{'latitude_xOffset'};
486             }
487              
488             #==============================================================================
489              
490             =item sub longitude([$newValue])
491              
492             $value = $los_xresp->longitude($newValue);
493              
494             Longitude.
495              
496             If the Entity ID Valid attribute is set to Invalid (0) or if Response
497             Coordinate System in the request packet was set to Geodetic (0), this attribute
498             indicates the geodetic longitude of the point of intersection along the LOS
499             test segment or vector.
500              
501             If this packet is in response to an LOS segment request and Visible is set to
502             Occluded (0), this point is on the occulting surface. If this packet is in
503             response to an LOS segment request and Visible is set to Visible (1), this
504             point is simply the destination point.
505              
506             =cut
507              
508             sub longitude() {
509 1     1 1 4 my ($self,$nv) = @_;
510 1 50       4 if (defined($nv)) {
511 1         3 $self->{'longitude_yOffset'} = $nv;
512             }
513 1         3 return $self->{'longitude_yOffset'};
514             }
515              
516             #==============================================================================
517              
518             =item sub y_offset([$newValue])
519              
520             $value = $los_xresp->y_offset($newValue);
521              
522             Y Offset.
523              
524             If the Entity ID Valid attribute is set to Valid (1) and Response Coordinate
525             System in the request packet was set to Entity (1), this attribute specifies
526             the offset of the point of intersection of the LOS test segment or vector along
527             the intersected entity's Y axis.
528              
529             =cut
530              
531             sub y_offset() {
532 1     1 1 5 my ($self,$nv) = @_;
533 1 50       9 if (defined($nv)) {
534 1         2 $self->{'longitude_yOffset'} = $nv;
535             }
536 1         3 return $self->{'longitude_yOffset'};
537             }
538              
539             #==============================================================================
540              
541             =item sub altitude([$newValue])
542              
543             $value = $los_xresp->altitude($newValue);
544              
545             Altitude.
546              
547             If the Entity ID Valid attribute is set to Invalid (0) or if Response
548             Coordinate System in the request packet was set to Geodetic (0), this attribute
549             indicates the geodetic altitude of the point of intersection along the LOS test
550             segment or vector.
551              
552             If this packet is in response to a LOS segment request and Visible is set to
553             Occluded (0), this point is on the occulting surface. If this packet is in
554             response to a LOS segment request and Visible is set to Visible (1), this point
555             is simply the destination point.
556              
557             =cut
558              
559             sub altitude() {
560 1     1 1 6 my ($self,$nv) = @_;
561 1 50       3 if (defined($nv)) {
562 1         80 $self->{'altitude_zOffset'} = $nv;
563             }
564 1         4 return $self->{'altitude_zOffset'};
565             }
566              
567             #==============================================================================
568              
569             =item sub z_offset([$newValue])
570              
571             $value = $los_xresp->z_offset($newValue);
572              
573             Z Offset.
574              
575             If the Entity ID Valid attribute is set to Valid (1) and Response Coordinate
576             System in the request packet was set to Entity (1), this attribute specifies
577             the offset of the point of intersection of the LOS test segment or vector along
578             the intersected entity's Z axis.
579              
580             =cut
581              
582             sub z_offset() {
583 1     1 1 5 my ($self,$nv) = @_;
584 1 50       5 if (defined($nv)) {
585 1         2 $self->{'altitude_zOffset'} = $nv;
586             }
587 1         3 return $self->{'altitude_zOffset'};
588             }
589              
590             #==============================================================================
591              
592             =item sub red([$newValue])
593              
594             $value = $los_xresp->red($newValue);
595              
596             Red.
597              
598             This attribute indicates the red color component of the surface at the point of intersection.
599              
600             =cut
601              
602             sub red() {
603 1     1 1 4 my ($self,$nv) = @_;
604 1 50       4 if (defined($nv)) {
605 1         3 $self->{'red'} = $nv;
606             }
607 1         2 return $self->{'red'};
608             }
609              
610             #==============================================================================
611              
612             =item sub green([$newValue])
613              
614             $value = $los_xresp->green($newValue);
615              
616             Green.
617              
618             This attribute indicates the green color component of the surface at the point
619             of intersection.
620              
621             =cut
622              
623             sub green() {
624 1     1 1 4 my ($self,$nv) = @_;
625 1 50       3 if (defined($nv)) {
626 1         3 $self->{'green'} = $nv;
627             }
628 1         2 return $self->{'green'};
629             }
630              
631             #==============================================================================
632              
633             =item sub blue([$newValue])
634              
635             $value = $los_xresp->blue($newValue);
636              
637             Blue.
638              
639             This attribute indicates the blue color component of the surface at the point
640             of intersection.
641              
642             =cut
643              
644             sub blue() {
645 1     1 1 4 my ($self,$nv) = @_;
646 1 50       4 if (defined($nv)) {
647 1         2 $self->{'blue'} = $nv;
648             }
649 1         3 return $self->{'blue'};
650             }
651              
652             #==============================================================================
653              
654             =item sub alpha([$newValue])
655              
656             $value = $los_xresp->alpha($newValue);
657              
658             Alpha.
659              
660             This attribute indicates the alpha color component of the surface at the point
661             of intersection.
662              
663             =cut
664              
665             sub alpha() {
666 1     1 1 4 my ($self,$nv) = @_;
667 1 50       3 if (defined($nv)) {
668 1         2 $self->{'alpha'} = $nv;
669             }
670 1         3 return $self->{'alpha'};
671             }
672              
673             #==============================================================================
674              
675             =item sub material_code([$newValue])
676              
677             $value = $los_xresp->material_code($newValue);
678              
679             Material Code.
680              
681             This attribute indicates the material code of the surface intersected by the
682             LOS test segment or vector.
683              
684             =cut
685              
686             sub material_code() {
687 1     1 1 5 my ($self,$nv) = @_;
688 1 50       8 if (defined($nv)) {
689 1         3 $self->{'materialCode'} = $nv;
690             }
691 1         3 return $self->{'materialCode'};
692             }
693              
694             #==============================================================================
695              
696             =item sub normal_vector_azimuth([$newValue])
697              
698             $value = $los_xresp->normal_vector_azimuth($newValue);
699              
700             Normal Vector Azimuth.
701              
702             This attribute represents the azimuth of the normal unit vector of the surface
703             intersected by the HAT/HOT test vector. This value is the horizontal angle from
704             True North to the vector.
705              
706             =cut
707              
708             sub normal_vector_azimuth() {
709 1     1 1 4 my ($self,$nv) = @_;
710 1 50       3 if (defined($nv)) {
711 1         3 $self->{'normalVectorAzimuth'} = $nv;
712             }
713 1         3 return $self->{'normalVectorAzimuth'};
714             }
715              
716             #==============================================================================
717              
718             =item sub normal_vector_elevation([$newValue])
719              
720             $value = $los_xresp->normal_vector_elevation($newValue);
721              
722             Normal Vector Elevation.
723              
724             This attribute represents the elevation of the normal unit vector of the
725             surface intersected by the HAT/HOT test vector. This value is the vertical
726             angle from the geodetic reference plane to the vector.
727              
728             =cut
729              
730             sub normal_vector_elevation() {
731 1     1 1 5 my ($self,$nv) = @_;
732 1 50       4 if (defined($nv)) {
733 1         2 $self->{'normalVectorElevation'} = $nv;
734             }
735 1         3 return $self->{'normalVectorElevation'};
736             }
737              
738             #==========================================================================
739              
740             =item sub pack()
741              
742             $value = $los_xresp->pack();
743              
744             Returns the packed data packet.
745              
746             =cut
747              
748             sub pack($) {
749 1     1 1 5 my $self = shift ;
750              
751 1         9 $self->{'_Buffer'} = CORE::pack($self->{'_Pack'},
752             $self->{'packetType'},
753             $self->{'packetSize'},
754             $self->{'requestIdent'},
755             $self->{'_bitfields1'}, # Includes bitfields hostFrameNumberLSN, visible, rangeValid, entityIdentValid, and valid.
756             $self->{'responseCount'},
757             $self->{'entityIdent'},
758             $self->{'range'},
759             $self->{'latitude_xOffset'},
760             $self->{'longitude_yOffset'},
761             $self->{'altitude_zOffset'},
762             $self->{'red'},
763             $self->{'green'},
764             $self->{'blue'},
765             $self->{'alpha'},
766             $self->{'materialCode'},
767             $self->{'normalVectorAzimuth'},
768             $self->{'normalVectorElevation'},
769             );
770              
771 1         3 return $self->{'_Buffer'};
772             }
773              
774             #==========================================================================
775              
776             =item sub unpack()
777              
778             $value = $los_xresp->unpack();
779              
780             Unpacks the packed data packet.
781              
782             =cut
783              
784             sub unpack($) {
785 0     0 1   my $self = shift @_;
786              
787 0 0         if (@_) {
788 0           $self->{'_Buffer'} = shift @_;
789             }
790 0           my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'});
791 0           $self->{'packetType'} = $a;
792 0           $self->{'packetSize'} = $b;
793 0           $self->{'requestIdent'} = $c;
794 0           $self->{'_bitfields1'} = $d; # Includes bitfields hostFrameNumberLSN, visible, rangeValid, entityIdentValid, and valid.
795 0           $self->{'responseCount'} = $e;
796 0           $self->{'entityIdent'} = $f;
797 0           $self->{'range'} = $g;
798 0           $self->{'latitude_xOffset'} = $h;
799 0           $self->{'longitude_yOffset'} = $i;
800 0           $self->{'altitude_zOffset'} = $j;
801 0           $self->{'red'} = $k;
802 0           $self->{'green'} = $l;
803 0           $self->{'blue'} = $m;
804 0           $self->{'alpha'} = $n;
805 0           $self->{'materialCode'} = $o;
806 0           $self->{'normalVectorAzimuth'} = $p;
807 0           $self->{'normalVectorElevation'} = $q;
808              
809 0           $self->{'hostFrameNumberLSN'} = $self->host_frame_number_lsn();
810 0           $self->{'visible'} = $self->visible();
811 0           $self->{'rangeValid'} = $self->range_valid();
812 0           $self->{'entityIdentValid'} = $self->entity_ident_valid();
813 0           $self->{'valid'} = $self->valid();
814              
815 0           return $self->{'_Buffer'};
816             }
817              
818             #==========================================================================
819              
820             =item sub byte_swap()
821              
822             $obj_name->byte_swap();
823              
824             Byte swaps the packed data packet.
825              
826             =cut
827              
828             sub byte_swap($) {
829 0     0 1   my $self = shift @_;
830            
831 0 0         if (@_) {
832 0           $self->{'_Buffer'} = shift @_;
833             } else {
834 0           $self->pack();
835             }
836 0           my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'});
837              
838 0           $self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$h,$g,$j,$i,$l,$k,$n,$m,$o,$p,$q,$r,$s,$t,$u);
839 0           $self->unpack();
840              
841 0           return $self->{'_Buffer'};
842             }
843              
844             1;
845             __END__