origami-docspring 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/examples/attachments/attachment.rb +7 -8
  4. data/examples/attachments/nested_document.rb +6 -5
  5. data/examples/encryption/encryption.rb +5 -4
  6. data/examples/events/events.rb +7 -6
  7. data/examples/flash/flash.rb +10 -9
  8. data/examples/forms/javascript.rb +14 -13
  9. data/examples/forms/xfa.rb +67 -66
  10. data/examples/javascript/hello_world.rb +6 -5
  11. data/examples/javascript/js_emulation.rb +26 -26
  12. data/examples/loop/goto.rb +12 -11
  13. data/examples/loop/named.rb +17 -16
  14. data/examples/signature/signature.rb +11 -11
  15. data/examples/uri/javascript.rb +25 -24
  16. data/examples/uri/open-uri.rb +5 -4
  17. data/examples/uri/submitform.rb +11 -10
  18. data/lib/origami/3d.rb +330 -334
  19. data/lib/origami/acroform.rb +267 -268
  20. data/lib/origami/actions.rb +266 -278
  21. data/lib/origami/annotations.rb +659 -670
  22. data/lib/origami/array.rb +192 -196
  23. data/lib/origami/boolean.rb +66 -70
  24. data/lib/origami/catalog.rb +360 -363
  25. data/lib/origami/collections.rb +132 -133
  26. data/lib/origami/compound.rb +125 -129
  27. data/lib/origami/destinations.rb +226 -237
  28. data/lib/origami/dictionary.rb +155 -154
  29. data/lib/origami/encryption.rb +967 -923
  30. data/lib/origami/extensions/fdf.rb +270 -275
  31. data/lib/origami/extensions/ppklite.rb +323 -328
  32. data/lib/origami/filespec.rb +170 -173
  33. data/lib/origami/filters/ascii.rb +162 -167
  34. data/lib/origami/filters/ccitt/tables.rb +248 -252
  35. data/lib/origami/filters/ccitt.rb +309 -312
  36. data/lib/origami/filters/crypt.rb +31 -34
  37. data/lib/origami/filters/dct.rb +47 -50
  38. data/lib/origami/filters/flate.rb +57 -60
  39. data/lib/origami/filters/jbig2.rb +50 -53
  40. data/lib/origami/filters/jpx.rb +40 -43
  41. data/lib/origami/filters/lzw.rb +151 -155
  42. data/lib/origami/filters/predictors.rb +250 -255
  43. data/lib/origami/filters/runlength.rb +111 -115
  44. data/lib/origami/filters.rb +319 -325
  45. data/lib/origami/font.rb +173 -177
  46. data/lib/origami/functions.rb +62 -66
  47. data/lib/origami/graphics/colors.rb +203 -208
  48. data/lib/origami/graphics/instruction.rb +79 -81
  49. data/lib/origami/graphics/path.rb +141 -144
  50. data/lib/origami/graphics/patterns.rb +156 -160
  51. data/lib/origami/graphics/render.rb +51 -47
  52. data/lib/origami/graphics/state.rb +144 -142
  53. data/lib/origami/graphics/text.rb +185 -188
  54. data/lib/origami/graphics/xobject.rb +818 -804
  55. data/lib/origami/graphics.rb +25 -26
  56. data/lib/origami/header.rb +63 -65
  57. data/lib/origami/javascript.rb +718 -651
  58. data/lib/origami/linearization.rb +284 -285
  59. data/lib/origami/metadata.rb +156 -135
  60. data/lib/origami/name.rb +98 -100
  61. data/lib/origami/null.rb +49 -51
  62. data/lib/origami/numeric.rb +133 -135
  63. data/lib/origami/obfuscation.rb +180 -182
  64. data/lib/origami/object.rb +634 -631
  65. data/lib/origami/optionalcontent.rb +147 -149
  66. data/lib/origami/outline.rb +46 -48
  67. data/lib/origami/outputintents.rb +76 -77
  68. data/lib/origami/page.rb +637 -596
  69. data/lib/origami/parser.rb +214 -221
  70. data/lib/origami/parsers/fdf.rb +44 -45
  71. data/lib/origami/parsers/pdf/lazy.rb +147 -154
  72. data/lib/origami/parsers/pdf/linear.rb +104 -109
  73. data/lib/origami/parsers/pdf.rb +109 -107
  74. data/lib/origami/parsers/ppklite.rb +44 -46
  75. data/lib/origami/pdf.rb +886 -896
  76. data/lib/origami/reference.rb +116 -120
  77. data/lib/origami/signature.rb +617 -625
  78. data/lib/origami/stream.rb +560 -558
  79. data/lib/origami/string.rb +366 -368
  80. data/lib/origami/template/patterns.rb +50 -52
  81. data/lib/origami/template/widgets.rb +111 -114
  82. data/lib/origami/trailer.rb +153 -157
  83. data/lib/origami/tree.rb +55 -57
  84. data/lib/origami/version.rb +19 -19
  85. data/lib/origami/webcapture.rb +87 -90
  86. data/lib/origami/xfa/config.rb +409 -414
  87. data/lib/origami/xfa/connectionset.rb +113 -117
  88. data/lib/origami/xfa/datasets.rb +38 -42
  89. data/lib/origami/xfa/localeset.rb +33 -37
  90. data/lib/origami/xfa/package.rb +49 -52
  91. data/lib/origami/xfa/pdf.rb +54 -59
  92. data/lib/origami/xfa/signature.rb +33 -37
  93. data/lib/origami/xfa/sourceset.rb +34 -38
  94. data/lib/origami/xfa/stylesheet.rb +35 -39
  95. data/lib/origami/xfa/template.rb +1630 -1634
  96. data/lib/origami/xfa/xdc.rb +33 -37
  97. data/lib/origami/xfa/xfa.rb +132 -123
  98. data/lib/origami/xfa/xfdf.rb +34 -38
  99. data/lib/origami/xfa/xmpmeta.rb +34 -38
  100. data/lib/origami/xfa.rb +50 -53
  101. data/lib/origami/xreftable.rb +462 -462
  102. data/lib/origami.rb +37 -38
  103. data/test/test_actions.rb +22 -20
  104. data/test/test_annotations.rb +54 -52
  105. data/test/test_forms.rb +23 -21
  106. data/test/test_native_types.rb +82 -78
  107. data/test/test_object_tree.rb +25 -24
  108. data/test/test_pages.rb +43 -41
  109. data/test/test_pdf.rb +2 -0
  110. data/test/test_pdf_attachment.rb +23 -21
  111. data/test/test_pdf_create.rb +16 -15
  112. data/test/test_pdf_encrypt.rb +69 -66
  113. data/test/test_pdf_parse.rb +131 -129
  114. data/test/test_pdf_parse_lazy.rb +53 -53
  115. data/test/test_pdf_sign.rb +67 -67
  116. data/test/test_streams.rb +145 -143
  117. data/test/test_xrefs.rb +46 -45
  118. metadata +64 -8
