sketchup-api-stubs 0.1.2 → 0.2.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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/SketchUp/Geom/BoundingBox.rb +17 -20
  3. data/SketchUp/Geom/Bounds2d.rb +172 -0
  4. data/SketchUp/Geom/LatLong.rb +31 -16
  5. data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
  6. data/SketchUp/Geom/Point2d.rb +365 -0
  7. data/SketchUp/Geom/Point3d.rb +121 -110
  8. data/SketchUp/Geom/PolygonMesh.rb +30 -21
  9. data/SketchUp/Geom/Transformation.rb +8 -4
  10. data/SketchUp/Geom/Transformation2d.rb +125 -0
  11. data/SketchUp/Geom/UTM.rb +43 -37
  12. data/SketchUp/Geom/Vector2d.rb +497 -0
  13. data/SketchUp/Geom/Vector3d.rb +143 -131
  14. data/SketchUp/Layout.rb +25 -0
  15. data/SketchUp/Layout/AngularDimension.rb +569 -0
  16. data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
  17. data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
  18. data/SketchUp/Layout/ConnectionPoint.rb +70 -0
  19. data/SketchUp/Layout/Document.rb +458 -0
  20. data/SketchUp/Layout/Ellipse.rb +29 -0
  21. data/SketchUp/Layout/Entities.rb +155 -0
  22. data/SketchUp/Layout/Entity.rb +363 -0
  23. data/SketchUp/Layout/FormattedText.rb +349 -0
  24. data/SketchUp/Layout/Grid.rb +131 -0
  25. data/SketchUp/Layout/Group.rb +261 -0
  26. data/SketchUp/Layout/Image.rb +86 -0
  27. data/SketchUp/Layout/Label.rb +371 -0
  28. data/SketchUp/Layout/Layer.rb +222 -0
  29. data/SketchUp/Layout/LayerInstance.rb +128 -0
  30. data/SketchUp/Layout/Layers.rb +232 -0
  31. data/SketchUp/Layout/LinearDimension.rb +563 -0
  32. data/SketchUp/Layout/LockedEntityError.rb +10 -0
  33. data/SketchUp/Layout/LockedLayerError.rb +11 -0
  34. data/SketchUp/Layout/Page.rb +187 -0
  35. data/SketchUp/Layout/PageInfo.rb +393 -0
  36. data/SketchUp/Layout/Pages.rb +216 -0
  37. data/SketchUp/Layout/Path.rb +326 -0
  38. data/SketchUp/Layout/Rectangle.rb +174 -0
  39. data/SketchUp/Layout/SketchUpModel.rb +522 -0
  40. data/SketchUp/Layout/Style.rb +1520 -0
  41. data/SketchUp/Layout/Table.rb +290 -0
  42. data/SketchUp/Layout/TableCell.rb +149 -0
  43. data/SketchUp/Layout/TableColumn.rb +139 -0
  44. data/SketchUp/Layout/TableRow.rb +135 -0
  45. data/SketchUp/Sketchup/Animation.rb +7 -4
  46. data/SketchUp/Sketchup/ArcCurve.rb +10 -10
  47. data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
  48. data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
  49. data/SketchUp/Sketchup/Color.rb +68 -78
  50. data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
  51. data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
  52. data/SketchUp/Sketchup/DefinitionList.rb +34 -17
  53. data/SketchUp/Sketchup/Drawingelement.rb +19 -21
  54. data/SketchUp/Sketchup/Edge.rb +22 -24
  55. data/SketchUp/Sketchup/Entities.rb +173 -162
  56. data/SketchUp/Sketchup/Entity.rb +71 -55
  57. data/SketchUp/Sketchup/Face.rb +45 -44
  58. data/SketchUp/Sketchup/Group.rb +47 -49
  59. data/SketchUp/Sketchup/Image.rb +16 -0
  60. data/SketchUp/Sketchup/ImageRep.rb +226 -0
  61. data/SketchUp/Sketchup/InstancePath.rb +13 -13
  62. data/SketchUp/Sketchup/Layer.rb +15 -17
  63. data/SketchUp/Sketchup/Material.rb +40 -30
  64. data/SketchUp/Sketchup/Materials.rb +40 -22
  65. data/SketchUp/Sketchup/Menu.rb +5 -5
  66. data/SketchUp/Sketchup/Model.rb +230 -228
  67. data/SketchUp/Sketchup/Page.rb +32 -0
  68. data/SketchUp/Sketchup/Pages.rb +3 -4
  69. data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
  70. data/SketchUp/Sketchup/SectionPlane.rb +64 -0
  71. data/SketchUp/Sketchup/Selection.rb +20 -28
  72. data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
  73. data/SketchUp/Sketchup/Text.rb +24 -26
  74. data/SketchUp/Sketchup/Texture.rb +28 -12
  75. data/SketchUp/Sketchup/Vertex.rb +14 -11
  76. data/SketchUp/Sketchup/View.rb +126 -116
  77. data/SketchUp/UI/Command.rb +17 -17
  78. data/SketchUp/UI/HtmlDialog.rb +8 -5
  79. data/SketchUp/UI/Notification.rb +1 -1
  80. data/SketchUp/UI/Toolbar.rb +13 -14
  81. data/SketchUp/UI/WebDialog.rb +55 -59
  82. data/SketchUp/_top_level.rb +139 -27
  83. data/SketchUp/{Array.rb → array.rb} +167 -30
  84. data/SketchUp/{Geom.rb → geom.rb} +9 -7
  85. data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
  86. data/SketchUp/{Length.rb → length.rb} +15 -15
  87. data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
  88. data/SketchUp/sketchup.rb +167 -156
  89. data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
  90. data/SketchUp/{String.rb → string.rb} +1 -1
  91. data/SketchUp/ui.rb +113 -87
  92. metadata +46 -9
