sketchup-api-stubs 0.5.0 → 0.6.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/{autoload.rb → sketchup.rb} +5 -4
  3. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +4 -4
  4. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +2 -2
  5. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +23 -23
  6. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +5 -5
  7. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +3 -3
  8. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
  9. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
  10. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +1 -1
  11. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +0 -2
  12. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
  13. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +8 -5
  14. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +2 -2
  15. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +1 -1
  16. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +2 -2
  17. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +1 -1
  18. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
  19. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +2 -2
  20. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +18 -0
  21. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +4 -2
  22. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +8 -4
  23. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +8 -8
  24. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +3 -1
  25. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
  26. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +21 -2
  27. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -5
  28. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +208 -189
  29. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +55 -34
  30. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +3 -0
  31. data/lib/sketchup-api-stubs/stubs/_top_level.rb +11 -11
  32. data/lib/sketchup-api-stubs/stubs/array.rb +0 -2
  33. data/lib/sketchup-api-stubs/stubs/length.rb +69 -17
  34. data/lib/sketchup-api-stubs/stubs/sketchup.rb +36 -13
  35. data/lib/sketchup-api-stubs/stubs/ui.rb +3 -3
  36. metadata +13 -7
@@ -878,37 +878,20 @@ class Sketchup::View
878
878
  def vpwidth
879
879
  end
880
880
 
881
- # The write_image method is used to write the current view to an image file.
881
+ # The {#write_image} method is used to write the current view to an image file.
882
882
  #
883
- # All arguments except for the filename are optional.
884
- #
885
- # If antialias is specified, it should be either true or false.
886
- #
887
- # If a hash is passed as the first parameter, then the contents of that hash
888
- # define how the image is exported.
889
- #
890
- # @example With options hash.
891
- # options = {
892
- # :filename => "c:/tmp/write_image.png",
893
- # :width => 640,
894
- # :height => 480,
895
- # :antialias => false,
896
- # :compression => 0.9,
897
- # :transparent => true
898
- # }
899
- # model = Sketchup.active_model
900
- # view = model.active_view
901
- # view.write_image(options)
883
+ # @overload write_image(filename, width = view.vpwidth, height = view.vpheight, antialias = false, compression = 1.0)
902
884
  #
903
- # @example Legacy arguments variant.
904
- # filename => "c:/tmp/write_image.png"
905
- # antialias => false
906
- # compression => 0.9
907
- # model = Sketchup.active_model
908
- # view = model.active_view
909
- # view.write_image(filename, 640, 480, antialias, compression)
885
+ # @note Prefer the overload with option hash instead of this variant. This
886
+ # overload is not updated with new options.
910
887
  #
911
- # @overload write_image(filename, width = view.vpwidth, height = view.vpheight, antialias = false, compression = 1.0)
888
+ # @example
889
+ # filename => "c:/tmp/write_image.png"
890
+ # antialias => false
891
+ # compression => 0.9
892
+ # model = Sketchup.active_model
893
+ # view = model.active_view
894
+ # view.write_image(filename, 640, 480, antialias, compression)
912
895
  #
913
896
  # @param [String] filename
914
897
  # The filename for the saved image
@@ -917,23 +900,61 @@ class Sketchup::View
917
900
  # @param [Integer] height
918
901
  # Height in pixels, defaults to the current viewport height {#vpheight}.
919
902
  # @param [Boolean] antialias
920
- # true or false
921
903
  # @param [Float] compression
922
- # Float compression factor for JPEG images,
923
- # between 0.0 and 1.0
904
+ # Compression factor for JPEG images, between +0.0+ and +1.0+.
924
905
  #
925
906
  # @overload write_image(options)
926
907
  #