data/lib/origami/3d.rb CHANGED
@@ -1,364 +1,360 @@
1
- =begin
2
-
3
- This file is part of Origami, PDF manipulation framework for Ruby
4
- Copyright (C) 2016 Guillaume Delugré.
5
-
6
- Origami is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU Lesser General Public License as published by
8
- the Free Software Foundation, either version 3 of the License, or
9
- (at your option) any later version.
10
-
11
- Origami is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU Lesser General Public License for more details.
15
-
16
- You should have received a copy of the GNU Lesser General Public License
17
- along with Origami. If not, see <http://www.gnu.org/licenses/>.
18
-
19
- =end
1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # This file is part of Origami, PDF manipulation framework for Ruby
5
+ # Copyright (C) 2016 Guillaume Delugré.
6
+ #
7
+ # Origami is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Lesser General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # Origami is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public License
18
+ # along with Origami. If not, see <http://www.gnu.org/licenses/>.
19
+ #
20
20
 
21
21
  module Origami
22
+ class Projection3D < Dictionary
23
+ include StandardObject
22
24
 
23
- class Projection3D < Dictionary
24
- include StandardObject
25
-
26
- ORTHOGRAPHIC = :O
27
- PERSPECTIVE = :P
25
+ ORTHOGRAPHIC = :O
26
+ PERSPECTIVE = :P
28
27
 
29
- module ClippingStyles
30
- EXPLICIT_NEARFAR = :XNF
31
- AUTOMATIC_NEARFAR = :ANF
32
- end
33
-
34
- module Scaling
35
- WIDTH = :W
36
- HEIGHT = :H
37
- MINIMUM = :Min
38
- MAXIMUM = :Max
39
- ABSOLUTE = :Absolute
40
- end
41
-
42
- field :Subtype, :Type => Name, :Default => ORTHOGRAPHIC
43
- field :CS, :Type => Name, :Default => ClippingStyles::AUTOMATIC_NEARFAR
44
- field :F, :Type => Number
45
- field :N, :Type => Number
46
- field :FOV, :Type => Number
47
- field :PS, :Type => [ Number, Name ], :Default => Scaling::WIDTH
48
- field :OS, :Type => Number, :Default => 1
49
- field :OB, :Type => Name, :Version => "1.7", :Default => Scaling::ABSOLUTE
28
+ module ClippingStyles
29
+ EXPLICIT_NEARFAR = :XNF
30
+ AUTOMATIC_NEARFAR = :ANF
50
31
  end
51
32
 
