sketchup-api-stubs 0.7.0 → 0.7.5

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +2 -0
  3. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +14 -10
  4. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +4 -4
  5. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +4 -4
  6. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +4 -5
  7. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +17 -17
  8. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +6 -0
  9. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -2
  10. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +3 -3
  11. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +4 -0
  12. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +6 -13
  13. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +60 -4
  14. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +6 -13
  15. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +188 -0
  16. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +8 -3
  17. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -2
  18. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +6 -13
  19. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +5 -1
  20. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +6 -13
  21. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +147 -4
  22. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +4 -0
  23. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +3 -3
  24. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +2 -2
  25. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +5 -0
  26. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +31 -57
  27. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +109 -208
  28. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +23 -10
  29. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +22 -7
  30. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +23 -12
  31. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +15 -8
  32. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +60 -27
  33. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +5 -3
  34. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +5 -3
  35. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +2 -8
  36. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +4 -0
  37. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +9 -3
  38. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +7 -13
  39. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +54 -25
  40. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +5 -3
  41. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +19 -14
  42. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +5 -4
  43. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +8 -7
  44. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +8 -7
  45. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +46 -44
  46. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +8 -0
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +46 -6
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +10 -11
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +32 -20
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +5 -3
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +4 -1
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +112 -69
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +224 -28
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +117 -4
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -12
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +7 -9
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +14 -7
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +5 -4
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +8 -10
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +122 -72
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +4 -3
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +1 -2
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +6 -6
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +3 -3
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +142 -39
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +21 -11
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +5 -4
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +36 -14
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +4 -3
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +9 -4
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +19 -19
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +4 -4
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +5 -3
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +8 -2
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +13 -21
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +30 -24
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +5 -3
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +31 -21
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +72 -66
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +5 -3
  84. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +12 -5
  85. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +34 -3
  86. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +36 -10
  87. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +2 -2
  88. data/lib/sketchup-api-stubs/stubs/_top_level.rb +2 -0
  89. data/lib/sketchup-api-stubs/stubs/geom.rb +3 -0
  90. data/lib/sketchup-api-stubs/stubs/sketchup.rb +54 -22
  91. data/lib/sketchup-api-stubs/stubs/ui.rb +9 -8
  92. metadata +4 -16
@@ -16,7 +16,7 @@ class Sketchup::Tools
16
16
  #
17
17
  # @example
18
18
  # tools = Sketchup.active_model.tools
19
- # tool = tools.current
19
+ # tool = tools.active_tool
20
20
  #
21
21
  # @return [Object, nil] Returns the active Ruby tool, or `nil` otherwise.
22
22
  #
@@ -1,9 +1,7 @@
1
1
  # Copyright:: Copyright 2020 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # This observer interface is implemented to react to tool events. To implement
5
- # this observer, create a Ruby class of this type, override the desired
6
- # methods, and add an instance of the observer to the {Sketchup::Tools} object.
4
+ # This observer interface is implemented to react to tool events.
7
5
  #
8
6
  # Some of the code below mentions +tool_names+ and +tool_ids+. Here is a list
9
7
  # of the common tool IDs and names:
@@ -42,6 +40,10 @@
42
40
  # - +21020+ = SketchTool
43
41
  # - +21405+ = TextTool
44
42
  #
43
+ # @abstract To implement this observer, create a Ruby class of this type,
44
+ # override the desired methods, and add an instance of the observer to the
45
+ # {Sketchup::Tools} object.
46
+ #
45
47
  # @example
46
48
  # # This is an example of an observer that watches tool interactions.
47
49
  # class MyToolsObserver < Sketchup::ToolsObserver
@@ -14,45 +14,55 @@ class Sketchup::UVHelper
14
14
 
15
15
  # Instance Methods
16
16
 
17
- # The get_back_UVQ method is used to get the UV coordinates for the back of a
18
- # face.
17
+ # The {#get_back_UVQ} method is used to get the UV texture coordinates on the
18
+ # back of a face.
19
19
  #
20
20
  # @example