908
+ # @example
909
+ # options = {
910
+ # :filename => "c:/tmp/write_image.png",
911
+ # :width => 640,
912
+ # :height => 480,
913
+ # :antialias => false,
914
+ # :compression => 0.9,
915
+ # :transparent => true
916
+ # }
917
+ # model = Sketchup.active_model
918
+ # view = model.active_view
919
+ # view.write_image(options)
920
+ #
927
921
  # @version SketchUp 7
928
922
  # @param [Hash] options
929
923
  # @option options [String] filename The filename for the saved image.
930
- # @option options [Integer] width (#vpwidth) Width in pixels (max 16000).
931
- # @option options [Integer] height (#vpheight) Height in pixels (max 16000).
924
+ # @option options [Integer] width (#vpwidth) Width in pixels (max +1600+).
925
+ # @option options [Integer] height (#vpheight) Height in pixels (max +16000+).
926
+ # @option options [Float] scale_factor (1.0) Scaling factor for
927
+ # elements that are viewport dependent, such as text heights, arrow heads,
928
+ # line widths, stipple patterns, etc. (Added in SketchUp 2019.1)
932
929
  # @option options [Boolean] antialias (false)
933
930
  # @option options [Float] compression (1.0) Compression factor for JPEG,
934
- # images between 0.0 and 1.0
931
+ # images between +0.0+ and +1.0+.
935
932
  # @option options [Boolean] transparent (false) Added in SketchUp 8.
936
933
  #
934
+ # @overload write_image(options)
935
+ #
936
+ # It is possible to dump the framebuffer to file by setting +:source+ to
937
+ # +:framebuffer+. When saving the framebuffer only the following options are
938
+ # valid.
939
+ #
940
+ # @example
941
+ # options = {
942
+ # :filename => "c:/tmp/write_image.png",
943
+ # :source => :framebuffer,
944
+ # :compression => 0.9,
945
+ # }
946
+ # model = Sketchup.active_model
947
+ # view = model.active_view
948
+ # view.write_image(options)
949
+ #
950
+ # @version SketchUp 7
951
+ # @param [Hash] options
952
+ # @option options [String] filename The filename for the saved image.
953
+ # @option options [Boolean] source (:image) Set to +:framebuffer+ to dump the
954
+ # current framebuffer.
955
+ # @option options [Float] compression (1.0) Compression factor for JPEG,
956
+ # images between +0.0+ and +1.0+.
957
+ #
937
958
  # @return [Boolean]
938
959
  #
939
960
  # @version SketchUp 6.0
@@ -24,6 +24,9 @@ class Sketchup::ViewObserver
24
24
  # The {#onViewChanged} method is called whenever the view is altered, such as
25
25
  # when the user uses the Pan, Orbit, or Zoom tools are used.
26
26
  #
27
+ # @bug Prior to SketchUp 2019.2 this event did not trigger when the viewport
28
+ # size changed.
29
+ #
27
30
  # @example
28
31
  # def onViewChanged(view)
29
32
  # puts "onViewChanged: #{view}"
@@ -5,16 +5,19 @@
5
5
 
6
6
  # Constants
7
7
 
8
+ ALT_MODIFIER_KEY = nil # Stub value.
9
+ ALT_MODIFIER_MASK = nil # Stub value.
10
+
8
11
  ALeaderModel = nil # Stub value.
9
12
  ALeaderNone = nil # Stub value.
10
13
  ALeaderView = nil # Stub value.
11
14
 
12
- ALT_MODIFIER_KEY = nil # Stub value.
13
- ALT_MODIFIER_MASK = nil # Stub value.
14
-
15
15
  COPY_MODIFIER_KEY = nil # Stub value.
16
16
  COPY_MODIFIER_MASK = nil # Stub value.
17
17
 
18
+ CONSTRAIN_MODIFIER_KEY = nil # Stub value.
19
+ CONSTRAIN_MODIFIER_MASK = nil # Stub value.
20
+
18
21
  CMD_ARC = nil # Stub value.
19
22
  CMD_CAMERA_UNDO = nil # Stub value.