52
- class Background3D < Dictionary
53
- include StandardObject
54
-
55
- field :Type, :Type => Name, :Default => :"3DBG"
56
- field :Subtype, :Type => Name, :Default => :SC
57
- field :CS, :Type => [ Name, Array ], :Default => Graphics::Color::Space::DEVICE_RGB
58
- field :C, :Type => Object, :Default => [ 1, 1, 1 ]
59
- field :EA, :Type => Boolean, :Default => false
33
+ module Scaling
34
+ WIDTH = :W
35
+ HEIGHT = :H
36
+ MINIMUM = :Min
37
+ MAXIMUM = :Max
38
+ ABSOLUTE = :Absolute
60
39
  end
61
40
 
62
- class RenderMode3D < Dictionary
63
- include StandardObject
64
-
65
- module Modes
66
- SOLID = :Solid
67
- SOLID_WIREFRAME = :SolidWireFrame
68
- TRANSPARENT = :Transparent
69
- TRANSPARENT_WIREFRAME = :TransparentWireFrame
70
- BOUNDINGBOX = :BoundingBox
71
- TRANSPARENT_BOUNDINGBOX = :TransparentBoundingBox
72
- TRANSPARENT_BOUNDINGBOX_OUTLINE = :TransparentBoundingBoxOutline
73
- WIREFRAME = :WireFrame
74
- SHADED_WIREFRAME = :ShadedWireFrame
75
- HIDDEN_WIREFRAME = :HiddenWireFrame
76
- VERTICES = :Vertices
77
- SHADED_VERTICES = :ShadedVertices
78
- ILLUSTRATION = :Illustration
79
- SOLID_OUTLINE = :SolidOutline
80
- SHADED_ILLUSTRATION = :ShadedIllustration
81
- end
82
-
83
- field :Type, :Type => Name, :Default => :"3DRenderMode"
84
- field :Subtype, :Type => Name, :Required => true, :Version => "1.7"
85
- field :AC, :Type => Array, :Default => [ Graphics::Color::Space::DEVICE_RGB, 0, 0, 0]
86
- field :BG, :Type => [ Name, Array ], :Default => :BG
87
- field :O, :Type => Number, :Default => 0.5
88
- field :CV, :Type => Number, :Default => 45
41
+ field :Subtype, Type: Name, Default: ORTHOGRAPHIC
42
+ field :CS, Type: Name, Default: ClippingStyles::AUTOMATIC_NEARFAR
43
+ field :F, Type: Number
44
+ field :N, Type: Number
45
+ field :FOV, Type: Number
46
+ field :PS, Type: [Number, Name], Default: Scaling::WIDTH
47
+ field :OS, Type: Number, Default: 1
48
+ field :OB, Type: Name, Version: "1.7", Default: Scaling::ABSOLUTE
49
+ end
50
+
51
+ class Background3D < Dictionary
52
+ include StandardObject
53
+
54
+ field :Type, Type: Name, Default: :'3DBG'
55
+ field :Subtype, Type: Name, Default: :SC
56
+ field :CS, Type: [Name, Array], Default: Graphics::Color::Space::DEVICE_RGB
57
+ field :C, Type: Object, Default: [1, 1, 1]
58
+ field :EA, Type: Boolean, Default: false
59
+ end
60
+
61
+ class RenderMode3D < Dictionary
62
+ include StandardObject
63
+
64
+ module Modes
65
+ SOLID = :Solid
66
+ SOLID_WIREFRAME = :SolidWireFrame
67
+ TRANSPARENT = :Transparent
68
+ TRANSPARENT_WIREFRAME = :TransparentWireFrame
69
+ BOUNDINGBOX = :BoundingBox
70
+ TRANSPARENT_BOUNDINGBOX = :TransparentBoundingBox
71
+ TRANSPARENT_BOUNDINGBOX_OUTLINE = :TransparentBoundingBoxOutline
72
+ WIREFRAME = :WireFrame
73
+ SHADED_WIREFRAME = :ShadedWireFrame
74
+ HIDDEN_WIREFRAME = :HiddenWireFrame
75
+ VERTICES = :Vertices
76
+ SHADED_VERTICES = :ShadedVertices
77
+ ILLUSTRATION = :Illustration
78
+ SOLID_OUTLINE = :SolidOutline
79
+ SHADED_ILLUSTRATION = :ShadedIllustration
89
80
  end
90
81
 
