sketchup-api-stubs 0.6.1 → 0.7.4

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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/lib/sketchup-api-stubs.rb +1 -1
  4. data/lib/sketchup-api-stubs/sketchup.rb +145 -145
  5. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +318 -318
  6. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  7. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  8. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -401
  10. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  11. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +492 -492
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  13. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  14. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -523
  16. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
  17. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -569
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +174 -186
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +514 -455
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +143 -155
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -359
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -123
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -86
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +371 -371
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +220 -232
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -563
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +204 -216
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -547
  43. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  44. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +140 -140
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -281
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +328 -328
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +577 -577
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +281 -281
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +562 -554
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +194 -194
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +329 -329
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +72 -72
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +102 -102
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +312 -312
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +38 -38
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +390 -390
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +508 -508
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1119 -1097
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -537
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +59 -59
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +750 -750
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +697 -697
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +409 -409
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +226 -226
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +190 -190
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +393 -393
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +82 -82
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +303 -303
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +285 -262
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +244 -231
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +136 -136
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -123
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +416 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +311 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +141 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +95 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1638 -1483
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +356 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +132 -132
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -282
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +770 -650
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +353 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +76 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +456 -456
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -356
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +44 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +454 -454
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +57 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +211 -211
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +225 -225
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +829 -829
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +154 -154
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +61 -61
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1301 -995
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +43 -43
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +310 -310
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +356 -356
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +229 -229
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -303
  140. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +348 -233
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  143. data/lib/sketchup-api-stubs/stubs/length.rb +278 -262
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1310 -1310
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  147. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +667 -660
  149. metadata +2 -16