21
- # uv_helper = face.get_UVHelper true, true, my_texture_writer
21
+ # uv_helper = face.get_UVHelper(true, true, my_texture_writer)
22
22
  # face.outer_loop.vertices.each do |vert|
23
- # uvq = uv_help.get_back_UVQ(vert.position)
24
- # puts "u=" + uvq.x.to_s + " v=" + uvq.y.to_s
23
+ # uvq = uv_helper.get_back_UVQ(vert.position)
24
+ # # "Normalize" UVQ to UV.
25
+ # u = uvq.u / unq.q
26
+ # v = uvq.v / unq.q
27
+ # puts "u=#{u} v=#{v}""
25
28
  # end
26
29
  #
27
- # @param point
28
- # A Point3d object containing one of the 3D vertexes of
29
- # the face.
30
+ # @note To convert UVQ coordinates to UV,
31
+ # divide U and V by Q.
32
+ # u = uvq.u / uvq.q
33
+ # v = uvq.v / uvq.q
30
34
  #
31
- # @return point - a Point3d containing the UV coordinates where
32
- # the X value is the U value, the Y value is the V value
33
- # and the Z value is a Q value (which is not used).
35
+ # @param [Geom::Point3d] point
36
+ # A point on the face.
37
+ #
38
+ # @return [Geom::Point3d] Point where X represents U, Y represents V and Z represents Q.
34
39
  #
35
40
  # @version SketchUp 6.0
36
41
  def get_back_UVQ(point)
37
42
  end
38
43
 
39
- # The get_front_UVQ method is used to get the UV coordinates for a front of a
40
- # face.
44
+ # The {#get_front_UVQ} method is used to get the UV texture coordinates on the
45
+ # front of a face.
41
46
  #
42
47
  # @example
43
- # uv_helper = face.get_UVHelper true, true, my_texture_writer
48
+ # uv_helper = face.get_UVHelper(true, true, my_texture_writer)
44
49
  # face.outer_loop.vertices.each do |vert|
45
50
  # uvq = uv_helper.get_front_UVQ(vert.position)
46
- # puts "u=" + uvq.x.to_s + " v=" + uvq.y.to_s
51
+ # # "Normalize" UVQ to UV.
52
+ # u = uvq.u / unq.q
53
+ # v = uvq.v / unq.q
54
+ # puts "u=#{u} v=#{v}""
47
55
  # end
48
56
  #
49
- # @param point
50
- # A Point3d object containing one of the 3D vertexes of
51
- # the face.
57
+ # @note To convert UVQ coordinates to UV,
58
+ # divide U and V by Q.
59
+ # u = uvq.u / uvq.q
60
+ # v = uvq.v / uvq.q
61
+ #
62
+ # @param [Geom::Point3d] point
63
+ # A point on the face.
52
64
  #
53
- # @return point - a Point3d containing the UV coordinates where
54
- # the X value is the U value, the Y value is the V value
55
- # and the Z value is a Q value (which is not used).
65
+ # @return [Geom::Point3d] Point where X represents U, Y represents V and Z represents Q.
56
66
  #
57
67
  # @version SketchUp 6.0
58
68
  def get_front_UVQ(point)
@@ -91,15 +91,13 @@ class Sketchup::View
91
91
  #
92
92
  # @overload camera=(camera)
93
93
  #
94
- # @param camera [Sketchup::Camera] The new Camera object.
95
- # @return [Sketchup::Camera]
94
+ # @param [Sketchup::Camera] camera The new camera object.
96
95
  #
97
96
  # @overload camera=(camera_and_transition)
98
97
  #
99
- # @param camera_and_transition [Array(Sketchup::Camera, Float)]
98
+ # @param [Array(Sketchup::Camera, Float)] camera_and_transition
100
99
  # The second item in the array represents the transition time from the
101
- # existing camera to the new one
102
- # @return [Array(Sketchup::Camera, Float)]
100
+ # existing camera to the new one.
103
101
  #
104
102
  # @version SketchUp 6.0
105
103
  def camera=(arg)
@@ -246,11 +244,11 @@ class Sketchup::View
246
244
  # light will affect it. By providing an array of vertex normals lighting