91
- class LightingScheme3D < Dictionary
92
- include StandardObject
93
-
94
- module Styles
95
- ARTWORK = :Artwork
96
- NONE = :None
97
- WHITE = :White
98
- DAY = :Day
99
- NIGHT = :Night
100
- HARD = :Hard
101
- PRIMARY = :Primary
102
- BLUE = :Blue
103
- RED = :Red
104
- CUBE = :Cube
105
- CAD = :CAD
106
- HEADLAMP = :HeadLamp
107
- end
108
-
109
- field :Type, :Type => Name, :Default => :"3DLightingScheme"
110
- field :Subtype, :Type => Name, :Version => "1.7", :Required => true
82
+ field :Type, Type: Name, Default: :'3DRenderMode'
83
+ field :Subtype, Type: Name, Required: true, Version: "1.7"
84
+ field :AC, Type: Array, Default: [Graphics::Color::Space::DEVICE_RGB, 0, 0, 0]
85
+ field :BG, Type: [Name, Array], Default: :BG
86
+ field :O, Type: Number, Default: 0.5
87
+ field :CV, Type: Number, Default: 45
88
+ end
89
+
90
+ class LightingScheme3D < Dictionary
91
+ include StandardObject
92
+
93
+ module Styles
94
+ ARTWORK = :Artwork
95
+ NONE = :None
96
+ WHITE = :White
97
+ DAY = :Day
98
+ NIGHT = :Night
99
+ HARD = :Hard
100
+ PRIMARY = :Primary
101
+ BLUE = :Blue
102
+ RED = :Red
103
+ CUBE = :Cube
104
+ CAD = :CAD
105
+ HEADLAMP = :HeadLamp
111
106
  end
112
107
 