@@ -17,7 +17,7 @@ class Sketchup::Text < Sketchup::Drawingelement
17
17
  # @example
18
18
  # type = text.arrow_type=0
19
19
  #
20
- # @return arrow - a numerical representation for the type of
20
+ # @return [Integer] a numerical representation for the type of
21
21
  # arrow.
22
22
  #
23
23
  # @version SketchUp 6.0
@@ -32,11 +32,11 @@ class Sketchup::Text < Sketchup::Drawingelement
32
32
  # @example
33
33
  # arrow = text.arrow_type=type
34
34
  #
35
- # @param type
35
+ # @param [Integer] type
36
36
  # A numerical representation of the type of arrow to be
37
37
  # set.
38
38
  #
39
- # @return arrow - a numerical representation for the type of
39
+ # @return [Integer] a numerical representation for the type of
40
40
  # arrow.
41
41
  #
42
42
  # @version SketchUp 6.0
@@ -51,11 +51,11 @@ class Sketchup::Text < Sketchup::Drawingelement
51
51
  # @example
52
52
  # leader = text.display_leader=true
53
53
  #
54
- # @param status
54
+ # @param [Boolean] status
55
55
  # true if you want to display the leader text, false if
56
56
  # you do not want to display the leader text.
57
57
  #
58
- # @return status - the status that you set.
58
+ # @return [Boolean] the status that you set.
59
59
  #
60
60
  # @version SketchUp 6.0
61
61
  def display_leader=(status)
@@ -66,8 +66,7 @@ class Sketchup::Text < Sketchup::Drawingelement
66
66
  # @example
67
67
  # status = text.display_leader
68
68
  #
69
- # @return status - true if the leader is being displayed, false
70
- # if it is not displayed.
69
+ # @return [Boolean]
71
70
  #
72
71
  # @return [Boolean]
73
72
  #
@@ -80,8 +79,7 @@ class Sketchup::Text < Sketchup::Drawingelement
80
79
  # @example
81
80
  # status = text.has_leader
82
81
  #
83
- # @return status - true if the Text object has a leader. False if
84
- # the Text object does not have a leader.
82
+ # @return [Boolean]
85
83
  #
86
84
  # @return [Boolean]
87
85
  #
@@ -94,7 +92,7 @@ class Sketchup::Text < Sketchup::Drawingelement
94
92
  # @example
95
93
  # leader = text.leader_type
96
94
  #
97
- # @return leader - a numerical value representing the currently
95
+ # @return [Integer] a numerical value representing the currently
98
96
  # set leader type.
99
97
  #
100
98
  # @version SketchUp 6.0
@@ -108,11 +106,11 @@ class Sketchup::Text < Sketchup::Drawingelement
108
106
  # @example
109
107
  # leader = text.leader_type=1
110
108
  #
111
- # @param type
109
+ # @param [Integer] type
112
110
  # A numerical value representing the leader type to be
113
111
  # set.
114
112
  #
115
- # @return leader - a numerical value representing the leader type
113
+ # @return [Integer] a numerical value representing the leader type
116
114
  # you just set.
117
115
  #
118
116
  # @version SketchUp 6.0
@@ -126,7 +124,7 @@ class Sketchup::Text < Sketchup::Drawingelement
126
124
  # @example
127
125
  # weight = text.line_weight
128
126
  #
129
- # @return lineweight - the line weight in pixels
127
+ # @return [Integer] the line weight in pixels
130
128
  #
131
129
  # @version SketchUp 6.0
132
130
  def line_weight
@@ -139,10 +137,10 @@ class Sketchup::Text < Sketchup::Drawingelement
139
137
  # @example
140
138
  # newweight = text.line_weight = 4
141
139
  #
142
- # @param weight
140
+ # @param [Integer] weight
143
141
  # The line weight to be set (in pixels).
144
142
  #
145
- # @return The line weight that has been set.
143
+ # @return [Integer] The line weight that has been set.
146
144
  #
147
145
  # @version SketchUp 6.0
148
146
  def line_weight=(weight)
@@ -153,7 +151,7 @@ class Sketchup::Text < Sketchup::Drawingelement
153
151
  # @example
154
152
  # point3d = text.point
155
153
  #
156
- # @return point - a Point3d object.
154
+ # @return [Geom::Point3d] a Point3d object.
157
155
  #
158
156
  # @version SketchUp 6.0
159
157
  def point
@@ -164,10 +162,10 @@ class Sketchup::Text < Sketchup::Drawingelement
164
162
  # @example
165
163
  # status = text.point = point3d
166
164
  #
167
- # @param point3d
165
+ # @param [Geom::Point3d] point3d
168
166
  # A Point3d object.
169
167
  #
170
- # @return status - true if successful, false if unsuccessful.
168
+ # @return [Geom::Point3d] true if successful, false if unsuccessful.
171
169
  #
172
170
  # @version SketchUp 6.0
173
171
  def point=(point3d)
@@ -179,10 +177,10 @@ class Sketchup::Text < Sketchup::Drawingelement
179
177
  # @example
180
178
  # text = text.set_text "This is another text"
181
179
  #
182
- # @param textstring
180
+ # @param [String] textstring
183
181
  # The string to be set within the Text object.
184
182
  #
185
- # @return text - the Text object
183
+ # @return [Sketchup::Text] the Text object
186
184
  #
187
185
  # @version SketchUp 6.0
188
186
  def set_text(textstring)
@@ -193,7 +191,7 @@ class Sketchup::Text < Sketchup::Drawingelement
193
191
  # @example
194
192
  # textstring = text.text
195
193
  #
196
- # @return textstring - the string representation of the Text
194
+ # @return [String] the string representation of the Text
197
195
  # object
