sketchup-api-stubs 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs.rb +1 -1
- data/lib/sketchup-api-stubs/sketchup.rb +147 -145
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +498 -492
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +179 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +515 -514
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -371
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -220
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -204
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -694
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +577 -562
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +604 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +362 -329
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1126 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +751 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +699 -697
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +417 -409
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +405 -393
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +327 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -456
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +835 -829
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +71 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1307 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +317 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +387 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +255 -229
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/geom.rb +351 -348
- data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
- data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
- data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/sketchup.rb +1342 -1310
- data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/ui.rb +668 -667
- metadata +4 -2
@@ -1,76 +1,77 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# This observer interface is implemented to react to pages events.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# {
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
# {
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# This observer interface is implemented to react to pages events.
|
5
|
+
#
|
6
|
+
# @abstract To implement this observer, create a Ruby class of this type, override the
|
7
|
+
# desired methods, and add an instance of the observer to the objects of
|
8
|
+
# interests.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# # This is an example of an observer that watches the pages for new ones.
|
12
|
+
# class MyPagesObserver < Sketchup::PagesObserver
|
13
|
+
# def onElementAdded(pages, page)
|
14
|
+
# puts "onElementAdded: #{page}"
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# # Attach the observer.
|
19
|
+
# Sketchup.active_model.pages.add_observer(MyPagesObserver.new)
|
20
|
+
#
|
21
|
+
# @version SketchUp 6.0
|
22
|
+
class Sketchup::PagesObserver < Sketchup::EntitiesObserver
|
23
|
+
|
24
|
+
# Instance Methods
|
25
|
+
|
26
|
+
# The {#onContentsModified} method is invoked whenever the pages change.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# def onContentsModified(pages)
|
30
|
+
# puts "onContentsModified: #{pages}"
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# @param [Sketchup::Pages] pages
|
34
|
+
#
|
35
|
+
# @return [nil]
|
36
|
+
#
|
37
|
+
# @version SketchUp 6.0
|
38
|
+
def onContentsModified(pages)
|
39
|
+
end
|
40
|
+
|
41
|
+
# The {#onElementAdded} method is invoked when an element is added to a
|
42
|
+
# {Sketchup::Pages} object.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# def onElementAdded(pages, page)
|
46
|
+
# puts "onElementAdded: #{page}"
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# @param [Sketchup::Pages] pages
|
50
|
+
#
|
51
|
+
# @param [Sketchup::Page] page
|
52
|
+
#
|
53
|
+
# @return [nil]
|
54
|
+
#
|
55
|
+
# @version SketchUp 6.0
|
56
|
+
def onElementAdded(pages, page)
|
57
|
+
end
|
58
|
+
|
59
|
+
# The {#onElementRemoved} method is invoked when an element is removed from a
|
60
|
+
# {Sketchup::Pages} object.
|
61
|
+
#
|
62
|
+
# @example
|
63
|
+
# def onElementRemoved(pages, page)
|
64
|
+
# puts "onElementRemoved: #{page}"
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# @param [Sketchup::Pages] pages
|
68
|
+
#
|
69
|
+
# @param [Sketchup::Page] page
|
70
|
+
#
|
71
|
+
# @return [nil]
|
72
|
+
#
|
73
|
+
# @version SketchUp 6.0
|
74
|
+
def onElementRemoved(pages, page)
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -1,456 +1,478 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The PickHelper class is used to pick entities that reside under
|
5
|
-
# cursor location
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
#
|
33
|
-
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
# @
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
# @
|
124
|
-
#
|
125
|
-
#
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
# @
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
# @
|
159
|
-
#
|
160
|
-
#
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
# @
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
# @
|
196
|
-
#
|
197
|
-
#
|
198
|
-
#
|
199
|
-
#
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
# @
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
#
|
208
|
-
#
|
209
|
-
#
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
# @
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
222
|
-
#
|
223
|
-
#
|
224
|
-
#
|
225
|
-
# @
|
226
|
-
#
|
227
|
-
#
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
#
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
#
|
243
|
-
#
|
244
|
-
#
|
245
|
-
#
|
246
|
-
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
# @
|
253
|
-
#
|
254
|
-
#
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
#
|
265
|
-
#
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
# @
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
#
|
290
|
-
#
|
291
|
-
#
|
292
|
-
#
|
293
|
-
# @
|
294
|
-
#
|
295
|
-
#
|
296
|
-
#
|
297
|
-
#
|
298
|
-
#
|
299
|
-
# @param [
|
300
|
-
#
|
301
|
-
#
|
302
|
-
# @return [Integer, false] an index on success, +false+ on failure
|
303
|
-
#
|
304
|
-
# @
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
#
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
#
|
320
|
-
#
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
329
|
-
#
|
330
|
-
#
|
331
|
-
#
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
#
|
336
|
-
#
|
337
|
-
#
|
338
|
-
#
|
339
|
-
#
|
340
|
-
#
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
#
|
345
|
-
#
|
346
|
-
#
|
347
|
-
#
|
348
|
-
#
|
349
|
-
#
|
350
|
-
#
|
351
|
-
#
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
#
|
356
|
-
#
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
# @
|
366
|
-
#
|
367
|
-
#
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
#
|
372
|
-
#
|
373
|
-
#
|
374
|
-
#
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
378
|
-
# to
|
379
|
-
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
#
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
401
|
-
# @
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
#
|
406
|
-
#
|
407
|
-
#
|
408
|
-
#
|
409
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
# @
|
413
|
-
#
|
414
|
-
#
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
#
|
419
|
-
#
|
420
|
-
# @example
|
421
|
-
#
|
422
|
-
#
|
423
|
-
#
|
424
|
-
#
|
425
|
-
#
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
432
|
-
#
|
433
|
-
#
|
434
|
-
# @
|
435
|
-
#
|
436
|
-
#
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
#
|
441
|
-
#
|
442
|
-
#
|
443
|
-
#
|
444
|
-
#
|
445
|
-
#
|
446
|
-
#
|
447
|
-
#
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
#
|
452
|
-
#
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {Sketchup::PickHelper} class is used to pick entities that reside under
|
5
|
+
# the current cursor location, similar to native Select tool. Unlike
|
6
|
+
# {Sketchup::InputPoint}, {Sketchup::PickHelper} uses no inference.
|
7
|
+
#
|
8
|
+
# Only {Sketchup::Tool}s react to cursor location and most of these methods are
|
9
|
+
# only useful in the context of a tool. For example, if you want to determine
|
10
|
+
# the entity you just clicked, you would use {#do_pick} from within your
|
11
|
+
# {Sketchup::Tool#onLButtonDown} method.
|
12
|
+
#
|
13
|
+
# You can retrieve a PickHelper object using the {Sketchup::View#pick_helper}
|
14
|
+
# method.
|
15
|
+
#
|
16
|
+
# Entities that are picked (found under the
|
17
|
+
# cursor when a mouse or keyboard event occurs), are called Pick Records and
|
18
|
+
# are placed in an indexed list.
|
19
|
+
#
|
20
|
+
# @note The same {Sketchup::Pickhelper} instance is being reused by SketchUp.
|
21
|
+
# Don't extend, add methods or redefine methods on this object as it can
|
22
|
+
# clash with other extensions.
|
23
|
+
#
|
24
|
+
# @version SketchUp 6.0
|
25
|
+
class Sketchup::PickHelper
|
26
|
+
|
27
|
+
# Constants
|
28
|
+
|
29
|
+
PICK_CROSSING = nil # Stub value.
|
30
|
+
PICK_INSIDE = nil # Stub value.
|
31
|
+
|
32
|
+
# Instance Methods
|
33
|
+
|
34
|
+
# The all_picked method is used to get an array of entities from the
|
35
|
+
# active entities from all the pick paths. Duplicates might occur if
|
36
|
+
# there are multiple pick paths for entities that ends in a group or
|
37
|
+
# component.
|
38
|
+
#
|
39
|
+
# For example, if the pick hits at the border of an edge and face
|
40
|
+
# inside a group there will be two pick paths - one for the face and
|
41
|
+
# one for the edge. Since this method returns entities from the active
|
42
|
+
# entities it would return an array with the group two times.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# ph = view.pick_helper
|
46
|
+
# ph.do_pick(x, y)
|
47
|
+
# entities = ph.all_picked
|
48
|
+
#
|
49
|
+
# @return elements - the array of elements in the pick.
|
50
|
+
#
|
51
|
+
# @version SketchUp 6.0
|
52
|
+
def all_picked
|
53
|
+
end
|
54
|
+
|
55
|
+
# The best_picked method is used to retrieve the "best" entity picked (entity
|
56
|
+
# that you would have picked if you were using the select tool).
|
57
|
+
#
|
58
|
+
# Returns nil if nothing was picked. You must have called do_pick
|
59
|
+
# before calling this method.
|
60
|
+
#
|
61
|
+
# @example
|
62
|
+
# ph = view.pick_helper
|
63
|
+
# ph.do_pick(x, y)
|
64
|
+
# best_entity = ph.best_picked
|
65
|
+
#
|
66
|
+
# @return entity - the best picked entity
|
67
|
+
#
|
68
|
+
# @version SketchUp 6.0
|
69
|
+
def best_picked
|
70
|
+
end
|
71
|
+
|
72
|
+
# Used to pick a set of entities from a model from a BoundingBox. The pick
|
73
|
+
# criteria can be for completely-contained or partially-contained entities,
|
74
|
+
# similar to how the Selection tool works.
|
75
|
+
#
|
76
|
+
# @example
|
77
|
+
# boundingbox = Geom::BoundingBox.new
|
78
|
+
# boundingbox.add([1, 1, 1], [100, 100, 100])
|
79
|
+
# ph = Sketchup.active_model.active_view.pick_helper
|
80
|
+
#
|
81
|
+
# # Rotate the box 45' around the z-axis
|
82
|
+
# angle = 45
|
83
|
+
# transformation = Geom::Transformation.new(ORIGIN, Z_AXIS, angle)
|
84
|
+
#
|
85
|
+
# num_picked = ph.boundingbox_pick(boundingbox, Sketchup::PickHelper::PICK_CROSSING, transformation)
|
86
|
+
# if num_picked > 0
|
87
|
+
# Sketchup.active_model.selection.add(ph.all_picked)
|
88
|
+
# end
|
89
|
+
#
|
90
|
+
# @param bounding_box
|
91
|
+
# BoundingBox object defining the volume to use for picking
|
92
|
+
#
|
93
|
+
# @param pick_type
|
94
|
+
# PICK_INSIDE to select entities completely contained or
|
95
|
+
# PICK_CROSSING to select entities partially contained.
|
96
|
+
#
|
97
|
+
# @param [optional] transformation
|
98
|
+
# Transformation that will be applied to the
|
99
|
+
# volume defined by the BoundingBox that allows for a
|
100
|
+
# rotation.
|
101
|
+
#
|
102
|
+
# @return The number of Entity objects picked
|
103
|
+
#
|
104
|
+
# @version SketchUp 2016
|
105
|
+
def boundingbox_pick(bounding_box, pick_type, transformation = IDENTITY)
|
106
|
+
end
|
107
|
+
|
108
|
+
# The count method is used to count the number of entities picked (number of
|
109
|
+
# pick records)
|
110
|
+
#
|
111
|
+
# @example
|
112
|
+
# number = pickhelper.count
|
113
|
+
#
|
114
|
+
# @return number - the number of entities picked
|
115
|
+
#
|
116
|
+
# @version SketchUp 6.0
|
117
|
+
def count
|
118
|
+
end
|
119
|
+
|
120
|
+
# The depth_at method retrieves the depth of one of the currently picked
|
121
|
+
# entities in the list of pick records.
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
# pickhelper = view.pick_helper
|
125
|
+
# pickhelper.do_pick(x, y)
|
126
|
+
# # Iterate all pick-routes:
|
127
|
+
# pickhelper.count.times { |pick_path_index|
|
128
|
+
# puts pickhelper.depth_at(pick_path_index)
|
129
|
+
# }
|
130
|
+
#
|
131
|
+
# @param index
|
132
|
+
# A number from 0 to number of items picked minus one.
|
133
|
+
#
|
134
|
+
# @return integer - the depth of the entity if successful
|
135
|
+
#
|
136
|
+
# @version SketchUp 6.0
|
137
|
+
def depth_at(index)
|
138
|
+
end
|
139
|
+
|
140
|
+
# The do_pick method is used to perform the initial pick. This method is
|
141
|
+
# generally called before any other methods in the PickHelper class.
|
142
|
+
#
|
143
|
+
# Returns the number of entities picked. The x and y values are the screen
|
144
|
+
# coordinates of the point at which would want to do a pick.
|
145
|
+
#
|
146
|
+
# @example
|
147
|
+
# ph = view.pick_helpernum = ph.do_pick(x, y)
|
148
|
+
#
|
149
|
+
# @param x
|
150
|
+
# X screen coordinate for the pick.
|
151
|
+
#
|
152
|
+
# @param y
|
153
|
+
# Y screen coordinate for the pick.
|
154
|
+
#
|
155
|
+
# @param aperture
|
156
|
+
# The size of the pick-aperture.
|
157
|
+
#
|
158
|
+
# @return Integer - The number of Entity objects picked
|
159
|
+
#
|
160
|
+
# @version SketchUp 6.0
|
161
|
+
def do_pick(x, y, aperture = 0)
|
162
|
+
end
|
163
|
+
|
164
|
+
# The element_at method is used to retrieve a specific entity in the list of
|
165
|
+
# picked elements. This element will be from the active entities.
|
166
|
+
#
|
167
|
+
# Use count() to get the number of possible pick paths.
|
168
|
+
#
|
169
|
+
# @example
|
170
|
+
# pickhelper = view.pick_helper
|
171
|
+
# pickhelper.do_pick(x, y)
|
172
|
+
# # Iterate all pick-routes:
|
173
|
+
# pickhelper.count.times { |pick_path_index|
|
174
|
+
# puts pickhelper.element_at(pick_path_index)
|
175
|
+
# }
|
176
|
+
# # You would iterate the same elements in all_picked.
|
177
|
+
#
|
178
|
+
# @param index
|
179
|
+
# A number from 0 to number of items picked minus one.
|
180
|
+
#
|
181
|
+
# @return entity - the entity at the index position in the list
|
182
|
+
# of picked entities.
|
183
|
+
#
|
184
|
+
# @version SketchUp 6.0
|
185
|
+
def element_at(index)
|
186
|
+
end
|
187
|
+
|
188
|
+
# The {#init} method is used to initialize the PickHelper for testing points.
|
189
|
+
#
|
190
|
+
# You do not normally need to call this method, but you can use this if you
|
191
|
+
# want to call {#test_point} or {#pick_segment} on a lot of points.
|
192
|
+
#
|
193
|
+
# If the optional aperture is given, it is given in pixels.
|
194
|
+
#
|
195
|
+
# @example
|
196
|
+
# ph = view.pick_helper
|
197
|
+
# ph.init(x, y, 5)
|
198
|
+
# # Find all points picked by the screen click.
|
199
|
+
# selected = points.select { |point|
|
200
|
+
# ph.test_point(point)
|
201
|
+
# }
|
202
|
+
#
|
203
|
+
# @param [Integer] x
|
204
|
+
# X screen coordinate for the pick.
|
205
|
+
#
|
206
|
+
# @param [Integer] y
|
207
|
+
# Y screen coordinate for the pick.
|
208
|
+
#
|
209
|
+
# @param [Integer] aperture
|
210
|
+
# aperture in pixels.
|
211
|
+
#
|
212
|
+
# @return [PickHelper] self
|
213
|
+
#
|
214
|
+
# @version SketchUp 6.0
|
215
|
+
def init(x, y, aperture = 0)
|
216
|
+
end
|
217
|
+
|
218
|
+
# The leaf_at method retrieves the deepest thing in a pick path.
|
219
|
+
#
|
220
|
+
# For example, if you have a face that is within a component that is within
|
221
|
+
# another component, leaf_at returns the face.
|
222
|
+
#
|
223
|
+
# Use count() to get the number of possible pick paths.
|
224
|
+
#
|
225
|
+
# @example
|
226
|
+
# pickhelper = view.pick_helper
|
227
|
+
# pickhelper.do_pick(x, y)
|
228
|
+
# # Iterate all pick-routes:
|
229
|
+
# pickhelper.count.times { |pick_path_index|
|
230
|
+
# p pickhelper.leaf_at(pick_path_index)
|
231
|
+
# }
|
232
|
+
#
|
233
|
+
# @param index
|
234
|
+
# A number from 0 to number of items picked minus one.
|
235
|
+
#
|
236
|
+
# @return entity - the leaf entity
|
237
|
+
#
|
238
|
+
# @version SketchUp 6.0
|
239
|
+
def leaf_at(index)
|
240
|
+
end
|
241
|
+
|
242
|
+
# The path_at method is used to retrieve the entire path for an entity in the
|
243
|
+
# pick list (as an array).
|
244
|
+
#
|
245
|
+
# If one of the pick paths end in a face nested in a group nested in a
|
246
|
+
# component this method will return an array of these entities. The Group
|
247
|
+
# will be first and the face will be last.
|
248
|
+
#
|
249
|
+
# The first item in the array will be from the active entities and the last
|
250
|
+
# item will be a drawing element that is not a group, component or image.
|
251
|
+
#
|
252
|
+
# @example
|
253
|
+
# pickhelper = view.pick_helper
|
254
|
+
# pickhelper.do_pick(x, y)
|
255
|
+
# # Iterate all pick-routes:
|
256
|
+
# pickhelper.count.times { |pick_path_index|
|
257
|
+
# p pickhelper.path_at(pick_path_index)
|
258
|
+
# }
|
259
|
+
#
|
260
|
+
# @param index
|
261
|
+
# A number from 0 to number of items picked minus one.
|
262
|
+
#
|
263
|
+
# @return array - an array of entities including the leaf
|
264
|
+
#
|
265
|
+
# @version SketchUp 6.0
|
266
|
+
def path_at(index)
|
267
|
+
end
|
268
|
+
|
269
|
+
# The {#pick_segment} method is used to pick a segment of a polyline curve that
|
270
|
+
# is defined by an array of points.
|
271
|
+
#
|
272
|
+
# If you click on a point in a polyline curve, the index of
|
273
|
+
# the point in the curve is returned (starting at 0).
|
274
|
+
#
|
275
|
+
# If you click on a segment in the polyline curve, the index of the segment is
|
276
|
+
# returned. Segments are returned by negative indicies and start at index -1
|
277
|
+
# (for the segment connecting the first two points) and increase by a factor
|
278
|
+
# of -1 (for example, the segment connecting second and third point is -2).
|
279
|
+
#
|
280
|
+
# There is no need to invoke {#do_pick} for this and the results are unrelated.
|
281
|
+
#
|
282
|
+
# @example
|
283
|
+
# point1 = Geom::Point3d.new(0 ,0, 0)
|
284
|
+
# point2 = Geom::Point3d.new(10, 0, 0)
|
285
|
+
# segment = [point1, point2]
|
286
|
+
# ph = view.pick_helper
|
287
|
+
# # If testing many points this is the fastest way to test.
|
288
|
+
# ph.init(x, y)
|
289
|
+
# picked = ph.pick_segment(segment)
|
290
|
+
# # This do not require .init
|
291
|
+
# picked = ph.pick_segment(segment, x, y)
|
292
|
+
#
|
293
|
+
# @note The return value will be a negative index when a segment is picked.
|
294
|
+
#
|
295
|
+
# @overload pick_segment(points)
|
296
|
+
#
|
297
|
+
# This is more efficient if you need to test a number of segments for the
|
298
|
+
# same set of screen coordinates. But then you must use {#init} first.
|
299
|
+
# @param [Array<Geom::Point3d>] points A series of points in the polyline as
|
300
|
+
# a list of parameters or an array containing Point3d
|
301
|
+
# objects.
|
302
|
+
# @return [Integer, false] an index on success, +false+ on failure
|
303
|
+
#
|
304
|
+
# @overload pick_segment(points, x, y, aperture = 0)
|
305
|
+
#
|
306
|
+
# @param [Array<Geom::Point3d>] points A series of points in the polyline as
|
307
|
+
# a list of parameters or an array containing Point3d
|
308
|
+
# objects.
|
309
|
+
# @param [Integer] x screen mouse position in pixels.
|
310
|
+
# @param [Integer] y (required if x given) screen mouse position
|
311
|
+
# in pixels.
|
312
|
+
# @param aperture aperture in pixels.
|
313
|
+
# @return [Integer, false] an index on success, +false+ on failure
|
314
|
+
#
|
315
|
+
# @version SketchUp 6.0
|
316
|
+
def pick_segment(*args)
|
317
|
+
end
|
318
|
+
|
319
|
+
# The picked_edge method is used to retrieve the "best" Edge picked.
|
320
|
+
#
|
321
|
+
# Returns nil if there were no edges picked. You must have called do_pick
|
322
|
+
# before calling this method.
|
323
|
+
#
|
324
|
+
# @example
|
325
|
+
# ph = view.pick_helper
|
326
|
+
# ph.do_pick(x, y)
|
327
|
+
# edge = ph.picked_edge
|
328
|
+
#
|
329
|
+
# @return edge - an Edge object if successful
|
330
|
+
#
|
331
|
+
# @version SketchUp 6.0
|
332
|
+
def picked_edge
|
333
|
+
end
|
334
|
+
|
335
|
+
# The picked_element method retrieves the best drawing element, that is not an
|
336
|
+
# edge or a face, picked.
|
337
|
+
#
|
338
|
+
# Returns nil if nothing was picked. You must have called do_pick
|
339
|
+
# before calling this method.
|
340
|
+
#
|
341
|
+
# @example
|
342
|
+
# ph = view.pick_helper
|
343
|
+
# ph.do_pick(x, y)
|
344
|
+
# entity = ph.picked_element
|
345
|
+
#
|
346
|
+
# @param index
|
347
|
+
#
|
348
|
+
# @return element - a drawing element that is not an edge or face
|
349
|
+
# if successful
|
350
|
+
#
|
351
|
+
# @version SketchUp 6.0
|
352
|
+
def picked_element(index)
|
353
|
+
end
|
354
|
+
|
355
|
+
# The picked_face method is used to retrieve the best face picked.
|
356
|
+
#
|
357
|
+
# Returns nil if there were no faces picked. You must have called do_pick
|
358
|
+
# before calling this method.
|
359
|
+
#
|
360
|
+
# @example
|
361
|
+
# ph = view.pick_helper
|
362
|
+
# ph.do_pick(x, y)
|
363
|
+
# face = ph.picked_face
|
364
|
+
#
|
365
|
+
# @return face - a Face object if successful
|
366
|
+
#
|
367
|
+
# @version SketchUp 6.0
|
368
|
+
def picked_face
|
369
|
+
end
|
370
|
+
|
371
|
+
# The {#test_point} method is used to test a point to see if it would be
|
372
|
+
# selected using the default or given pick aperture.
|
373
|
+
#
|
374
|
+
# There is no need to invoke {#do_pick} for this and the results are unrelated.
|
375
|
+
#
|
376
|
+
# @example
|
377
|
+
# ph = view.pick_helper
|
378
|
+
# # If testing many points this is the fastest way to test.
|
379
|
+
# ph.init(x, y)
|
380
|
+
# picked = ph.test_point(point)
|
381
|
+
# # These do not require init()
|
382
|
+
# picked = ph.test_point(point, x, y)
|
383
|
+
# picked = ph.test_point(point, x, y, aperture)
|
384
|
+
#
|
385
|
+
# @overload test_point(point)
|
386
|
+
#
|
387
|
+
# This is more efficient if you want to test a lot of points using the same
|
388
|
+
# screen point. But you *must* have called the {#init} method first for this
|
389
|
+
# to work.
|
390
|
+
# @param [Geom::Point3d] point
|
391
|
+
#
|
392
|
+
# @overload test_point(point, x, y, aperture = 0)
|
393
|
+
#
|
394
|
+
# @param [Geom::Point3d] point
|
395
|
+
# @param [Integer] x
|
396
|
+
# @param [Integer] y
|
397
|
+
# @param [Integer] aperture
|
398
|
+
#
|
399
|
+
# @return [Boolean]
|
400
|
+
#
|
401
|
+
# @version SketchUp 6.0
|
402
|
+
def test_point(*args)
|
403
|
+
end
|
404
|
+
|
405
|
+
# The transformation_at method is used to get a transformation at a specific
|
406
|
+
# pick path index in the pick helper.
|
407
|
+
#
|
408
|
+
# The transformation combines the transformation of all groups, components and
|
409
|
+
# images in the pick path. This transformation can be used to transform the
|
410
|
+
# coordinates of the leaf entity into the coordinates of the active entities.
|
411
|
+
#
|
412
|
+
# @example
|
413
|
+
# pickhelper = view.pick_helper
|
414
|
+
# pickhelper.do_pick(x, y)
|
415
|
+
# # Iterate all pick-routes:
|
416
|
+
# pickhelper.count.times { |pick_path_index|
|
417
|
+
# puts pickhelper.transformation_at(pick_path_index)
|
418
|
+
# }
|
419
|
+
#
|
420
|
+
# @example Get transformation for specific picked element
|
421
|
+
# pickhelper = view.pick_helper
|
422
|
+
# pickhelper.do_pick(x, y)
|
423
|
+
# face = pickhelper.picked_face # Face may be inside a group or component.
|
424
|
+
#
|
425
|
+
# index = pickhelper.count.times.find { |i| pickhelper.leaf_at(i) == face }
|
426
|
+
# transformation = index ? pickhelper.transformation_at(index) : IDENTITY
|
427
|
+
#
|
428
|
+
# # Face#area is one method that may need a transformation.
|
429
|
+
# area = face.area(transformation)
|
430
|
+
#
|
431
|
+
# @param index
|
432
|
+
# The index where the transformation should be retrieved.
|
433
|
+
#
|
434
|
+
# @return transformation - the transformation found
|
435
|
+
#
|
436
|
+
# @version SketchUp 6.0
|
437
|
+
def transformation_at(index)
|
438
|
+
end
|
439
|
+
|
440
|
+
# The view method is used to get the view associated with the PickHelper.
|
441
|
+
#
|
442
|
+
# @example
|
443
|
+
# view = pickhelper.view
|
444
|
+
#
|
445
|
+
# @return view - the associated view
|
446
|
+
#
|
447
|
+
# @version SketchUp 6.0
|
448
|
+
def view
|
449
|
+
end
|
450
|
+
|
451
|
+
# Used to pick a set of entities from a model based on a screen coordinate
|
452
|
+
# rectangular area defined by two points. The pick criteria can be for
|
453
|
+
# completely-contained or partially-contained entities, similar to how
|
454
|
+
# the Selection tool works. The z value of the points passed in are ignored.
|
455
|
+
#
|
456
|
+
# @example
|
457
|
+
# ph = Sketchup.active_model.active_view.pick_helper
|
458
|
+
# start_point = Geom::Point3d.new(100, 100, 0)
|
459
|
+
# end_point = Geom::Point3d.new(500, 500, 0)
|
460
|
+
# num_picked = ph.window_pick(start_point, end_point, Sketchup::PickHelper::PICK_CROSSING)
|
461
|
+
#
|
462
|
+
# @param start_point
|
463
|
+
# First screen coordinate point.
|
464
|
+
#
|
465
|
+
# @param end_point
|
466
|
+
# Second screen coordinate point.
|
467
|
+
#
|
468
|
+
# @param pick_type
|
469
|
+
# PICK_INSIDE to select entities completely contained or
|
470
|
+
# PICK_CROSSING to select entities partially contained.
|
471
|
+
#
|
472
|
+
# @return The number of Entity objects picked
|
473
|
+
#
|
474
|
+
# @version SketchUp 2016
|
475
|
+
def window_pick(start_point, end_point, pick_type)
|
476
|
+
end
|
477
|
+
|
478
|
+
end
|