113
- class CrossSection3D < Dictionary
114
- include StandardObject
115
-
116
- field :Type, :Type => Name, :Default => :"3DCrossSection"
117
- field :C, :Type => Array, :Default => [ 0, 0, 0 ]
118
- field :O, :Type => Array, :Version => "1.7", :Default => [ Null.new, 0, 0 ], :Required => true
119
- field :PO, :Type => Number, :Default => 0.5
120
- field :PC, :Type => Array, :Default => [ Graphics::Color::Space::DEVICE_RGB, 1, 1, 1 ]
121
- field :IV, :Type => Boolean, :Default => false
122
- field :IC, :Type => Array, :Default => [ Graphics::Color::Space::DEVICE_RGB, 0, 1 ,0]
108
+ field :Type, Type: Name, Default: :'3DLightingScheme'
109
+ field :Subtype, Type: Name, Version: "1.7", Required: true
110
+ end
111
+
112
+ class CrossSection3D < Dictionary
113
+ include StandardObject
114
+
115
+ field :Type, Type: Name, Default: :'3DCrossSection'
116
+ field :C, Type: Array, Default: [0, 0, 0]
117
+ field :O, Type: Array, Version: "1.7", Default: [Null.new, 0, 0], Required: true
118
+ field :PO, Type: Number, Default: 0.5
119
+ field :PC, Type: Array, Default: [Graphics::Color::Space::DEVICE_RGB, 1, 1, 1]
120
+ field :IV, Type: Boolean, Default: false
121
+ field :IC, Type: Array, Default: [Graphics::Color::Space::DEVICE_RGB, 0, 1, 0]
122
+ end
123
+
124
+ class Node3D < Dictionary
125
+ include StandardObject
126
+
127
+ field :Type, Type: Name, Default: :'3DNode'
128
+ field :N, Type: String, Version: "1.7", Required: true
129
+ field :O, Type: Number
130
+ field :V, Type: Boolean
131
+ field :M, Type: Array
132
+ end
133
+
134
+ class Measurement3D < Dictionary
135
+ include StandardObject
136
+
137
+ field :Type, Type: Name, Default: :'3DMeasure'
138
+ field :Subtype, Type: Name, Required: true
139
+ field :TRL, Type: String
140
+ end
141
+
142
+ class LinearDimensionMeasurement3D < Measurement3D
143
+ field :Subtype, Type: Name, Default: :L3D, Required: true
144
+ field :AP, Type: Array.of(Number, length: 3), Required: true
145
+ field :A1, Type: Array.of(Number, length: 3), Required: true
146
+ field :N1, Type: String
147
+ field :A2, Type: Array.of(Number, length: 3), Required: true
148
+ field :N2, Type: String
149
+ field :TP, Type: Array.of(Number, length: 3), Required: true
150
+ field :TY, Type: Array.of(Number, length: 3), Required: true
151
+ field :TS, Type: Number
152
+ field :C, Type: Array.of(Number, length: 3)
153
+ field :V, Type: Number, Required: true
154
+ field :U, Type: String, Required: true
155
+ field :P, Type: Integer, Default: 3
156
+ field :UT, Type: String
157
+ field :S, Type: Annotation::Projection
158
+ end
159
+
160
+ class PerpendicularDimensionMeasurement3D < Measurement3D
161
+ field :Subtype, Type: Name, Default: :PD3, Required: true
162
+ field :AP, Type: Array.of(Number, length: 3), Required: true
163
+ field :A1, Type: Array.of(Number, length: 3), Required: true
164
+ field :N1, Type: String
165
+ field :A2, Type: Array.of(Number, length: 3), Required: true
166
+ field :N2, Type: String
167
+ field :D1, Type: Array.of(Number, length: 3), Required: true
168
+ field :TP, Type: Array.of(Number, length: 3), Required: true
169
+ field :TY, Type: Array.of(Number, length: 3), Required: true
170
+ field :TS, Type: Number
171
+ field :C, Type: Array.of(Number, length: 3)
172
+ field :V, Type: Number, Required: true
173
+ field :U, Type: String, Required: true
174
+ field :P, Type: Integer, Default: 3
175
+ field :UT, Type: String
176
+ field :S, Type: Annotation::Projection
177
+ end
178
+
179
+ class AngularDimensionMeasurement3D < Measurement3D
180
+ field :Subtype, Type: Name, Default: :AD3, Required: true
181
+ field :AP, Type: Array.of(Number, length: 3), Required: true
182
+ field :A1, Type: Array.of(Number, length: 3), Required: true
183
+ field :D1, Type: Array.of(Number, length: 3), Required: true
184
+ field :N1, Type: String
185
+ field :A2, Type: Array.of(Number, length: 3), Required: true
186
+ field :D2, Type: Array.of(Number, length: 3), Required: true
187
+ field :N2, Type: String
188
+ field :TP, Type: Array.of(Number, length: 3), Required: true
189
+ field :TX, Type: Array.of(Number, length: 3), Required: true
190
+ field :TY, Type: Array.of(Number, length: 3), Required: true
191
+ field :TS, Type: Number
192
+ field :C, Type: Array.of(Number, length: 3)
193
+ field :V, Type: Number, Required: true
194
+ field :P, Type: Integer, Default: 3
195
+ field :UT, Type: String
196
+ field :DR, Type: Boolean, Default: true
197
+ field :S, Type: Annotation::Projection
198
+ end
199
+
200
+ class RadialMeasurement3D < Measurement3D
201
+ field :Subtype, Type: Name, Default: :RD3, Required: true
202
+ field :AP, Type: Array.of(Number, length: 3), Required: true
203
+ field :A1, Type: Array.of(Number, length: 3), Required: true
204
+ field :A2, Type: Array.of(Number, length: 3), Required: true
205
+ field :N2, Type: String
206
+ field :A3, Type: Array.of(Number, length: 3), Required: true
207
+ field :A4, Type: Array.of(Number, length: 3), Required: true
208
+ field :TP, Type: Array.of(Number, length: 3), Required: true
209
+ field :TX, Type: Array.of(Number, length: 3), Required: true
210
+ field :TY, Type: Array.of(Number, length: 3), Required: true
211
+ field :EL, Type: Number, Default: 60
212
+ field :TS, Type: Number
213
+ field :C, Type: Array.of(Number, length: 3)
214
+ field :V, Type: Number, Required: true
215
+ field :U, Type: String, Required: true
216
+ field :P, Type: Integer, Default: 3
217
+ field :UT, Type: String
218
+ field :SC, Type: Boolean, Default: false
219
+ field :R, Type: Boolean, Default: true
220
+ field :S, Type: Annotation::Projection
221
+ end
222
+
223
+ class CommentNote3D < Measurement3D
224
+ field :Subtype, Type: Name, Default: :'3DC', Required: true
225
+ field :A1, Type: Array.of(Number, length: 3), Required: true
226
+ field :N1, Type: String
227
+ field :TP, Type: Array.of(Number, length: 3), Required: true
228
+ field :TB, Type: Array.of(Integer, length: 2)
229
+ field :TS, Type: Number
230
+ field :C, Type: Array.of(Number, length: 3)
231
+ field :UT, Type: String
232
+ field :S, Type: Annotation::Projection
233
+ end
234
+
235
+ class View3D < Dictionary
236
+ include StandardObject
237
+
238
+ field :Type, Type: Name, Default: :'3DView'
239
+ field :XN, Type: String, Required: true
240
+ field :IN, Type: String
241
+ field :MS, Type: Name
242
+ field :C2W, Type: Array
243
+ field :U3DPath, Type: [String, Array.of(String)]
244
+ field :CO, Type: Number
245
+ field :P, Type: Projection3D
246
+ field :O, Type: Graphics::FormXObject
247
+ field :BG, Type: Background3D
248
+ field :RM, Type: RenderMode3D, Version: "1.7"
249
+ field :LS, Type: LightingScheme3D, Version: "1.7"
250
+ field :SA, Type: Array.of(CrossSection3D), Version: "1.7"
251
+ field :NA, Type: Array.of(Node3D), Version: "1.7"
252
+ field :NR, Type: Boolean, Version: "1.7", Default: false
253
+ end
254
+
255
+ class AnimationStyle3D < Dictionary
256
+ include StandardObject
257
+
258
+ module Styles
259
+ NONE = :None
260
+ LINEAR = :Linear
261
+ OSCILLATING = :Oscillating
123
262
  end
124
263
 
125
- class Node3D < Dictionary
126
- include StandardObject
264
+ field :Type, Type: Name, Default: :'3DAnimationStyle'
265
+ field :Subtype, Type: Name, Default: Styles::NONE
266
+ field :PC, Type: Integer, Default: 0
267
+ field :TM, Type: Number, Default: 1
268
+ end
127
269
 
