sketchup-api-stubs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/SketchUp/Geom/BoundingBox.rb +335 -0
  3. data/SketchUp/Geom/LatLong.rb +123 -0
  4. data/SketchUp/Geom/Point3d.rb +643 -0
  5. data/SketchUp/Geom/PolygonMesh.rb +478 -0
  6. data/SketchUp/Geom/Transformation.rb +476 -0
  7. data/SketchUp/Geom/UTM.rb +135 -0
  8. data/SketchUp/Geom/Vector3d.rb +684 -0
  9. data/SketchUp/Sketchup/Animation.rb +137 -0
  10. data/SketchUp/Sketchup/AppObserver.rb +157 -0
  11. data/SketchUp/Sketchup/ArcCurve.rb +209 -0
  12. data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
  13. data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
  14. data/SketchUp/Sketchup/Axes.rb +149 -0
  15. data/SketchUp/Sketchup/Behavior.rb +338 -0
  16. data/SketchUp/Sketchup/Camera.rb +594 -0
  17. data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
  18. data/SketchUp/Sketchup/Classifications.rb +118 -0
  19. data/SketchUp/Sketchup/Color.rb +291 -0
  20. data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
  21. data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
  22. data/SketchUp/Sketchup/Console.rb +78 -0
  23. data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
  24. data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
  25. data/SketchUp/Sketchup/Curve.rb +196 -0
  26. data/SketchUp/Sketchup/DefinitionList.rb +312 -0
  27. data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
  28. data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
  29. data/SketchUp/Sketchup/Dimension.rb +167 -0
  30. data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
  31. data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
  32. data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
  33. data/SketchUp/Sketchup/Drawingelement.rb +400 -0
  34. data/SketchUp/Sketchup/Edge.rb +517 -0
  35. data/SketchUp/Sketchup/EdgeUse.rb +213 -0
  36. data/SketchUp/Sketchup/Entities.rb +1011 -0
  37. data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
  38. data/SketchUp/Sketchup/Entity.rb +522 -0
  39. data/SketchUp/Sketchup/EntityObserver.rb +59 -0
  40. data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
  41. data/SketchUp/Sketchup/Face.rb +737 -0
  42. data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
  43. data/SketchUp/Sketchup/Group.rb +705 -0
  44. data/SketchUp/Sketchup/Http.rb +27 -0
  45. data/SketchUp/Sketchup/Http/Request.rb +285 -0
  46. data/SketchUp/Sketchup/Http/Response.rb +62 -0
  47. data/SketchUp/Sketchup/Image.rb +393 -0
  48. data/SketchUp/Sketchup/Importer.rb +192 -0
  49. data/SketchUp/Sketchup/InputPoint.rb +393 -0
  50. data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
  51. data/SketchUp/Sketchup/InstancePath.rb +297 -0
  52. data/SketchUp/Sketchup/Layer.rb +240 -0
  53. data/SketchUp/Sketchup/Layers.rb +235 -0
  54. data/SketchUp/Sketchup/LayersObserver.rb +136 -0
  55. data/SketchUp/Sketchup/Licensing.rb +47 -0
  56. data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
  57. data/SketchUp/Sketchup/Loop.rb +141 -0
  58. data/SketchUp/Sketchup/Material.rb +384 -0
  59. data/SketchUp/Sketchup/Materials.rb +283 -0
  60. data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
  61. data/SketchUp/Sketchup/Menu.rb +97 -0
  62. data/SketchUp/Sketchup/Model.rb +1459 -0
  63. data/SketchUp/Sketchup/ModelObserver.rb +356 -0
  64. data/SketchUp/Sketchup/OptionsManager.rb +135 -0
  65. data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
  66. data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
  67. data/SketchUp/Sketchup/Page.rb +636 -0
  68. data/SketchUp/Sketchup/Pages.rb +349 -0
  69. data/SketchUp/Sketchup/PagesObserver.rb +76 -0
  70. data/SketchUp/Sketchup/PickHelper.rb +457 -0
  71. data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
  72. data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
  73. data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
  74. data/SketchUp/Sketchup/SectionPlane.rb +88 -0
  75. data/SketchUp/Sketchup/Selection.rb +470 -0
  76. data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
  77. data/SketchUp/Sketchup/Set.rb +253 -0
  78. data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
  79. data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
  80. data/SketchUp/Sketchup/Style.rb +77 -0
  81. data/SketchUp/Sketchup/Styles.rb +204 -0
  82. data/SketchUp/Sketchup/Text.rb +241 -0
  83. data/SketchUp/Sketchup/Texture.rb +211 -0
  84. data/SketchUp/Sketchup/TextureWriter.rb +237 -0
  85. data/SketchUp/Sketchup/Tool.rb +808 -0
  86. data/SketchUp/Sketchup/Tools.rb +120 -0
  87. data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
  88. data/SketchUp/Sketchup/UVHelper.rb +61 -0
  89. data/SketchUp/Sketchup/Vertex.rb +143 -0
  90. data/SketchUp/Sketchup/View.rb +965 -0
  91. data/SketchUp/Sketchup/ViewObserver.rb +40 -0
  92. data/SketchUp/UI/Command.rb +307 -0
  93. data/SketchUp/UI/HtmlDialog.rb +346 -0
  94. data/SketchUp/UI/Notification.rb +229 -0
  95. data/SketchUp/UI/Toolbar.rb +243 -0
  96. data/SketchUp/UI/WebDialog.rb +623 -0
  97. data/SketchUp/_top_level.rb +193 -0
  98. data/SketchUp/array.rb +593 -0
  99. data/SketchUp/geom.rb +231 -0
  100. data/SketchUp/languagehandler.rb +92 -0
  101. data/SketchUp/length.rb +210 -0
  102. data/SketchUp/numeric.rb +249 -0
  103. data/SketchUp/sketchup.rb +1290 -0
  104. data/SketchUp/sketchupextension.rb +355 -0
  105. data/SketchUp/string.rb +24 -0
  106. data/SketchUp/ui.rb +637 -0
  107. metadata +176 -0