20
23
  CMD_CIRCLE = nil # Stub value.
@@ -83,9 +86,6 @@
83
86
  CMD_ZOOM_EXTENTS = nil # Stub value.
84
87
  CMD_ZOOM_WINDOW = nil # Stub value.
85
88
 
86
- CONSTRAIN_MODIFIER_KEY = nil # Stub value.
87
- CONSTRAIN_MODIFIER_MASK = nil # Stub value.
88
-
89
89
  DimensionArrowClosed = nil # Stub value.
90
90
  DimensionArrowDot = nil # Stub value.
91
91
  DimensionArrowNone = nil # Stub value.
@@ -107,6 +107,9 @@
107
107
  GL_TRIANGLE_FAN = nil # Stub value.
108
108
  GL_TRIANGLE_STRIP = nil # Stub value.
109
109
 
110
+ IDENTITY = nil # Stub value.
111
+ IDENTITY_2D = nil # Stub value.
112
+
110
113
  IDABORT = nil # Stub value.
111
114
  IDCANCEL = nil # Stub value.
112
115
  IDIGNORE = nil # Stub value.
@@ -115,9 +118,6 @@
115
118
  IDRETRY = nil # Stub value.
116
119
  IDYES = nil # Stub value.
117
120
 
118
- IDENTITY = nil # Stub value.
119
- IDENTITY_2D = nil # Stub value.
120
-
121
121
  LAYER_HIDDEN_BY_DEFAULT = nil # Stub value.
122
122
  LAYER_IS_HIDDEN_ON_NEW_PAGES = nil # Stub value.
123
123
  LAYER_IS_VISIBLE_ON_NEW_PAGES = nil # Stub value.
@@ -151,12 +151,12 @@
151
151
  PAGE_USE_SHADOWINFO = nil # Stub value.
152
152
  PAGE_USE_SKETCHCS = nil # Stub value.
153
153
 
154
- SKETCHUP_CONSOLE = nil # Stub value.
155
-
156
154
  SB_PROMPT = nil # Stub value.
157
155
  SB_VCB_LABEL = nil # Stub value.
158
156
  SB_VCB_VALUE = nil # Stub value.
159
157
 
158
+ SKETCHUP_CONSOLE = nil # Stub value.
159
+
160
160
  SnapTo_Arbitrary = nil # Stub value.
161
161
  SnapTo_Horizontal = nil # Stub value.
162
162
  SnapTo_Sloped = nil # Stub value.
@@ -393,8 +393,6 @@ class Array
393
393
  # @return [Boolean] +true+ if the point is on the line, +false+ if the
394
394
  # point is not on the line.
395
395
  #
396
- # @return [Boolean]
397
- #
398
396
  # @see Geom
399
397
  # The Geom module for instructions on how to create a line.
400
398
  #
@@ -9,28 +9,80 @@
9
9
  # stores values in inches as well. A number of methods have been added to the
10
10
  # Ruby Numeric class to do units conversions.
11
11
  #
12
- # Constants:
13
- # Length Format:
14
- # - Length::Decimal
15
- # - Length::Architectural
16
- # - Length::Engineering
17
- # - Length::Fractional
18
- # Length Unit:
19
- # - Length::Inches
20
- # - Length::Feet
21
- # - Length::Millimeter
22
- # - Length::Centimeter
23
- # - Length::Meter
24
- # The setting for the Length format and Length unit can be retrieved from the
25
- # model options by querying the "UnitsOptions" OptionsProvider for
26
- # "LengthFormat" and "LengthUnit" respectively.
12
+ # The setting for the Length Format and Length Unit can be retrieved from the
13
+ # {Sketchup::Model#options} by querying the +"UnitsOptions"+
14
+ # {Sketchup::OptionsProvider} for +"LengthFormat"+ and +"LengthUnit"+
15
+ # respectively.
27
16
  #
