line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Rinchi Common Image Generator Interface for Perl |
3
|
|
|
|
|
|
|
# Class Identifier: f78aeac0-200e-11de-bdb5-001c25551abc |
4
|
|
|
|
|
|
|
# Author: Brian M. Ames |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Rinchi::CIGIPP::ViewDefinition; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
25
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
127
|
|
10
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
11
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
211
|
|
12
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3303
|
|
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::ViewDefinition - Perl extension for the Common Image Generator |
42
|
|
|
|
|
|
|
Interface - View Definition data packet. |
43
|
|
|
|
|
|
|
data packet. |
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Rinchi::CIGIPP::ViewDefinition; |
47
|
|
|
|
|
|
|
my $view_def = Rinchi::CIGIPP::ViewDefinition->new(); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$packet_type = $view_def->packet_type(); |
50
|
|
|
|
|
|
|
$packet_size = $view_def->packet_size(); |
51
|
|
|
|
|
|
|
$view_ident = $view_def->view_ident(6573); |
52
|
|
|
|
|
|
|
$group_ident = $view_def->group_ident(45); |
53
|
|
|
|
|
|
|
$mirror_mode = $view_def->mirror_mode(Rinchi::CIGIPP->None); |
54
|
|
|
|
|
|
|
$bottom_enable = $view_def->bottom_enable(Rinchi::CIGIPP->Disable); |
55
|
|
|
|
|
|
|
$top_enable = $view_def->top_enable(Rinchi::CIGIPP->Disable); |
56
|
|
|
|
|
|
|
$right_enable = $view_def->right_enable(Rinchi::CIGIPP->Disable); |
57
|
|
|
|
|
|
|
$left_enable = $view_def->left_enable(Rinchi::CIGIPP->Disable); |
58
|
|
|
|
|
|
|
$far_enable = $view_def->far_enable(Rinchi::CIGIPP->Disable); |
59
|
|
|
|
|
|
|
$near_enable = $view_def->near_enable(Rinchi::CIGIPP->Disable); |
60
|
|
|
|
|
|
|
$view_type = $view_def->view_type(2); |
61
|
|
|
|
|
|
|
$reorder = $view_def->reorder(Rinchi::CIGIPP->NoReorder); |
62
|
|
|
|
|
|
|
$projection_type = $view_def->projection_type(Rinchi::CIGIPP->Perspective); |
63
|
|
|
|
|
|
|
$pixel_replication_mode = $view_def->pixel_replication_mode(Rinchi::CIGIPP->None); |
64
|
|
|
|
|
|
|
$near = $view_def->near(36.544); |
65
|
|
|
|
|
|
|
$far = $view_def->far(79.657); |
66
|
|
|
|
|
|
|
$left = $view_def->left(8.335); |
67
|
|
|
|
|
|
|
$right = $view_def->right(1.447); |
68
|
|
|
|
|
|
|
$top = $view_def->top(12.453); |
69
|
|
|
|
|
|
|
$bottom = $view_def->bottom(36.497); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 DESCRIPTION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
The View Definition packet allows the Host to override the IG's default |
74
|
|
|
|
|
|
|
configuration for a view. This packet is used to specify the projection type, |
75
|
|
|
|
|
|
|
to define the size of the viewing volume, and to assign the view to a view |
76
|
|
|
|
|
|
|
group. Refer to Section 3.2 of the CIGI ICD for details on these view characteristics. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 EXPORT |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
None by default. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#============================================================================== |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item new $view_def = Rinchi::CIGIPP::ViewDefinition->new() |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Constructor for Rinchi::ViewDefinition. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub new { |
91
|
1
|
|
|
1
|
1
|
222
|
my $class = shift; |
92
|
1
|
|
33
|
|
|
9
|
$class = ref($class) || $class; |
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
36
|
my $self = { |
95
|
|
|
|
|
|
|
'_Buffer' => '', |
96
|
|
|
|
|
|
|
'_ClassIdent' => 'f78aeac0-200e-11de-bdb5-001c25551abc', |
97
|
|
|
|
|
|
|
'_Pack' => 'CCSCCCCffffff', |
98
|
|
|
|
|
|
|
'_Swap1' => 'CCvCCCCVVVVVV', |
99
|
|
|
|
|
|
|
'_Swap2' => 'CCnCCCCNNNNNN', |
100
|
|
|
|
|
|
|
'packetType' => 21, |
101
|
|
|
|
|
|
|
'packetSize' => 32, |
102
|
|
|
|
|
|
|
'viewIdent' => 0, |
103
|
|
|
|
|
|
|
'groupIdent' => 0, |
104
|
|
|
|
|
|
|
'_bitfields1' => 0, # Includes bitfields mirrorMode, bottomEnable, topEnable, rightEnable, leftEnable, farEnable, and nearEnable. |
105
|
|
|
|
|
|
|
'mirrorMode' => 0, |
106
|
|
|
|
|
|
|
'bottomEnable' => 0, |
107
|
|
|
|
|
|
|
'topEnable' => 0, |
108
|
|
|
|
|
|
|
'rightEnable' => 0, |
109
|
|
|
|
|
|
|
'leftEnable' => 0, |
110
|
|
|
|
|
|
|
'farEnable' => 0, |
111
|
|
|
|
|
|
|
'nearEnable' => 0, |
112
|
|
|
|
|
|
|
'_bitfields2' => 0, # Includes bitfields viewType, reorder, projectionType, and pixelReplicationMode. |
113
|
|
|
|
|
|
|
'viewType' => 0, |
114
|
|
|
|
|
|
|
'reorder' => 0, |
115
|
|
|
|
|
|
|
'projectionType' => 0, |
116
|
|
|
|
|
|
|
'pixelReplicationMode' => 0, |
117
|
|
|
|
|
|
|
'_unused34' => 0, |
118
|
|
|
|
|
|
|
'near' => 0, |
119
|
|
|
|
|
|
|
'far' => 0, |
120
|
|
|
|
|
|
|
'left' => 0, |
121
|
|
|
|
|
|
|
'right' => 0, |
122
|
|
|
|
|
|
|
'top' => 0, |
123
|
|
|
|
|
|
|
'bottom' => 0, |
124
|
|
|
|
|
|
|
}; |
125
|
|
|
|
|
|
|
|
126
|
1
|
50
|
|
|
|
7
|
if (@_) { |
127
|
0
|
0
|
|
|
|
0
|
if (ref($_[0]) eq 'ARRAY') { |
|
|
0
|
|
|
|
|
|
128
|
0
|
|
|
|
|
0
|
$self->{'_Buffer'} = $_[0][0]; |
129
|
|
|
|
|
|
|
} elsif (ref($_[0]) eq 'HASH') { |
130
|
0
|
|
|
|
|
0
|
foreach my $attr (keys %{$_[0]}) { |
|
0
|
|
|
|
|
0
|
|
131
|
0
|
0
|
|
|
|
0
|
$self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
1
|
|
|
|
|
3
|
bless($self,$class); |
137
|
1
|
|
|
|
|
3
|
return $self; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
#============================================================================== |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=item sub packet_type() |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
$value = $view_def->packet_type(); |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Data Packet Identifier. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
This attribute identifies this data packet as the View Definition packet. The |
149
|
|
|
|
|
|
|
value of this attribute must be 21. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=cut |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub packet_type() { |
154
|
1
|
|
|
1
|
1
|
8
|
my ($self) = @_; |
155
|
1
|
|
|
|
|
8
|
return $self->{'packetType'}; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
#============================================================================== |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item sub packet_size() |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
$value = $view_def->packet_size(); |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Data Packet Size. |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
This attribute indicates the number of bytes in this data packet. The value of |
167
|
|
|
|
|
|
|
this attribute must be 32. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=cut |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub packet_size() { |
172
|
1
|
|
|
1
|
1
|
9
|
my ($self) = @_; |
173
|
1
|
|
|
|
|
3
|
return $self->{'packetSize'}; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
#============================================================================== |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=item sub view_ident([$newValue]) |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
$value = $view_def->view_ident($newValue); |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
View ID. |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
This attribute specifies the view to which the data in this packet will be applied. |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub view_ident() { |
189
|
1
|
|
|
1
|
1
|
7
|
my ($self,$nv) = @_; |
190
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
191
|
1
|
|
|
|
|
3
|
$self->{'viewIdent'} = $nv; |
192
|
|
|
|
|
|
|
} |
193
|
1
|
|
|
|
|
3
|
return $self->{'viewIdent'}; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
#============================================================================== |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=item sub group_ident([$newValue]) |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
$value = $view_def->group_ident($newValue); |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Group ID. |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
This attribute specifies the group to which the view is to be assigned. If this |
205
|
|
|
|
|
|
|
value is zero (0), the view is not assigned to a group. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=cut |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
sub group_ident() { |
210
|
1
|
|
|
1
|
1
|
9
|
my ($self,$nv) = @_; |
211
|
1
|
50
|
|
|
|
6
|
if (defined($nv)) { |
212
|
1
|
|
|
|
|
5
|
$self->{'groupIdent'} = $nv; |
213
|
|
|
|
|
|
|
} |
214
|
1
|
|
|
|
|
3
|
return $self->{'groupIdent'}; |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
#============================================================================== |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=item sub mirror_mode([$newValue]) |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
$value = $view_def->mirror_mode($newValue); |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
Mirror Mode. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
This attribute specifies the mirroring function to be performed on the view. |
226
|
|
|
|
|
|
|
This feature is typically used to replicate the view of a mirrored surface such |
227
|
|
|
|
|
|
|
as a rear view mirror. |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
None 0 |
230
|
|
|
|
|
|
|
Horizontal 1 |
231
|
|
|
|
|
|
|
Vertical 2 |
232
|
|
|
|
|
|
|
HorizontalAndVertical 3 |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=cut |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub mirror_mode() { |
237
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
238
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
239
|
1
|
50
|
33
|
|
|
7
|
if (($nv==0) or ($nv==1) or ($nv==2) or ($nv==3)) { |
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
240
|
1
|
|
|
|
|
3
|
$self->{'mirrorMode'} = $nv; |
241
|
1
|
|
|
|
|
88
|
$self->{'_bitfields1'} |= ($nv << 6) &0xC0; |
242
|
|
|
|
|
|
|
} else { |
243
|
0
|
|
|
|
|
0
|
carp "mirror_mode must be 0 (None), 1 (Horizontal), 2 (Vertical), or 3 (HorizontalAndVertical)."; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
} |
246
|
1
|
|
|
|
|
5
|
return (($self->{'_bitfields1'} & 0xC0) >> 6); |
247
|
|
|
|
|
|
|
} |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
#============================================================================== |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=item sub bottom_enable([$newValue]) |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
$value = $view_def->bottom_enable($newValue); |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Bottom Enable. |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
This attribute specifies whether the bottom half-angle of the view frustum will |
258
|
|
|
|
|
|
|
be set according to the value of the Bottom attribute within this packet. If |
259
|
|
|
|
|
|
|
this attribute is set to Disable (0), the Bottom attribute will be ignored. |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Disable 0 |
262
|
|
|
|
|
|
|
Enable 1 |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub bottom_enable() { |
267
|
1
|
|
|
1
|
1
|
4
|
my ($self,$nv) = @_; |
268
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
269
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
270
|
1
|
|
|
|
|
3
|
$self->{'bottomEnable'} = $nv; |
271
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 5) &0x20; |
272
|
|
|
|
|
|
|
} else { |
273
|
0
|
|
|
|
|
0
|
carp "bottom_enable must be 0 (Disable), or 1 (Enable)."; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} |
276
|
1
|
|
|
|
|
16
|
return (($self->{'_bitfields1'} & 0x20) >> 5); |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
#============================================================================== |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=item sub top_enable([$newValue]) |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
$value = $view_def->top_enable($newValue); |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
Top Enable. |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
This attribute specifies whether the top half-angle of the view frustum will be |
288
|
|
|
|
|
|
|
set according to the value of the Top attribute within this packet. If this |
289
|
|
|
|
|
|
|
attribute is set to Disable (0), the Top attribute will be ignored. |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Disable 0 |
292
|
|
|
|
|
|
|
Enable 1 |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=cut |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
sub top_enable() { |
297
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
298
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
299
|
1
|
50
|
33
|
|
|
13
|
if (($nv==0) or ($nv==1)) { |
300
|
1
|
|
|
|
|
3
|
$self->{'topEnable'} = $nv; |
301
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 4) &0x10; |
302
|
|
|
|
|
|
|
} else { |
303
|
0
|
|
|
|
|
0
|
carp "top_enable must be 0 (Disable), or 1 (Enable)."; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
} |
306
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x10) >> 4); |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
#============================================================================== |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=item sub right_enable([$newValue]) |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
$value = $view_def->right_enable($newValue); |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
Right Enable. |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
This attribute specifies whether the right half-angle of the view frustum will |
318
|
|
|
|
|
|
|
be set according to the value of the Right attribute within this packet. If |
319
|
|
|
|
|
|
|
this attribute is set to Disable (0), the Right attribute will be ignored. |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
Disable 0 |
322
|
|
|
|
|
|
|
Enable 1 |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=cut |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
sub right_enable() { |
327
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
328
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
329
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
330
|
1
|
|
|
|
|
4
|
$self->{'rightEnable'} = $nv; |
331
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 3) &0x08; |
332
|
|
|
|
|
|
|
} else { |
333
|
0
|
|
|
|
|
0
|
carp "right_enable must be 0 (Disable), or 1 (Enable)."; |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
} |
336
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields1'} & 0x08) >> 3); |
337
|
|
|
|
|
|
|
} |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
#============================================================================== |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=item sub left_enable([$newValue]) |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
$value = $view_def->left_enable($newValue); |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
Left Enable. |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
This attribute specifies whether the left half-angle of the view frustum will |
348
|
|
|
|
|
|
|
be set according to the value of the Left attribute within this packet. If this |
349
|
|
|
|
|
|
|
attribute is set to Disable (0), the Left attribute will be ignored. |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
Disable 0 |
352
|
|
|
|
|
|
|
Enable 1 |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=cut |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
sub left_enable() { |
357
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
358
|
1
|
50
|
|
|
|
12
|
if (defined($nv)) { |
359
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
360
|
1
|
|
|
|
|
3
|
$self->{'leftEnable'} = $nv; |
361
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= ($nv << 2) &0x04; |
362
|
|
|
|
|
|
|
} else { |
363
|
0
|
|
|
|
|
0
|
carp "left_enable must be 0 (Disable), or 1 (Enable)."; |
364
|
|
|
|
|
|
|
} |
365
|
|
|
|
|
|
|
} |
366
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields1'} & 0x04) >> 2); |
367
|
|
|
|
|
|
|
} |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
#============================================================================== |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
=item sub far_enable([$newValue]) |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
$value = $view_def->far_enable($newValue); |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
Far Enable. |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
This attribute specifies whether the far clipping plane will be set to the |
378
|
|
|
|
|
|
|
value of the Far attribute within this packet. If this attribute is set to |
379
|
|
|
|
|
|
|
Disable (0), the Far attribute will be ignored. |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
Disable 0 |
382
|
|
|
|
|
|
|
Enable 1 |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
=cut |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
sub far_enable() { |
387
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
388
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
389
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
390
|
1
|
|
|
|
|
4
|
$self->{'farEnable'} = $nv; |
391
|
1
|
|
|
|
|
2
|
$self->{'_bitfields1'} |= ($nv << 1) &0x02; |
392
|
|
|
|
|
|
|
} else { |
393
|
0
|
|
|
|
|
0
|
carp "far_enable must be 0 (Disable), or 1 (Enable)."; |
394
|
|
|
|
|
|
|
} |
395
|
|
|
|
|
|
|
} |
396
|
1
|
|
|
|
|
5
|
return (($self->{'_bitfields1'} & 0x02) >> 1); |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
#============================================================================== |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=item sub near_enable([$newValue]) |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
$value = $view_def->near_enable($newValue); |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Near Enable. |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
This attribute specifies whether the near clipping plane will be set to the |
408
|
|
|
|
|
|
|
value of the Near attribute within this packet. If this attribute is set to |
409
|
|
|
|
|
|
|
Disable (0), the Near attribute will be ignored. |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
Disable 0 |
412
|
|
|
|
|
|
|
Enable 1 |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=cut |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub near_enable() { |
417
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
418
|
1
|
50
|
|
|
|
4
|
if (defined($nv)) { |
419
|
1
|
50
|
33
|
|
|
7
|
if (($nv==0) or ($nv==1)) { |
420
|
1
|
|
|
|
|
3
|
$self->{'nearEnable'} = $nv; |
421
|
1
|
|
|
|
|
3
|
$self->{'_bitfields1'} |= $nv &0x01; |
422
|
|
|
|
|
|
|
} else { |
423
|
0
|
|
|
|
|
0
|
carp "near_enable must be 0 (Disable), or 1 (Enable)."; |
424
|
|
|
|
|
|
|
} |
425
|
|
|
|
|
|
|
} |
426
|
1
|
|
|
|
|
4
|
return ($self->{'_bitfields1'} & 0x01); |
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
#============================================================================== |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
=item sub view_type([$newValue]) |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
$value = $view_def->view_type($newValue); |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
View Type. |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
This attribute specifies an IG-defined type for the indicated view. For |
438
|
|
|
|
|
|
|
example, a Host might switch a view type from out-the-window to IR for a given channel. |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=cut |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
sub view_type() { |
443
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
444
|
1
|
50
|
|
|
|
11
|
if (defined($nv)) { |
445
|
1
|
50
|
33
|
|
|
20
|
if ($nv>=0 and $nv<=7 and int($nv) == $nv) { |
|
|
|
33
|
|
|
|
|
446
|
1
|
|
|
|
|
4
|
$self->{'viewType'} = $nv; |
447
|
1
|
|
|
|
|
3
|
$self->{'_bitfields2'} |= ($nv << 5) &0xE0; |
448
|
|
|
|
|
|
|
} else { |
449
|
0
|
|
|
|
|
0
|
carp "view_type must be an integer 0-7."; |
450
|
|
|
|
|
|
|
} |
451
|
|
|
|
|
|
|
} |
452
|
1
|
|
|
|
|
3
|
return (($self->{'_bitfields2'} & 0xE0) >> 5); |
453
|
|
|
|
|
|
|
} |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
#============================================================================== |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=item sub reorder([$newValue]) |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
$value = $view_def->reorder($newValue); |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
Reorder. |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
This attribute specifies whether the view should be moved to the top of any |
464
|
|
|
|
|
|
|
overlapping views. In cases where multiple overlapping views are moved to the |
465
|
|
|
|
|
|
|
top, the last view specified gets priority. |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
NoReorder 0 |
468
|
|
|
|
|
|
|
BringToTop 1 |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
=cut |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
sub reorder() { |
473
|
1
|
|
|
1
|
1
|
9
|
my ($self,$nv) = @_; |
474
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
475
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
476
|
1
|
|
|
|
|
3
|
$self->{'reorder'} = $nv; |
477
|
1
|
|
|
|
|
4
|
$self->{'_bitfields2'} |= ($nv << 4) &0x10; |
478
|
|
|
|
|
|
|
} else { |
479
|
0
|
|
|
|
|
0
|
carp "reorder must be 0 (NoReorder), or 1 (BringToTop)."; |
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
} |
482
|
1
|
|
|
|
|
5
|
return (($self->{'_bitfields2'} & 0x10) >> 4); |
483
|
|
|
|
|
|
|
} |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
#============================================================================== |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
=item sub projection_type([$newValue]) |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
$value = $view_def->projection_type($newValue); |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
Projection Type. |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
This attribute specifies whether the view projection should be perspective or |
494
|
|
|
|
|
|
|
orthographic parallel. |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
Perspective 0 |
497
|
|
|
|
|
|
|
OrthographicParallel 1 |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=cut |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
sub projection_type() { |
502
|
1
|
|
|
1
|
1
|
3
|
my ($self,$nv) = @_; |
503
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
504
|
1
|
50
|
33
|
|
|
6
|
if (($nv==0) or ($nv==1)) { |
505
|
1
|
|
|
|
|
3
|
$self->{'projectionType'} = $nv; |
506
|
1
|
|
|
|
|
3
|
$self->{'_bitfields2'} |= ($nv << 3) &0x08; |
507
|
|
|
|
|
|
|
} else { |
508
|
0
|
|
|
|
|
0
|
carp "projection_type must be 0 (Perspective), or 1 (OrthographicParallel)."; |
509
|
|
|
|
|
|
|
} |
510
|
|
|
|
|
|
|
} |
511
|
1
|
|
|
|
|
4
|
return (($self->{'_bitfields2'} & 0x08) >> 3); |
512
|
|
|
|
|
|
|
} |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
#============================================================================== |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
=item sub pixel_replication_mode([$newValue]) |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
$value = $view_def->pixel_replication_mode($newValue); |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
Pixel Replication Mode. |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
This attribute specifies the pixel replication function to be performed on the |
523
|
|
|
|
|
|
|
view. This feature is typically used in sensor applications to perform |
524
|
|
|
|
|
|
|
electronic zooming (i.e., pixel and line doubling). |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
None 0 |
527
|
|
|
|
|
|
|
Replicate1x2 1 |
528
|
|
|
|
|
|
|
Replicate2x1 2 |
529
|
|
|
|
|
|
|
Replicate2x2 3 |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
=cut |
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
sub pixel_replication_mode() { |
534
|
1
|
|
|
1
|
1
|
2
|
my ($self,$nv) = @_; |
535
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
536
|
1
|
50
|
33
|
|
|
8
|
if (($nv==0) or ($nv==1) or ($nv==2) or ($nv==3)) { |
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
537
|
1
|
|
|
|
|
3
|
$self->{'pixelReplicationMode'} = $nv; |
538
|
1
|
|
|
|
|
2
|
$self->{'_bitfields2'} |= $nv &0x07; |
539
|
|
|
|
|
|
|
} else { |
540
|
0
|
|
|
|
|
0
|
carp "pixel_replication_mode must be 0 (None), 1 (Replicate1x2), 2 (Replicate2x1), or 3 (Replicate2x2)."; |
541
|
|
|
|
|
|
|
} |
542
|
|
|
|
|
|
|
} |
543
|
1
|
|
|
|
|
4
|
return ($self->{'_bitfields2'} & 0x07); |
544
|
|
|
|
|
|
|
} |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
#============================================================================== |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
=item sub near([$newValue]) |
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
$value = $view_def->near($newValue); |
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
Near. |
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
This attribute specifies the position of the view's near clipping plane. This |
555
|
|
|
|
|
|
|
distance is measured along the viewing vector from the eyepoint to the plane. |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
=cut |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
sub near() { |
560
|
1
|
|
|
1
|
1
|
11
|
my ($self,$nv) = @_; |
561
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
562
|
1
|
|
|
|
|
4
|
$self->{'near'} = $nv; |
563
|
|
|
|
|
|
|
} |
564
|
1
|
|
|
|
|
4
|
return $self->{'near'}; |
565
|
|
|
|
|
|
|
} |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
#============================================================================== |
568
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
=item sub far([$newValue]) |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
$value = $view_def->far($newValue); |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
Far. |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
This attribute specifies the position of the view's far clipping plane. This |
576
|
|
|
|
|
|
|
distance is measured along the viewing vector from the eyepoint to the plane. |
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
=cut |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
sub far() { |
581
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
582
|
1
|
50
|
|
|
|
6
|
if (defined($nv)) { |
583
|
1
|
|
|
|
|
2
|
$self->{'far'} = $nv; |
584
|
|
|
|
|
|
|
} |
585
|
1
|
|
|
|
|
3
|
return $self->{'far'}; |
586
|
|
|
|
|
|
|
} |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
#============================================================================== |
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
=item sub left([$newValue]) |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
$value = $view_def->left($newValue); |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
Left. |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
This attribute specifies the left half-angle of the view frustum. This value is |
597
|
|
|
|
|
|
|
the measure of the angle formed at the view eyepoint between the viewing vector |
598
|
|
|
|
|
|
|
and the frustum side. |
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
=cut |
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
sub left() { |
603
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
604
|
1
|
50
|
|
|
|
3
|
if (defined($nv)) { |
605
|
1
|
|
|
|
|
2
|
$self->{'left'} = $nv; |
606
|
|
|
|
|
|
|
} |
607
|
1
|
|
|
|
|
4
|
return $self->{'left'}; |
608
|
|
|
|
|
|
|
} |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
#============================================================================== |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
=item sub right([$newValue]) |
613
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
$value = $view_def->right($newValue); |
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
Right. |
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
This attribute specifies the right half-angle of the view frustum. This value |
619
|
|
|
|
|
|
|
is the measure of the angle formed at the view eyepoint between the viewing |
620
|
|
|
|
|
|
|
vector and the frustum side. |
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
=cut |
623
|
|
|
|
|
|
|
|
624
|
|
|
|
|
|
|
sub right() { |
625
|
1
|
|
|
1
|
1
|
7
|
my ($self,$nv) = @_; |
626
|
1
|
50
|
|
|
|
11
|
if (defined($nv)) { |
627
|
1
|
|
|
|
|
3
|
$self->{'right'} = $nv; |
628
|
|
|
|
|
|
|
} |
629
|
1
|
|
|
|
|
5
|
return $self->{'right'}; |
630
|
|
|
|
|
|
|
} |
631
|
|
|
|
|
|
|
|
632
|
|
|
|
|
|
|
#============================================================================== |
633
|
|
|
|
|
|
|
|
634
|
|
|
|
|
|
|
=item sub top([$newValue]) |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
$value = $view_def->top($newValue); |
637
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
Top. |
639
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
This attribute specifies the top half-angle of the view frustum. This value is |
641
|
|
|
|
|
|
|
the measure of the angle formed at the view eyepoint between the viewing vector |
642
|
|
|
|
|
|
|
and the frustum side. |
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
=cut |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
sub top() { |
647
|
1
|
|
|
1
|
1
|
6
|
my ($self,$nv) = @_; |
648
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
649
|
1
|
|
|
|
|
3
|
$self->{'top'} = $nv; |
650
|
|
|
|
|
|
|
} |
651
|
1
|
|
|
|
|
3
|
return $self->{'top'}; |
652
|
|
|
|
|
|
|
} |
653
|
|
|
|
|
|
|
|
654
|
|
|
|
|
|
|
#============================================================================== |
655
|
|
|
|
|
|
|
|
656
|
|
|
|
|
|
|
=item sub bottom([$newValue]) |
657
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
$value = $view_def->bottom($newValue); |
659
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
Bottom. |
661
|
|
|
|
|
|
|
|
662
|
|
|
|
|
|
|
This attribute specifies the bottom half-angle of the view frustum. This value |
663
|
|
|
|
|
|
|
is the measure of the angle formed at the view eyepoint between the viewing |
664
|
|
|
|
|
|
|
vector and the frustum side. |
665
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
=cut |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
sub bottom() { |
669
|
1
|
|
|
1
|
1
|
5
|
my ($self,$nv) = @_; |
670
|
1
|
50
|
|
|
|
5
|
if (defined($nv)) { |
671
|
1
|
|
|
|
|
3
|
$self->{'bottom'} = $nv; |
672
|
|
|
|
|
|
|
} |
673
|
1
|
|
|
|
|
4
|
return $self->{'bottom'}; |
674
|
|
|
|
|
|
|
} |
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
#========================================================================== |
677
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
=item sub pack() |
679
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
$value = $view_def->pack(); |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
Returns the packed data packet. |
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
=cut |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
sub pack($) { |
687
|
1
|
|
|
1
|
1
|
5
|
my $self = shift ; |
688
|
|
|
|
|
|
|
|
689
|
1
|
|
|
|
|
9
|
$self->{'_Buffer'} = CORE::pack($self->{'_Pack'}, |
690
|
|
|
|
|
|
|
$self->{'packetType'}, |
691
|
|
|
|
|
|
|
$self->{'packetSize'}, |
692
|
|
|
|
|
|
|
$self->{'viewIdent'}, |
693
|
|
|
|
|
|
|
$self->{'groupIdent'}, |
694
|
|
|
|
|
|
|
$self->{'_bitfields1'}, # Includes bitfields mirrorMode, bottomEnable, topEnable, rightEnable, leftEnable, farEnable, and nearEnable. |
695
|
|
|
|
|
|
|
$self->{'_bitfields2'}, # Includes bitfields viewType, reorder, projectionType, and pixelReplicationMode. |
696
|
|
|
|
|
|
|
$self->{'_unused34'}, |
697
|
|
|
|
|
|
|
$self->{'near'}, |
698
|
|
|
|
|
|
|
$self->{'far'}, |
699
|
|
|
|
|
|
|
$self->{'left'}, |
700
|
|
|
|
|
|
|
$self->{'right'}, |
701
|
|
|
|
|
|
|
$self->{'top'}, |
702
|
|
|
|
|
|
|
$self->{'bottom'}, |
703
|
|
|
|
|
|
|
); |
704
|
|
|
|
|
|
|
|
705
|
1
|
|
|
|
|
4
|
return $self->{'_Buffer'}; |
706
|
|
|
|
|
|
|
} |
707
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
#========================================================================== |
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
=item sub unpack() |
711
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
$value = $view_def->unpack(); |
713
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
Unpacks the packed data packet. |
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
=cut |
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
sub unpack($) { |
719
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
720
|
|
|
|
|
|
|
|
721
|
0
|
0
|
|
|
|
|
if (@_) { |
722
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
723
|
|
|
|
|
|
|
} |
724
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'}); |
725
|
0
|
|
|
|
|
|
$self->{'packetType'} = $a; |
726
|
0
|
|
|
|
|
|
$self->{'packetSize'} = $b; |
727
|
0
|
|
|
|
|
|
$self->{'viewIdent'} = $c; |
728
|
0
|
|
|
|
|
|
$self->{'groupIdent'} = $d; |
729
|
0
|
|
|
|
|
|
$self->{'_bitfields1'} = $e; # Includes bitfields mirrorMode, bottomEnable, topEnable, rightEnable, leftEnable, farEnable, and nearEnable. |
730
|
0
|
|
|
|
|
|
$self->{'_bitfields2'} = $f; # Includes bitfields viewType, reorder, projectionType, and pixelReplicationMode. |
731
|
0
|
|
|
|
|
|
$self->{'_unused34'} = $g; |
732
|
0
|
|
|
|
|
|
$self->{'near'} = $h; |
733
|
0
|
|
|
|
|
|
$self->{'far'} = $i; |
734
|
0
|
|
|
|
|
|
$self->{'left'} = $j; |
735
|
0
|
|
|
|
|
|
$self->{'right'} = $k; |
736
|
0
|
|
|
|
|
|
$self->{'top'} = $l; |
737
|
0
|
|
|
|
|
|
$self->{'bottom'} = $m; |
738
|
|
|
|
|
|
|
|
739
|
0
|
|
|
|
|
|
$self->{'mirrorMode'} = $self->mirror_mode(); |
740
|
0
|
|
|
|
|
|
$self->{'bottomEnable'} = $self->bottom_enable(); |
741
|
0
|
|
|
|
|
|
$self->{'topEnable'} = $self->top_enable(); |
742
|
0
|
|
|
|
|
|
$self->{'rightEnable'} = $self->right_enable(); |
743
|
0
|
|
|
|
|
|
$self->{'leftEnable'} = $self->left_enable(); |
744
|
0
|
|
|
|
|
|
$self->{'farEnable'} = $self->far_enable(); |
745
|
0
|
|
|
|
|
|
$self->{'nearEnable'} = $self->near_enable(); |
746
|
0
|
|
|
|
|
|
$self->{'viewType'} = $self->view_type(); |
747
|
0
|
|
|
|
|
|
$self->{'reorder'} = $self->reorder(); |
748
|
0
|
|
|
|
|
|
$self->{'projectionType'} = $self->projection_type(); |
749
|
0
|
|
|
|
|
|
$self->{'pixelReplicationMode'} = $self->pixel_replication_mode(); |
750
|
|
|
|
|
|
|
|
751
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
752
|
|
|
|
|
|
|
} |
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
#========================================================================== |
755
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
=item sub byte_swap() |
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
$obj_name->byte_swap(); |
759
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
Byte swaps the packed data packet. |
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
=cut |
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
sub byte_swap($) { |
765
|
0
|
|
|
0
|
1
|
|
my $self = shift @_; |
766
|
|
|
|
|
|
|
|
767
|
0
|
0
|
|
|
|
|
if (@_) { |
768
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = shift @_; |
769
|
|
|
|
|
|
|
} else { |
770
|
0
|
|
|
|
|
|
$self->pack(); |
771
|
|
|
|
|
|
|
} |
772
|
0
|
|
|
|
|
|
my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'}); |
773
|
|
|
|
|
|
|
|
774
|
0
|
|
|
|
|
|
$self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m); |
775
|
0
|
|
|
|
|
|
$self->unpack(); |
776
|
|
|
|
|
|
|
|
777
|
0
|
|
|
|
|
|
return $self->{'_Buffer'}; |
778
|
|
|
|
|
|
|
} |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
1; |
781
|
|
|
|
|
|
|
__END__ |