247
245
  # is turned on and will use the model's current light. Note that the number
248
246
  # of normals must match the number of points provided.
249
- # @option options [Integer] :texture_id
247
+ # @option options [Integer] :texture
250
248
  # A texture id provided by {#load_texture}.
251
249
  # @option options [Array<Geom::Vector3d>] :uvs
252
250
  # Set of UV (Not UVQ) coordinates matching the number of points provided.
253
- # This must be used along with the +:texture_id+ option.
251
+ # This must be used along with the +:texture+ option.
254
252
  #
255
253
  # @overload draw(openglenum, *points, **options)
256
254
  #
@@ -265,11 +263,11 @@ class Sketchup::View
265
263
  # light will affect it. By providing an array of vertex normals lighting
266
264
  # is turned on and will use the model's current light. Note that the number
267
265
  # of normals must match the number of points provided.
268
- # @option options [Integer] :texture_id
266
+ # @option options [Integer] :texture
269
267
  # A texture id provided by {#load_texture}.
270
268
  # @option options [Array<Geom::Vector3d>] :uvs
271
269
  # Set of UV (Not UVQ) coordinates matching the number of points provided.
272
- # This must be used along with the +:texture_id+ option.
270
+ # This must be used along with the +:texture+ option.
273
271
  #
274
272
  # @return [Sketchup::View]
275
273
  #
@@ -320,11 +318,11 @@ class Sketchup::View
320
318
  # from the comments, such as +GL_LINES+.
321
319
  # @param [Array<Geom::Point3d>] points
322
320
  # @param [Hash] options
323
- # @option options [Integer] :texture_id
321
+ # @option options [Integer] :texture
324
322
  # A texture id provided by {#load_texture}.
325
323
  # @option options [Array<Geom::Vector3d>] :uvs
326
324
  # Set of UV (Not UVQ) coordinates matching the number of points provided.
327
- # This must be used along with the +:texture_id+ option.
325
+ # This must be used along with the +:texture+ option.
328
326
  #
329
327
  # @overload draw2d(openglenum, *points, **options)
330
328
  #
@@ -334,11 +332,11 @@ class Sketchup::View
334
332
  # from the comments, such as +GL_LINES+.
335
333
  # @param [Array<Geom::Point3d>] points
336
334
  # @param [Hash] options
337
- # @option options [Integer] :texture_id
335
+ # @option options [Integer] :texture
338
336
  # A texture id provided by {#load_texture}.
339
337
  # @option options [Array<Geom::Vector3d>] :uvs
340
338
  # Set of UV (Not UVQ) coordinates matching the number of points provided.
341
- # This must be used along with the +:texture_id+ option.
339
+ # This must be used along with the +:texture+ option.
342
340
  #
343
341
  # @return [Sketchup::View]
344
342
  #
@@ -362,15 +360,16 @@ class Sketchup::View
362
360
  # status = view.drawing_color="red"
363
361
  # status = view.draw_lines point4, point5
364
362
  #
365
- # @overload draw_lines(point_list, ...)
363
+ # @overload draw_lines(points, ...)
366
364
  #
367
- # @param point_list [Array<Geom::Point3d>] An even number of Point3d objects.
368
- # @return [Sketchup::View] returns the View object
365
+ # @param [Array<Geom::Point3d>] points
366
+ # An even number of Point3d objects.
367
+ # @return [Sketchup::View]
369
368
  #
370
- # @overload draw_lines(pts)
369
+ # @overload draw_lines(points)
371
370
  #
372
- # @param pts [Array<Geom::Point3d>] An array of Point3d objects.
373
- # @return [Sketchup::View] returns the View object
371
+ # @param [Array<Geom::Point3d>] points An array of Point3d objects.
372
+ # @return [Sketchup::View]
374
373
  #
375
374
  # @version SketchUp 6.0
376
375
  def draw_line(*args)
@@ -388,15 +387,16 @@ class Sketchup::View
388
387
  # status = view.drawing_color="red"
389
388
  # status = view.draw_lines point4, point5
390
389
  #