@@ -1,393 +1,393 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The InputPoint used to pick entities that reside under the current cursor
5
- # location. InputPoint and PickHelper are similar, but InputPoint also uses
6
- # inferencing. Only tools react to cursor location. Therefore, most of the
7
- # methods in this class are only useful in the context of a tool you are
8
- # writing. For example, if you want to determine the entity that you just
9
- # clicked on with the mouse, you would use InputPoint.pick from within your
10
- # onLMouseButton method in a tool. See the example script linetool.rb for
11
- # examples of using the InputPoint class.
12
- #
13
- # @version SketchUp 6.0
14
- class Sketchup::InputPoint
15
-
16
- # Instance Methods
17
-
18
- # The == method is used to determine if two input points are the same.
19
- #
20
- # @example
21
- # view = Sketchup.active_model.active_view
22
- # x = 100
23
- # y = 100
24
- # ip1 = Sketchup::InputPoint.new
25
- # ip2 = view.inputpoint x,y
26
- # # Copy the contents of inputpoint2 into inputpoint1
27
- # ip1.copy! ip2
28
- # # Returns true
29
- # status = ip1 == ip2
30
- #
31
- # @param inputpoint2
32
- # The second input point in the comparison.
33
- #
34
- # @return status - true if the InputPoint objects are the same
35
- # object. False if the objects are not the same.
36
- #
37
- # @version SketchUp 6.0
38
- def ==(inputpoint2)
39
- end
40
-
41
- # The clear method is used to clear the input point.
42
- #
43
- # This sets it to an empty state. After calling this, valid? will return
44
- # false.
45
- #
46
- # @example
47
- # view = Sketchup.active_model.active_view
48
- # x = 100
49
- # y = 100
50
- # ip1 = view.inputpoint x,y
51
- # # Returns true
52
- # ip = ip1.clear
53
- #
54
- # @return inputpoint - the cleared (empty) input point if this
55
- # successful
56
- #
57
- # @version SketchUp 6.0
58
- def clear
59
- end
60
-
61
- # The copy! method is used to copy the data from a second input point into
62
- # this input point.
63
- #
64
- # @example
65
- # view = Sketchup.active_model.active_view
66
- # x = 100
67
- # y = 100
68
- # ip1 = Sketchup::InputPoint.new
69
- # ip2 = view.inputpoint x,y
70
- # # Copy the contents of inputpoint2 into inputpoint1
71
- # ip = ip1.copy! ip2
72
- #
73
- # @param inputpoint
74
- # The second input point.
75
- #
76
- # @return inputpoint - the new input point that received the copy
77
- # if successful
78
- #
79
- # @version SketchUp 6.0
80
- def copy!(inputpoint)
81
- end
82
-
83
- # The degrees_of_freedom method retrieves the number of degrees of freedom
84
- # there are for an input point.
85
- #
86
- # If you are just getting a point in space, then the degrees_of_freedom will
87
- # be 3 - meaning that there is nothing about the point that would constrain
88
- # its position.
89
- #
90
- # If you are on a face, then the degrees_of_freedom will be 2
91
- # meaning that you can only move on the plane of the face.
92
- #
93
- # If you are on an Edge or an axis, then the degrees_of_freedom will be 1
94
- # meaning that you can only move in the direction of the edge or axis.
95
- #
96
- # If you get an end point of an Edge, or an intersection point, then the
97
- # degrees_of_freedom will be 0.
98
- #
99
- # @example
100
- # view = Sketchup.active_model.active_view
101
- # x = 100
102
- # y = 100
103
- # ip1 = view.inputpoint x,y
104
- # dof = ip1.degrees_of_freedom
105
- #
106
- # @return degrees_of_freedom - see comments.
107
- #
108
- # @version SketchUp 6.0
109
- def degrees_of_freedom
110
- end
111
-
112
- # The depth method retrieves the depth of an inference if it is coming from a
113
- # component.
114
- #
115
- # If the InputPoint is not getting a position from inside a component, this
116
- # method will return 0. Otherwise it returns the depth of the entity in a
117
- # nested component that is providing the position.
118
- #
119
- # @example
120
- # view = Sketchup.active_model.active_view
121
- # x = 100
122
- # y = 100
123
- # ip1 = view.inputpoint x,y
124
- # d = ip1.depth
125
- #
126
- # @return depth - a number representing the depth of the
127
- # inputpoint (inside groups and components) if successful
128
- #
129
- # @version SketchUp 6.0
130
- def depth
131
- end
132
-
133
- # The display? method is used to determine if the input point has anything to
134
- # draw.
135
- #
136
- # If the method returns true, then the draw method will draw something.
137
- #
138
- # @example
139
- # view = Sketchup.active_model.active_view
140
- # x = 100
141
- # y = 100
142
- # ip1 = view.inputpoint x,y
143
- # status = ip1.display
144
- #
145
- # @return [Boolean] status - true if the draw method will draw something,
146
- # false if the draw method has nothing to draw
147
- #
148
- # @version SketchUp 6.0
149
- def display?
150
- end
151
-
152
- # The draw method is used to draw the input point.
153
- #
154
- # This is useful for showing an InputPoint from within the draw method of a
155
- # tool that you have implemented in Ruby. Additional examples are available in
156
- # the Plugins/examples directory.
157
- #
158
- # @example
159
- # view = Sketchup.active_model.active_view
160
- # x = 100
161
- # y = 100
162
- # ip1 = view.inputpoint x,y
163
- # ip = ip1.draw view
164
- #
165
- # @param view
166
- # The current view.
167
- #
168
- # @return view
169
- #
170
- # @version SketchUp 6.0
171
- def draw(view)
172
- end
173
-
174
- # The edge method is used to retrieve the edge if the input point is getting
175
- # its position from a point on an Edge.
176
- #
177
- # @example
178
- # view = Sketchup.active_model.active_view
179
- # x = 100
180
- # y = 100
181
- # ip1 = view.inputpoint x,y
182
- # e = ip1.edge
183
- #
184
- # @return edge - an Edge object if successful, or nil if
185
- # unsuccessful
186
- #
187
- # @version SketchUp 6.0
188
- def edge
189
- end
190
-
191
- # The face method retrieves the face if the input point is getting its
192
- # position from a face.
193
- #
194
- # Otherwise it returns nil.
195
- #
196
- # @example
197
- # view = Sketchup.active_model.active_view
198
- # x = 100
199
- # y = 100
200
- # ip1 = view.inputpoint x,y
201
- # f = ip1.face
202
- #
203
- # @return face - a Face object if successful, or nil if
204
- # unsuccessful
205
- #
206
- # @version SketchUp 6.0
207
- def face
208
- end
209
-
210
- # The new method is used to create a new InputPoint object.
211
- #
212
- # @example
213
- # ip1 = Sketchup::InputPoint.new
214
- #
215
- # # Or you can construct it at an arbitrary location.
216
- # starting_point = Geom::Point3d.new(100, 200, 300)
217
- # ip2 = Sketchup::InputPoint.new(starting_point)
218
- #
219
- # @note Prior to SketchUp 2019 it was not possible to
220
- # sub-class {Sketchup::InputPoint} due to a bug in how SketchUp initialized
221
- # the class.
222
- #
223
- # @param pt_or_vertex
224
- # An optional Point3d or Vertex where the new InputPoint
225
- # should be created.
226
- #
227
- # @return inputpoint - the newly created InputPoint object if
228
- # successful
229
- #
230
- # @version SketchUp 6.0
231
- def initialize(pt_or_vertex)
232
- end
233
-
234
- # The {#instance_path} method retrieves the instance path for the picked point.
235
- #
236
- # The returned instance_path is a copy of what the input point is holding on to
237
- # at the moment you access it. Your copy will not update if you make new picks
238
- # with the input point.
239
- #
240
- # If there has been no valid pick it will return `nil`.
241
- #
242
- # @example
243
- # view = Sketchup.active_model.active_view
244
- # x = 100
245
- # y = 100
246
- # ip = view.inputpoint(x, y)
247
- # instance_path = ip.instance_path
248
- #
249
- # @return [Sketchup::InstancePath, nil]
250
- #
251
- # @version SketchUp 2017
252
- def instance_path
253
- end
254
-
255
- # The pick method is used to get the input point at a specific screen
256
- # position.
257
- #
258
- # The first form just uses the screen position to compute the InputPoint. It
259
- # is used when you don't want the InputPoint to be dependent on another
260
- # InputPoint.
261
- #
262
- # The second form uses the screen position and another InputPoint. It will
263
- # find additional inferences such as along one of the axis directions from the
264
- # first point.
265
- #
266
- # @example
267
- # view = Sketchup.active_model.active_view
268
- # x = 100
269
- # y = 100
270
- # inputpoint = view.inputpoint x, y
271
- # inputpoint2 = Sketchup::InputPoint.new
272
- # inputpoint.pick view, x, y
273
- # inputpoint.pick view, x, y, inputpoint2
274
- #
275
- # @param view
276
- # The current view.
277
- #
278
- # @param x
279
- # A x value.
280
- #
281
- # @param y
282
- # A y value.
283
- #
284
- # @param [optional] inputpoint
285
- # A second input point used as a reference
286
- # for the pick.
287
- #
288
- # @return status - true if a valid InputPoint was picked and it
289
- # is different than it was before.
290
- #
291
- # @version SketchUp 6.0
292
- def pick(view, x, y, inputpoint)
293
- end
294
-
295
- # The position method is used to get the 3D point from the input point.
296
- #
297
- # @example
298
- # view = Sketchup.active_model.active_view
299
- # x = 100
300
- # y = 100
301
- # ip1 = view.inputpoint x,y
302
- # point = ip1.position
303
- #
304
- # @return point - a Point3d object position for the input point
305
- # if successful
306
- #
307
- # @version SketchUp 6.0
308
- def position
309
- end
310
-
311
- # The tooltip method is used to retrieve the string that is the tool tip to
312
- # display for the input point.
313
- #
314
- # @example
315
- # view = Sketchup.active_model.active_view
316
- # x = 100
317
- # y = 100
318
- # ip1 = view.inputpoint x,y
319
- # # Click on a face and you get "On Face"
320
- # tip = ip1.tooltip
321
- #
322
- # @return tip - a string tooltip or an empty string (if the input
323
- # point doesn't provide a tooltip).
324
- #
325
- # @version SketchUp 6.0
326
- def tooltip
327
- end
328
-
329
- # The transformation method retrieves the Transformation object for the input
330
- # point.
331
- #
332
- # If the InputPoint object is getting its position from something inside of a
333
- # component instance, this method returns the Transformation of the component
334
- # instance. Otherwise it returns the identity Transformation.
335
- #
336
- # Note that the position method on a input point always returns a point that is
337
- # transformed into model space. If you are using the edge, face or vertex
338
- # method on the InputPoint though, you will probably need to use the
339
- # transformation method to transform the data that you get back from the
340
- # selected entity.
341
- #
342
- # @example
343
- # view = Sketchup.active_model.active_view
344
- # x = 100
345
- # y = 100
346
- # ip1 = view.inputpoint x,y
347
- # # In this case, returning the identity transformation
348
- # tform = ip1.transformation
349
- #
350
- # @return transformation - the Transformation for the input point
351
- # if successful
352
- #
353
- # @version SketchUp 6.0
354
- def transformation
355
- end
356
-
357
- # The valid? method is used to determine if an input point has valid data.
358
- #
359
- # You must have called the pick method to set the data before it is valid.
360
- #
361
- # @example
362
- # view = Sketchup.active_model.active_view
363
- # x = 100
364
- # y = 100
365
- # ip1 = view.inputpoint x,y
366
- # status = ip1.valid?
367
- #
368
- # @return [Boolean] status - true if the input point has valid data, false
369
- # if it does not have valid data.
370
- #
371
- # @version SketchUp 6.0
372
- def valid?
373
- end
374
-
375
- # The vertex method returns a Vertex associated with the InputPoint. If the
376
- # InputPoint is on the end of a line, then it will return the Vertex. If the
377
- # InputPoint does not select any vertices this method returns nil.
378
- #
379
- # @example
380
- # view = Sketchup.active_model.active_view
381
- # x = 100
382
- # y = 100
383
- # ip1 = view.inputpoint x,y
384
- # # Click on a face and you get "On Face"
385
- # tip = ip1.vertex
386
- #
387
- # @return vertex - The associated vertex
388
- #
389
- # @version SketchUp 6.0
390
- def vertex
391
- end
392
-
393
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The InputPoint used to pick entities that reside under the current cursor
5
+ # location. InputPoint and PickHelper are similar, but InputPoint also uses
6
+ # inferencing. Only tools react to cursor location. Therefore, most of the
7
+ # methods in this class are only useful in the context of a tool you are
8
+ # writing. For example, if you want to determine the entity that you just
9
+ # clicked on with the mouse, you would use InputPoint.pick from within your
10
+ # onLMouseButton method in a tool. See the example script linetool.rb for
11
+ # examples of using the InputPoint class.
12
+ #
13
+ # @version SketchUp 6.0
14
+ class Sketchup::InputPoint
15
+
16
+ # Instance Methods
17
+
18
+ # The == method is used to determine if two input points are the same.
19
+ #
20
+ # @example
21
+ # view = Sketchup.active_model.active_view
22
+ # x = 100
23
+ # y = 100
24
+ # ip1 = Sketchup::InputPoint.new
25
+ # ip2 = view.inputpoint x,y
26
+ # # Copy the contents of inputpoint2 into inputpoint1
27
+ # ip1.copy! ip2
28
+ # # Returns true
29
+ # status = ip1 == ip2
30
+ #
31
+ # @param inputpoint2
32
+ # The second input point in the comparison.
33
+ #
34
+ # @return status - true if the InputPoint objects are the same
35
+ # object. False if the objects are not the same.
36
+ #
37
+ # @version SketchUp 6.0
38
+ def ==(inputpoint2)
39
+ end
40
+
41
+ # The clear method is used to clear the input point.
42
+ #
43
+ # This sets it to an empty state. After calling this, valid? will return
44
+ # false.
45
+ #
46
+ # @example
47
+ # view = Sketchup.active_model.active_view
48
+ # x = 100
49
+ # y = 100
50
+ # ip1 = view.inputpoint x,y
51
+ # # Returns true
52
+ # ip = ip1.clear
53
+ #
54
+ # @return inputpoint - the cleared (empty) input point if this
55
+ # successful
56
+ #
57
+ # @version SketchUp 6.0
58
+ def clear
59
+ end
60
+
61
+ # The copy! method is used to copy the data from a second input point into
62
+ # this input point.
63
+ #
64
+ # @example
65
+ # view = Sketchup.active_model.active_view
66
+ # x = 100
67
+ # y = 100
68
+ # ip1 = Sketchup::InputPoint.new
69
+ # ip2 = view.inputpoint x,y
70
+ # # Copy the contents of inputpoint2 into inputpoint1
71
+ # ip = ip1.copy! ip2
72
+ #
73
+ # @param inputpoint
74
+ # The second input point.
75
+ #
76
+ # @return inputpoint - the new input point that received the copy
77
+ # if successful
78
+ #
79
+ # @version SketchUp 6.0
80
+ def copy!(inputpoint)
81
+ end
82
+
83
+ # The degrees_of_freedom method retrieves the number of degrees of freedom
84
+ # there are for an input point.
85
+ #
86
+ # If you are just getting a point in space, then the degrees_of_freedom will
87
+ # be 3 - meaning that there is nothing about the point that would constrain
88
+ # its position.
89
+ #
90
+ # If you are on a face, then the degrees_of_freedom will be 2
91
+ # meaning that you can only move on the plane of the face.
92
+ #
93
+ # If you are on an Edge or an axis, then the degrees_of_freedom will be 1
94
+ # meaning that you can only move in the direction of the edge or axis.
95
+ #
96
+ # If you get an end point of an Edge, or an intersection point, then the
97
+ # degrees_of_freedom will be 0.
98
+ #
99
+ # @example
100
+ # view = Sketchup.active_model.active_view
101
+ # x = 100
102
+ # y = 100
103
+ # ip1 = view.inputpoint x,y
104
+ # dof = ip1.degrees_of_freedom
105
+ #
106
+ # @return degrees_of_freedom - see comments.
107
+ #
108
+ # @version SketchUp 6.0
109
+ def degrees_of_freedom
110
+ end
111
+
112
+ # The depth method retrieves the depth of an inference if it is coming from a
113
+ # component.
114
+ #
115
+ # If the InputPoint is not getting a position from inside a component, this
116
+ # method will return 0. Otherwise it returns the depth of the entity in a
117
+ # nested component that is providing the position.
118
+ #
119
+ # @example
120
+ # view = Sketchup.active_model.active_view
121
+ # x = 100
122
+ # y = 100
123
+ # ip1 = view.inputpoint x,y
124
+ # d = ip1.depth
125
+ #
126
+ # @return depth - a number representing the depth of the
127
+ # inputpoint (inside groups and components) if successful
128
+ #
129
+ # @version SketchUp 6.0
130
+ def depth
131
+ end
132
+
133
+ # The display? method is used to determine if the input point has anything to
134
+ # draw.
135
+ #
136
+ # If the method returns true, then the draw method will draw something.
137
+ #
138
+ # @example
139
+ # view = Sketchup.active_model.active_view
140
+ # x = 100
141
+ # y = 100
142
+ # ip1 = view.inputpoint x,y
143
+ # status = ip1.display
144
+ #
145
+ # @return [Boolean] status - true if the draw method will draw something,
146
+ # false if the draw method has nothing to draw
147
+ #
148
+ # @version SketchUp 6.0
149
+ def display?
150
+ end
151
+
152
+ # The draw method is used to draw the input point.
153
+ #
154
+ # This is useful for showing an InputPoint from within the draw method of a
155
+ # tool that you have implemented in Ruby. Additional examples are available in
156
+ # the Plugins/examples directory.
157
+ #
158
+ # @example
159
+ # view = Sketchup.active_model.active_view
160
+ # x = 100
161
+ # y = 100
162
+ # ip1 = view.inputpoint x,y
163
+ # ip = ip1.draw view
164
+ #
165
+ # @param view
166
+ # The current view.
167
+ #
168
+ # @return view
169
+ #
170
+ # @version SketchUp 6.0
171
+ def draw(view)
172
+ end
173
+
174
+ # The edge method is used to retrieve the edge if the input point is getting
175
+ # its position from a point on an Edge.
176
+ #
177
+ # @example
178
+ # view = Sketchup.active_model.active_view
179
+ # x = 100
180
+ # y = 100
181
+ # ip1 = view.inputpoint x,y
182
+ # e = ip1.edge
183
+ #
184
+ # @return edge - an Edge object if successful, or nil if
185
+ # unsuccessful
186
+ #
187
+ # @version SketchUp 6.0
188
+ def edge
189
+ end
190
+
191
+ # The face method retrieves the face if the input point is getting its
192
+ # position from a face.
193
+ #
194
+ # Otherwise it returns nil.
195
+ #
196
+ # @example
197
+ # view = Sketchup.active_model.active_view
198
+ # x = 100
199
+ # y = 100
200
+ # ip1 = view.inputpoint x,y
201
+ # f = ip1.face
202
+ #
203
+ # @return face - a Face object if successful, or nil if
204
+ # unsuccessful
205
+ #
206
+ # @version SketchUp 6.0
207
+ def face
208
+ end
209
+
210
+ # The new method is used to create a new InputPoint object.
211
+ #
212
+ # @example
213
+ # ip1 = Sketchup::InputPoint.new
214
+ #
215
+ # # Or you can construct it at an arbitrary location.
216
+ # starting_point = Geom::Point3d.new(100, 200, 300)
217
+ # ip2 = Sketchup::InputPoint.new(starting_point)
218
+ #
219
+ # @note Prior to SketchUp 2019 it was not possible to
220
+ # sub-class {Sketchup::InputPoint} due to a bug in how SketchUp initialized
221
+ # the class.
222
+ #
223
+ # @param pt_or_vertex
224
+ # An optional Point3d or Vertex where the new InputPoint
225
+ # should be created.
226
+ #
227
+ # @return inputpoint - the newly created InputPoint object if
228
+ # successful
229
+ #
230
+ # @version SketchUp 6.0
231
+ def initialize(pt_or_vertex)
232
+ end
233
+
234
+ # The {#instance_path} method retrieves the instance path for the picked point.
235
+ #
236
+ # The returned instance_path is a copy of what the input point is holding on to
237
+ # at the moment you access it. Your copy will not update if you make new picks
238
+ # with the input point.
239
+ #
240
+ # If there has been no valid pick it will return `nil`.
241
+ #
242
+ # @example
243
+ # view = Sketchup.active_model.active_view
244
+ # x = 100
245
+ # y = 100
246
+ # ip = view.inputpoint(x, y)
247
+ # instance_path = ip.instance_path
248
+ #
249
+ # @return [Sketchup::InstancePath, nil]
250
+ #
251
+ # @version SketchUp 2017
252
+ def instance_path
253
+ end
254
+
255
+ # The pick method is used to get the input point at a specific screen
256
+ # position.
257
+ #
258
+ # The first form just uses the screen position to compute the InputPoint. It
259
+ # is used when you don't want the InputPoint to be dependent on another
260
+ # InputPoint.
261
+ #
262
+ # The second form uses the screen position and another InputPoint. It will
263
+ # find additional inferences such as along one of the axis directions from the
264
+ # first point.
265
+ #
266
+ # @example
267
+ # view = Sketchup.active_model.active_view
268
+ # x = 100
269
+ # y = 100
270
+ # inputpoint = view.inputpoint x, y
271
+ # inputpoint2 = Sketchup::InputPoint.new
272
+ # inputpoint.pick view, x, y
273
+ # inputpoint.pick view, x, y, inputpoint2
274
+ #
275
+ # @param view
276
+ # The current view.
277
+ #
278
+ # @param x
279
+ # A x value.
280
+ #
281
+ # @param y
282
+ # A y value.
283
+ #
284
+ # @param [optional] inputpoint
285
+ # A second input point used as a reference
286
+ # for the pick.
287
+ #
288
+ # @return status - true if a valid InputPoint was picked and it
289
+ # is different than it was before.
290
+ #
291
+ # @version SketchUp 6.0
292
+ def pick(view, x, y, inputpoint)
293
+ end
294
+
295
+ # The position method is used to get the 3D point from the input point.
296
+ #
297
+ # @example
298
+ # view = Sketchup.active_model.active_view
299
+ # x = 100
300
+ # y = 100
301
+ # ip1 = view.inputpoint x,y
302
+ # point = ip1.position
303
+ #
304
+ # @return point - a Point3d object position for the input point
305
+ # if successful
306
+ #
307
+ # @version SketchUp 6.0
308
+ def position
309
+ end
310
+
311
+ # The tooltip method is used to retrieve the string that is the tool tip to
312
+ # display for the input point.
313
+ #
314
+ # @example
315
+ # view = Sketchup.active_model.active_view
316
+ # x = 100
317
+ # y = 100
318
+ # ip1 = view.inputpoint x,y
319
+ # # Click on a face and you get "On Face"
320
+ # tip = ip1.tooltip
321
+ #
322
+ # @return tip - a string tooltip or an empty string (if the input
323
+ # point doesn't provide a tooltip).
324
+ #
325
+ # @version SketchUp 6.0
326
+ def tooltip
327
+ end
328
+
329
+ # The transformation method retrieves the Transformation object for the input
330
+ # point.
331
+ #
332
+ # If the InputPoint object is getting its position from something inside of a
333
+ # component instance, this method returns the Transformation of the component
334
+ # instance. Otherwise it returns the identity Transformation.
335
+ #
336
+ # Note that the position method on a input point always returns a point that is
337
+ # transformed into model space. If you are using the edge, face or vertex
338
+ # method on the InputPoint though, you will probably need to use the
339
+ # transformation method to transform the data that you get back from the
340
+ # selected entity.
341
+ #
342
+ # @example
343
+ # view = Sketchup.active_model.active_view
344
+ # x = 100
345
+ # y = 100
346
+ # ip1 = view.inputpoint x,y
347
+ # # In this case, returning the identity transformation
348
+ # tform = ip1.transformation
349
+ #
350
+ # @return transformation - the Transformation for the input point
351
+ # if successful
352
+ #
353
+ # @version SketchUp 6.0
354
+ def transformation
355
+ end
356
+
357
+ # The valid? method is used to determine if an input point has valid data.
358
+ #
359
+ # You must have called the pick method to set the data before it is valid.
360
+ #
361
+ # @example
362
+ # view = Sketchup.active_model.active_view
363
+ # x = 100
364
+ # y = 100
365
+ # ip1 = view.inputpoint x,y
366
+ # status = ip1.valid?
367
+ #
368
+ # @return [Boolean] status - true if the input point has valid data, false
369
+ # if it does not have valid data.
370
+ #
371
+ # @version SketchUp 6.0
372
+ def valid?
373
+ end
374
+
375
+ # The vertex method returns a Vertex associated with the InputPoint. If the
376
+ # InputPoint is on the end of a line, then it will return the Vertex. If the
377
+ # InputPoint does not select any vertices this method returns nil.
378
+ #
379
+ # @example
380
+ # view = Sketchup.active_model.active_view
381
+ # x = 100
382
+ # y = 100
383
+ # ip1 = view.inputpoint x,y
384
+ # # Click on a face and you get "On Face"
385
+ # tip = ip1.vertex
386
+ #
387
+ # @return vertex - The associated vertex
388
+ #
389
+ # @version SketchUp 6.0
390
+ def vertex
391
+ end
392
+
393
+ end