28
- # @note Prior to SketchUp 2015, Length used to be derived from Float. This is
29
- # no longer the case.
17
+ # *Constants:*
18
+ #
19
+ # [Length Format]
20
+ # - +Length::Decimal+
21
+ # - +Length::Architectural+
22
+ # - +Length::Engineering+
23
+ # - +Length::Fractional+
24
+ #
25
+ # [Length Unit]
26
+ # - +Length::Inches+
27
+ # - +Length::Feet+
28
+ # - +Length::Millimeter+
29
+ # - +Length::Centimeter+
30
+ # - +Length::Meter+
31
+ #
32
+ # [Area Unit]
33
+ # (Added in SketchUp 2019.1)
34
+ # - +Length::SquareInches+
35
+ # - +Length::SquareFeet+
36
+ # - +Length::SquareMillimeter+
37
+ # - +Length::SquareCentimeter+
38
+ # - +Length::SquareMeter+
39
+ #
40
+ # [Volume Unit]
41
+ # (Added in SketchUp 2019.1)
42
+ # - +Length::CubicInches+
43
+ # - +Length::CubicFeet+
44
+ # - +Length::CubicMillimeter+
45
+ # - +Length::CubicCentimeter+
46
+ # - +Length::CubicMeter+
47
+ #
48
+ # @note Prior to SketchUp 2015, +Length+ used to be derived from +Float+. This
49
+ # is no longer the case.
30
50
  #
31
51
  # @version SketchUp 6.0
32
52
  class Length < Float
33
53
 
54
+ # Constants
55
+
56
+ Architectural = nil # Stub value.
57
+
58
+ Centimeter = nil # Stub value.
59
+
60
+ CubicCentimeter = nil # Stub value.
61
+ CubicFeet = nil # Stub value.
62
+ CubicInches = nil # Stub value.
63
+ CubicMeter = nil # Stub value.
64
+ CubicMillimeter = nil # Stub value.
65
+
66
+ Decimal = nil # Stub value.
67
+
68
+ Engineering = nil # Stub value.
69
+
70
+ Fractional = nil # Stub value.
71
+
72
+ Feet = nil # Stub value.
73
+
74
+ Inches = nil # Stub value.
75
+
76
+ Millimeter = nil # Stub value.
77
+
78
+ Meter = nil # Stub value.
79
+
80
+ SquareCentimeter = nil # Stub value.
81
+ SquareFeet = nil # Stub value.
82
+ SquareInches = nil # Stub value.
83
+ SquareMeter = nil # Stub value.
84
+ SquareMillimeter = nil # Stub value.
85
+
34
86
  # Instance Methods
35
87
 
36
88
  # The < method is used to see if one length is less than another length.
@@ -306,19 +306,19 @@ module Sketchup
306
306
  def self.format_angle(number)
307
307
  end
308
308
 
309
- # The format_area method formats a number as an area using the current units
309
+ # The #{format_area} method formats a number as an area using the current units
310
310
  # settings.
311
311
  #
312
- # The default unit setting is inches. For example, 10 becomes 10 inches
313
- # squared.
312
+ # The +number+ must be in square inches.
314
313
  #
315
314
  # @example
316
- # area = Sketchup.format_area(number)
315
+ # number = 3.m * 4.m # This will result in 12m2 in inches.
316
+ # formatted_area = Sketchup.format_area(number)
317
317
  #
318
318
  # @param [Numeric] number
319
319
  # A number to be formatted.
320
320
  #
321
- # @return [String] an area if successful, false if unsuccessful.
321
+ # @return [String]
322
322
  #
323
323
  # @version SketchUp 6.0
324
324
  def self.format_area(number)
@@ -339,24 +339,46 @@ module Sketchup
339
339
  def self.format_degrees(number)
340
340
  end
341
341
 
342
- # The format_length method formats a number as a length using the current
342
+ # The {#format_length} method formats a number as a length using the current
343
343
  # units settings.
344
344
  #