391
- # @overload draw_lines(point_list, ...)
390
+ # @overload draw_lines(points, ...)
392
391
  #
393
- # @param point_list [Array<Geom::Point3d>] An even number of Point3d objects.
394
- # @return [Sketchup::View] returns the View object
392
+ # @param [Array<Geom::Point3d>] points
393
+ # An even number of Point3d objects.
394
+ # @return [Sketchup::View]
395
395
  #
396
- # @overload draw_lines(pts)
396
+ # @overload draw_lines(points)
397
397
  #
398
- # @param pts [Array<Geom::Point3d>] An array of Point3d objects.
399
- # @return [Sketchup::View] returns the View object
398
+ # @param [Array<Geom::Point3d>] points An array of Point3d objects.
399
+ # @return [Sketchup::View]
400
400
  #
401
401
  # @version SketchUp 6.0
402
402
  def draw_lines(*args)
@@ -409,26 +409,23 @@ class Sketchup::View
409
409
  # @example
410
410
  # point3 = Geom::Point3d.new 0,0,0
411
411
  # # returns a view
412
- # status = view.draw_points point3, 10, 1, "red"
412
+ # status = view.draw_points(point3, 10, 1, "red")
413
413
  #
414
- # @param [Array<Geom::Point3d>] pts
415
- # An array of Point3d objects.
414
+ # @param [Array<Geom::Point3d>] points
416
415
  #
417
- # @param [Integer] pointsize
416
+ # @param [Integer] size
418
417
  # Size of the point in pixels.
419
418
  #
420
- # @param [Sketchup::Color] pointcolor
421
- # Color of the point.
422
- #
423
- # @param [Integer] pointstyle
424
- # Style of the point. 1 = open square,
425
- # 2 = filled square, 3 = "+", 4 = "X", 5 = "*",
419
+ # @param [Integer] style
420
+ # 1 = open square, 2 = filled square, 3 = "+", 4 = "X", 5 = "*",
426
421
  # 6 = open triangle, 7 = filled triangle.
427
422
  #
423
+ # @param [Sketchup::Color] color
424
+ #
428
425
  # @return [Sketchup::View] a View object
429
426
  #
430
427
  # @version SketchUp 6.0
431
- def draw_points(pts, pointsize = 6, pointstyle = 3, pointcolor = 'black')
428
+ def draw_points(points, size = 6, style = 3, color = 'black')
432
429
  end
433
430
 
434
431
  # The draw_polyline method is used to draw a series of connected line segments
@@ -443,15 +440,15 @@ class Sketchup::View
443
440
  # point15 = Geom::Point3d.new 30,30,30
444
441
  # status = view.draw_polyline point12, point13, point14, point15
445
442
  #
446
- # @overload draw_polyline(point_list, ...)
443
+ # @overload draw_polyline(points, ...)
447
444
  #
448
- # @param point_list [Array<Geom::Point3d>] An even number of Point3d objects.
449
- # @return [Sketchup::View] a View object
445
+ # @param [Array<Geom::Point3d>] points An even number of Point3d objects.
446
+ # @return [Sketchup::View]
450
447
  #
451
- # @overload draw_polyline(pts)
448
+ # @overload draw_polyline(points)
452
449
  #
453
- # @param pts [Array<Geom::Point3d>] An array of Point3d objects.
454
- # @return [Sketchup::View] a View object
450
+ # @param [Array<Geom::Point3d>] points An array of Point3d objects.
451
+ # @return [Sketchup::View]
455
452
  #
456
453
  # @version SketchUp 6.0
457
454
  def draw_polyline(*args)
@@ -473,7 +470,7 @@ class Sketchup::View
473
470
  # class ExampleTool
474
471
  # def draw(view)
475
472
  # # This works in all SketchUp versions and draws the text using the
476
- # # default font, color and size.
473
+ # # default font, size and color (i.e. the model edge color).
477
474
  # point = Geom::Point3d.new(200, 100, 0)
478
475
  # view.draw_text(point, "This is a test")
479
476
  #
@@ -498,14 +495,14 @@ class Sketchup::View
498
495
  # IS_WIN = Sketchup.platform == :platform_win