198
196
  #
199
197
  # @version SketchUp 6.0
@@ -205,9 +203,9 @@ class Sketchup::Text < Sketchup::Drawingelement
205
203
  # @example
206
204
  # textstring = text.text= "text"
207
205
  #
208
- # @param textstring
206
+ # @param [String] textstring
209
207
  #
210
- # @return textstring - the newly set text
208
+ # @return [String] the newly set text
211
209
  #
212
210
  # @version SketchUp 6.0
213
211
  def text=(textstring)
@@ -218,7 +216,7 @@ class Sketchup::Text < Sketchup::Drawingelement
218
216
  # @example
219
217
  # vector = text.vector
220
218
  #
221
- # @return vector - a Vector3d object.
219
+ # @return [Geom::Vector3d] a Vector3d object.
222
220
  #
223
221
  # @version SketchUp 6.0
224
222
  def vector
@@ -229,10 +227,10 @@ class Sketchup::Text < Sketchup::Drawingelement
229
227
  # @example
230
228
  # vector = text.vector
231
229
  #
232
- # @param vector
230
+ # @param [Geom::Vector3d] vector
233
231
  # A Vector3d object.
234
232
  #
235
- # @return success - true if successful.
233
+ # @return [Geom::Vector3d]
236
234
  #
237
235
  # @version SketchUp 6.0
238
236
  def vector=(vector)
@@ -34,7 +34,7 @@ class Sketchup::Texture < Sketchup::Entity
34
34
  # UI.messagebox "Failure: No average color"
35
35
  # end
36
36
  #
37
- # @return color - a color object (if successful), nil if
37
+ # @return [Sketchup::Color, nil] a color object (if successful), nil if
38
38
  # unsuccessful.
39
39
  #
40
40
  # @version SketchUp 6.0
@@ -63,7 +63,7 @@ class Sketchup::Texture < Sketchup::Entity
63
63
  # UI.messagebox "Failure"
64
64
  # end
65
65
  #
66
- # @return filename - a string representation of the path and
66
+ # @return [String] a string representation of the path and
67
67
  # filename used for the texture.
68
68
  #
69
69
  # @version SketchUp 6.0
@@ -76,7 +76,7 @@ class Sketchup::Texture < Sketchup::Entity
76
76
  # @example
77
77
  # height = texture.height
78
78
  #
79
- # @return height - the height, in inches, of the texture pattern
79
+ # @return [Integer] the height, in inches, of the texture pattern
80
80
  #
81
81
  # @version SketchUp 6.0
82
82
  def height
@@ -93,13 +93,29 @@ class Sketchup::Texture < Sketchup::Entity
93
93
  # UI.messagebox "Failure"
94
94
  # end
95
95
  #
96
- # @return imageheight - the height, in pixels, of the texture
96
+ # @return [Integer] the height, in pixels, of the texture
97
97
  # pattern
98
98
  #
99
99
  # @version SketchUp 6.0
100
100
  def image_height
101
101
  end
102
102
 
103
+ # The {#image_rep} method returns a copy of a {Sketchup::ImageRep} object
104
+ # representing the texture pixel data.
105
+ #
106
+ # @example
107
+ # texture = Sketchup.active_model.materials[0].texture
108
+ # image_rep = texture.image_rep
109
+ #
110
+ # @param [Boolean] colorized
111
+ # Set to +true+ to obtain the colorized version.
112
+ #
113
+ # @return [Sketchup::ImageRep]
114
+ #
115
+ # @version SketchUp 2018
116
+ def image_rep(colorized = false)
117
+ end
118
+
103
119
  # The image_width method retrieves the width of the repeatable texture image,
104
120
  # in pixels.
105
121
  #
@@ -111,7 +127,7 @@ class Sketchup::Texture < Sketchup::Entity
111
127
  # UI.messagebox "Failure"
112
128
  # end
113
129
  #
114
- # @return imagewidth - the width, in pixels, of the texture
130
+ # @return [Integer] the width, in pixels, of the texture
115
131
  # pattern
116
132
  #
117
133
  # @version SketchUp 6.0
@@ -139,14 +155,14 @@ class Sketchup::Texture < Sketchup::Entity
139
155
  # UI.messagebox "Failure"
140
156
  # end
141
157
  #
142
- # @param size
158
+ # @param [Integer, Array(Integer, Integer)] size
143
159
  # The size, in inches, of the texture. This number will
144
160
  # apply to height and width to keep aspect ratio.
145
161
  # You can also pass as a parameter an array of two
146
162
  # numeric values which will set width and height
147
163
  # regardless of maintaining the height/width ratio.
148
164
  #
149
- # @return size - the size, in inches, of the texture. This number
165
+ # @return [Integer, Array(Integer, Integer)] the size, in inches, of the texture. This number
150
166
  # will apply to height and width to keep aspect ratio.
151
167
  # If you have passed in an array of two numbers for width
152
168
  # and height, the same array will be returned if
@@ -166,7 +182,7 @@ class Sketchup::Texture < Sketchup::Entity
166
182
  # UI.messagebox status
167
183
  # end
168
184
  #
169
- # @return status - true if valid, false if invalid.
185
+ # @return [Boolean]
170
186
  #
171
187
  # @return [Boolean]
172
188
  #
@@ -180,7 +196,7 @@ class Sketchup::Texture < Sketchup::Entity
180
196
  # @example
181
197
  # width = texture.width
182
198
  #
183
- # @return width - the width, in inches, of the texture pattern
199
+ # @return [Integer] the width, in inches, of the texture pattern
184
200
  #
185
201
  # @version SketchUp 6.0
186
202
  def width
@@ -195,14 +211,14 @@ class Sketchup::Texture < Sketchup::Entity
195
211
  # filename = File.join(Sketchup.temp_dir, basename)