345
345
  # The default unit setting is inches. For example, 10 becomes 10".
346
346
  #
347
347
  # @example
348
348
  # length = Sketchup.format_length(10)
349
- # if length
350
- # UI.messagebox(length)
351
- # end
349
+ #
350
+ # @overload format_length(number)
351
+ #
352
+ # @param [Numeric] number A number to be formatted.
353
+ #
354
+ # @overload format_length(number, precision)
355
+ #
356
+ # @param [Numeric] number A number to be formatted.
357
+ # @param [Integer] number A custom precision. Negative number will strip
358
+ # trailing zeros.
359
+ #
360
+ # @return [String]
361
+ #
362
+ # @version SketchUp 6.0
363
+ def self.format_length(*args)
364
+ end
365
+
366
+ # The #{format_volume} method formats a number as a volume using the current
367
+ # units settings.
368
+ #
369
+ # The +number+ must be in cubic inches.
370
+ #
371
+ # @example
372
+ # number = 3.m * 4.m * 5.m # This will result in 60m3 in inches.
373
+ # formatted_volume = Sketchup.format_area(number)
352
374
  #
353
375
  # @param [Numeric] number
354
376
  # A number to be formatted.
355
377
  #
356
- # @return [String] length if successful, false if unsuccessful
378
+ # @return [String]
357
379
  #
358
- # @version SketchUp 6.0
359
- def self.format_length(number)
380
+ # @version SketchUp 2019.2
381
+ def self.format_volume(number)
360
382
  end
361
383
 
362
384
  # The get_datfile_info method is used to retrieve the value for the given key
@@ -983,7 +1005,8 @@ module Sketchup
983
1005
  # - 21096: select the Circle tool
984
1006
  # - 21098: open the Open Window
985
1007
  # - 21100: select the Offset tool
986
- # - 21101: slect all objects
1008
+ # - 21101: select all objects
1009
+ # - 21107: invert selection
987
1010
  # - 21112: open the Import Window
988
1011
  # - 21124: launch the validity check tool
989
1012
  # - 21126: select the Axes tool
@@ -419,7 +419,7 @@ module UI
419
419
  def self.scale_factor
420
420
  end
421
421
 
422
- # The {.select_directory} method is used to display the OS dialog for selecting
422
+ # The {#select_directory} method is used to display the OS dialog for selecting
423
423
  # one or several directories from the file system.
424
424
  #
425
425
  # @example
@@ -462,7 +462,7 @@ module UI
462
462
  def self.select_directory(options = {})
463
463
  end
464
464
 
465
- # The set_cursor method is used to change the cursor to a new cursor with a
465
+ # The #{set_cursor} method is used to change the cursor to a new cursor with a
466
466
  # given cursor id. See UI.create_cursor and the Tool class for details
467
467
  # on creating your own tools with arbitrary cursors.
468
468
  #
@@ -478,7 +478,7 @@ module UI
478
478
  # @param [Integer] cursor_id
479
479
  # The id of the cursor you want to display.
480
480
  #
481
- # @return [nil]
481
+ # @return [Boolean]
482
482
  #
483
483
  # @version SketchUp 6.0
484
484
  def self.set_cursor(cursor_id)
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sketchup-api-stubs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trimble Inc, SketchUp Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-16 00:00:00.000000000 Z
11
+ date: 2019-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.15.0
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '1.13'
22
+ version: '3.0'
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.15.0
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '1.13'
32
+ version: '3.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -46,7 +52,7 @@ extra_rdoc_files: []
46
52
  files:
47
53
  - ".yardopts"
48
54
  - lib/sketchup-api-stubs.rb
49
- - lib/sketchup-api-stubs/autoload.rb
55
+ - lib/sketchup-api-stubs/sketchup.rb
50
56
  - lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb
51
57
  - lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb
52
58
  - lib/sketchup-api-stubs/stubs/Geom/LatLong.rb