sketchup-api-stubs 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/SketchUp/Geom/BoundingBox.rb +17 -20
  3. data/SketchUp/Geom/Bounds2d.rb +172 -0
  4. data/SketchUp/Geom/LatLong.rb +31 -16
  5. data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
  6. data/SketchUp/Geom/Point2d.rb +365 -0
  7. data/SketchUp/Geom/Point3d.rb +121 -110
  8. data/SketchUp/Geom/PolygonMesh.rb +30 -21
  9. data/SketchUp/Geom/Transformation.rb +8 -4
  10. data/SketchUp/Geom/Transformation2d.rb +125 -0
  11. data/SketchUp/Geom/UTM.rb +43 -37
  12. data/SketchUp/Geom/Vector2d.rb +497 -0
  13. data/SketchUp/Geom/Vector3d.rb +143 -131
  14. data/SketchUp/Layout.rb +25 -0
  15. data/SketchUp/Layout/AngularDimension.rb +569 -0
  16. data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
  17. data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
  18. data/SketchUp/Layout/ConnectionPoint.rb +70 -0
  19. data/SketchUp/Layout/Document.rb +458 -0
  20. data/SketchUp/Layout/Ellipse.rb +29 -0
  21. data/SketchUp/Layout/Entities.rb +155 -0
  22. data/SketchUp/Layout/Entity.rb +363 -0
  23. data/SketchUp/Layout/FormattedText.rb +349 -0
  24. data/SketchUp/Layout/Grid.rb +131 -0
  25. data/SketchUp/Layout/Group.rb +261 -0
  26. data/SketchUp/Layout/Image.rb +86 -0
  27. data/SketchUp/Layout/Label.rb +371 -0
  28. data/SketchUp/Layout/Layer.rb +222 -0
  29. data/SketchUp/Layout/LayerInstance.rb +128 -0
  30. data/SketchUp/Layout/Layers.rb +232 -0
  31. data/SketchUp/Layout/LinearDimension.rb +563 -0
  32. data/SketchUp/Layout/LockedEntityError.rb +10 -0
  33. data/SketchUp/Layout/LockedLayerError.rb +11 -0
  34. data/SketchUp/Layout/Page.rb +187 -0
  35. data/SketchUp/Layout/PageInfo.rb +393 -0
  36. data/SketchUp/Layout/Pages.rb +216 -0
  37. data/SketchUp/Layout/Path.rb +326 -0
  38. data/SketchUp/Layout/Rectangle.rb +174 -0
  39. data/SketchUp/Layout/SketchUpModel.rb +522 -0
  40. data/SketchUp/Layout/Style.rb +1520 -0
  41. data/SketchUp/Layout/Table.rb +290 -0
  42. data/SketchUp/Layout/TableCell.rb +149 -0
  43. data/SketchUp/Layout/TableColumn.rb +139 -0
  44. data/SketchUp/Layout/TableRow.rb +135 -0
  45. data/SketchUp/Sketchup/Animation.rb +7 -4
  46. data/SketchUp/Sketchup/ArcCurve.rb +10 -10
  47. data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
  48. data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
  49. data/SketchUp/Sketchup/Color.rb +68 -78
  50. data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
  51. data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
  52. data/SketchUp/Sketchup/DefinitionList.rb +34 -17
  53. data/SketchUp/Sketchup/Drawingelement.rb +19 -21
  54. data/SketchUp/Sketchup/Edge.rb +22 -24
  55. data/SketchUp/Sketchup/Entities.rb +173 -162
  56. data/SketchUp/Sketchup/Entity.rb +71 -55
  57. data/SketchUp/Sketchup/Face.rb +45 -44
  58. data/SketchUp/Sketchup/Group.rb +47 -49
  59. data/SketchUp/Sketchup/Image.rb +16 -0
  60. data/SketchUp/Sketchup/ImageRep.rb +226 -0
  61. data/SketchUp/Sketchup/InstancePath.rb +13 -13
  62. data/SketchUp/Sketchup/Layer.rb +15 -17
  63. data/SketchUp/Sketchup/Material.rb +40 -30
  64. data/SketchUp/Sketchup/Materials.rb +40 -22
  65. data/SketchUp/Sketchup/Menu.rb +5 -5
  66. data/SketchUp/Sketchup/Model.rb +230 -228
  67. data/SketchUp/Sketchup/Page.rb +32 -0
  68. data/SketchUp/Sketchup/Pages.rb +3 -4
  69. data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
  70. data/SketchUp/Sketchup/SectionPlane.rb +64 -0
  71. data/SketchUp/Sketchup/Selection.rb +20 -28
  72. data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
  73. data/SketchUp/Sketchup/Text.rb +24 -26
  74. data/SketchUp/Sketchup/Texture.rb +28 -12
  75. data/SketchUp/Sketchup/Vertex.rb +14 -11
  76. data/SketchUp/Sketchup/View.rb +126 -116
  77. data/SketchUp/UI/Command.rb +17 -17
  78. data/SketchUp/UI/HtmlDialog.rb +8 -5
  79. data/SketchUp/UI/Notification.rb +1 -1
  80. data/SketchUp/UI/Toolbar.rb +13 -14
  81. data/SketchUp/UI/WebDialog.rb +55 -59
  82. data/SketchUp/_top_level.rb +139 -27
  83. data/SketchUp/{Array.rb → array.rb} +167 -30
  84. data/SketchUp/{Geom.rb → geom.rb} +9 -7
  85. data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
  86. data/SketchUp/{Length.rb → length.rb} +15 -15
  87. data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
  88. data/SketchUp/sketchup.rb +167 -156
  89. data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
  90. data/SketchUp/{String.rb → string.rb} +1 -1
  91. data/SketchUp/ui.rb +113 -87
  92. metadata +46 -9