196
212
  # material.texture.write(filename)
197
213
  #
198
- # @param filename
214
+ # @param [String] filename
199
215
  # String - The filename to write the texture to.
200
216
  #
201
- # @param colorize
217
+ # @param [Boolean] colorize
202
218
  # Boolean - Allows for the texture to
203
219
  # be exported with the color adjustments.
204
220
  #
205
- # @return Boolean - true if the method succeeded
221
+ # @return [Boolean] true if the method succeeded
206
222
  #
207
223
  # @version SketchUp 2016
208
224
  def write(filename, colorize = false)
@@ -24,10 +24,10 @@ class Sketchup::Vertex < Sketchup::Entity
24
24
  # UI.messagebox "Failure"
25
25
  # end
26
26
  #
27
- # @param vertex2
27
+ # @param [Sketchup::Vertex] vertex2
28
28
  # A Vertex object.
29
29
  #
30
- # @return edge - an Edge object common to both vertices if
30
+ # @return [Sketchup::Edge, nil] an Edge object common to both vertices if
31
31
  # successful. Returns nil if there is no edge between the
32
32
  # two vertices.
33
33
  #
@@ -35,7 +35,7 @@ class Sketchup::Vertex < Sketchup::Entity
35
35
  def common_edge(vertex2)
36
36
  end
37
37
 
38
- # The curve_interior? method is used to determine if this vertex is on the
38
+ # The {#curve_interior?} method is used to determine if this vertex is on the
39
39
  # interior of a Curve.
40
40
  #
41
41
  # @example
@@ -51,8 +51,11 @@ class Sketchup::Vertex < Sketchup::Entity
51
51
  # UI.messagebox "Failure"
52
52
  # end
53
53
  #
54
- # @return status - true if it is used by exactly two edges which
55
- # are both part of the same curve.
54
+ # @note This method doesn't actually return a boolean as the question mark
55
+ # post-fix would normally indicate. But the result still evaluates to
56
+ # truthy or falsy.
57
+ #
58
+ # @return [Boolean]
56
59
  #
57
60
  # @return [Boolean]
58
61
  #
@@ -69,7 +72,7 @@ class Sketchup::Vertex < Sketchup::Entity
69
72
  # vertex1 = verticies[0]
70
73
  # edges = vertex1.edges
71
74
  #
72
- # @return edges - an Array of edge objects if successful
75
+ # @return [Array<Sketchup::Edge>] an Array of edge objects if successful
73
76
  #
74
77
  # @version SketchUp 6.0
75
78
  def edges
@@ -84,7 +87,7 @@ class Sketchup::Vertex < Sketchup::Entity
84
87
  # vertex1 = verticies[0]
85
88
  # faces = vertex1.faces
86
89
  #
87
- # @return faces - an Array of faces that use the vertex if
90
+ # @return [Array<Sketchup::Face>] an Array of faces that use the vertex if
88
91
  # successful
89
92
  #
90
93
  # @version SketchUp 6.0
@@ -100,7 +103,7 @@ class Sketchup::Vertex < Sketchup::Entity
100
103
  # vertex1 = verticies[0]
101
104
  # loops = vertex1.loops
102
105
  #
103
- # @return loops - an Array of loops that use the vertex if
106
+ # @return [Array<Sketchup::Loop>] an Array of loops that use the vertex if
104
107
  # successful
105
108
  #
106
109
  # @version SketchUp 6.0
@@ -116,7 +119,7 @@ class Sketchup::Vertex < Sketchup::Entity
116
119
  # vertex1 = verticies[0]
117
120
  # position = vertex1.position
118
121
  #
119
- # @return point - a Point3d object representing the position of
122
+ # @return [Geom::Point3d] a Point3d object representing the position of
120
123
  # the vertex if successful
121
124
  #
122
125
  # @version SketchUp 6.0
@@ -129,10 +132,10 @@ class Sketchup::Vertex < Sketchup::Entity
129
132
  # @example
130
133
  # used = vertex1.used_by? my_face
131
134
  #
132
- # @param face_or_edge
135
+ # @param [Sketchup::Edge, Sketchup::Face] face_or_edge
133
136
  # A Face or Edge ot test against.
134
137
  #
135
- # @return used - true if the Vertex is used in the given entity.
138
+ # @return [Boolean]
136
139
  #
137
140
  # @return [Boolean]
138
141
  #
@@ -22,10 +22,10 @@ class Sketchup::View
22
22
  # view = Sketchup.active_model.active_view
23
23
  # status = view.add_observer observer
24
24
  #
25
- # @param observer
25
+ # @param [Object] observer
26
26
  # An observer.
27
27
  #
28
- # @return true if successful, false if unsuccessful.
28
+ # @return [Boolean] true if successful, false if unsuccessful.
29
29
  #
30
30
  # @version SketchUp 6.0
31
31
  def add_observer(observer)
@@ -45,10 +45,10 @@ class Sketchup::View
45
45
  # UI.messagebox "Failure"
46
46
  # end
47
47
  #
48
- # @param animation
48
+ # @param [#nextFrame] animation
49
49
  # An Animation object.
50
50
  #
51
- # @return animation - the newly set Animation object
51
+ # @return [#nextFrame] the newly set Animation object
52
52
  #
53
53
  # @version SketchUp 6.0
54
54
  def animation=(animation)
@@ -63,7 +63,7 @@ class Sketchup::View
63
63
  # view = model.active_view
64
64
  # time = view.average_refresh_time
65
65
  #
66
- # @return time - the time in milliseconds
66
+ # @return [Float] the time in seconds
67
67
  #
68
68
  # @version SketchUp 6.0
69
69
  def average_refresh_time