128
- field :Type, :Type => Name, :Default => :"3DNode"
129
- field :N, :Type => String, :Version => "1.7", :Required => true
130
- field :O, :Type => Number
131
- field :V, :Type => Boolean
132
- field :M, :Type => Array
133
- end
270
+ class U3DStream < Stream
271
+ include StandardObject
134
272
 
135
- class Measurement3D < Dictionary
136
- include StandardObject
137
-
138
- field :Type, :Type => Name, :Default => :"3DMeasure"
139
- field :Subtype, :Type => Name, :Required => true
140
- field :TRL, :Type => String
273
+ module Type
274
+ U3D = :U3D
275
+ PRC = :PRC
141
276
  end
142
277
 
143
- class LinearDimensionMeasurement3D < Measurement3D
144
- field :Subtype, :Type => Name, :Default => :L3D, :Required => true
145
- field :AP, :Type => Array.of(Number, length: 3), :Required => true
146
- field :A1, :Type => Array.of(Number, length: 3), :Required => true
147
- field :N1, :Type => String
148
- field :A2, :Type => Array.of(Number, length: 3), :Required => true
149
- field :N2, :Type => String
150
- field :TP, :Type => Array.of(Number, length: 3), :Required => true
151
- field :TY, :Type => Array.of(Number, length: 3), :Required => true
152
- field :TS, :Type => Number
153
- field :C, :Type => Array.of(Number, length: 3)
154
- field :V, :Type => Number, :Required => true
155
- field :U, :Type => String, :Required => true
156
- field :P, :Type => Integer, :Default => 3
157
- field :UT, :Type => String
158
- field :S, :Type => Annotation::Projection
159
- end
278
+ field :Type, Type: Name, Default: :'3D'
279
+ field :Subtype, Type: Name, Default: Type::U3D, Required: true, Version: "1.7", ExtensionLevel: 3
280
+ field :VA, Type: Array.of(View3D)
281
+ field :DV, Type: Object
282
+ field :Resources, Type: Dictionary
283
+ field :OnInstantiate, Type: Stream
284
+ field :AN, Type: AnimationStyle3D
160
285
 
161
- class PerpendicularDimensionMeasurement3D < Measurement3D
162
- field :Subtype, :Type => Name, :Default => :PD3, :Required => true
163
- field :AP, :Type => Array.of(Number, length: 3), :Required => true
164
- field :A1, :Type => Array.of(Number, length: 3), :Required => true
165
- field :N1, :Type => String
166
- field :A2, :Type => Array.of(Number, length: 3), :Required => true
167
- field :N2, :Type => String
168
- field :D1, :Type => Array.of(Number, length: 3), :Required => true
169
- field :TP, :Type => Array.of(Number, length: 3), :Required => true
170
- field :TY, :Type => Array.of(Number, length: 3), :Required => true
171
- field :TS, :Type => Number
172
- field :C, :Type => Array.of(Number, length: 3)
173
- field :V, :Type => Number, :Required => true
174
- field :U, :Type => String, :Required => true
175
- field :P, :Type => Integer, :Default => 3
176
- field :UT, :Type => String
177
- field :S, :Type => Annotation::Projection
286
+ def onInstantiate(action)
287
+ self[:OnInstantiate] = action
178
288
  end