499
496
  #
500
497
  # def draw(view)
501
- # draw_text(view, "Hello World", size: 20)
498
+ # draw_text(view, [100, 200, 0], "Hello World", size: 20)
502
499
  # end
503
500
  #
504
501
  # private
505
502
  #
506
503
  # # This will ensure text is drawn with consistent size across platforms,
507
504
  # # using pixels as size units.
508
- # def draw_text(view, text, **options)
505
+ # def draw_text(view, position, text, **options)
509
506
  # native_options = options.dup
510
507
  # if IS_WIN && options.key?(:size)
511
508
  # native_options[:size] = pixels_to_points(size)
@@ -763,7 +760,6 @@ class Sketchup::View
763
760
  # @example
764
761
  # module Example
765
762
  # class MyTool
766
- #
767
763
  # def activate
768
764
  # view = Sketchup.active_model.active_view
769
765
  # image_rep = view.model.materials.current.texture.image_rep
@@ -777,9 +773,8 @@ class Sketchup::View
777
773
  # def draw(view)
778
774
  # points = [ [0, 0, 0], [9, 0, 0], [9, 9, 0], [0, 9, 0] ]
779
775
  # uvs = [ [0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0] ]
780
- # view.draw(points, texture_id: @texture_id, uvs: uvs)
776
+ # view.draw(GL_QUADS, points, texture: @texture_id, uvs: uvs)
781
777
  # end
782
- #
783
778
  # end
784
779
  # end
785
780
  # Sketchup.active_model.select_tool(Example::MyTool.new)
@@ -804,16 +799,20 @@ class Sketchup::View
804
799
  # @see #release_texture
805
800
  #
806
801
  # @see #draw
802
+ #
803
+ # @version 2020.0
807
804
  def load_texture(image_rep)
808
805
  end
809
806
 
810
- # The lock_inference method is used to lock or unlock an inference.
807
+ # The {#lock_inference} method is used to lock or unlock an inference.
811
808
  #
812
809
  # This method will typically be called from inside a tool class when the user
813
- # presses the shift key.
810
+ # presses the shift key or arrow keys.
814
811
  #
815
- # With no arguments it unlocks all inferences. With one or two arguments, it
816
- # locks the inference based on the given InputPoint(s).
812
+ # With no arguments it unlocks all inferences. With one argument it locks
813
+ # inference based on that passed {Sketchup::InputPoint}'s entities, e.g. along
814
+ # a {Sketchup::Edge}'s line or a {Sketchup::Face}'s plane. With two arguments,
815
+ # it locks inference along an axis.
817
816
  #
818
817
  # @example
819
818
  # view = view.lock_inference
@@ -826,14 +825,19 @@ class Sketchup::View
826
825
  # @overload lock_inference(inputpoint)
827
826
  #
828
827
  # @param [Sketchup::InputPoint] inputpoint
829
- # 1st InputPoint to inference to.
830
828
  #
831
829
  # @overload lock_inference(inputpoint, inputpoint2)
832
830
  #
833
831
  # @param [Sketchup::InputPoint] inputpoint
834
- # 1st InputPoint to inference to.
835
832
  # @param [Sketchup::InputPoint] inputpoint2
836
- # 2nd InputPoint to inference to.
833
+ # @example
834
+ # # Lock inference to X axis.
835
+ # # The points can be anywhere; only the vector between them affects
836
+ # # the result.
837
+ # view.lock_inference(
838
+ # Sketchup::InputPoint.new(ORIGIN),
839
+ # Sketchup::InputPoint.new(Geom::Point3d.new(1, 0, 0))
840
+ # )
837
841
  #
838
842
  # @return [Sketchup::View] a View object
839
843
  #
@@ -949,7 +953,6 @@ class Sketchup::View
949
953
  # @example
950
954
  # module Example
951
955
  # class MyTool
952
- #
953
956
  # def activate
954
957
  # view = Sketchup.active_model.active_view
955
958
  # image_rep = view.model.materials.current.texture.image_rep
@@ -963,9 +966,8 @@ class Sketchup::View
963
966
  # def draw(view)