@@ -74,7 +74,7 @@ class Sketchup::View
74
74
  # @example
75
75
  # camera = view.camera
76
76
  #
77
- # @return camera - a Camera object
77
+ # @return [Sketchup::Camera] a Camera object
78
78
  #
79
79
  # @version SketchUp 6.0
80
80
  def camera
@@ -92,15 +92,15 @@ class Sketchup::View
92
92
  #
93
93
  # @overload camera=(camera)
94
94
  #
95
- # @param [Sketchup::Camera] camera The new Camera object.
96
- # @return nil
95
+ # @param camera [Sketchup::Camera] The new Camera object.
96
+ # @return [Sketchup::Camera]
97
97
  #
98
98
  # @overload camera=(camera_and_transition)
99
99
  #
100
- # @param [Array(Sketchup::Camera, Float)] camera_and_transition
101
- # The second item in the array represent the transition time from the
102
- # existing camera to the
103
- # @return nil
100
+ # @param camera_and_transition [Array(Sketchup::Camera, Float)]
101
+ # The second item in the array represents the transition time from the
102
+ # existing camera to the new one
103
+ # @return [Array(Sketchup::Camera, Float)]
104
104
  #
105
105
  # @version SketchUp 6.0
106
106
  def camera=(arg)
@@ -114,7 +114,7 @@ class Sketchup::View
114
114
  # view = model.active_view
115
115
  # c = view.center
116
116
  #
117
- # @return center - the center of the view
117
+ # @return [Geom::Point3d] the center of the view
118
118
  #
119
119
  # @version SketchUp 6.0
120
120
  def center
@@ -137,11 +137,11 @@ class Sketchup::View
137
137
  # @example
138
138
  # point = view.corner index
139
139
  #
140
- # @param index
140
+ # @param [Integer] index
141
141
  # A value between (or including) 0 and 3 identifying the
142
142
  # corner whose coordinate you want to retrieve.
143
143
  #
144
- # @return point - a 2d array [w,h] representing the screen point
144
+ # @return [Array(Integer, Integer)] a 2d array [w,h] representing the screen point
145
145
  #
146
146
  # @version SketchUp 6.0
147
147
  def corner(index)
@@ -217,10 +217,10 @@ class Sketchup::View
217
217
  # view.draw(GL_LINE_LOOP, points)
218
218
  #
219
219
  # @note If you draw outside the model bounds you need to implement
220
- # {Tool#getExtents} which return a bounding box large enough to include the
220
+ # {Tool#getExtents} which returns a bounding box large enough to include the
221
221
  # points you draw. Otherwise your drawing will be clipped.
222
222
  #
223
- # @param [Integer] mode
223
+ # @param [Integer] openglenum
224
224
  # The item you are going to draw, one of the constants
225
225
  # from the comments, such as +GL_LINES+.
226
226
  #
@@ -231,7 +231,7 @@ class Sketchup::View
231
231
  # @see Tool#getExtents
232
232
  #
233
233
  # @version SketchUp 6.0
234
- def draw(mode, points)
234
+ def draw(openglenum, points)
235
235
  end
236
236
 
237
237
  # The {#draw2d} method is used to draw in screen space (using 2D screen
@@ -253,12 +253,12 @@ class Sketchup::View
253
253
  # ]
254
254
  # view.draw2d(GL_LINE_STRIP, points)
255
255
  #
256
- # @param [Array<Geom::Point3d>] points
257
- #
258
256
  # @param [Integer] openglenum
259
257
  # An OpenGL enumerator (unsigned integer). See
260
258
  # comments in the {#draw} method for a list of constants.
261
259
  #
260
+ # @param [Array<Geom::Point3d>] points
261
+ #
262
262
  # @return [Sketchup::View] returns the View object.
263
263
  #
264
264
  # @see #draw
@@ -283,13 +283,13 @@ class Sketchup::View
283
283
  #
284
284
  # @overload draw_lines(point_list, ...)
285
285
  #
286
- # @param point_list An even number of Point3d objects.
287
- # @return view - a View object
286
+ # @param point_list [Array<Geom::Point3d>] An even number of Point3d objects.
287
+ # @return [Sketchup::View] returns the View object
288
288
  #
289
289
  # @overload draw_lines(pts)
290
290
  #
291
- # @param pts An array of Point3d objects.
292
- # @return view - a View object
291
+ # @param pts [Array<Geom::Point3d>] An array of Point3d objects.
292
+ # @return [Sketchup::View] returns the View object
293
293
  #
294
294
  # @version SketchUp 6.0
295
295
  def draw_line(*args)
@@ -309,13 +309,13 @@ class Sketchup::View
309
309
  #
310
310
  # @overload draw_lines(point_list, ...)
311
311
  #
312
- # @param point_list An even number of Point3d objects.
313
- # @return view - a View object
312
+ # @param point_list [Array<Geom::Point3d>] An even number of Point3d objects.
313
+ # @return [Sketchup::View] returns the View object
314
314
  #
315
315
  # @overload draw_lines(pts)
316
316
  #
317
- # @param pts An array of Point3d objects.
318
- # @return view - a View object
317
+ # @param pts [Array<Geom::Point3d>] An array of Point3d objects.
318
+ # @return [Sketchup::View] returns the View object
319
319
  #
320
320
  # @version SketchUp 6.0
321
321
  def draw_lines(*args)
@@ -330,24 +330,24 @@ class Sketchup::View
330
330
  # # returns a view
331
331
  # status = view.draw_points point3, 10, 1, "red"
332
332
  #
333
- # @param pts
333
+ # @param [Array<Geom::Point3d>] pts
334
334
  # An array of Point3d objects.
335
335
  #