179
-
180
- class AngularDimensionMeasurement3D < Measurement3D
181
- field :Subtype, :Type => Name, :Default => :AD3, :Required => true
182
- field :AP, :Type => Array.of(Number, length: 3), :Required => true
183
- field :A1, :Type => Array.of(Number, length: 3), :Required => true
184
- field :D1, :Type => Array.of(Number, length: 3), :Required => true
185
- field :N1, :Type => String
186
- field :A2, :Type => Array.of(Number, length: 3), :Required => true
187
- field :D2, :Type => Array.of(Number, length: 3), :Required => true
188
- field :N2, :Type => String
189
- field :TP, :Type => Array.of(Number, length: 3), :Required => true
190
- field :TX, :Type => Array.of(Number, length: 3), :Required => true
191
- field :TY, :Type => Array.of(Number, length: 3), :Required => true
192
- field :TS, :Type => Number
193
- field :C, :Type => Array.of(Number, length: 3)
194
- field :V, :Type => Number, :Required => true
195
- field :P, :Type => Integer, :Default => 3
196
- field :UT, :Type => String
197
- field :DR, :Type => Boolean, :Default => true
198
- field :S, :Type => Annotation::Projection
199
- end
200
-
201
- class RadialMeasurement3D < Measurement3D
202
- field :Subtype, :Type => Name, :Default => :RD3, :Required => true
203
- field :AP, :Type => Array.of(Number, length: 3), :Required => true
204
- field :A1, :Type => Array.of(Number, length: 3), :Required => true
205
- field :A2, :Type => Array.of(Number, length: 3), :Required => true
206
- field :N2, :Type => String
207
- field :A3, :Type => Array.of(Number, length: 3), :Required => true
208
- field :A4, :Type => Array.of(Number, length: 3), :Required => true
209
- field :TP, :Type => Array.of(Number, length: 3), :Required => true
210
- field :TX, :Type => Array.of(Number, length: 3), :Required => true
211
- field :TY, :Type => Array.of(Number, length: 3), :Required => true
212
- field :EL, :Type => Number, :Default => 60
213
- field :TS, :Type => Number
214
- field :C, :Type => Array.of(Number, length: 3)
215
- field :V, :Type => Number, :Required => true
216
- field :U, :Type => String, :Required => true
217
- field :P, :Type => Integer, :Default => 3
218
- field :UT, :Type => String
219
- field :SC, :Type => Boolean, :Default => false
220
- field :R, :Type => Boolean, :Default => true
221
- field :S, :Type => Annotation::Projection
222
- end
223
-
224
- class CommentNote3D < Measurement3D
225
- field :Subtype, :Type => Name, :Default => :"3DC", :Required => true
226
- field :A1, :Type => Array.of(Number, length: 3), :Required => true
227
- field :N1, :Type => String
228
- field :TP, :Type => Array.of(Number, length: 3), :Required => true
229
- field :TB, :Type => Array.of(Integer, length: 2)
230
- field :TS, :Type => Number
231
- field :C, :Type => Array.of(Number, length: 3)
232
- field :UT, :Type => String
233
- field :S, :Type => Annotation::Projection
234
- end
235
-
236
- class View3D < Dictionary
289
+ end
290
+
291
+ class Reference3D < Dictionary
292
+ include StandardObject
293
+
294
+ field :Type, Type: Name, Default: :'3DRef'
295
+ field :'3DD', Type: U3DStream
296
+ end
297
+
298
+ class Units3D < Dictionary
299
+ include StandardObject
300
+
301
+ field :TSm, Type: Number, Default: 1.0
302
+ field :TSn, Type: Number, Default: 1.0
303
+ field :TU, Type: String
304
+ field :USm, Type: Number, Default: 1.0
305
+ field :USn, Type: Number, Default: 1.0
306
+ field :UU, Type: String
307
+ field :DSm, Type: Number, Default: 1.0
308
+ field :DSn, Type: Number, Default: 1.0
309
+ field :DU, Type: String
310
+ end
311
+
312
+ class Annotation
313
+ #
314
+ # 3D Artwork annotation.
315
+ #
316
+ class Artwork3D < Annotation
317
+ class Activation < Dictionary
237
318
  include StandardObject
238
319
 
239
- field :Type, :Type => Name, :Default => :"3DView"
240
- field :XN, :Type => String, :Required => true
241
- field :IN, :Type => String
242
- field :MS, :Type => Name
243
- field :C2W, :Type => Array
244
- field :U3DPath, :Type => [ String, Array.of(String) ]
245
- field :CO, :Type => Number
246
- field :P, :Type => Projection3D
247
- field :O, :Type => Graphics::FormXObject
248
- field :BG, :Type => Background3D
249
- field :RM, :Type => RenderMode3D, :Version => "1.7"
250
- field :LS, :Type => LightingScheme3D, :Version => "1.7"
251
- field :SA, :Type => Array.of(CrossSection3D), :Version => "1.7"
252
- field :NA, :Type => Array.of(Node3D), :Version => "1.7"
253
- field :NR, :Type => Boolean, :Version => "1.7", :Default => false
254
- end
255
-
256
- class AnimationStyle3D < Dictionary
257
- include StandardObject
258
-
259
- module Styles
260
- NONE = :None
261
- LINEAR = :Linear
262
- OSCILLATING = :Oscillating
320
+ module Events
321
+ PAGE_OPEN = :PO
322
+ PAGE_CLOSE = :PC
323
+ PAGE_VISIBLE = :PV
324
+ PAGE_INVISIBLE = :PI
325
+ USER_ACTIVATE = :XA
326
+ USER_DEACTIVATE = :XD
263
327
  end
264
328
 
265
- field :Type, :Type => Name, :Default => :"3DAnimationStyle"
266
- field :Subtype, :Type => Name, :Default => Styles::NONE
267
- field :PC, :Type => Integer, :Default => 0
268
- field :TM, :Type => Number, :Default => 1
269
- end
270
-
271
- class U3DStream < Stream
272
- include StandardObject
273
-
274
- module Type
275
- U3D = :U3D
276
- PRC = :PRC
329
+ module State
330
+ UNINSTANCIATED = :U
331
+ INSTANCIATED = :I
332
+ LIVE = :L
277
333
  end
278
334
 
