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,62 +1,62 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # Http::Response objects allows you to get the response information from the
5
- # server, you can only receive the Http::Response if you have attached a
6
- # callback block when calling start from the Http::Request object.
7
- #
8
- # @version SketchUp 2017
9
- class Sketchup::Http::Response
10
-
11
- # Instance Methods
12
-
13
- # Gets the http body that was received from the server as a string encoded
14
- # using the charset provided in the Content-Type of the server response, if
15
- # no charset is specified, ASCII-8BIT will be used.
16
- #
17
- # @example
18
- # request = Sketchup::Http::Request.new("http://localhost:8080")
19
- #
20
- # request.start do |request, response|
21
- # puts "body: " + response.body
22
- # end
23
- #
24
- # @return [String]
25
- #
26
- # @version SketchUp 2017
27
- def body
28
- end
29
-
30
- # Returns the http headers that were sent by the server.
31
- #
32
- # @example
33
- # request = Sketchup::Http::Request.new("http://localhost:8080")
34
- #
35
- # request.start do |request, response|
36
- # response.headers.each do |key, value|
37
- # puts "#{key}: #{value}"
38
- # end
39
- # end
40
- #
41
- # @return [Hash]
42
- #
43
- # @version SketchUp 2017
44
- def headers
45
- end
46
-
47
- # Returns the HTTP response status code as defined in rfc2616.
48
- #
49
- # @example
50
- # request = Sketchup::Http::Request.new("http://localhost:8080")
51
- #
52
- # request.start do |request, response|
53
- # puts "http status code: #{response.status_code}"
54
- # end
55
- #
56
- # @return [int]
57
- #
58
- # @version SketchUp 2017
59
- def status_code
60
- end
61
-
62
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # Http::Response objects allows you to get the response information from the
5
+ # server, you can only receive the Http::Response if you have attached a
6
+ # callback block when calling start from the Http::Request object.
7
+ #
8
+ # @version SketchUp 2017
9
+ class Sketchup::Http::Response
10
+
11
+ # Instance Methods
12
+
13
+ # Gets the http body that was received from the server as a string encoded
14
+ # using the charset provided in the Content-Type of the server response, if
15
+ # no charset is specified, ASCII-8BIT will be used.
16
+ #
17
+ # @example
18
+ # request = Sketchup::Http::Request.new("http://localhost:8080")
19
+ #
20
+ # request.start do |request, response|
21
+ # puts "body: " + response.body
22
+ # end
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @version SketchUp 2017
27
+ def body
28
+ end
29
+
30
+ # Returns the http headers that were sent by the server.
31
+ #
32
+ # @example
33
+ # request = Sketchup::Http::Request.new("http://localhost:8080")
34
+ #
35
+ # request.start do |request, response|
36
+ # response.headers.each do |key, value|
37
+ # puts "#{key}: #{value}"
38
+ # end
39
+ # end
40
+ #
41
+ # @return [Hash]
42
+ #
43
+ # @version SketchUp 2017
44
+ def headers
45
+ end
46
+
47
+ # Returns the HTTP response status code as defined in rfc2616.
48
+ #
49
+ # @example
50
+ # request = Sketchup::Http::Request.new("http://localhost:8080")
51
+ #
52
+ # request.start do |request, response|
53
+ # puts "http status code: #{response.status_code}"
54
+ # end
55
+ #
56
+ # @return [int]
57
+ #
58
+ # @version SketchUp 2017
59
+ def status_code
60
+ end
61
+
62
+ end
@@ -1,409 +1,409 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # An Image object represents a raster image placed in the Model.
5
- #
6
- # @version SketchUp 6.0
7
- class Sketchup::Image < Sketchup::Drawingelement
8
-
9
- # Instance Methods
10
-
11
- # The explode method is used to explode an image into a face with a texture
12
- # on it.
13
- #
14
- # Note that current versions of SketchUp will return an empty array here.
15
- # To work around this limitation you can iterate over your entities collection
16
- # to determine which new entities were created.
17
- #
18
- # Versions prior to SketchUp 2015 returned an empty array due to a bug.
19
- #
20
- # @example
21
- # model = Sketchup.active_model
22
- # path = "Plugins/su_dynamiccomponents/images"
23
- # image_file = Sketchup.find_support_file("report_tool.png", path)
24
- # image = model.active_entities.add_image(image_file, ORIGIN, 300)
25
- # entities = image.explode
26
- #
27
- # @return entitiesarray - an Array object of entities if
28
- # successful
29
- #
30
- # @version SketchUp 6.0
31
- def explode
32
- end
33
-
34
- # The height method is used to retrieve the height of the image.
35
- #
36
- # The height is given in inches.
37
- #
38
- # @example
39
- # model = Sketchup.active_model
40
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
41
- # pt = Geom::Point3d.new
42
- # entities = model.active_entities
43
- # image = entities.add_image path, pt, 300
44
- # height = image.height
45
- # if (height)
46
- # UI.messagebox height
47
- # else
48
- # UI.messagebox "Failure"
49
- # end
50
- #
51
- # @return height - the height of the model if successful
52
- #
53
- # @version SketchUp 6.0
54
- def height
55
- end
56
-
57
- # The height= method is used to set the height of the image.
58
- #
59
- # The height is set in inches.
60
- #
61
- # @example
62
- # model = Sketchup.active_model
63
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
64
- # pt = Geom::Point3d.new
65
- # entities = model.active_entities
66
- # image = entities.add_image path, pt, 300
67
- # UI.messagebox "Before adjustment"
68
- # height = image.height = 400
69
- # if (height)
70
- # UI.messagebox height
71
- # else
72
- # UI.messagebox "Failure"
73
- # end
74
- #
75
- # @param height
76
- # The height, in inches, to set the image.
77
- #
78
- # @return height - the new height if successful
79
- #
80
- # @version SketchUp 6.0
81
- def height=(height)
82
- end
83
-
84
- # The {#image_rep} method returns a copy of a {Sketchup::ImageRep} object
85
- # representing the pixel data.
86
- #
87
- # @example
88
- # model = Sketchup.active_model
89
- # path = "Plugins/su_dynamiccomponents/images"
90
- # image_file = Sketchup.find_support_file("report_tool.png", path)
91
- # image = model.active_entities.add_image(image_file, ORIGIN, 300)
92
- # image_rep = image.image_rep
93
- #
94
- # @return [Sketchup::ImageRep]
95
- #
96
- # @version SketchUp 2018
97
- def image_rep
98
- end
99
-
100
- # The normal method is used to retrieve the 3D Vector that is perpendicular to
101
- # the plane of the image.
102
- #
103
- # @example
104
- # model = Sketchup.active_model
105
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
106
- # pt = Geom::Point3d.new
107
- # entities = model.active_entities
108
- # image = entities.add_image path, pt, 300
109
- # vector = image.normal
110
- # if (vector)
111
- # UI.messagebox vector
112
- # else
113
- # UI.messagebox "Failure"
114
- # end
115
- #
116
- # @return vector - a Vector3d object if successful
117
- #
118
- # @version SketchUp 6.0
119
- def normal
120
- end
121
-
122
- # The origin method is used to retrieve the 3D point that defines the origin
123
- # of the image.
124
- #
125
- # @example
126
- # model = Sketchup.active_model
127
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
128
- # pt = Geom::Point3d.new
129
- # entities = model.active_entities
130
- # image = entities.add_image path, pt, 300
131
- # origin = image.origin
132
- # if (origin)
133
- # UI.messagebox origin
134
- # else
135
- # UI.messagebox "Failure"
136
- # end
137
- #
138
- # @return point - a Point3d object containing the origin location
139
- # if successful
140
- #
141
- # @version SketchUp 6.0
142
- def origin
143
- end
144
-
145
- # The origin= method is used to set the 3D point as the origin of the image.
146
- #
147
- # @example
148
- # model = Sketchup.active_model
149
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
150
- # pt = Geom::Point3d.new
151
- # pt2 = Geom::Point3d.new 100,100,100
152
- # entities = model.active_entities
153
- # image = entities.add_image path, pt, 300
154
- # UI.messagebox "Before Move"
155
- # origin = image.origin=pt2
156
- # if (origin)
157
- # UI.messagebox origin
158
- # else
159
- # UI.messagebox "Failure"
160
- # end
161
- #
162
- # @param point
163
- # A Point3d object with the new origin.
164
- #
165
- # @return point - the Point3d object representing the newly
166
- # established origin if successful
167
- #
168
- # @version SketchUp 6.0
169
- def origin=(point)
170
- end
171
-
172
- # The path method is used to retrieve the path of the file defining the image.
173
- #
174
- # @example
175
- # model = Sketchup.active_model
176
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
177
- # pt = Geom::Point3d.new
178
- # entities = model.active_entities
179
- # image = entities.add_image path, pt, 300
180
- # path = image.path
181
- # if (path)
182
- # UI.messagebox path
183
- # else
184
- # UI.messagebox "Failure"
185
- # end
186
- #
187
- # @return path - the path for the image file if successful
188
- #
189
- # @version SketchUp 6.0
190
- def path
191
- end
192
-
193
- # The pixelheight method is used to retrieve the height of the image file in
194
- # pixels.
195
- #
196
- # @example
197
- # model = Sketchup.active_model
198
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
199
- # pt = Geom::Point3d.new
200
- # entities = model.active_entities
201
- # image = entities.add_image path, pt, 300
202
- # pixelheight = image.pixelheight
203
- # if (pixelheight)
204
- # UI.messagebox pixelheight
205
- # else
206
- # UI.messagebox "Failure"
207
- # end
208
- #
209
- # @return height - the height of the image in pixels if
210
- # successful
211
- #
212
- # @version SketchUp 6.0
213
- def pixelheight
214
- end
215
-
216
- # The pixelwidth method is used to retrieve the width of the image file in
217
- # pixels.
218
- #
219
- # @example
220
- # model = Sketchup.active_model
221
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
222
- # pt = Geom::Point3d.new
223
- # entities = model.active_entities
224
- # image = entities.add_image path, pt, 300
225
- # pixelwidth = image.pixelwidth
226
- # if (pixelwidth)
227
- # UI.messagebox pixelwidth
228
- # else
229
- # UI.messagebox "Failure"
230
- # end
231
- #
232
- # @return width - the width of the image in pixels if successful
233
- #
234
- # @version SketchUp 6.0
235
- def pixelwidth
236
- end
237
-
238
- # The size= method is used to set the width and height of the image, in inches.
239
- #
240
- # @example
241
- # model = Sketchup.active_model
242
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
243
- # pt = Geom::Point3d.new
244
- # entities = model.active_entities
245
- # image = entities.add_image path, pt, 300
246
- # UI.messagebox "Before Resize"
247
- # size = image.size= 500,500
248
- # if (size)
249
- # UI.messagebox size
250
- # else
251
- # UI.messagebox "Failure"
252
- # end
253
- #
254
- # @param width
255
- # The width of the image.
256
- #
257
- # @param height
258
- # The height of the image.
259
- #
260
- # @return size - the new width and height of the image if
261
- # successful
262
- #
263
- # @version SketchUp 6.0
264
- def size=(width, height)
265
- end
266
-
267
- # The transform! method is used to apply a transformation to the image.
268
- #
269
- # @example
270
- # model = Sketchup.active_model
271
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
272
- # point = Geom::Point3d.new 100,100,100
273
- # t = Geom::Transformation.new point
274
- # pt = Geom::Point3d.new
275
- # entities = model.active_entities
276
- # image = entities.add_image path, pt, 300
277
- # UI.messagebox "Before Move"
278
- # image = image.transform! t
279
- # if (image)
280
- # UI.messagebox image
281
- # else
282
- # UI.messagebox "Failure"
283
- # end
284
- #
285
- # @param transform
286
- # A Transformation object.
287
- #
288
- # @return image - the transformed Image object if successful
289
- #
290
- # @version SketchUp 6.0
291
- def transform!(transform)
292
- end
293
-
294
- # The transformation method is used to retrieve the transformation for the
295
- # image.
296
- #
297
- # @example
298
- # # Add an image to the model.
299
- # model = Sketchup.active_model
300
- # entities = model.active_entities
301
- # path = Sketchup.find_support_file('report_tool.png', 'Plugins/su_dynamiccomponents/images')
302
- # point = Geom::Point3d.new(100,100,100)
303
- # image = entities.add_image(path, point, 300)
304
- #
305
- # trans = image.transformation
306
- #
307
- # @return transformation - a Transformation object if successful
308
- #
309
- # @version SketchUp 2014
310
- def transformation
311
- end
312
-
313
- # The transformation= method is used to set the transformation for the
314
- # image.
315
- #
316
- # @example
317
- # # Add an image to the model.
318
- # model = Sketchup.active_model
319
- # entities = model.active_entities
320
- # path = Sketchup.find_support_file('report_tool.png', 'Plugins/su_dynamiccomponents/images')
321
- # point = Geom::Point3d.new(100,100,100)
322
- # image = entities.add_image(path, point, 300)
323
- #
324
- # new_transform = Geom::Transformation.new([100,0,0])
325
- # image.transformation = new_transform
326
- #
327
- # @param transform
328
- # The Transformation object to apply
329
- #
330
- # @return image - the newly transformed image
331
- #
332
- # @version SketchUp 2014
333
- def transformation=(transform)
334
- end
335
-
336
- # The width method is used to retrieve the width of the image.
337
- #
338
- # The width is given in inches.
339
- #
340
- # @example
341
- # model = Sketchup.active_model
342
- # path = Sketchup.find_support_file "report_tool.png",
343
- # "Tools/DynamicComponents/images"
344
- # pt = Geom::Point3d.new
345
- # entities = model.active_entities
346
- # image = entities.add_image path, pt, 300
347
- # width = image.width
348
- # if (width)
349
- # UI.messagebox width
350
- # else
351
- # UI.messagebox "Failure"
352
- # end
353
- #
354
- # @return width - the width of the image if successful
355
- #
356
- # @version SketchUp 6.0
357
- def width
358
- end
359
-
360
- # The width= method is used to set the width of the image.
361
- #
362
- # The width is set in inches.
363
- #
364
- # @example
365
- # model = Sketchup.active_model
366
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
367
- # pt = Geom::Point3d.new
368
- # entities = model.active_entities
369
- # image = entities.add_image path, pt, 300
370
- # UI.messagebox "Before adjustment"
371
- # width = image.width=400
372
- # if (width)
373
- # UI.messagebox width
374
- # else
375
- # UI.messagebox "Failure"
376
- # end
377
- #
378
- # @param width
379
- # The width, in inches, to set the image.
380
- #
381
- # @return width - the new width if successful
382
- #
383
- # @version SketchUp 6.0
384
- def width=(width)
385
- end
386
-
387
- # The zrotation method is used to get the angle that the image is rotated
388
- # about the normal vector from an arbitrary X axis.
389
- #
390
- # @example
391
- # model = Sketchup.active_model
392
- # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
393
- # pt = Geom::Point3d.new
394
- # entities = model.active_entities
395
- # image = entities.add_image path, pt, 300
396
- # zrotation = image.zrotation
397
- # if (zrotation)
398
- # UI.messagebox zrotation
399
- # else
400
- # UI.messagebox "Failure"
401
- # end
402
- #
403
- # @return vector - a Vector3d object if successful
404
- #
405
- # @version SketchUp 6.0
406
- def zrotation
407
- end
408
-
409
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # An Image object represents a raster image placed in the Model.
5
+ #
6
+ # @version SketchUp 6.0
7
+ class Sketchup::Image < Sketchup::Drawingelement
8
+
9
+ # Instance Methods
10
+
11
+ # The explode method is used to explode an image into a face with a texture
12
+ # on it.
13
+ #
14
+ # Note that current versions of SketchUp will return an empty array here.
15
+ # To work around this limitation you can iterate over your entities collection
16
+ # to determine which new entities were created.
17
+ #
18
+ # Versions prior to SketchUp 2015 returned an empty array due to a bug.
19
+ #
20
+ # @example
21
+ # model = Sketchup.active_model
22
+ # path = "Plugins/su_dynamiccomponents/images"
23
+ # image_file = Sketchup.find_support_file("report_tool.png", path)
24
+ # image = model.active_entities.add_image(image_file, ORIGIN, 300)
25
+ # entities = image.explode
26
+ #
27
+ # @return entitiesarray - an Array object of entities if
28
+ # successful
29
+ #
30
+ # @version SketchUp 6.0
31
+ def explode
32
+ end
33
+
34
+ # The height method is used to retrieve the height of the image.
35
+ #
36
+ # The height is given in inches.
37
+ #
38
+ # @example
39
+ # model = Sketchup.active_model
40
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
41
+ # pt = Geom::Point3d.new
42
+ # entities = model.active_entities
43
+ # image = entities.add_image path, pt, 300
44
+ # height = image.height
45
+ # if (height)
46
+ # UI.messagebox height
47
+ # else
48
+ # UI.messagebox "Failure"
49
+ # end
50
+ #
51
+ # @return height - the height of the model if successful
52
+ #
53
+ # @version SketchUp 6.0
54
+ def height
55
+ end
56
+
57
+ # The height= method is used to set the height of the image.
58
+ #
59
+ # The height is set in inches.
60
+ #
61
+ # @example
62
+ # model = Sketchup.active_model
63
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
64
+ # pt = Geom::Point3d.new
65
+ # entities = model.active_entities
66
+ # image = entities.add_image path, pt, 300
67
+ # UI.messagebox "Before adjustment"
68
+ # height = image.height = 400
69
+ # if (height)
70
+ # UI.messagebox height
71
+ # else
72
+ # UI.messagebox "Failure"
73
+ # end
74
+ #
75
+ # @param height
76
+ # The height, in inches, to set the image.
77
+ #
78
+ # @return height - the new height if successful
79
+ #
80
+ # @version SketchUp 6.0
81
+ def height=(height)
82
+ end
83
+
84
+ # The {#image_rep} method returns a copy of a {Sketchup::ImageRep} object
85
+ # representing the pixel data.
86
+ #
87
+ # @example
88
+ # model = Sketchup.active_model
89
+ # path = "Plugins/su_dynamiccomponents/images"
90
+ # image_file = Sketchup.find_support_file("report_tool.png", path)
91
+ # image = model.active_entities.add_image(image_file, ORIGIN, 300)
92
+ # image_rep = image.image_rep
93
+ #
94
+ # @return [Sketchup::ImageRep]
95
+ #
96
+ # @version SketchUp 2018
97
+ def image_rep
98
+ end
99
+
100
+ # The normal method is used to retrieve the 3D Vector that is perpendicular to
101
+ # the plane of the image.
102
+ #
103
+ # @example
104
+ # model = Sketchup.active_model
105
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
106
+ # pt = Geom::Point3d.new
107
+ # entities = model.active_entities
108
+ # image = entities.add_image path, pt, 300
109
+ # vector = image.normal
110
+ # if (vector)
111
+ # UI.messagebox vector
112
+ # else
113
+ # UI.messagebox "Failure"
114
+ # end
115
+ #
116
+ # @return vector - a Vector3d object if successful
117
+ #
118
+ # @version SketchUp 6.0
119
+ def normal
120
+ end
121
+
122
+ # The origin method is used to retrieve the 3D point that defines the origin
123
+ # of the image.
124
+ #
125
+ # @example
126
+ # model = Sketchup.active_model
127
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
128
+ # pt = Geom::Point3d.new
129
+ # entities = model.active_entities
130
+ # image = entities.add_image path, pt, 300
131
+ # origin = image.origin
132
+ # if (origin)
133
+ # UI.messagebox origin
134
+ # else
135
+ # UI.messagebox "Failure"
136
+ # end
137
+ #
138
+ # @return point - a Point3d object containing the origin location
139
+ # if successful
140
+ #
141
+ # @version SketchUp 6.0
142
+ def origin
143
+ end
144
+
145
+ # The origin= method is used to set the 3D point as the origin of the image.
146
+ #
147
+ # @example
148
+ # model = Sketchup.active_model
149
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
150
+ # pt = Geom::Point3d.new
151
+ # pt2 = Geom::Point3d.new 100,100,100
152
+ # entities = model.active_entities
153
+ # image = entities.add_image path, pt, 300
154
+ # UI.messagebox "Before Move"
155
+ # origin = image.origin=pt2
156
+ # if (origin)
157
+ # UI.messagebox origin
158
+ # else
159
+ # UI.messagebox "Failure"
160
+ # end
161
+ #
162
+ # @param point
163
+ # A Point3d object with the new origin.
164
+ #
165
+ # @return point - the Point3d object representing the newly
166
+ # established origin if successful
167
+ #
168
+ # @version SketchUp 6.0
169
+ def origin=(point)
170
+ end
171
+
172
+ # The path method is used to retrieve the path of the file defining the image.
173
+ #
174
+ # @example
175
+ # model = Sketchup.active_model
176
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
177
+ # pt = Geom::Point3d.new
178
+ # entities = model.active_entities
179
+ # image = entities.add_image path, pt, 300
180
+ # path = image.path
181
+ # if (path)
182
+ # UI.messagebox path
183
+ # else
184
+ # UI.messagebox "Failure"
185
+ # end
186
+ #
187
+ # @return path - the path for the image file if successful
188
+ #
189
+ # @version SketchUp 6.0
190
+ def path
191
+ end
192
+
193
+ # The pixelheight method is used to retrieve the height of the image file in
194
+ # pixels.
195
+ #
196
+ # @example
197
+ # model = Sketchup.active_model
198
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
199
+ # pt = Geom::Point3d.new
200
+ # entities = model.active_entities
201
+ # image = entities.add_image path, pt, 300
202
+ # pixelheight = image.pixelheight
203
+ # if (pixelheight)
204
+ # UI.messagebox pixelheight
205
+ # else
206
+ # UI.messagebox "Failure"
207
+ # end
208
+ #
209
+ # @return height - the height of the image in pixels if
210
+ # successful
211
+ #
212
+ # @version SketchUp 6.0
213
+ def pixelheight
214
+ end
215
+
216
+ # The pixelwidth method is used to retrieve the width of the image file in
217
+ # pixels.
218
+ #
219
+ # @example
220
+ # model = Sketchup.active_model
221
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
222
+ # pt = Geom::Point3d.new
223
+ # entities = model.active_entities
224
+ # image = entities.add_image path, pt, 300
225
+ # pixelwidth = image.pixelwidth
226
+ # if (pixelwidth)
227
+ # UI.messagebox pixelwidth
228
+ # else
229
+ # UI.messagebox "Failure"
230
+ # end
231
+ #
232
+ # @return width - the width of the image in pixels if successful
233
+ #
234
+ # @version SketchUp 6.0
235
+ def pixelwidth
236
+ end
237
+
238
+ # The size= method is used to set the width and height of the image, in inches.
239
+ #
240
+ # @example
241
+ # model = Sketchup.active_model
242
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
243
+ # pt = Geom::Point3d.new
244
+ # entities = model.active_entities
245
+ # image = entities.add_image path, pt, 300
246
+ # UI.messagebox "Before Resize"
247
+ # size = image.size= 500,500
248
+ # if (size)
249
+ # UI.messagebox size
250
+ # else
251
+ # UI.messagebox "Failure"
252
+ # end
253
+ #
254
+ # @param width
255
+ # The width of the image.
256
+ #
257
+ # @param height
258
+ # The height of the image.
259
+ #
260
+ # @return size - the new width and height of the image if
261
+ # successful
262
+ #
263
+ # @version SketchUp 6.0
264
+ def size=(width, height)
265
+ end
266
+
267
+ # The transform! method is used to apply a transformation to the image.
268
+ #
269
+ # @example
270
+ # model = Sketchup.active_model
271
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
272
+ # point = Geom::Point3d.new 100,100,100
273
+ # t = Geom::Transformation.new point
274
+ # pt = Geom::Point3d.new
275
+ # entities = model.active_entities
276
+ # image = entities.add_image path, pt, 300
277
+ # UI.messagebox "Before Move"
278
+ # image = image.transform! t
279
+ # if (image)
280
+ # UI.messagebox image
281
+ # else
282
+ # UI.messagebox "Failure"
283
+ # end
284
+ #
285
+ # @param transform
286
+ # A Transformation object.
287
+ #
288
+ # @return image - the transformed Image object if successful
289
+ #
290
+ # @version SketchUp 6.0
291
+ def transform!(transform)
292
+ end
293
+
294
+ # The transformation method is used to retrieve the transformation for the
295
+ # image.
296
+ #
297
+ # @example
298
+ # # Add an image to the model.
299
+ # model = Sketchup.active_model
300
+ # entities = model.active_entities
301
+ # path = Sketchup.find_support_file('report_tool.png', 'Plugins/su_dynamiccomponents/images')
302
+ # point = Geom::Point3d.new(100,100,100)
303
+ # image = entities.add_image(path, point, 300)
304
+ #
305
+ # trans = image.transformation
306
+ #
307
+ # @return transformation - a Transformation object if successful
308
+ #
309
+ # @version SketchUp 2014
310
+ def transformation
311
+ end
312
+
313
+ # The transformation= method is used to set the transformation for the
314
+ # image.
315
+ #
316
+ # @example
317
+ # # Add an image to the model.
318
+ # model = Sketchup.active_model
319
+ # entities = model.active_entities
320
+ # path = Sketchup.find_support_file('report_tool.png', 'Plugins/su_dynamiccomponents/images')
321
+ # point = Geom::Point3d.new(100,100,100)
322
+ # image = entities.add_image(path, point, 300)
323
+ #
324
+ # new_transform = Geom::Transformation.new([100,0,0])
325
+ # image.transformation = new_transform
326
+ #
327
+ # @param transform
328
+ # The Transformation object to apply
329
+ #
330
+ # @return image - the newly transformed image
331
+ #
332
+ # @version SketchUp 2014
333
+ def transformation=(transform)
334
+ end
335
+
336
+ # The width method is used to retrieve the width of the image.
337
+ #
338
+ # The width is given in inches.
339
+ #
340
+ # @example
341
+ # model = Sketchup.active_model
342
+ # path = Sketchup.find_support_file "report_tool.png",
343
+ # "Tools/DynamicComponents/images"
344
+ # pt = Geom::Point3d.new
345
+ # entities = model.active_entities
346
+ # image = entities.add_image path, pt, 300
347
+ # width = image.width
348
+ # if (width)
349
+ # UI.messagebox width
350
+ # else
351
+ # UI.messagebox "Failure"
352
+ # end
353
+ #
354
+ # @return width - the width of the image if successful
355
+ #
356
+ # @version SketchUp 6.0
357
+ def width
358
+ end
359
+
360
+ # The width= method is used to set the width of the image.
361
+ #
362
+ # The width is set in inches.
363
+ #
364
+ # @example
365
+ # model = Sketchup.active_model
366
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
367
+ # pt = Geom::Point3d.new
368
+ # entities = model.active_entities
369
+ # image = entities.add_image path, pt, 300
370
+ # UI.messagebox "Before adjustment"
371
+ # width = image.width=400
372
+ # if (width)
373
+ # UI.messagebox width
374
+ # else
375
+ # UI.messagebox "Failure"
376
+ # end
377
+ #
378
+ # @param width
379
+ # The width, in inches, to set the image.
380
+ #
381
+ # @return width - the new width if successful
382
+ #
383
+ # @version SketchUp 6.0
384
+ def width=(width)
385
+ end
386
+
387
+ # The zrotation method is used to get the angle that the image is rotated
388
+ # about the normal vector from an arbitrary X axis.
389
+ #
390
+ # @example
391
+ # model = Sketchup.active_model
392
+ # path = Sketchup.find_support_file "report_tool.png", "Tools/DynamicComponents/images"
393
+ # pt = Geom::Point3d.new
394
+ # entities = model.active_entities
395
+ # image = entities.add_image path, pt, 300
396
+ # zrotation = image.zrotation
397
+ # if (zrotation)
398
+ # UI.messagebox zrotation
399
+ # else
400
+ # UI.messagebox "Failure"
401
+ # end
402
+ #
403
+ # @return vector - a Vector3d object if successful
404
+ #
405
+ # @version SketchUp 6.0
406
+ def zrotation
407
+ end
408
+
409
+ end