336
- # @param [optional] pointsize
337
- # Size of the point in pixels.
338
- #
339
- # @param [optional] pointcolor
340
- # Color of the point.
341
- #
342
- # @param [optional] pointstyle
336
+ # @param [Integer] pointstyle
343
337
  # Style of the point. 1 = open square,
344
338
  # 2 = filled square, 3 = "+", 4 = "X", 5 = "*",
345
339
  # 6 = open triangle, 7 = filled triangle.
346
340
  #
347
- # @return view - a View object
341
+ # @param [Sketchup::Color] pointcolor
342
+ # Color of the point.
343
+ #
344
+ # @param [Integer] pointsize
345
+ # Size of the point in pixels.
346
+ #
347
+ # @return [Sketchup::View] a View object
348
348
  #
349
349
  # @version SketchUp 6.0
350
- def draw_points(pts, pointsize, pointstyle, pointcolor)
350
+ def draw_points(pts, pointsize = 6, pointstyle = 3, pointcolor = 'black')
351
351
  end
352
352
 
353
353
  # The draw_polyline method is used to draw a series of connected line segments
@@ -364,13 +364,13 @@ class Sketchup::View
364
364
  #
365
365
  # @overload draw_polyline(point_list, ...)
366
366
  #
367
- # @param point_list An even number of Point3d objects.
368
- # @return view - a View object
367
+ # @param point_list [Array<Geom::Point3d>] An even number of Point3d objects.
368
+ # @return [Sketchup::View] a View object
369
369
  #
370
370
  # @overload draw_polyline(pts)
371
371
  #
372
- # @param pts An array of Point3d objects.
373
- # @return view - a View object
372
+ # @param pts [Array<Geom::Point3d>] An array of Point3d objects.
373
+ # @return [Sketchup::View] a View object
374
374
  #
375
375
  # @version SketchUp 6.0
376
376
  def draw_polyline(*args)
@@ -443,10 +443,10 @@ class Sketchup::View
443
443
  # @example
444
444
  # view = view.drawing_color = color
445
445
  #
446
- # @param color
446
+ # @param [Sketchup::Color, String] color
447
447
  # A Color object.
448
448
  #
449
- # @return view - a View object
449
+ # @return [Sketchup::View]
450
450
  #
451
451
  # @version SketchUp 6.0
452
452
  def drawing_color=(color)
@@ -463,10 +463,10 @@ class Sketchup::View
463
463
  # @example
464
464
  # view.dynamic = true
465
465
  #
466
- # @param value
466
+ # @param [Boolean] value
467
467
  # true or false
468
468
  #
469
- # @return nil
469
+ # @return [Boolean]
470
470
  #
471
471
  # @version SketchUp 6.0
472
472
  def dynamic=(value)
@@ -478,7 +478,7 @@ class Sketchup::View
478
478
  # @example
479
479
  # fov = Sketchup.active_model.active_view.field_of_view
480
480
  #
481
- # @return fov - the field of view
481
+ # @return [Float] the field of view
482
482
  #
483
483
  # @version SketchUp 6.0
484
484
  def field_of_view
@@ -492,10 +492,10 @@ class Sketchup::View
492
492
  # my_view.field_of_view = 45
493
493
  # my_view.invalidate
494
494
  #
495
- # @param fov
496
- # - the field of view
495
+ # @param [Numeric] fov
496
+ # the field of view
497
497
  #
498
- # @return status - true if successful
498
+ # @return [Numeric]
499
499
  #
500
500
  # @version SketchUp 6.0
501
501
  def field_of_view=(fov)
@@ -510,11 +510,11 @@ class Sketchup::View
510
510
  # @example
511
511
  # target = view.guess_target
512
512
  #
513
- # @return target - a Point3d object representing the point in the
513
+ # @return [Geom::Point3d] a Point3d object representing the point in the
514
514
  # model that the user is likely interested in.
515
515
  #
516
516
  # @version SketchUp 6.0
517
- def guess_target
517
+ def guess_target(*args)
518
518
  end
519
519
 
520
520
  # The inference_locked? method is used to determine if inference locking is on
@@ -525,7 +525,7 @@ class Sketchup::View
525
525
  # view = model.active_view
526
526
  # status = view.inference_locked
527
527
  #
528
- # @return status - true if locked, false if unlocked
528
+ # @return [Boolean]
529
529
  #
530
530
  # @return [Boolean]
531
531
  #
@@ -542,16 +542,16 @@ class Sketchup::View
542
542
  # @example
543
543
  # inputpoint = view.inputpoint x, y, inputpoint1
544
544
  #
545
- # @param x
545
+ # @param [Numeric] x
546
546
  # A x value.
547
547
  #
548
- # @param y
549
- # A y value.
550
- #
551
- # @param inputpoint1
548
+ # @param [Sketchup::InputPoint] inputpoint1
552
549
  # An InputPoint object.
553
550
  #
554
- # @return nil
551
+ # @param [Numeric] y
552
+ # A y value.
553
+ #
554
+ # @return [Sketchup::InputPoint]
555
555
  #
556
556
  # @version SketchUp 6.0
557
557
  def inputpoint(x, y, inputpoint1)
@@ -567,7 +567,7 @@ class Sketchup::View
567
567
  # @note This is the preferred method to update the viewport. Use this before
568
568
  # trying to use {#refresh}.
569
569
  #
570
- # @return invalidated_view - the invalidated View object
570
+ # @return [Sketchup::View] the invalidated View object
571
571
  #
572
572
  # @version SketchUp 6.0
573
573
  def invalidate
@@ -579,10 +579,10 @@ class Sketchup::View
579
579
  # @example
580
580
  # time = view.last_refresh_time
581
581
  #
582
- # @return time - time in milliseconds
582
+ # @return [Float] time in milliseconds
583
583
  #
584
584
  # @version SketchUp 6.0
