CIGIPP/SymbolSurfaceDefinition.pm

filter: Statementstmt 75.0% 132 / 176 Branchbran 42.4% 28 / 66 Conditioncond 33.3% 5 / 15 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 93.9% 31 / 33 Podpod 100% 29 / 29 totaltotal 68.3% 225 / 329 CC 40 SCAR 14.9
CC
40
Cov
64%
new
19.6
unpack
6.0
byte_swap
6.0
CRAP 4.5
« CIGIPP/LineOfSightExtendedResponse.pm ↑ Summary
1 #
2 # Rinchi Common Image Generator Interface for Perl
3 # Class Identifier: f78b0078-200e-11de-bdbd-001c25551abc
4 # Author: Brian M. Ames
5 #
6  
7 package Rinchi::CIGIPP::SymbolSurfaceDefinition;
8  
9 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 require Exporter;
15  
16 2 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 2 our %EXPORT_TAGS = ( 'all' => [ qw(
26
27 ) ] );
28  
29 2 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
30  
31 2 our @EXPORT = qw(
32
33 );
34  
35 2 our $VERSION = '0.01';
36  
37 # Preloaded methods go here.
38  
39 =head1 NAME
40  
41 Rinchi::CIGIPP::SymbolSurfaceDefinition - Perl extension for the Common Image
42 Generator Interface - Symbol Surface Definition data packet.
43 data packet.
44 =head1 SYNOPSIS
45  
46 use Rinchi::CIGIPP::SymbolSurfaceDefinition;
47 my $sym_surf = Rinchi::CIGIPP::SymbolSurfaceDefinition->new();
48  
49 $packet_type = $sym_surf->packet_type();
50 $packet_size = $sym_surf->packet_size();
51 $surface_ident = $sym_surf->surface_ident(35085);
52 $perspective_growth_enable = $sym_surf->perspective_growth_enable(Rinchi::CIGIPP->Enabled);
53 $billboard = $sym_surf->billboard(Rinchi::CIGIPP->Billboard);
54 $attach_type = $sym_surf->attach_type(Rinchi::CIGIPP->ViewAT);
55 $surface_state = $sym_surf->surface_state(Rinchi::CIGIPP->DestroyedSS);
56 $entity_ident = $sym_surf->entity_ident(47752);
57 $view_ident = $sym_surf->view_ident(58180);
58 $x_offset = $sym_surf->x_offset(40.156);
59 $left = $sym_surf->left(30.873);
60 $y_offset = $sym_surf->y_offset(36.278);
61 $right = $sym_surf->right(65.423);
62 $z_offset = $sym_surf->z_offset(64.092);
63 $top = $sym_surf->top(30.89);
64 $yaw = $sym_surf->yaw(0.109);
65 $bottom = $sym_surf->bottom(5.179);
66 $pitch = $sym_surf->pitch(80.979);
67 $roll = $sym_surf->roll(61.448);
68 $width = $sym_surf->width(83.426);
69 $height = $sym_surf->height(47.941);
70 $min_u = $sym_surf->min_u(31.315);
71 $max_u = $sym_surf->max_u(53.721);
72 $min_v = $sym_surf->min_v(16.873);
73 $max_v = $sym_surf->max_v(34.874);
74  
75 =head1 DESCRIPTION
76  
77 The Symbol Surface Definition packet is used to create a symbol surface and
78 control its position, orientation,size, and other attributes.
79  
80 Each symbol surface is identified by a unique Surface ID value. When the IG
81 receives a Symbol Surface Definition packet referring to a surface that does
82 not exist, the IG creates a new surface based on the packet'sattributes. If the
83 surface does exist, it is modified according to the packet's attributes.
84  
85 A symbol surface must be attached to exactly one entity or view. The Attach
86 Type attribute determines the typeof object to which the view is attached, and
87 the Entity ID/View ID attribute identifies that object. If the entity or view
88 does not exist, the Symbol Surface Definition packet is ignored.
89  
90 For surfaces attached to a view, the Left, Right, Top, and Bottom attributes
91 define the position and size of the surface. These values are specified
92 relative to the view's Normalized Viewport Coordinate System as described in
93 CIGI ICD Section 3.4.4.3.
94  
95 For non-billboard surfaces attached to an entity, the X Offset, Y Offset, Z
96 Offset, Yaw, Pitch, and Roll attributes specify the position and attitude of
97 the surface in relation to the entity to which it is attached. The translation
98 and rotation behavior is the same as for a child entity and is described in
99 CIGI ICD Section 3.4.4.1. The Width and Height attributes specify the size of
100 the surface.
101  
102 For billboard surfaces attached to an entity, the X Offset, Y Offset, and Z
103 Offset attributes define the distance from the surface to the entity. The
104 orientation of the entity has no effect on the view's orientation; the view is
105 always parallel to the view plane as described in CIGI ICD Section Section
106 3.4.4.2. The Width and Height attributes specify the size of the surface. The
107 Yaw, Pitch, and Roll attributes are ignored. Every surface has a local 2D (UV)
108 coordinate system that is used to place, rotate, and size of each symbol drawn
109 on the surface as described in CIGI ICD Section 3.4.5.1. The Min U, Max U, Min
110 V, and Max V attributes define this coordinate system.
111  
112 The stacking order for surfaces attached to the same view is such that a
113 surface with a lower Surface ID value is drawn behind (i.e., further from the
114 eyepoint than) a surface with a higher value. For example, if three surfaces
115 attached to the same view have Surface ID values of 3, 4, and 7, then Surface 3
116 is drawn first. Surface 4 is drawn next and may occult any overlapping areas.
117 Finally, Surface 7 is drawn on top and may likewise occult parts of the other
118 surfaces.
119 Any surface attached to an entity is contained in the scene and is drawn with
120 entities and other objects also in the scene. Since surfaces attached to views
121 are coincident with the near clipping plane, view-attached surfaces ared rawn
122 on top of all other objects in the view.
123  
124 Once a Symbol Surface Definition packet describing a symbol surface is sent to
125 the IG, the state of that surface will not change until another Symbol Surface
126 Definition packet referencing the same Surface ID is received.
127  
128 A symbol surface is destroyed by setting the Surface State attribute to
129 Destroyed (1). Any symbols associated with that surface are also destroyed.
130  
131 If an entity is destroyed, then any symbol surfaces attached to that entity are
132 also destroyed.
133  
134 =head2 EXPORT
135  
136 None by default.
137  
138 #==============================================================================
139  
140 =item new $sym_surf = Rinchi::CIGIPP::SymbolSurfaceDefinition->new()
141  
142 Constructor for Rinchi::SymbolSurfaceDefinition.
143  
144 =cut
145  
146 2 ▶sub new {
Subroutine new: called CC=7 SCAR=29.8
Pod documented
147 2 my $class = shift;
148 2 ▶ $class = ref($class) || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
149  
150 2 my $self = {
151 '_Buffer' => '',
152 '_ClassIdent' => 'f78b0078-200e-11de-bdbd-001c25551abc',
153 '_Pack' => 'CCSCCSffffffffffff',
154 '_Swap1' => 'CCvCCvVVVVVVVVVVVV',
155 '_Swap2' => 'CCnCCnNNNNNNNNNNNN',
156 'packetType' => 29,
157 'packetSize' => 56,
158 'surfaceIdent' => 0,
159 '_bitfields1' => 0, # Includes bitfields unused51, perspectiveGrowthEnable, billboard, attachType, and surfaceState.
160 'perspectiveGrowthEnable' => 0,
161 'billboard' => 0,
162 'attachType' => 0,
163 'surfaceState' => 0,
164 '_unused52' => 0,
165 'entityIdent_viewIdent' => 0,
166 'xOffset_left' => 0,
167 'yOffset_right' => 0,
168 'zOffset_top' => 0,
169 'yaw_bottom' => 0,
170 'pitch' => 0,
171 'roll' => 0,
172 'width' => 0,
173 'height' => 0,
174 'minU' => 0,
175 'maxU' => 0,
176 'minV' => 0,
177 'maxV' => 0,
178 };
179  
180 2 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 2 2
181 0 ▶ if (ref($_[0]) eq 'ARRAY') {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $_[0] eq 'ARRAY') { } 0 0 0
elsif (ref $_[0] eq 'HASH') { } 0 0 0
182 0 $self->{'_Buffer'} = $_[0][0];
183 } elsif (ref($_[0]) eq 'HASH') {
184 0 foreach my $attr (keys %{$_[0]}) {
185 0 ▶ $self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/);
Branch: 1 branch
BranchTrueFalseTotal
unless $attr =~ /^_/ 0 0 0
186 }
187 }
188 }
189  
190 2 bless($self,$class);
191 2 return $self;
192 }
193  
194 #==============================================================================
195  
196 =item sub packet_type()
197  
198 $value = $sym_surf->packet_type();
199  
200 Data Packet Identifier.
201  
202 This attribute identifies this data packet as the Symbol Surface Definition
203 packet. The value of this attribute must be 29.
204  
205 =cut
206  
207 2 ▶sub packet_type() {
Subroutine packet_type: called CC=1 SCAR=0.0
Pod documented
208 2 my ($self) = @_;
209 2 return $self->{'packetType'};
210 }
211  
212 #==============================================================================
213  
214 =item sub packet_size()
215  
216 $value = $sym_surf->packet_size();
217  
218 Data Packet Size.
219  
220 This attribute indicates the number of bytes in this data packet. The value of
221 this attribute must be 56.
222  
223 =cut
224  
225 2 ▶sub packet_size() {
Subroutine packet_size: called CC=1 SCAR=0.0
Pod documented
226 2 my ($self) = @_;
227 2 return $self->{'packetSize'};
228 }
229  
230 #==============================================================================
231  
232 =item sub surface_ident([$newValue])
233  
234 $value = $sym_surf->surface_ident($newValue);
235  
236 Surface ID.
237  
238 This attribute specifies the symbol surface to which this packet is applied.
239  
240 Values 0 through 32767 are used for Host-defined symbols. Values of 32768
241 through 65535 are reserved for IG-defined symbols. The Host may redefine these.
242  
243 =cut
244  
245 2 ▶sub surface_ident() {
Subroutine surface_ident: called CC=2 SCAR=7.0
Pod documented
246 2 my ($self,$nv) = @_;
247 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
248 2 $self->{'surfaceIdent'} = $nv;
249 }
250 2 return $self->{'surfaceIdent'};
251 }
252  
253 #==============================================================================
254  
255 =item sub perspective_growth_enable([$newValue])
256  
257 $value = $sym_surf->perspective_growth_enable($newValue);
258  
259 Perspective Growth Enable.
260  
261 This attribute specifies whether the surface appears to maintain a constant
262 size or has perspective growth as the entity to which the surface is attached
263 moves closer to the eyepoint.
264  
265 If the surface is attached to an entity and is a billboard, and if this
266 attribute is set to Disabled (0), then the surface will appear to stay the same
267 size (i.e., will cover the same area of the view) regardless of its distance
268 from the eyepoint.
269  
270 If the surface is attached to an entity and is a billboard, and if this
271 attribute is set to Enabled (1), then the surface will appear to change size
272 relative to the viewport as the entity to which the surface is attached moves
273 away from or closer to the eyepoint.
274  
275 If the surface is attached to an entity but is not a billboard, then this
276 attribute is ignored.
277  
278 If the surface is attached to a view, this attribute is ignored.
279  
280 Disabled 0
281 Enabled 1
282  
283 =cut
284  
285 2 ▶sub perspective_growth_enable() {
Subroutine perspective_growth_enable: called CC=4 SCAR=15.5
Pod documented
286 2 my ($self,$nv) = @_;
287 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
288 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
289 2 $self->{'perspectiveGrowthEnable'} = $nv;
290 2 $self->{'_bitfields1'} |= ($nv << 3) &0x08;
291 } else {
292 0 carp "perspective_growth_enable must be 0 (Disabled), or 1 (Enabled).";
293 }
294 }
295 2 return (($self->{'_bitfields1'} & 0x08) >> 3);
296 }
297  
298 #==============================================================================
299  
300 =item sub billboard([$newValue])
301  
302 $value = $sym_surf->billboard($newValue);
303  
304 Billboard.
305  
306 This attribute specifies whether the surface is treated as a billboard.
307  
308 If the surface is attached to an entity and this value is set to Non-Billboard
309 (0), then the orientation of the surface is specified in relation to the
310 entity's local coordinate system by the Yaw, Pitch, and Roll attributes.
311  
312 If the surface is attached to an entity and this value is set to Billboard (1),
313 then a normal vector from the center of the surface will be parallel to the
314 viewing vector as shown in CIGI ICD Figure 25.
315  
316 If the surface is attached to a view, then this attribute is ignored.
317  
318 NonBillboard 0
319 Billboard 1
320  
321 =cut
322  
323 2 ▶sub billboard() {
Subroutine billboard: called CC=4 SCAR=15.5
Pod documented
324 2 my ($self,$nv) = @_;
325 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
326 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
327 2 $self->{'billboard'} = $nv;
328 2 $self->{'_bitfields1'} |= ($nv << 2) &0x04;
329 } else {
330 0 carp "billboard must be 0 (NonBillboard), or 1 (Billboard).";
331 }
332 }
333 2 return (($self->{'_bitfields1'} & 0x04) >> 2);
334 }
335  
336 #==============================================================================
337  
338 =item sub attach_type([$newValue])
339  
340 $value = $sym_surf->attach_type($newValue);
341  
342 Attach Type.
343  
344 This attribute specifies whether the surface should be attached to an entity or
345 a view.
346  
347 If the specified entity or view does not exist, this packet is ignored.
348  
349 EntityAT 0
350 ViewAT 1
351  
352 =cut
353  
354 2 ▶sub attach_type() {
Subroutine attach_type: called CC=4 SCAR=15.5
Pod documented
355 2 my ($self,$nv) = @_;
356 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
357 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
358 2 $self->{'attachType'} = $nv;
359 2 $self->{'_bitfields1'} |= ($nv << 1) &0x02;
360 } else {
361 0 carp "attach_type must be 0 (EntityAT), or 1 (ViewAT).";
362 }
363 }
364 2 return (($self->{'_bitfields1'} & 0x02) >> 1);
365 }
366  
367 #==============================================================================
368  
369 =item sub surface_state([$newValue])
370  
371 $value = $sym_surf->surface_state($newValue);
372  
373 Surface State.
374  
375 This attribute specifies whether the symbol surface should be active or
376 destroyed.
377 Active – The surface is active and symbols may be drawn on it. The surface can
378 be positioned, oriented, and sized; and it can be attached to an entity or a
379 view.
380 Destroyed – The surface is removed from the system. Any symbols drawn to it are
381 also destroyed. All other attributes in this packet are ignored.
382  
383 ActiveSS 0
384 DestroyedSS 1
385  
386 =cut
387  
388 2 ▶sub surface_state() {
Subroutine surface_state: called CC=4 SCAR=15.5
Pod documented
389 2 my ($self,$nv) = @_;
390 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
391 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
392 2 $self->{'surfaceState'} = $nv;
393 2 $self->{'_bitfields1'} |= $nv &0x01;
394 } else {
395 0 carp "surface_state must be 0 (ActiveSS), or 1 (DestroyedSS).";
396 }
397 }
398 2 return ($self->{'_bitfields1'} & 0x01);
399 }
400  
401 #==============================================================================
402  
403 =item sub entity_ident([$newValue])
404  
405 $value = $sym_surf->entity_ident($newValue);
406  
407 Entity ID.
408  
409 This attribute specifies the entity to which this surface is attached.
410  
411 =cut
412  
413 2 ▶sub entity_ident() {
Subroutine entity_ident: called CC=2 SCAR=7.0
Pod documented
414 2 my ($self,$nv) = @_;
415 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
416 2 $self->{'entityIdent'} = $nv;
417 }
418 2 return $self->{'entityIdent'};
419 }
420  
421 #==============================================================================
422  
423 =item sub view_ident([$newValue])
424  
425 $value = $sym_surf->view_ident($newValue);
426  
427 View ID.
428  
429 This attribute specifies the view to which this surface is attached.
430  
431 =cut
432  
433 2 ▶sub view_ident() {
Subroutine view_ident: called CC=2 SCAR=7.0
Pod documented
434 2 my ($self,$nv) = @_;
435 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
436 2 $self->{'viewIdent'} = $nv;
437 }
438 2 return $self->{'viewIdent'};
439 }
440  
441 #==============================================================================
442  
443 =item sub x_offset([$newValue])
444  
445 $value = $sym_surf->x_offset($newValue);
446  
447 X Offset. For a non-billboard surface attached to an entity, this attribute
448 specifies the distance along the entity's X axis from the entity's reference
449 point to the center of the surface (see CIGI ICD Section 3.4.4.1).
450  
451 For a billboard surface attached to an entity, this attribute specifies the
452 distance along the surface's X axis from the center of the surface to the
453 entity's reference point (see CIGI ICD Section 3.4.4.2).
454  
455 =cut
456  
457 2 ▶sub x_offset() {
Subroutine x_offset: called CC=2 SCAR=7.0
Pod documented
458 2 my ($self,$nv) = @_;
459 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
460 2 $self->{'xOffset'} = $nv;
461 }
462 2 return $self->{'xOffset'};
463 }
464  
465 #==============================================================================
466  
467 =item sub left([$newValue])
468  
469 $value = $sym_surf->left($newValue);
470  
471 Left.
472  
473 For a surface attached to a view, this attribute specifies the distance from
474 the left edge of the viewport to the surface's leftmost boundary as a fraction
475 of the viewport's width (see CIGI ICD Section 3.4.4.3).
476  
477 =cut
478  
479 2 ▶sub left() {
Subroutine left: called CC=2 SCAR=7.0
Pod documented
480 2 my ($self,$nv) = @_;
481 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
482 2 $self->{'left'} = $nv;
483 }
484 2 return $self->{'left'};
485 }
486  
487 #==============================================================================
488  
489 =item sub y_offset([$newValue])
490  
491 $value = $sym_surf->y_offset($newValue);
492  
493 Y Offset.
494  
495 For a non-billboard surface attached to an entity, this attribute specifies the
496 distance along the entity's Y axis from the entity's reference point to the
497 center of the surface (see CIGI ICD Section 3.4.4.1).
498  
499 For a billboard surface attached to an entity, this attribute specifies the
500 distance along the surface's Y axis from the center of the surface to the
501 entity's reference point (see CIGI ICD Section 3.4.4.2).
502  
503 =cut
504  
505 2 ▶sub y_offset() {
Subroutine y_offset: called CC=2 SCAR=7.0
Pod documented
506 2 my ($self,$nv) = @_;
507 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
508 2 $self->{'yOffset'} = $nv;
509 }
510 2 return $self->{'yOffset'};
511 }
512  
513 #==============================================================================
514  
515 =item sub right([$newValue])
516  
517 $value = $sym_surf->right($newValue);
518  
519 Right.
520  
521 For a surface attached to a view, this attribute specifies the distance from
522 the left edge of the viewport to the surface's rightmost boundary as a fraction
523 of the viewport's width (see CIGI ICD Section 3.4.4.3).
524  
525 =cut
526  
527 2 ▶sub right() {
Subroutine right: called CC=2 SCAR=7.0
Pod documented
528 2 my ($self,$nv) = @_;
529 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
530 2 $self->{'right'} = $nv;
531 }
532 2 return $self->{'right'};
533 }
534  
535 #==============================================================================
536  
537 =item sub z_offset([$newValue])
538  
539 $value = $sym_surf->z_offset($newValue);
540  
541 Z Offset.
542  
543 For a non-billboard surface attached to an entity, this attribute specifies the
544 distance along the entity's Z axis from the entity's reference point to the
545 center of the surface (see CIGI ICD Section 3.4.4.1).
546  
547 For a billboard surface attached to an entity, this attribute specifies the
548 distance along the surface's Z axis from the center of the surface to the
549 entity's reference point (see CIGI ICD Section 3.4.4.2).
550  
551 =cut
552  
553 2 ▶sub z_offset() {
Subroutine z_offset: called CC=2 SCAR=7.0
Pod documented
554 2 my ($self,$nv) = @_;
555 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
556 2 $self->{'zOffset'} = $nv;
557 }
558 2 return $self->{'zOffset'};
559 }
560  
561 #==============================================================================
562  
563 =item sub top([$newValue])
564  
565 $value = $sym_surf->top($newValue);
566  
567 Top.
568  
569 For a surface attached to a view, this attribute specifies the distance from
570 the bottom edge of the viewport to the surface's topmost boundary as a fraction
571 of the viewport's height (see CIGI ICD Section 3.4.4.3).
572  
573 =cut
574  
575 2 ▶sub top() {
Subroutine top: called CC=2 SCAR=7.0
Pod documented
576 2 my ($self,$nv) = @_;
577 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
578 2 $self->{'top'} = $nv;
579 }
580 2 return $self->{'top'};
581 }
582  
583 #==============================================================================
584  
585 =item sub yaw([$newValue])
586  
587 $value = $sym_surf->yaw($newValue);
588  
589 Yaw.
590  
591 For a non-billboard surface attached to an entity, this attribute specifies a
592 rotation about the surface's Z axis as described in CIGI ICD Section 3.4.4.1
593  
594 For entity-attached billboard surfaces, this attribute is ignored.
595  
596 =cut
597  
598 2 ▶sub yaw() {
Subroutine yaw: called CC=2 SCAR=7.0
Pod documented
599 2 my ($self,$nv) = @_;
600 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
601 2 $self->{'yaw'} = $nv;
602 }
603 2 return $self->{'yaw'};
604 }
605  
606 #==============================================================================
607  
608 =item sub bottom([$newValue])
609  
610 $value = $sym_surf->bottom($newValue);
611  
612 Bottom.
613  
614 For a surface attached to a view, this attribute specifies the distance from
615 the bottom edge of the viewport to the surface's bottommost boundary as a
616 fraction of the viewport's height (see CIGI ICD Section 3.4.4.3).
617  
618 =cut
619  
620 2 ▶sub bottom() {
Subroutine bottom: called CC=2 SCAR=7.0
Pod documented
621 2 my ($self,$nv) = @_;
622 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
623 2 $self->{'bottom'} = $nv;
624 }
625 2 return $self->{'bottom'};
626 }
627  
628 #==============================================================================
629  
630 =item sub pitch([$newValue])
631  
632 $value = $sym_surf->pitch($newValue);
633  
634 Pitch.
635  
636 For a non-billboard surface attached to an entity, this attribute specifies a
637 rotation about the surface's Y axis as described in CIGI ICD Section 3.4.4.1
638  
639 For entity-attached billboard surfaces, this attribute is ignored.
640  
641 For a surface attached to a view, this attribute is ignored.
642  
643 =cut
644  
645 2 ▶sub pitch() {
Subroutine pitch: called CC=2 SCAR=7.0
Pod documented
646 2 my ($self,$nv) = @_;
647 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
648 2 $self->{'pitch'} = $nv;
649 }
650 2 return $self->{'pitch'};
651 }
652  
653 #==============================================================================
654  
655 =item sub roll([$newValue])
656  
657 $value = $sym_surf->roll($newValue);
658  
659 Roll.
660  
661 For a non-billboard surface attached to an entity, this attribute specifies a
662 rotation about the surface's X axis as described in SCIGI ICD ection 3.4.4.1
663  
664 For entity-attached billboard surfaces, this attribute is ignored.
665  
666 For a surface attached to a view, this attribute is ignored.
667  
668 =cut
669  
670 2 ▶sub roll() {
Subroutine roll: called CC=2 SCAR=7.0
Pod documented
671 2 my ($self,$nv) = @_;
672 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
673 2 $self->{'roll'} = $nv;
674 }
675 2 return $self->{'roll'};
676 }
677  
678 #==============================================================================
679  
680 =item sub width([$newValue])
681  
682 $value = $sym_surf->width($newValue);
683  
684 Width.
685  
686 If the surface is attached to an entity and is not a billboard, then this
687 attribute specifies the width of the surface in meters.
688  
689 If the surface is attached to an entity and is a billboard, and if Perspective
690 Growth Enable is set to Enabled (1), then this attribute specifies the width of
691 the surface in meters. The apparent size of the surface will depend upon the
692 distance to the surface from the eyepoint.
693  
694 If the surface is attached to an entity and is a billboard, and if Perspective
695 Growth Enable is set to Disabled (0), then this attribute specifies the width
696 as a view arc and the occupied view space remains constant regardless of the
697 surface's distance from the eyepoint.
698  
699 If the surface is attached to a view, this attribute is ignored.
700  
701 =cut
702  
703 2 ▶sub width() {
Subroutine width: called CC=2 SCAR=7.0
Pod documented
704 2 my ($self,$nv) = @_;
705 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
706 2 $self->{'width'} = $nv;
707 }
708 2 return $self->{'width'};
709 }
710  
711 #==============================================================================
712  
713 =item sub height([$newValue])
714  
715 $value = $sym_surf->height($newValue);
716  
717 Height.
718  
719 If the surface is attached to an entity and is not a billboard, then this
720 attribute specifies the width of the surface in meters.
721  
722 If the surface is attached to an entity and is a billboard, and if Perspective
723 Growth Enable is set to Enabled (1), then this attribute specifies the width of
724 the surface in meters. The apparent size of the surface will depend upon the
725 distance to the surface from the eyepoint.
726  
727 If the surface is attached to an entity and is a billboard, and if Perspective
728 Growth Enable is set to Disabled (0), then this attribute specifies the width
729 as a view arc and the occupied view space remains constant regardless of the
730 surface's distance from the eyepoint.
731  
732 If the surface is attached to a view, this attribute is ignored.
733  
734 =cut
735  
736 2 ▶sub height() {
Subroutine height: called CC=2 SCAR=7.0
Pod documented
737 2 my ($self,$nv) = @_;
738 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
739 2 $self->{'height'} = $nv;
740 }
741 2 return $self->{'height'};
742 }
743  
744 #==============================================================================
745  
746 =item sub min_u([$newValue])
747  
748 $value = $sym_surf->min_u($newValue);
749  
750 Min U.
751  
752 This attribute specifies the minimum U coordinate of the symbol surface's
753 viewable area. In other words, this attribute specifies the U coordinate that
754 will correspond to the leftmost boundary of the symbol surface.
755  
756 Symbol surface 2D coordinate systems and horizontal units are described in CIGI
757 ICD Section 3.4.5.1.
758  
759 =cut
760  
761 2 ▶sub min_u() {
Subroutine min_u: called CC=2 SCAR=7.0
Pod documented
762 2 my ($self,$nv) = @_;
763 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
764 2 $self->{'minU'} = $nv;
765 }
766 2 return $self->{'minU'};
767 }
768  
769 #==============================================================================
770  
771 =item sub max_u([$newValue])
772  
773 $value = $sym_surf->max_u($newValue);
774  
775 Max U.
776  
777 This attribute specifies the maximum U coordinate of the symbol surface's
778 viewable area. In other words, this attribute specifies the U coordinate that
779 will correspond to the rightmost boundary of the symbol surface.
780  
781 Symbol surface 2D coordinate systems and horizontal units are described in CIGI
782 ICD Section 3.4.5.1.
783  
784 =cut
785  
786 2 ▶sub max_u() {
Subroutine max_u: called CC=2 SCAR=7.0
Pod documented
787 2 my ($self,$nv) = @_;
788 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
789 2 $self->{'maxU'} = $nv;
790 }
791 2 return $self->{'maxU'};
792 }
793  
794 #==============================================================================
795  
796 =item sub min_v([$newValue])
797  
798 $value = $sym_surf->min_v($newValue);
799  
800 Min V.
801  
802 This attribute specifies the minimum V coordinate of the symbol surface's
803 viewable area. In other words, this attribute specifies the U coordinate that
804 will correspond to the bottommost boundary of the symbol surface.
805  
806 Symbol surface 2D coordinate systems and vertical units are described in CIGI
807 ICD Section 3.4.5.1.
808  
809 =cut
810  
811 2 ▶sub min_v() {
Subroutine min_v: called CC=2 SCAR=7.0
Pod documented
812 2 my ($self,$nv) = @_;
813 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
814 2 $self->{'minV'} = $nv;
815 }
816 2 return $self->{'minV'};
817 }
818  
819 #==============================================================================
820  
821 =item sub max_v([$newValue])
822  
823 $value = $sym_surf->max_v($newValue);
824  
825 Max V.
826  
827 This attribute specifies the maximum V coordinate of the symbol surface's
828 viewable area. In other words, this attribute specifies the U coordinate that
829 will correspond to the topmost boundary of the symbol surface.
830  
831 Symbol surface 2D coordinate systems and vertical units are described in CIGI
832 ICD Section 3.4.5.1.
833  
834 =cut
835  
836 2 ▶sub max_v() {
Subroutine max_v: called CC=2 SCAR=7.0
Pod documented
837 2 my ($self,$nv) = @_;
838 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
839 2 $self->{'maxV'} = $nv;
840 }
841 2 return $self->{'maxV'};
842 }
843  
844 #==========================================================================
845  
846 =item sub pack()
847  
848 $value = $sym_surf->pack();
849  
850 Returns the packed data packet.
851  
852 =cut
853  
854 2 ▶sub pack($) {
Subroutine pack: called CC=1 SCAR=0.0
Pod documented
855 2 my $self = shift ;
856
857 $self->{'_Buffer'} = CORE::pack($self->{'_Pack'},
858 $self->{'packetType'},
859 $self->{'packetSize'},
860 $self->{'surfaceIdent'},
861 $self->{'_bitfields1'}, # Includes bitfields unused51, perspectiveGrowthEnable, billboard, attachType, and surfaceState.
862 $self->{'_unused52'},
863 $self->{'entityIdent_viewIdent'},
864 $self->{'xOffset_left'},
865 $self->{'yOffset_right'},
866 $self->{'zOffset_top'},
867 $self->{'yaw_bottom'},
868 $self->{'pitch'},
869 $self->{'roll'},
870 $self->{'width'},
871 $self->{'height'},
872 $self->{'minU'},
873 $self->{'maxU'},
874 $self->{'minV'},
875 2 $self->{'maxV'},
876 );
877  
878 2 return $self->{'_Buffer'};
879 }
880  
881 #==========================================================================
882  
883 =item sub unpack()
884  
885 $value = $sym_surf->unpack();
886  
887 Unpacks the packed data packet.
888  
889 =cut
890  
891 0 ▶sub unpack($) {
Subroutine unpack: not called CC=2 SCAR=17.9
Pod documented
892 0 my $self = shift @_;
893
894 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
895 0 $self->{'_Buffer'} = shift @_;
896 }
897 0 my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'});
898 0 $self->{'packetType'} = $a;
899 0 $self->{'packetSize'} = $b;
900 0 $self->{'surfaceIdent'} = $c;
901 0 $self->{'_bitfields1'} = $d; # Includes bitfields unused51, perspectiveGrowthEnable, billboard, attachType, and surfaceState.
902 0 $self->{'_unused52'} = $e;
903 0 $self->{'entityIdent_viewIdent'} = $f;
904 0 $self->{'xOffset_left'} = $g;
905 0 $self->{'yOffset_right'} = $h;
906 0 $self->{'zOffset_top'} = $i;
907 0 $self->{'yaw_bottom'} = $j;
908 0 $self->{'pitch'} = $k;
909 0 $self->{'roll'} = $l;
910 0 $self->{'width'} = $m;
911 0 $self->{'height'} = $n;
912 0 $self->{'minU'} = $o;
913 0 $self->{'maxU'} = $p;
914 0 $self->{'minV'} = $q;
915 0 $self->{'maxV'} = $r;
916  
917 0 $self->{'perspectiveGrowthEnable'} = $self->perspective_growth_enable();
918 0 $self->{'billboard'} = $self->billboard();
919 0 $self->{'attachType'} = $self->attach_type();
920 0 $self->{'surfaceState'} = $self->surface_state();
921  
922 0 return $self->{'_Buffer'};
923 }
924  
925 #==========================================================================
926  
927 =item sub byte_swap()
928  
929 $obj_name->byte_swap();
930  
931 Byte swaps the packed data packet.
932  
933 =cut
934  
935 0 ▶sub byte_swap($) {
Subroutine byte_swap: not called CC=2 SCAR=17.9
Pod documented
936 0 my $self = shift @_;
937
938 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
939 0 $self->{'_Buffer'} = shift @_;
940 } else {
941 0 $self->pack();
942 }
943 0 my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'});
944  
945 0 $self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r);
946 0 $self->unpack();
947  
948 0 return $self->{'_Buffer'};
949 }
950  
951 2 1;
952 __END__
« CIGIPP/LineOfSightExtendedResponse.pm ↑ Summary