@@ -0,0 +1,470 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # A set of the currently selected entities. Use the Model.selection method
5
+ # to get a Selection object. Note that the order of entities
6
+ # (<code>selection[0]</code>, <code>selection[1]</code> and so on) in the set
7
+ # is in no particular order and should not be assumed to be in the same order
8
+ # as the user selected the entities.
9
+ #
10
+ # @example
11
+ # # Get a handle to the selection set.
12
+ # model = Sketchup.active_model
13
+ # selection = model.selection
14
+ #
15
+ # @version SketchUp 6.0
16
+ class Sketchup::Selection
17
+
18
+ # Includes
19
+
20
+ include Enumerable
21
+
22
+ # Instance Methods
23
+
24
+ # The [] method is used to retrieve an Entity object from the selection by
25
+ # index. Index 0 is the first entity in the selection.
26
+ #
27
+ # This method is not very efficient. If you need to look at every entity in
28
+ # the selection, consider using Selection.each instead of using this method
29
+ # to manually grab each one.
30
+ #
31
+ # @example
32
+ # depth = 100
33
+ # width = 100
34
+ # model = Sketchup.active_model
35
+ # entities = model.active_entities
36
+ # pts = []
37
+ # pts[0] = [0, 0, 0]
38
+ # pts[1] = [width, 0, 0]
39
+ # pts[2] = [width, depth, 0]
40
+ # pts[3] = [0, depth, 0]
41
+ # # Add the face to the entities in the model
42
+ # face = entities.add_face pts
43
+ # selection = model.selection
44
+ # entity = entities[0]
45
+ # status = selection.add entity
46
+ # entity = selection[0]
47
+ # if (entity)
48
+ # UI.messagebox entity
49
+ # else
50
+ # UI.messagebox "Failure"
51
+ # end
52
+ #
53
+ # @param index
54
+ # The index of the Entity object to retrieve.
55
+ #
56
+ # @return entity - an Entity object if successful
57
+ #
58
+ # @version SketchUp 6.0
59
+ def [](index)
60
+ end
61
+
62
+ # The add method is used to add entities to the selection. Entities that are
63
+ # added to the Selection are visually indicated by the selection bounding box.
64
+ #
65
+ # You can pass it individual Entities or an Array of Entities:
66
+ # Note that the add, remove, and toggle methods are all aliases for one
67
+ # another. So if you call remove on an entity that is not selected, it will
68
+ # be toggled to be selected, not removed! Be cautious when writing your code to
69
+ # not make the assumption about the currently selected state of a given entity.
70
+ #
71
+ # @example
72
+ # # Add by listing the entities...
73
+ # ss.add(e1, e2, e3)
74
+ #
75
+ # # ...or add by passing an Array of entities.
76
+ # ss.add([e1, e2, e3])
77
+ #
78
+ # @example
79
+ # entities = model.active_entities
80
+ # entity = entities[0]
81
+ # status = selection.add entity
82
+ #
83
+ # @param ents_or_array
84
+ # List or Array of Entity objects.
85
+ #
86
+ # @return status - the number of Entity objects added
87
+ #
88
+ # @version SketchUp 6.0
89
+ def add(ents_or_array)
90
+ end
91
+
92
+ # The add_observer method is used to add an observer to the selection object.
93
+ #
94
+ # @example
95
+ # selection = Sketchup.active_model.selection
96
+ # status = selection.add_observer observer
97
+ #
98
+ # @param observer
99
+ # An observer.
100
+ #
101
+ # @return true if successful, false if unsuccessful.
102
+ #
103
+ # @version SketchUp 6.0
104
+ def add_observer(observer)
105
+ end
106
+
107
+ # The [] method is used to retrieve an Entity object from the selection by
108
+ # index. Index 0 is the first entity in the selection.
109
+ #
110
+ # This method is not very efficient. If you need to look at every entity in
111
+ # the selection, consider using Selection.each instead of using this method
112
+ # to manually grab each one.
113
+ #
114
+ # @example
115
+ # depth = 100
116
+ # width = 100
117
+ # model = Sketchup.active_model
118
+ # entities = model.active_entities
119
+ # pts = []
120
+ # pts[0] = [0, 0, 0]
121
+ # pts[1] = [width, 0, 0]
122
+ # pts[2] = [width, depth, 0]
123
+ # pts[3] = [0, depth, 0]
124
+ # # Add the face to the entities in the model
125
+ # face = entities.add_face pts
126
+ # selection = model.selection
127
+ # entity = entities[0]
128
+ # status = selection.add entity
129
+ # entity = selection[0]
130
+ # if (entity)
131
+ # UI.messagebox entity
132
+ # else
133
+ # UI.messagebox "Failure"
134
+ # end
135
+ #
136
+ # @param index
137
+ # The index of the Entity object to retrieve.
138
+ #
139
+ # @return entity - an Entity object if successful
140
+ #
141
+ # @version SketchUp 6.0
142
+ def at(index)
143
+ end
144
+
145
+ # The clear method is used to clear the selection.
146
+ #
147
+ # @example
148
+ # entity = entities[0]
149
+ # selection.add entity
150
+ # UI.messagebox "Ready to Clear"
151
+ # selection.clear
152
+ #
153
+ # @return nil
154
+ #
155
+ # @version SketchUp 6.0
156
+ def clear
157
+ end
158
+
159
+ # The include? method is an alias for contains
160
+ #
161
+ # @example
162
+ # selection.add entity
163
+ # status = selection.include? entity
164
+ #
165
+ # @param entity
166
+ # An Entity object.
167
+ #
168
+ # @return status - true if the Entity object is in the selection.
169
+ # False if the Entity object is not in the selection.
170
+ #
171
+ # @return [Boolean]
172
+ #
173
+ # @version SketchUp 6.0
174
+ def contains?(entity)
175
+ end
176
+
177
+ #
178
+ # @example
179
+ # selection = Sketchup.active_model.selection
180
+ # number = selection.count
181
+ #
182
+ # @note Since SketchUp 2014 the count method is inherited from Ruby's
183
+ # +Enumable+ mix-in module. Prior to that the {#count} method is an alias
184
+ # for {#length}.
185
+ #
186
+ # @return integer - the number of Entities in the selection if
187
+ # successful
188
+ #
189
+ # @see #length
190
+ #
191
+ # @version SketchUp 6.0
192
+ def count
193
+ end
194
+
195
+ # The each method is used to iterate through all of the selected entities.
196
+ #
197
+ # If you want to do something with all of the selected Entities, this is more
198
+ # efficient than using [].
199
+ #
200
+ # @example
201
+ # selection.each { |entity| UI.messagebox(entity) }
202
+ #
203
+ # @return nil
204
+ #
205
+ # @version SketchUp 6.0
206
+ #
207
+ # @yield [entity] A variable that will hold each Entity object as they
208
+ # are found.
209
+ def each
210
+ end
211
+
212
+ # The empty? method is used to determine if there are entities in the
213
+ # selection.
214
+ #
215
+ # @example
216
+ # status = selection.add entity
217
+ # status = selection.empty
218
+ #
219
+ # @return status - true if the selection is empty. False if the
220
+ # selection is not empty.
221
+ #
222
+ # @return [Boolean]
223
+ #
224
+ # @version SketchUp 6.0
225
+ def empty?
226
+ end
227
+
228
+ # The first method is used to retrieve the first selected entity
229
+ #
230
+ # Returns nil if nothing is selected. This method is useful when you know that
231
+ # only a single entity is selected, or you are only interested in the first
232
+ # selected entity.
233
+ #
234
+ # @example
235
+ # status = selection.add entity
236
+ # entity = selection.first
237
+ #
238
+ # @return entity - the first selected Entity object if successful
239
+ #
240
+ # @version SketchUp 6.0
241
+ def first
242
+ end
243
+
244
+ # The include? method is an alias for contains
245
+ #
246
+ # @example
247
+ # selection.add entity
248
+ # status = selection.include? entity
249
+ #
250
+ # @param entity
251
+ # An Entity object.
252
+ #
253
+ # @return status - true if the Entity object is in the selection.
254
+ # False if the Entity object is not in the selection.
255
+ #
256
+ # @return [Boolean]
257
+ #
258
+ # @version SketchUp 6.0
259
+ def include?(entity)
260
+ end
261
+
262
+ # The is_curve? method is used to determine if the selection contains all
263
+ # edges that belong to a single curve.
264
+ #
265
+ # @example
266
+ # selection.add entity
267
+ # status = selection.is_curve?
268
+ #
269
+ # @return status - true if the selection contains all edges that
270
+ # belong to a single curve. False if the selection does
271
+ # not contain all edges that belong to a single curve.
272
+ #
273
+ # @return [Boolean]
274
+ #
275
+ # @version SketchUp 6.0
276
+ def is_curve?
277
+ end
278
+
279
+ # The is_surface? method is used to determine if the selection contains only
280
+ # all of the faces that are part of a single curved surface.
281
+ #
282
+ # @example
283
+ # selection.add entity
284
+ # status = selection.is_surface
285
+ #
286
+ # @return status - true if the selection contains all faces that
287
+ # belong to a single curved surface. False if the
288
+ # selection does not contain all faces that belong to a
289
+ # single curved surface.
290
+ #
291
+ # @return [Boolean]
292
+ #
293
+ # @version SketchUp 6.0
294
+ def is_surface?
295
+ end
296
+
297
+ # The {#length} method is used to retrieve the number of selected Entities.
298
+ #
299
+ # The {#nitems} methods is an alias of {#length}.
300
+ #
301
+ # The {#size} methods is an alias of {#length} added in SketchUp 2014.
302
+ #
303
+ # @example
304
+ # selection = Sketchup.active_model.selection
305
+ # number = selection.length
306
+ #
307
+ # @return integer - the number of entities in the selection if
308
+ # successful
309
+ #
310
+ # @version SketchUp 6.0
311
+ def length
312
+ end
313
+
314
+ # The model method retrieves the model for the selection.
315
+ #
316
+ # @example
317
+ # model = selection.model
318
+ #
319
+ # @return model - the model that includes the selection if
320
+ # successful
321
+ #
322
+ # @version SketchUp 6.0
323
+ def model
324
+ end
325
+
326
+ # The {#length} method is used to retrieve the number of selected Entities.
327
+ #
328
+ # The {#nitems} methods is an alias of {#length}.
329
+ #
330
+ # The {#size} methods is an alias of {#length} added in SketchUp 2014.
331
+ #
332
+ # @example
333
+ # selection = Sketchup.active_model.selection
334
+ # number = selection.length
335
+ #
336
+ # @return integer - the number of entities in the selection if
337
+ # successful
338
+ #
339
+ # @version SketchUp 6.0
340
+ def nitems
341
+ end
342
+
343
+ # The remove method is used to remove entities from the selection.
344
+ #
345
+ # You can pass it individual Entities or an Array of Entities:
346
+ # Note that the add, remove, and toggle methods are all aliases for one
347
+ # another. So if you call remove on an entity that is not selected, it will
348
+ # be toggled to be selected, not removed! Be cautious when writing your code to
349
+ # not make the assumption about the currently selected state of a given entity.
350
+ #
351
+ # @example
352
+ # # Remove by listing the entities...
353
+ # ss.remove(e1, e2, e3)
354
+ #
355
+ # # ...or remove by passing an Array of entities.
356
+ # ss.remove([e1, e2, e3])
357
+ #
358
+ # @example
359
+ # entities = model.active_entities
360
+ # entity = entities[0]
361
+ # status = selection.add entity
362
+ #
363
+ # @param ents_or_array
364
+ # List or Array of Entity objects.
365
+ #
366
+ # @return status - the number of Entity objects removed
367
+ #
368
+ # @version SketchUp 6.0
369
+ def remove(ents_or_array)
370
+ end
371
+
372
+ # The remove_observer method is used to remove an observer from the selection
373
+ # object.
374
+ #
375
+ # @example
376
+ # selection = Sketchup.active_model.selection
377
+ # status = object.remove_observer observer
378
+ #
379
+ # @param observer
380
+ # An observer.
381
+ #
382
+ # @return true if successful, false if unsuccessful.
383
+ #
384
+ # @version SketchUp 6.0
385
+ def remove_observer(observer)
386
+ end
387
+
388
+ # The shift method is used to remove the first entity from the selection and
389
+ # returns it.
390
+ #
391
+ # @example
392
+ # status = selection.add entity
393
+ # UI.messagebox "Ready to remove item from selection set"
394
+ # entity = selection.shift
395
+ #
396
+ # @return entity - the first Entity object in the selection set
397
+ # if successful
398
+ #
399
+ # @version SketchUp 6.0
400
+ def shift
401
+ end
402
+
403
+ # The single_object? method is used to determine if the selection contains a
404
+ # single object.
405
+ #
406
+ # It can either be a single Entity or a group of Entities for which is_curve?
407
+ # or is_surface? will return true.
408
+ #
409
+ # @example
410
+ # status = selection.single_object
411
+ #
412
+ # @return status - true if the selection contains a single
413
+ # object. False if the selection does not contain a
414
+ # single object.
415
+ #
416
+ # @return [Boolean]
417
+ #
418
+ # @version SketchUp 6.0
419
+ def single_object?
420
+ end
421
+
422
+ # The {#length} method is used to retrieve the number of selected Entities.
423
+ #
424
+ # The {#nitems} methods is an alias of {#length}.
425
+ #
426
+ # The {#size} methods is an alias of {#length} added in SketchUp 2014.
427
+ #
428
+ # @example
429
+ # selection = Sketchup.active_model.selection
430
+ # number = selection.length
431
+ #
432
+ # @return integer - the number of entities in the selection if
433
+ # successful
434
+ #
435
+ # @version SketchUp 6.0
436
+ def size
437
+ end
438
+
439
+ # The toggle method is used to change whether an entity is part of the
440
+ # selection. Entities that are not already selected
441
+ # are added. Entities that are already selected are removed.
442
+ #
443
+ # You can pass it individual Entities or an Array of Entities:
444
+ # Note that the add, remove, and toggle methods are all aliases for one
445
+ # another. So if you call remove on an entity that is not selected, it will
446
+ # be toggled to be selected, not removed! Be cautious when writing your code to
447
+ # not make the assumption about the currently selected state of a given entity.
448
+ #
449
+ # @example
450
+ # # Toggle by listing the entities...
451
+ # ss.toggle(e1, e2, e3)
452
+ #
453
+ # # ...or toggle by passing an Array of entities.
454
+ # ss.toggle([e1, e2, e3])
455
+ #
456
+ # @example
457
+ # entities = model.active_entities
458
+ # entity = entities[0]
459
+ # status = selection.add entity
460
+ #
461
+ # @param ents_or_array
462
+ # List or Array of Entity objects.
463
+ #
464
+ # @return status - the number of Entity objects changed
465
+ #
466
+ # @version SketchUp 6.0
467
+ def toggle(ents_or_array)
468
+ end
469
+
470
+ end