@@ -0,0 +1,261 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # A group is a special type of {Layout::Entity} that does not belong to a
5
+ # {Layout::Layer} and contains other {Layout::Entity}s as children. A
6
+ # {Layout::Group}'s children may include other {Layout::Group}s, allowing for a
7
+ # hierarchical tree structure of {Layout::Entity}s. A {Layout::Group} must
8
+ # contain at least one child and will be automatically collapsed if an
9
+ # operation is performed that results in the {Layout::Group} being empty.
10
+ #
11
+ # @version LayOut 2018
12
+ class Layout::Group < Layout::Entity
13
+
14
+ # Constants
15
+
16
+ RESIZE_BEHAVIOR_BOUNDS = nil # Stub value.
17
+ RESIZE_BEHAVIOR_BOUNDS_AND_FONTS = nil # Stub value.
18
+ RESIZE_BEHAVIOR_NONE = nil # Stub value.
19
+
20
+ # Instance Methods
21
+
22
+ # The {#entities} method returns the {Layout::Entities} that belong to the
23
+ # {Layout::Group}.
24
+ #
25
+ # @example
26
+ # doc = Layout::Document.open("C:/path/to/document.layout")
27
+ # group = doc.shared_entities.first
28
+ # entities = group.entities
29
+ #
30
+ # @return [Layout::Entities]
31
+ #
32
+ # @version LayOut 2018
33
+ def entities
34
+ end
35
+
36
+ # The {#initialize} method creates a new {Layout::Group}.
37
+ #
38
+ # @example
39
+ # doc = Layout::Document.open("C:/path/to/document.layout")
40
+ # entities = doc.shared_entities
41
+ # entities.each { |entity|
42
+ # entity_array.push(entity)
43
+ # }
44
+ # group = Layout::Group.new(entity_array)
45
+ #
46
+ # @param [Array<Layout::Entity>] entities
47
+ #
48
+ # @raise [ArgumentError] if entities is empty.
49
+ #
50
+ # @raise [ArgumentError] if entities contains the same {Layout::Entity} more
51
+ # than once
52
+ #
53
+ # @raise [ArgumentError] if entities contains {Layout::Entity}s on both shared
54
+ # and non-shared {Layout::Layer}s, or on non-shared {Layout::Layer}s
55
+ # belonging to different {Layout::Page}s
56
+ #
57
+ # @raise [ArgumentError] if entities contains a mix of {Layout::Entity}s that
58
+ # belong to a {Layout::Document} and {Layout::Entity}s that don't belong to a
59
+ # {Layout::Document}
60
+ #
61
+ # @raise [ArgumentError] if entities contains {Layout::Entity}s that belong to
62
+ # different {Layout::Document}s
63
+ #
64
+ # @return [Layout::Group]
65
+ #
66
+ # @version LayOut 2018
67
+ def initialize(entities)
68
+ end
69
+
70
+ # The {#remove_scale_factor} method removes the scale factor from the
71
+ # {Layout::Group}.
72
+ #
73
+ # The resize behavior can be one of the following values:
74
+ # [+Layout::Group::RESIZE_BEHAVIOR_NONE+]
75
+ # [+Layout::Group::RESIZE_BEHAVIOR_BOUNDS+]
76
+ # [+Layout::Group::RESIZE_BEHAVIOR_BOUNDS_AND_FONTS+]
77
+ #
78
+ # @example
79
+ # doc = Layout::Document.open("C:/path/to/document.layout")
80
+ # group = doc.shared_entities.first
81
+ # group.remove_scale_factor(true)
82
+ #
83
+ # @param [Integer] resize_behavior
84
+ #
85
+ # @raise [ArgumentError] if the {Layout::Group} does not have a scale factor
86
+ #
87
+ # @raise [Layout::LockedLayerError] if the {Layout::Group} is on a locked layer
88
+ #
89
+ # @raise [Layout::LockedEntityError] if the {Layout::Group} is locked
90
+ #
91
+ # @version LayOut 2018
92
+ def remove_scale_factor(resize_behavior)
93
+ end
94
+
95
+ # The {#scale_factor} method returns the the scale factor associated with the
96
+ # {Layout::Group}.
97
+ #
98
+ # @example
99
+ # doc = Layout::Document.open("C:/path/to/document.layout")
100
+ # group = doc.shared_entities.first
101
+ # scale = group.scale_factor
102
+ #
103
+ # @return [Float, nil]
104
+ #
105
+ # @version LayOut 2018
106
+ def scale_factor
107
+ end
108
+
109
+ # The {#scale_precision} method returns the precision used for the scale of the
110
+ # {Layout::Group}.
111
+ #
112
+ # @example
113
+ # doc = Layout::Document.open("C:/path/to/document.layout")
114
+ # group = doc.shared_entities.first
115
+ # precision = group.scale_precision
116
+ #
117
+ # @return [Float] the number specifying the precision for the {Layout::Group}
118
+ #
119
+ # @version LayOut 2018
120
+ def scale_precision
121
+ end
122
+
123
+ # The {#scale_precision=} method sets the precision for the scale of the
124
+ # {Layout::Group}.
125
+ #
126
+ # @example
127
+ # doc = Layout::Document.open("C:/path/to/document.layout")
128
+ # group = doc.shared_entities.first
129
+ # group.scale_precision = 0.0001
130
+ #
131
+ # @note LayOut only allows for a finite set of precision values for each units
132
+ # setting, so it will set the precision to the closest valid setting for the
133
+ # specified units. See the "Units" section of LayOut's "Document Setup"
134
+ # dialog for a reference of the available precisions for each units setting.
135
+ #
136
+ # @param [Float] precision
137
+ # The double specifying the precision for the
138
+ # {Layout::Group}
139
+ #
140
+ # @version LayOut 2018
141
+ def scale_precision=(precision)
142
+ end
143
+
144
+ # The {#scale_units} method returns the units format used in the scale for the
145
+ # {Layout::Group}.
146
+ #
147
+ # The units format can be any of the following values:
148
+ # [Layout::Document::FRACTIONAL_INCHES]
149
+ # [Layout::Document::DECIMAL_INCHES]
150
+ # [Layout::Document::DECIMAL_FEET]
151
+ # [Layout::Document::DECIMAL_MILLIMETERS]
152
+ # [Layout::Document::DECIMAL_CENTIMETERS]
153
+ # [Layout::Document::DECIMAL_METERS]
154
+ # [Layout::Document::DECIMAL_POINTS]
155
+ #
156
+ # @example
157
+ # doc = Layout::Document.open("C:/path/to/document.layout")
158
+ # group = doc.shared_entities.first
159
+ # units = group.scale_units
160
+ #
161
+ # @raise [ArgumentError] if the {Layout::Group} does not have a scale factor
162
+ #
163
+ # @return [Integer] units The units format of the scale factor
164
+ #
165
+ # @version LayOut 2018
166
+ def scale_units
167
+ end
168
+
169
+ # The {#scale_units=} method sets the the units format for the scale of the
170
+ # {Layout::Group}.
171
+ #
172
+ # The units format can be any of the following values:
173
+ # [Layout::Document::FRACTIONAL_INCHES]
174
+ # [Layout::Document::DECIMAL_INCHES]
175
+ # [Layout::Document::DECIMAL_FEET]
176
+ # [Layout::Document::DECIMAL_MILLIMETERS]
177
+ # [Layout::Document::DECIMAL_CENTIMETERS]
178
+ # [Layout::Document::DECIMAL_METERS]
179
+ # [Layout::Document::DECIMAL_POINTS]
180
+ #
181
+ # @example
182
+ # doc = Layout::Document.open("C:/path/to/document.layout")
183
+ # group = doc.shared_entities.first
184
+ # group.scale_units = Layout::Document::DECIMAL_FEET
185
+ #
186
+ # @param [Integer] units_format
187
+ #
188
+ # @raise [ArgumentError] if the {Layout::Group} does not have a scale factor
189
+ #
190
+ # @raise [ArgumentError] if scale_units is not a valid value
191
+ #
192
+ # @raise [Layout::LockedLayerError] if the {Layout::Group} is on a locked layer
193
+ #
194
+ # @raise [Layout::LockedEntityError] if the {Layout::Group} is locked
195
+ #
196
+ # @version LayOut 2018
197
+ def scale_units=(units_format)
198
+ end
199
+
200
+ # The {#set_scale_factor} method sets the the scale factor for the
201
+ # {Layout::Group}.
202
+ #
203
+ # The units format can be any of the following values:
204
+ # [Layout::Document::FRACTIONAL_INCHES]
205
+ # [Layout::Document::DECIMAL_INCHES]
206
+ # [Layout::Document::DECIMAL_FEET]
207
+ # [Layout::Document::DECIMAL_MILLIMETERS]
208
+ # [Layout::Document::DECIMAL_CENTIMETERS]
209
+ # [Layout::Document::DECIMAL_METERS]
210
+ # [Layout::Document::DECIMAL_POINTS]
211
+ #
212
+ # The resize behavior can be one of the following values:
213
+ # [+Layout::Group::RESIZE_BEHAVIOR_NONE+]
214
+ # [+Layout::Group::RESIZE_BEHAVIOR_BOUNDS+]
215
+ # [+Layout::Group::RESIZE_BEHAVIOR_BOUNDS_AND_FONTS+]
216
+ #
217
+ # @example
218
+ # doc = Layout::Document.open("C:/path/to/document.layout")
219
+ # group = doc.shared_entities.first
220
+ # group.set_scale_factor(2.0, Layout::Group::RESIZE_BEHAVIOR_BOUNDS)
221
+ #
222
+ # @param [Integer] units_format
223
+ #
224
+ # @param [Float] scale_factor
225
+ #
226
+ # @param [Integer] resize_behavior
227
+ #
228
+ # @raise [LockedLayerError] if the {Layout::Group} is on a locked
229
+ # {Layout::Layer}
230
+ #
231
+ # @raise [ArgumentError] if a scale factor cannot be set for the
232
+ # {Layout::Group}
233
+ #
234
+ # @raise [ArgumentError] if scale_factor is an invalid value
235
+ #
236
+ # @raise [ArgumentError] if the {Layout::Group} cannot be assigned a scale
237
+ # factor because it is already inheriting a scale factor from its parent
238
+ #
239
+ # @raise [LockedEntityError] if the {Layout::Group} is locked
240
+ #
241
+ # @version LayOut 2018
242
+ def set_scale_factor(scale_factor, units_format, resize_behavior)
243
+ end
244
+
245
+ # The {#ungroup} method removes all {Layout::Entity}s from the {Layout::Group}
246
+ # and deletes the {Layout::Group}.
247
+ #
248
+ # @example
249
+ # doc = Layout::Document.open("C:/path/to/document.layout")
250
+ # group = doc.shared_entities.first
251
+ # group.ungroup
252
+ #
253
+ # @raise [LockedEntityError] if the {Layout::Group} is locked
254
+ #
255
+ # @return [Boolean]
256
+ #
257
+ # @version LayOut 2018
258
+ def ungroup
259
+ end
260
+
261
+ end
@@ -0,0 +1,86 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # A raster image entity.
5
+ #
6
+ # @example
7
+ # image = Layout::Image.new("my_image.png", [[1, 1], [3, 3]])
8
+ # clip_mask = image.clip_mask
9
+ # if clip_mask.is_a?(Layout::Rectangle)
10
+ # point1 = Geom::Point2d.new(1, 1)
11
+ # point2 = Geom::Point2d.new(2, 2)
12
+ # bounds = [point1, point2]
13
+ # image.clip_mask = Layout::Ellipse.new(bounds)
14
+ # end
15
+ #
16
+ # @version LayOut 2018
17
+ class Layout::Image < Layout::Entity
18
+
19
+ # Instance Methods
20
+
21
+ # The {#clip_mask} method returns the clip mask of the {Layout::Image}, or
22
+ # +nil+ if it does not have a clip mask.
23
+ #
24
+ # @example
25
+ # image = Layout::Image.new("my_image.png", [[1, 1], [3, 3]])
26
+ # clip_mask = image.clip_mask
27
+ #
28
+ # @return [Layout::Entity] The clip mask can be a {Layout::Path},
29
+ # {Layout::Rectangle}, or {Layout::Ellipse}.
30
+ #
31
+ # @version LayOut 2018
32
+ def clip_mask
33
+ end
34
+
35
+ # The {#clip_mask=} method sets the clip mask of the {Layout::Image}.
36
+ #
37
+ # @example
38
+ # image = Layout::Image.new("my_image.png", [[1, 1], [3, 3]])
39
+ # point1 = Geom::Point2d.new(1, 1)
40
+ # point2 = Geom::Point2d.new(2, 2)
41
+ # bounds = [point1, point2]
42
+ # clip_mask = Layout::Rectangle.new(bounds)
43
+ # image.clip_mask = clip_mask
44
+ #
45
+ # @param [Layout::Entity] clip_mask
46
+ # The clip mask can be a {Layout::Path},
47
+ # {Layout::Rectangle}, {Layout::Ellipse}, or +nil+.
48
+ #
49
+ # @raise [ArgumentError] if clip mask is already in a document
50
+ #
51
+ # @raise [LockedEntityError] if the {Layout::Image} is locked
52
+ #
53
+ # @raise [LockedLayerError] if the {Layout::Image} is on a locked {Layout::Layer}
54
+ #
55
+ # @raise [ArgumentError] if clip mask is not a {Layout::Path},
56
+ # {Layout::Rectangle}, or {Layout::Ellipse}
57
+ #
58
+ # @version LayOut 2018
59
+ def clip_mask=(clip_mask)
60
+ end
61
+
62
+ # The {#initialize} method creates a new {Layout::Image} from a given image
63
+ # file.
64
+ #
65
+ # @example
66
+ # image = Layout::Image.new("my_image.png", [[1, 1], [3, 3]])
67
+ #
68
+ # @param [String] path
69
+ # The path to the file
70
+ #
71
+ # @param [Geom::Bounds2d] bounds
72
+ #
73
+ # @raise [ArgumentError] if bounds are zero size
74
+ #
75
+ # @raise [RuntimeError] if there was an error allocating memory for the image
76
+ #
77
+ # @raise [ArgumentError] if there was an error reading the image file, such as
78
+ # the file name being invalid
79
+ #
80
+ # @return [Layout::Image]
81
+ #
82
+ # @version LayOut 2018
83
+ def initialize(path, bounds)
84
+ end
85
+
86
+ end
@@ -0,0 +1,371 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This is an interface to a label entity. A {Layout::Label} consists of a
5
+ # {Layout::FormattedText} and the label leader {Layout::Path}. A
6
+ # {Layout::Label} may be connected to another {Layout::Entity} via a
7
+ # {Layout::ConnectionPoint}.
8
+ #
9
+ # @version LayOut 2018
10
+ class Layout::Label < Layout::Entity
11
+
12
+ # Constants
13
+
14
+ CONNECTION_TYPE_AUTO = nil # Stub value.
15
+ CONNECTION_TYPE_BOTTOM_LEFT = nil # Stub value.
16
+ CONNECTION_TYPE_BOTTOM_RIGHT = nil # Stub value.
17
+ CONNECTION_TYPE_CENTER_LEFT = nil # Stub value.
18
+ CONNECTION_TYPE_CENTER_RIGHT = nil # Stub value.
19
+ CONNECTION_TYPE_NONE = nil # Stub value.
20
+ CONNECTION_TYPE_REVERSE_AUTO = nil # Stub value.
21
+ CONNECTION_TYPE_TOP_LEFT = nil # Stub value.
22
+ CONNECTION_TYPE_TOP_RIGHT = nil # Stub value.
23
+
24
+ LEADER_LINE_TYPE_BEZIER = nil # Stub value.
25
+ LEADER_LINE_TYPE_SINGLE_SEGMENT = nil # Stub value.
26
+ LEADER_LINE_TYPE_TWO_SEGMENT = nil # Stub value.
27
+ LEADER_LINE_TYPE_UNKNOWN = nil # Stub value.
28
+
29
+ # Instance Methods
30
+
31
+ # The {#connect} method connects the {Layout::Label} to the given
32
+ # {Layout::ConnectionPoint}. The leader line will be adjusted to point at the
33
+ # {Layout::ConnectionPoint}. The {Layout::Label} must be in the same
34
+ # {Layout::Document} as the {Layout::ConnectionPoint}. If both the
35
+ # {Layout::Label} and the {Layout::ConnectionPoint}'s {Layout::Entity} are on
36
+ # non-shared {Layout::Layer}s, they must be on the same {Layout::Page}.
37
+ #
38
+ # @example
39
+ # text = "A label"
40
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
41
+ # target_point = Geom::Point2d.new(1, 1)
42
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
43
+ # label = Layout::Label.new(text, leader_type, target_point, bounds)
44
+ # rect = Layout::Rectangle.new([4, 4, 4, 4])
45
+ #
46
+ # doc = Layout::Document.new
47
+ # doc.add_entity(label, doc.layers.first, doc.pages.first)
48
+ # doc.add_entity(rect, doc.layers.first, doc.pages.first)
49
+ #
50
+ # point = Geom::Point2d.new(4, 4)
51
+ # # Create a Connection Point to a LayOut Entity in the Document
52
+ # cp = Layout::ConnectionPoint.new(rect, point)
53
+ # label.connect(cp)
54
+ #
55
+ # @param [Layout::ConnectionPoint] connection_point
56
+ #
57
+ # @raise [LockedLayerError] if the {Layout::Label} is on a locked
58
+ # {Layout::Layer}
59
+ #
60
+ # @raise [ArgumentError] if both the {Layout::Label} and the
61
+ # {Layout::ConnectionPoint} are on non-shared {Layout::Layers}, but are not
62
+ # on the same {Layout::Page}.
63
+ #
64
+ # @raise [ArgumentError] if the {Layout::Label} is not in the same
65
+ # {Layout::Document} as the {Layout::ConnectionPoint}
66
+ #
67
+ # @raise [LockedEntityError] if the {Layout::Label} is locked
68
+ #
69
+ # @version LayOut 2018
70
+ def connect(connection_point)
71
+ end
72
+
73
+ # The {#connection_type} method returns the type of the text connection for the
74
+ # {Layout::Label}.
75
+ #
76
+ # The leader line type can be one of the following values:
77
+ # [+Layout::Label::CONNECTION_TYPE_NONE+]
78
+ # [+Layout::Label::CONNECTION_TYPE_AUTO+]
79
+ # [+Layout::Label::CONNECTION_TYPE_REVERSE_AUTO+]
80
+ # [+Layout::Label::CONNECTION_TYPE_TOP_LEFT+]
81
+ # [+Layout::Label::CONNECTION_TYPE_CENTER_LEFT+]
82
+ # [+Layout::Label::CONNECTION_TYPE_BOTTOM_LEFT+]
83
+ # [+Layout::Label::CONNECTION_TYPE_TOP_RIGHT+]
84
+ # [+Layout::Label::CONNECTION_TYPE_CENTER_RIGHT+]
85
+ # [+Layout::Label::CONNECTION_TYPE_BOTTOM_RIGHT+]
86
+ #
87
+ # @example
88
+ # text = "A label"
89
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
90
+ # target_point = Geom::Point2d.new(1, 1)
91
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
92
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
93
+ # bounds)
94
+ # text_connection_type = label_from_bounds.connection_type
95
+ #
96
+ # @return [Integer]
97
+ #
98
+ # @version LayOut 2018
99
+ def connection_type
100
+ end
101
+
102
+ # The {#connection_type=} method sets the type of the text connection for the
103
+ # {Layout::Label}.
104
+ #
105
+ # The leader line type can be one of the following values:
106
+ # [+Layout::Label::CONNECTION_TYPE_NONE+]
107
+ # [+Layout::Label::CONNECTION_TYPE_AUTO+]
108
+ # [+Layout::Label::CONNECTION_TYPE_REVERSE_AUTO+]
109
+ # [+Layout::Label::CONNECTION_TYPE_TOP_LEFT+]
110
+ # [+Layout::Label::CONNECTION_TYPE_CENTER_LEFT+]
111
+ # [+Layout::Label::CONNECTION_TYPE_BOTTOM_LEFT+]
112
+ # [+Layout::Label::CONNECTION_TYPE_TOP_RIGHT+]
113
+ # [+Layout::Label::CONNECTION_TYPE_CENTER_RIGHT+]
114
+ # [+Layout::Label::CONNECTION_TYPE_BOTTOM_RIGHT+]
115
+ #
116
+ # @example
117
+ # text = "A label"
118
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
119
+ # target_point = Geom::Point2d.new(1, 1)
120
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
121
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
122
+ # bounds)
123
+ # label_from_bounds.connection_type = Layout::Label::CONNECTION_TYPE_TOP_LEFT
124
+ #
125
+ # @param [Integer] connection_type
126
+ #
127
+ # @raise [LockedLayerError] if the {Layout::Label} is on a locked
128
+ # {Layout::Layer}
129
+ #
130
+ # @raise [ArgumentError] if the connection_type is not a valid text connection
131
+ # type
132
+ #
133
+ # @raise [LockedEntityError] if the {Layout::Label} is locked
134
+ #
135
+ # @version LayOut 2018
136
+ def connection_type=(connection_type)
137
+ end
138
+
139
+ # The {#disconnect} method disconnects the {Layout::Label} from its
140
+ # {Layout::ConnectionPoint}. The leader line will not be adjusted by
141
+ # disconnecting from a {Layout::ConnectionPoint}.
142
+ #
143
+ # @example
144
+ # doc = Layout::Document.open("C:/path/to/document.layout")
145
+ # label = doc.pages.first.entities.first
146
+ # label.disconnect
147
+ #
148
+ # @raise [LockedLayerError] if the {Layout::Label} is on a locked
149
+ # {Layout::Layer}
150
+ #
151
+ # @raise [LockedEntityError] if the {Layout::Label} is locked
152
+ #
153
+ # @version LayOut 2018
154
+ def disconnect
155
+ end
156
+
157
+ # The {#entities} method returns the {Layout::Entities} that represent the
158
+ # {Layout::Label} in its exploded form.
159
+ #
160
+ # @example
161
+ # text = "A label"
162
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
163
+ # target_point = Geom::Point2d.new(1, 1)
164
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
165
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
166
+ # bounds)
167
+ # entities = label_from_bounds.entities
168
+ #
169
+ # @overload entities
170
+ #
171
+ # @return [Layout::Entities]
172
+ #
173
+ # @overload entities(page)
174
+ #
175
+ # @param [Layout::Page] page The {Layout::Page} to use to convert an
176
+ # auto text tag to display text
177
+ # @return [Layout::Entities]
178
+ #
179
+ # @raise [ArgumentError] if page does not belong to the same document as the
180
+ # [Layout::Label]
181
+ #
182
+ # @version LayOut 2018
183
+ def entities(*args)
184
+ end
185
+
186
+ # The {#initialize} method creates a new disconnected {Layout::Label}.
187
+ #
188
+ # @example
189
+ # text = "A label"
190
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
191
+ # target_point = Geom::Point2d.new(1, 1)
192
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
193
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
194
+ # bounds)
195
+ # anchor_point = Geom::Point2d.new(2, 2)
196
+ # anchor_type = Layout::FormattedText::ANCHOR_TYPE_TOP_RIGHT
197
+ # label_from_point = Layout::Label.new(text, leader_type, target_point,
198
+ # anchor_point, anchor_type)
199
+ #
200
+ # @overload initialize(text, leader_type, target_point, bounds)
201
+ #
202
+ # @param [String] text The label text
203
+ # @param [Integer] leader_type The leader line type
204
+ # @param [Geom::Point2d] target_point Where the label leader should point to
205
+ # @param [Geom::Bounds2d] bounds
206
+ # @return [Layout::Label]
207
+ #
208
+ # @overload initialize(text, leader_type, target_point, anchor_point,
209
+ #
210
+ # anchor_type)
211
+ # @param [String] text The label text
212
+ # @param [Integer] leader_type The leader line type
213
+ # @param [Geom::Point2d] target_point Where the label leader should point to
214
+ # @param [Geom::Point2d] anchor_point The anchor point for the label text's
215
+ # position.
216
+ # @param [Integer] anchor_type Defines which point of the label text is set
217
+ # by anchor_point.
218
+ # @return [Layout::Label]
219
+ #
220
+ # @raise [ArgumentError] if anchor_type is not a valid anchor type
221
+ #
222
+ # @raise [ArgumentError] if plain_text is an empty string
223
+ #
224
+ # @raise [ArgumentError] if bounds is zero size
225
+ #
226
+ # @raise [ArgumentError] if leader_type is not a valid leader line type
227
+ #
228
+ # @version LayOut 2018
229
+ def initialize(*args)
230
+ end
231
+
232
+ # The {#leader_line} method returns a copy of the leader line.
233
+ #
234
+ # @example
235
+ # text = "A label"
236
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
237
+ # target_point = Geom::Point2d.new(1, 1)
238
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
239
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
240
+ # bounds)
241
+ # leader = label_from_bounds.leader_line
242
+ #
243
+ # @return [Layout::Path]
244
+ #
245
+ # @version LayOut 2018
246
+ def leader_line
247
+ end
248
+
249
+ # The {#leader_line=} method sets the leader line.
250
+ #
251
+ # @example
252
+ # text = "A label"
253
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
254
+ # target_point = Geom::Point2d.new(1, 1)
255
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
256
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
257
+ # bounds)
258
+ # path = Layout::Path.new(Geom::Point2d.new(1, 2), Geom::Point2d.new(2, 3))
259
+ # label_from_bounds.leader_line = path
260
+ #
261
+ # @param [Layout::Path] leader_path
262
+ #
263
+ # @raise [LockedEntityError] if the {Layout::Label} is locked
264
+ #
265
+ # @raise [LockedLayerError] if the {Layout::Label} is on a locked
266
+ # {Layout::Layer}
267
+ #
268
+ # @version LayOut 2018
269
+ def leader_line=(leader_path)
270
+ end
271
+
272
+ # The {#leader_line_type} method returns the type of the leader line for the
273
+ # {Layout::Label}.
274
+ #
275
+ # The leader line type can be one of the following values:
276
+ # [+Layout::Label::LEADER_LINE_TYPE_SINGLE_SEGMENT+]
277
+ # [+Layout::Label::LEADER_LINE_TYPE_TWO_SEGMENT+]
278
+ # [+Layout::Label::LEADER_LINE_TYPE_BEZIER+]
279
+ # [+Layout::Label::LEADER_LINE_TYPE_UNKNOWN+]
280
+ #
281
+ # @example
282
+ # text = "A label"
283
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
284
+ # target_point = Geom::Point2d.new(1, 1)
285
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
286
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
287
+ # bounds)
288
+ # leader_type = label_from_bounds.leader_line_type
289
+ #
290
+ # @return [Integer]
291
+ #
292
+ # @version LayOut 2018
293
+ def leader_line_type
294
+ end
295
+
296
+ # The {#leader_line_type=} method sets the type of the leader line for the
297
+ # {Layout::Label}.
298
+ #
299
+ # The leader line type can be one of the following values:
300
+ # [+Layout::Label::LEADER_LINE_TYPE_SINGLE_SEGMENT+]
301
+ # [+Layout::Label::LEADER_LINE_TYPE_TWO_SEGMENT+]
302
+ # [+Layout::Label::LEADER_LINE_TYPE_BEZIER+]
303
+ # [+Layout::Label::LEADER_LINE_TYPE_UNKNOWN+]
304
+ #
305
+ # @example
306
+ # text = "A label"
307
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
308
+ # target_point = Geom::Point2d.new(1, 1)
309
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
310
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
311
+ # bounds)
312
+ # label_from_bounds.leader_line_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
313
+ #
314
+ # @param [Integer] leader_type
315
+ #
316
+ # @raise [LockedLayerError] if the {Layout::Label} is on a locked
317
+ # {Layout::Layer}
318
+ #
319
+ # @raise [ArgumentError] if leader_type is
320
+ # +Layout::Label::LEADER_LINE_TYPE_UNKNOWN+ or not a valid leader line type
321
+ #
322
+ # @raise [LockedEntityError] if the {Layout::Label} is locked
323
+ #
324
+ # @version LayOut 2018
325
+ def leader_line_type=(leader_type)
326
+ end
327
+
328
+ # The {#text} method returns a copy of the {Layout::FormattedText} of the
329
+ # {Layout::Label}.
330
+ #
331
+ # @example
332
+ # text = "A label"
333
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
334
+ # target_point = Geom::Point2d.new(1, 1)
335
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
336
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
337
+ # bounds)
338
+ # text = label_from_bounds.text
339
+ #
340
+ # @return [Layout::FormattedText]
341
+ #
342
+ # @version LayOut 2018
343
+ def text
344
+ end
345
+
346
+ # The {#text=} method sets the {Layout::FormattedText} of the {Layout::Label}.
347
+ #
348
+ # @example
349
+ # text = "A label"
350
+ # leader_type = Layout::Label::LEADER_LINE_TYPE_BEZIER
351
+ # target_point = Geom::Point2d.new(1, 1)
352
+ # bounds = Geom::Bounds2d.new(2, 1, 1, 1)
353
+ # label_from_bounds = Layout::Label.new(text, leader_type, target_point,
354
+ # bounds)
355
+ # anchor = Geom::Point2d.new(1, 1)
356
+ # anchor_type = Layout::FormattedText::ANCHOR_TYPE_TOP_LEFT
357
+ # text = Layout::FormattedText.new("Test", anchor, anchor_type)
358
+ # label_from_bounds.text = text
359
+ #
360
+ # @param [Layout::FormattedText] new_text
361
+ #
362
+ # @raise [LockedEntityError] if the {Layout::Label} is locked
363
+ #
364
+ # @raise [LockedLayerError] if the {Layout::Label} is on a locked
365
+ # {Layout::Layer}
366
+ #
367
+ # @version LayOut 2018
368
+ def text=(new_text)
369
+ end
370
+
371
+ end