964
967
  # points = [ [0, 0, 0], [9, 0, 0], [9, 9, 0], [0, 9, 0] ]
965
968
  # uvs = [ [0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0] ]
966
- # view.draw(points, texture_id: @texture_id, uvs: uvs)
969
+ # view.draw(GL_QUADS, points, texture: @texture_id, uvs: uvs)
967
970
  # end
968
- #
969
971
  # end
970
972
  # end
971
973
  # Sketchup.active_model.select_tool(Example::MyTool.new)
@@ -1166,7 +1168,7 @@ class Sketchup::View
1166
1168
  # view = model.active_view
1167
1169
  # height = view.vpheight
1168
1170
  #
1169
- # @return [Integer] the height of the viewport in pixels.
1171
+ # @return [Integer] the height of the viewport in physical pixels.
1170
1172
  #
1171
1173
  # @version SketchUp 6.0
1172
1174
  def vpheight
@@ -1178,7 +1180,7 @@ class Sketchup::View
1178
1180
  # @example
1179
1181
  # width = view.vpwidth
1180
1182
  #
1181
- # @return [Integer] the width of the viewport in pixels.
1183
+ # @return [Integer] the width of the viewport in physical pixels.
1182
1184
  #
1183
1185
  # @version SketchUp 6.0
1184
1186
  def vpwidth
@@ -1186,15 +1188,19 @@ class Sketchup::View
1186
1188
 
1187
1189
  # The {#write_image} method is used to write the current view to an image file.
1188
1190
  #
1191
+ # Supported file types are `.png`, `.jpg`, `.jpeg`, `gif`, `.bmp`, `.tif`.
1192
+ # For other file formats available from the GUI in File > Export > 2D
1193
+ # Graphics, .e.g `.pdf`, use {Sketchup::Model#export}.
1194
+ #
1189
1195
  # @overload write_image(filename, width = view.vpwidth, height = view.vpheight, antialias = false, compression = 1.0)
1190
1196
  #
1191
1197
  # @note Prefer the overload with option hash instead of this variant. This
1192
1198
  # overload is not updated with new options.
1193
1199
  #
1194
1200
  # @example
1195
- # filename => "c:/tmp/write_image.png"
1196
- # antialias => false
1197
- # compression => 0.9
1201
+ # filename = File.join(Sketchup.temp_dir, 'example.png')
1202
+ # antialias = false
1203
+ # compression = 0.9
1198
1204
  # model = Sketchup.active_model
1199
1205
  # view = model.active_view
1200
1206
  # view.write_image(filename, 640, 480, antialias, compression)
@@ -1213,7 +1219,7 @@ class Sketchup::View
1213
1219
  #
1214
1220
  # @example
1215
1221
  # options = {
1216
- # :filename => "c:/tmp/write_image.png",
1222
+ # :filename => File.join(Sketchup.temp_dir, 'example.png'),
1217
1223
  # :width => 640,
1218
1224
  # :height => 480,
1219
1225
  # :antialias => false,
@@ -1227,7 +1233,7 @@ class Sketchup::View
1227
1233
  # @version SketchUp 7
1228
1234
  # @param [Hash] options
1229
1235
  # @option options [String] filename The filename for the saved image.
1230
- # @option options [Integer] width (#vpwidth) Width in pixels (max +1600+).
1236
+ # @option options [Integer] width (#vpwidth) Width in pixels (max +16000+).
1231
1237
  # @option options [Integer] height (#vpheight) Height in pixels (max +16000+).
1232
1238
  # @option options [Float] scale_factor (1.0) Scaling factor for
1233
1239
  # elements that are viewport dependent, such as text heights, arrow heads,
@@ -1245,7 +1251,7 @@ class Sketchup::View
1245
1251
  #
1246
1252
  # @example
1247
1253
  # options = {
1248
- # :filename => "c:/tmp/write_image.png",
1254
+ # :filename => File.join(Sketchup.temp_dir, 'example.png'),
1249
1255
  # :source => :framebuffer,
1250
1256
  # :compression => 0.9,
1251
1257
  # }