585
- def last_refresh_time
585
+ def last_refresh_time(*args)
586
586
  end
587
587
 
588
588
  # The line_stipple= method is used to set the line pattern to use for drawing.
@@ -602,10 +602,10 @@ class Sketchup::View
602
602
  # view.line_stipple = "-.-"
603
603
  # view = view.draw_lines point8, point9
604
604
  #
605
- # @param pattern
605
+ # @param [String] pattern
606
606
  # A string stipple pattern, such as "-.-"
607
607
  #
608
- # @return view - the View object
608
+ # @return [Sketchup::View] the View object
609
609
  #
610
610
  # @version SketchUp 6.0
611
611
  def line_stipple=(pattern)
@@ -619,10 +619,10 @@ class Sketchup::View
619
619
  # @example
620
620
  # view.line_width = width
621
621
  #
622
- # @param width
622
+ # @param [Integer] width
623
623
  # The width in pixels.
624
624
  #
625
- # @return view - a View object
625
+ # @return [Integer]
626
626
  #
627
627
  # @version SketchUp 6.0
628
628
  def line_width=(width)
@@ -638,19 +638,28 @@ class Sketchup::View
638
638
  #
639
639
  # @example
640
640
  # view = view.lock_inference
641
- # view = view.lock_inference inputpoint
642
- # view = view.lock_inference inputpoint1, inputpoint2
641
+ # view = view.lock_inference(inputpoint)
642
+ # view = view.lock_inference(inputpoint1, inputpoint2)
643
+ #
644
+ # @overload lock_inference
645
+ #
643
646
  #
644
- # @param [optional] inputpoint
645
- # 1st InputPoint to inference to.
647
+ # @overload lock_inference(inputpoint)
646
648
  #
647
- # @param [optional] inputpoint2
648
- # 2nd InputPoint to inference to.
649
+ # @param [Sketchup::InputPoint] inputpoint
650
+ # 1st InputPoint to inference to.
649
651
  #
650
- # @return view - a View object
652
+ # @overload lock_inference(inputpoint, inputpoint2)
653
+ #
654
+ # @param [Sketchup::InputPoint] inputpoint
655
+ # 1st InputPoint to inference to.
656
+ # @param [Sketchup::InputPoint] inputpoint2
657
+ # 2nd InputPoint to inference to.
658
+ #
659
+ # @return [Sketchup::View] a View object
651
660
  #
652
661
  # @version SketchUp 6.0
653
- def lock_inference(inputpoint, inputpoint2)
662
+ def lock_inference(*args)
654
663
  end
655
664
 
656
665
  # The model method is used to retrieve the model for the current view.
@@ -658,7 +667,7 @@ class Sketchup::View
658
667
  # @example
659
668
  # model = view.model
660
669
  #
661
- # @return model - the model for this view
670
+ # @return [Sketchup::Model] the model for this view
662
671
  #
663
672
  # @version SketchUp 6.0
664
673
  def model
@@ -676,14 +685,14 @@ class Sketchup::View
676
685
  #
677
686
  # @overload pick_helper
678
687
  #
679
- # @return pickhelper - a PickHelper object
688
+ # @return [Sketchup::PickHelper] a PickHelper object
680
689
  #
681
690
  # @overload pick_helper(x, y, aperture = 0)
682
691
  #
683
692
  # @param [Integer] x
684
693
  # @param [Integer] y
685
694
  # @param [Integer] aperture
686
- # @return pickhelper - a PickHelper object
695
+ # @return [Sketchup::PickHelper] a PickHelper object
687
696
  #
688
697
  # @version SketchUp 6.0
689
698
  def pick_helper(*args)
@@ -698,13 +707,13 @@ class Sketchup::View
698
707
  # @overload pickray(screen_point)
699
708
  #
700
709
  # @param [Array(Integer, Integer)] screen_point
701
- # @return ray - a ray
710
+ # @return [Array(Geom::Point3d, Geom::Vector3d)] a ray
702
711
  #
703
712
  # @overload pickray(x, y)
704
713
  #
705
714
  # @param [Integer] x
706
715
  # @param [Integer] y
707
- # @return ray - a ray
716
+ # @return [Array(Geom::Point3d, Geom::Vector3d)] a ray
708
717
  #
709
718
  # @version SketchUp 6.0
710
719
  def pickray(*args)
@@ -719,13 +728,13 @@ class Sketchup::View
719
728
  # @example
720
729
  # size = view.pixels_to_model pixels, point
721
730
  #
722
- # @param pixels
731
+ # @param [Numeric] pixels
723
732
  # The pixel size.
724
733
  #
725
- # @param point
734
+ # @param [Geom::Point3d] point
726
735
  # A Point3d object where the size will be calculated from.
727
736
  #
728
- # @return size - the model size
737
+ # @return [Float] the model size
729
738
  #
730
739
  # @version SketchUp 6.0
731
740
  def pixels_to_model(pixels, point)
@@ -742,7 +751,7 @@ class Sketchup::View
742
751
  # instability or crashes. Don't use this unless you have verified that
743
752
  # you cannot use {#invalidate} instead.
744
753
  #
745
- # @return refreshed_view - the refreshed View object
754
+ # @return [Sketchup::View] the refreshed View object
746
755
  #
747
756
  # @version SketchUp 7.1
748
757
  def refresh
@@ -755,10 +764,10 @@ class Sketchup::View
755
764
  # view = Sketchup.active_model.active_view
756
765
  # status = view.remove_observer observer
757
766
  #
758
- # @param observer
767
+ # @param [Object] observer
759
768
  # An observer.
760
769
  #
761
- # @return true if successful, false if unsuccessful.
770
+ # @return [Boolean] true if successful, false if unsuccessful.
762
771
  #