279
- field :Type, :Type => Name, :Default => :"3D"
280
- field :Subtype, :Type => Name, :Default => Type::U3D, :Required => true, :Version => "1.7", :ExtensionLevel => 3
281
- field :VA, :Type => Array.of(View3D)
282
- field :DV, :Type => Object
283
- field :Resources, :Type => Dictionary
284
- field :OnInstantiate, :Type => Stream
285
- field :AN, :Type => AnimationStyle3D
286
-
287
- def onInstantiate(action)
288
- self[:OnInstantiate] = action
335
+ module Style
336
+ EMBEDDED = :Embedded
337
+ WINDOWED = :Windowed
289
338
  end
290
- end
291
339
 
292
- class Reference3D < Dictionary
293
- include StandardObject
294
-
295
- field :Type, :Type => Name, :Default => :"3DRef"
296
- field :"3DD", :Type => U3DStream
340
+ field :A, Type: Name, Default: Events::USER_ACTIVATE
341
+ field :AIS, Type: Name, Default: State::LIVE
342
+ field :D, Type: Name, Default: Events::PAGE_INVISIBLE
343
+ field :DIS, Type: Name, Default: State::UNINSTANCIATED
344
+ field :TB, Type: Boolean, Version: "1.7", Default: true
345
+ field :NP, Type: Boolean, Version: "1.7", Default: false
346
+ field :Style, Type: Name, Version: "1.7", ExtensionLevel: 3, Default: Style::EMBEDDED
347
+ field :Window, Type: RichMedia::Window, Version: "1.7", ExtensionLevel: 3
348
+ field :Transparent, Type: Boolean, Version: "1.7", ExtensionLevel: 3, Default: false
349
+ end
350
+
351
+ field :Subtype, Type: Name, Default: :'3D', Version: "1.6", Required: true
352
+ field :'3DD', Type: [Reference3D, U3DStream], Required: true
353
+ field :'3DV', Type: Object
354
+ field :'3DA', Type: Activation
355
+ field :'3DI', Type: Boolean, Default: true
356
+ field :'3DB', Type: Rectangle
357
+ field :'3DU', Type: Units3D, Version: "1.7", ExtensionLevel: 3
297
358
  end
298
-
299
- class Units3D < Dictionary
300
- include StandardObject
301
-
302
- field :TSm, :Type => Number, :Default => 1.0
303
- field :TSn, :Type => Number, :Default => 1.0
304
- field :TU, :Type => String
305
- field :USm, :Type => Number, :Default => 1.0
306
- field :USn, :Type => Number, :Default => 1.0
307
- field :UU, :Type => String
308
- field :DSm, :Type => Number, :Default => 1.0
309
- field :DSn, :Type => Number, :Default => 1.0
310
- field :DU, :Type => String
311
- end
312
-
313
- class Annotation
314
-
315
- #
316
- # 3D Artwork annotation.
317
- #
318
- class Artwork3D < Annotation
319
-
320
- class Activation < Dictionary
321
- include StandardObject
322
-
323
- module Events
324
- PAGE_OPEN = :PO
325
- PAGE_CLOSE = :PC
326
- PAGE_VISIBLE = :PV
327
- PAGE_INVISIBLE = :PI
328
- USER_ACTIVATE = :XA
329
- USER_DEACTIVATE = :XD
330
- end
331
-
332
- module State
333
- UNINSTANCIATED = :U
334
- INSTANCIATED = :I
335
- LIVE = :L
336
- end
337
-
338
- module Style
339
- EMBEDDED = :Embedded
340
- WINDOWED = :Windowed
341
- end
342
-
343
- field :A, :Type => Name, :Default => Events::USER_ACTIVATE
344
- field :AIS, :Type => Name, :Default => State::LIVE
345
- field :D, :Type => Name, :Default => Events::PAGE_INVISIBLE
346
- field :DIS, :Type => Name, :Default => State::UNINSTANCIATED
347
- field :TB, :Type => Boolean, :Version => "1.7", :Default => true
348
- field :NP, :Type => Boolean, :Version => "1.7", :Default => false
349
- field :Style, :Type => Name, :Version => "1.7", :ExtensionLevel => 3, :Default => Style::EMBEDDED
350
- field :Window, :Type => RichMedia::Window, :Version => "1.7", :ExtensionLevel => 3
351
- field :Transparent, :Type => Boolean, :Version => "1.7", :ExtensionLevel => 3, :Default => false
352
- end
353
-
354
- field :Subtype, :Type => Name, :Default => :"3D", :Version => "1.6", :Required => true
355
- field :"3DD", :Type => [ Reference3D, U3DStream ], :Required => true
356
- field :"3DV", :Type => Object
357
- field :"3DA", :Type => Activation
358
- field :"3DI", :Type => Boolean, :Default => true
359
- field :"3DB", :Type => Rectangle
360
- field :"3DU", :Type => Units3D, :Version => "1.7", :ExtensionLevel => 3
361
- end
362
- end
363
-
359
+ end
364
360
  end