763
772
  # @version SketchUp 6.0
764
773
  def remove_observer(observer)
@@ -774,10 +783,10 @@ class Sketchup::View
774
783
  # @example
775
784
  # point = view.screen_coords(ORIGIN)
776
785
  #
777
- # @param point3d
786
+ # @param [Geom::Point3d] point3d
778
787
  # A Point3d object.
779
788
  #
780
- # @return x, y - A Point3d containing the screen position
789
+ # @return [Geom::Point3d] A Point3d containing the screen position
781
790
  #
782
791
  # @version SketchUp 6.0
783
792
  def screen_coords(point3d)
@@ -792,13 +801,13 @@ class Sketchup::View
792
801
  # @example
793
802
  # view = view.set_color_from_line point1, point2
794
803
  #
795
- # @param point1
804
+ # @param [Geom::Point3d] point1
796
805
  # Point3d object representing first point in the line.
797
806
  #
798
- # @param point2
799
- # Point3d object representing second point in the line.
807
+ # @param [Geom::Point3d] point2
808
+ # Point3d object representing the second point in the line.
800
809
  #
801
- # @return view - a View object
810
+ # @return [Sketchup::View] a View object
802
811
  #
803
812
  # @version SketchUp 6.0
804
813
  def set_color_from_line(point1, point2)
@@ -811,12 +820,12 @@ class Sketchup::View
811
820
  # frame. This can be useful to control the speed at which the animation runs.
812
821
  #
813
822
  # @example
814
- # status = view.show_frame &lt;delay
823
+ # status = view.show_frame delay
815
824
  #
816
- # @param delay
825
+ # @param [Numeric] delay
817
826
  # An optional delay in seconds.
818
827
  #
819
- # @return nil
828
+ # @return [Sketchup::View]
820
829
  #
821
830
  # @version SketchUp 6.0
822
831
  def show_frame(delay)
@@ -828,10 +837,10 @@ class Sketchup::View
828
837
  # @example
829
838
  # tooltip = view.tooltip = string
830
839
  #
831
- # @param string
840
+ # @param [String] string
832
841
  # The string tooltip.
833
842
  #
834
- # @return tooltip - the new tooltip string
843
+ # @return [String] the new tooltip string
835
844
  #
836
845
  # @version SketchUp 6.0
837
846
  def tooltip=(string)
@@ -845,7 +854,7 @@ class Sketchup::View
845
854
  # view = model.active_view
846
855
  # height = view.vpheight
847
856
  #
848
- # @return height - the height of the viewport in pixels.
857
+ # @return [Integer] the height of the viewport in pixels.
849
858
  #
850
859
  # @version SketchUp 6.0
851
860
  def vpheight
@@ -857,7 +866,7 @@ class Sketchup::View
857
866
  # @example
858
867
  # width = view.vpwidth
859
868
  #
860
- # @return width - the width of the viewport in pixels.
869
+ # @return [Integer] the width of the viewport in pixels.
861
870
  #
862
871
  # @version SketchUp 6.0
863
872
  def vpwidth
@@ -908,27 +917,28 @@ class Sketchup::View
908
917
  # view = model.active_view
909
918
  # view.write_image keys
910
919
  #
911
- # @param [optional] width
912
- # Width in pixels.
920
+ # @overload write_image(filename, width = view.vpwidth, height = view.vpheight, antialias = false, compression = 1.0)
913
921
  #
914
- # @param filename_or_hash
915
- # The filename for the saved image or a hash
916
- # containing a set of keys.
922
+ # @param [String] filename
923
+ # The filename for the saved image
924
+ # @param [Integer] width
925
+ # Width in pixels, defaults to the current viewport width {#vpwidth}.
926
+ # @param [Integer] height
927
+ # Height in pixels, defaults to the current viewport height {#vpheight}.
928
+ # @param [Boolean] antialias
929
+ # true or false
930
+ # @param [Float] compression
931
+ # Float compression factor for JPEG images,
932
+ # between 0.0 and 1.0
917
933
  #
918
- # @param [optional] height
919
- # Height in pixels.
934
+ # @overload write_image(options)
920
935
  #
921
- # @param [optional] compression
922
- # Float compression factor for JPEG images,
923
- # between 0.0 and 1.0
936
+ # @param [Hash] options
924
937
  #
925
- # @param [optional] antialias
926
- # true or false
927
- #
928
- # @return nil
938
+ # @return [Boolean]
929
939
  #
930
940
  # @version SketchUp 6.0
931
- def write_image(filename_or_hash, width, height, antialias, compression)
941
+ def write_image(*args)
932
942
  end
933
943
 
934
944
  # The zoom method is used to zoom in or out by some zoom factor.
@@ -939,11 +949,11 @@ class Sketchup::View
939
949
  # view = view.zoom entity
940
950
  # view = view.zoom array_of_entities
941
951
  #
942
- # @param zoom_or_ents
952
+ # @param [Numeric, Sketchup::Selection, Sketchup::Entity, Array<Sketchup::Entity>] zoom_or_ents
943
953
  # A Float zoom factor from 1.0 or larger or an Array or
944
954
  # collection of entities to "zoom extents" around.
945
955
  #
946
- # @return view - the zoomed View object
956
+ # @return [Sketchup::View] the zoomed View object
947
957
  #
948
958
  # @version SketchUp 6.0
949
959
  def zoom(zoom_or_ents)
@@ -956,7 +966,7 @@ class Sketchup::View
956
966
  # view = Sketchup.active_model.active_view
957
967
  # new_view = view.zoom_extents
958
968
  #
959
- # @return new_view - the zoomed View object
969
+ # @return [Sketchup::View] the zoomed View object
960
970
  #
961
971
  # @version SketchUp 6.0
962
972
  def zoom_extents