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.
- checksums.yaml +4 -4
- data/SketchUp/Geom/BoundingBox.rb +17 -20
- data/SketchUp/Geom/Bounds2d.rb +172 -0
- data/SketchUp/Geom/LatLong.rb +31 -16
- data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
- data/SketchUp/Geom/Point2d.rb +365 -0
- data/SketchUp/Geom/Point3d.rb +121 -110
- data/SketchUp/Geom/PolygonMesh.rb +30 -21
- data/SketchUp/Geom/Transformation.rb +8 -4
- data/SketchUp/Geom/Transformation2d.rb +125 -0
- data/SketchUp/Geom/UTM.rb +43 -37
- data/SketchUp/Geom/Vector2d.rb +497 -0
- data/SketchUp/Geom/Vector3d.rb +143 -131
- data/SketchUp/Layout.rb +25 -0
- data/SketchUp/Layout/AngularDimension.rb +569 -0
- data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
- data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
- data/SketchUp/Layout/ConnectionPoint.rb +70 -0
- data/SketchUp/Layout/Document.rb +458 -0
- data/SketchUp/Layout/Ellipse.rb +29 -0
- data/SketchUp/Layout/Entities.rb +155 -0
- data/SketchUp/Layout/Entity.rb +363 -0
- data/SketchUp/Layout/FormattedText.rb +349 -0
- data/SketchUp/Layout/Grid.rb +131 -0
- data/SketchUp/Layout/Group.rb +261 -0
- data/SketchUp/Layout/Image.rb +86 -0
- data/SketchUp/Layout/Label.rb +371 -0
- data/SketchUp/Layout/Layer.rb +222 -0
- data/SketchUp/Layout/LayerInstance.rb +128 -0
- data/SketchUp/Layout/Layers.rb +232 -0
- data/SketchUp/Layout/LinearDimension.rb +563 -0
- data/SketchUp/Layout/LockedEntityError.rb +10 -0
- data/SketchUp/Layout/LockedLayerError.rb +11 -0
- data/SketchUp/Layout/Page.rb +187 -0
- data/SketchUp/Layout/PageInfo.rb +393 -0
- data/SketchUp/Layout/Pages.rb +216 -0
- data/SketchUp/Layout/Path.rb +326 -0
- data/SketchUp/Layout/Rectangle.rb +174 -0
- data/SketchUp/Layout/SketchUpModel.rb +522 -0
- data/SketchUp/Layout/Style.rb +1520 -0
- data/SketchUp/Layout/Table.rb +290 -0
- data/SketchUp/Layout/TableCell.rb +149 -0
- data/SketchUp/Layout/TableColumn.rb +139 -0
- data/SketchUp/Layout/TableRow.rb +135 -0
- data/SketchUp/Sketchup/Animation.rb +7 -4
- data/SketchUp/Sketchup/ArcCurve.rb +10 -10
- data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
- data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
- data/SketchUp/Sketchup/Color.rb +68 -78
- data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
- data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
- data/SketchUp/Sketchup/DefinitionList.rb +34 -17
- data/SketchUp/Sketchup/Drawingelement.rb +19 -21
- data/SketchUp/Sketchup/Edge.rb +22 -24
- data/SketchUp/Sketchup/Entities.rb +173 -162
- data/SketchUp/Sketchup/Entity.rb +71 -55
- data/SketchUp/Sketchup/Face.rb +45 -44
- data/SketchUp/Sketchup/Group.rb +47 -49
- data/SketchUp/Sketchup/Image.rb +16 -0
- data/SketchUp/Sketchup/ImageRep.rb +226 -0
- data/SketchUp/Sketchup/InstancePath.rb +13 -13
- data/SketchUp/Sketchup/Layer.rb +15 -17
- data/SketchUp/Sketchup/Material.rb +40 -30
- data/SketchUp/Sketchup/Materials.rb +40 -22
- data/SketchUp/Sketchup/Menu.rb +5 -5
- data/SketchUp/Sketchup/Model.rb +230 -228
- data/SketchUp/Sketchup/Page.rb +32 -0
- data/SketchUp/Sketchup/Pages.rb +3 -4
- data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
- data/SketchUp/Sketchup/SectionPlane.rb +64 -0
- data/SketchUp/Sketchup/Selection.rb +20 -28
- data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
- data/SketchUp/Sketchup/Text.rb +24 -26
- data/SketchUp/Sketchup/Texture.rb +28 -12
- data/SketchUp/Sketchup/Vertex.rb +14 -11
- data/SketchUp/Sketchup/View.rb +126 -116
- data/SketchUp/UI/Command.rb +17 -17
- data/SketchUp/UI/HtmlDialog.rb +8 -5
- data/SketchUp/UI/Notification.rb +1 -1
- data/SketchUp/UI/Toolbar.rb +13 -14
- data/SketchUp/UI/WebDialog.rb +55 -59
- data/SketchUp/_top_level.rb +139 -27
- data/SketchUp/{Array.rb → array.rb} +167 -30
- data/SketchUp/{Geom.rb → geom.rb} +9 -7
- data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
- data/SketchUp/{Length.rb → length.rb} +15 -15
- data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
- data/SketchUp/sketchup.rb +167 -156
- data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
- data/SketchUp/{String.rb → string.rb} +1 -1
- data/SketchUp/ui.rb +113 -87
- metadata +46 -9
@@ -0,0 +1,174 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# A simple rectangular shape entity.
|
5
|
+
#
|
6
|
+
# @version LayOut 2018
|
7
|
+
class Layout::Rectangle < Layout::Entity
|
8
|
+
|
9
|
+
# Constants
|
10
|
+
|
11
|
+
TYPE_BULGED = nil # Stub value.
|
12
|
+
TYPE_LOZENGE = nil # Stub value.
|
13
|
+
TYPE_NORMAL = nil # Stub value.
|
14
|
+
TYPE_ROUNDED = nil # Stub value.
|
15
|
+
|
16
|
+
# Instance Methods
|
17
|
+
|
18
|
+
# The {#initialize} method creates a new normal, lozenge, bulged or rounded
|
19
|
+
# {Layout::Rectangle}, depending on the type passed in.
|
20
|
+
#
|
21
|
+
# The rectangle type can be one of the following values:
|
22
|
+
# [+Layout::Rectangle::TYPE_NORMAL+]
|
23
|
+
# [+Layout::Rectangle::TYPE_ROUNDED+]
|
24
|
+
# [+Layout::Rectangle::TYPE_LOZENGE+]
|
25
|
+
# [+Layout::Rectangle::TYPE_BULGED+]
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# upper_left = Geom::Point2d.new(1, 1)
|
29
|
+
# lower_right = Geom::Point2d.new(2, 2)
|
30
|
+
# bounds = Geom::Bounds2d.new(upper_left, lower_right)
|
31
|
+
# # Creates a normal rectangle
|
32
|
+
# rect = Layout::Rectangle.new(bounds)
|
33
|
+
# rounded_rect = Layout::Rectangle.new_rounded(
|
34
|
+
# Layout::Rectangle::TYPE_ROUNDED, bounds, radius)
|
35
|
+
# lozenge_rect = Layout::Rectangle.new_lozenge(
|
36
|
+
# Layout::Rectangle::TYPE_LOZENGE, bounds)
|
37
|
+
# bulged_rect = Layout::Rectangle.new_bulged(Layout::Rectangle::TYPE_BULGED,
|
38
|
+
# bounds, bulge_distance)
|
39
|
+
#
|
40
|
+
# @overload initialize(bounds)
|
41
|
+
#
|
42
|
+
# @param [Geom::Bounds2d] bounds
|
43
|
+
# @return [Layout::Rectangle]
|
44
|
+
#
|
45
|
+
# @overload initialize(bounds, type)
|
46
|
+
#
|
47
|
+
# @param [Geom::Bounds2d] bounds
|
48
|
+
# @param [Integer] type
|
49
|
+
# The type of {Layout::Rectangle} to create. Must be
|
50
|
+
# +Layout::Rectangle::TYPE_NORMAL+ or +Layout::Rectangle::TYPE_LOZENGE+
|
51
|
+
# @return [Layout::Rectangle]
|
52
|
+
#
|
53
|
+
# @overload initialize(bounds, type, radius)
|
54
|
+
#
|
55
|
+
# @param [Geom::Bounds2d] bounds
|
56
|
+
# @param [Integer] type
|
57
|
+
# The type of {Layout::Rectangle} to create. Must be
|
58
|
+
# +Layout::Rectangle::TYPE_BULGED+ or +Layout::Rectangle::TYPE_ROUNDED+
|
59
|
+
# @param [Float] radius
|
60
|
+
# @return [Layout::Rectangle]
|
61
|
+
#
|
62
|
+
# @raise [ArgumentError] if radius is a negative value
|
63
|
+
#
|
64
|
+
# @raise [ArgumentError] if bounds is zero size
|
65
|
+
#
|
66
|
+
# @raise [ArgumentError] if type is not a valid type
|
67
|
+
#
|
68
|
+
# @raise [ArgumentError] if type passed in does not match the number of
|
69
|
+
# arguments
|
70
|
+
#
|
71
|
+
# @version LayOut 2018
|
72
|
+
def initialize(*args)
|
73
|
+
end
|
74
|
+
|
75
|
+
# The {#radius} method returns the radius of the {Layout::Rectangle}, or +nil+
|
76
|
+
# if the {Layout::Rectangle} is not of type +Layout::Rectangle::TYPE_BULGED+ or
|
77
|
+
# +Layout::Rectangle::TYPE_ROUNDED+
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# upper_left = Geom::Point2d.new(1, 1)
|
81
|
+
# lower_right = Geom::Point2d.new(2, 2)
|
82
|
+
# bounds = Geom::Bounds2d.new(upper_left, lower_right)
|
83
|
+
# radius = 0.8
|
84
|
+
# rect = Layout::Rectangle.new_rounded(bounds, radius)
|
85
|
+
# # Should equal 0.8
|
86
|
+
# r = rect.radius
|
87
|
+
#
|
88
|
+
# @return [Float, nil]
|
89
|
+
#
|
90
|
+
# @version LayOut 2018
|
91
|
+
def radius
|
92
|
+
end
|
93
|
+
|
94
|
+
# The {#radius=} method sets the radius of the {Layout::Rectangle}.
|
95
|
+
#
|
96
|
+
# @example
|
97
|
+
# upper_left = Geom::Point2d.new(1, 1)
|
98
|
+
# lower_right = Geom::Point2d.new(2, 2)
|
99
|
+
# bounds = Geom::Bounds2d.new(upper_left, lower_right)
|
100
|
+
# radius = 0.8
|
101
|
+
# rect = Layout::Rectangle.new_rounded(bounds, radius)
|
102
|
+
# rect.radius = 0.5
|
103
|
+
#
|
104
|
+
# @param [Float] radius
|
105
|
+
# The new radius value to set
|
106
|
+
#
|
107
|
+
# @raise [ArgumentError] if the {Layout::Rectangle} is not of type
|
108
|
+
# +Layout::Rectangle::TYPE_BULGED+ or +Layout::Rectangle::TYPE_ROUNDED+
|
109
|
+
#
|
110
|
+
# @raise [LockedEntityError] if the {Layout::Rectangle} is locked
|
111
|
+
#
|
112
|
+
# @raise [LockedLayerError] if the {Layout::Rectangle} is on a locked
|
113
|
+
# {Layout::Layer}
|
114
|
+
#
|
115
|
+
# @raise [ArgumentError] if radius is negative
|
116
|
+
#
|
117
|
+
# @version LayOut 2018
|
118
|
+
def radius=(radius)
|
119
|
+
end
|
120
|
+
|
121
|
+
# The {#type} method returns the type of the {Layout::Rectangle}.
|
122
|
+
#
|
123
|
+
# The type of a rectangle can be one of the following:
|
124
|
+
# [+Layout::Rectangle::TYPE_NORMAL+]
|
125
|
+
# [+Layout::Rectangle::TYPE_ROUNDED+]
|
126
|
+
# [+Layout::Rectangle::TYPE_LOZENGE+]
|
127
|
+
# [+Layout::Rectangle::TYPE_BULGED+]
|
128
|
+
#
|
129
|
+
# @example
|
130
|
+
# upper_left = Geom::Point2d.new(1, 1)
|
131
|
+
# lower_right = Geom::Point2d.new(2, 2)
|
132
|
+
# bounds = Geom::Bounds2d.new(upper_left, lower_right)
|
133
|
+
# rect = Layout::Rectangle.new(bounds)
|
134
|
+
# rect_type =rect.type
|
135
|
+
#
|
136
|
+
# @return [Integer] integer that corresponds with a rectangle type
|
137
|
+
#
|
138
|
+
# @version LayOut 2018
|
139
|
+
def type
|
140
|
+
end
|
141
|
+
|
142
|
+
# The {#type=} method sets the type of the {Layout::Rectangle}. If the type is
|
143
|
+
# set to +Layout::Rectangle::TYPE_ROUNDED+ or +Layout::Rectangle::TYPE_BULGED+,
|
144
|
+
# the [Layout::Rectangle]'s radius will be set to the default value of 0.25, if
|
145
|
+
# the value had not previously been set.
|
146
|
+
#
|
147
|
+
# The type of a {Layout::Rectangle} can be one of the following:
|
148
|
+
# [+Layout::Rectangle::TYPE_NORMAL+]
|
149
|
+
# [+Layout::Rectangle::TYPE_ROUNDED+]
|
150
|
+
# [+Layout::Rectangle::TYPE_LOZENGE+]
|
151
|
+
# [+Layout::Rectangle::TYPE_BULGED+]
|
152
|
+
#
|
153
|
+
# @example
|
154
|
+
# upper_left = Geom::Point2d.new(1, 1)
|
155
|
+
# lower_right = Geom::Point2d.new(2, 2)
|
156
|
+
# bounds = Geom::Bounds2d.new(upper_left, lower_right)
|
157
|
+
# rect = Layout::Rectangle.new(bounds)
|
158
|
+
# rect.type = Layout::Rectangle::TYPE_LOZENGE
|
159
|
+
#
|
160
|
+
# @param [Integer] type
|
161
|
+
# An integer that corresponds with a rectangle type
|
162
|
+
#
|
163
|
+
# @raise [LockedLayerError] if the {Layout::Rectangle} is on a locked
|
164
|
+
# {Layout::Layer}
|
165
|
+
#
|
166
|
+
# @raise [ArgumentError] if type is not a valid rectangle type
|
167
|
+
#
|
168
|
+
# @raise [LockedEntityError] if the {Layout::Rectangle} is locked
|
169
|
+
#
|
170
|
+
# @version LayOut 2018
|
171
|
+
def type=(type)
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
@@ -0,0 +1,522 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# A SketchUp Model entity. This is an instance of a SketchUp Model that is
|
5
|
+
# inserted into a .layout file. You can change the render mode, line weight,
|
6
|
+
# and set the current scene for the SketchUp Model with this interface.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
10
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
11
|
+
# model.current_scene = 2
|
12
|
+
# model.view = Layout::SketchUpModel::FRONT_VIEW
|
13
|
+
# model.render_mode = Layout::SketchUpModel::VECTOR_RENDER
|
14
|
+
# model.render if model.render_needed?
|
15
|
+
#
|
16
|
+
# @version LayOut 2018
|
17
|
+
class Layout::SketchUpModel < Layout::Entity
|
18
|
+
|
19
|
+
# Constants
|
20
|
+
|
21
|
+
BOTTOM_RELATIVE_VIEW = nil # Stub value.
|
22
|
+
BOTTOM_VIEW = nil # Stub value.
|
23
|
+
|
24
|
+
BACK_VIEW = nil # Stub value.
|
25
|
+
|
26
|
+
CUSTOM_VIEW = nil # Stub value.
|
27
|
+
|
28
|
+
FRONT_VIEW = nil # Stub value.
|
29
|
+
|
30
|
+
HYBRID_RENDER = nil # Stub value.
|
31
|
+
|
32
|
+
ISO_VIEW = nil # Stub value.
|
33
|
+
|
34
|
+
LEFT_VIEW = nil # Stub value.
|
35
|
+
|
36
|
+
RIGHT_VIEW = nil # Stub value.
|
37
|
+
|
38
|
+
RASTER_RENDER = nil # Stub value.
|
39
|
+
|
40
|
+
TOP_RELATIVE_VIEW = nil # Stub value.
|
41
|
+
TOP_VIEW = nil # Stub value.
|
42
|
+
|
43
|
+
VECTOR_RENDER = nil # Stub value.
|
44
|
+
|
45
|
+
# Instance Methods
|
46
|
+
|
47
|
+
# The {#clip_mask} method returns the clip mask entity for the
|
48
|
+
# {Layout::SketchUpModel}, or +nil+ if it does not have one. clip_mask can be a
|
49
|
+
# {Layout::Rectangle}, {Layout::Ellipse}, or {Layout::Path}.
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
53
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
54
|
+
# clip_mask = model.clip_mask
|
55
|
+
#
|
56
|
+
# @return [Layout::Entity]
|
57
|
+
#
|
58
|
+
# @version LayOut 2018
|
59
|
+
def clip_mask
|
60
|
+
end
|
61
|
+
|
62
|
+
# The {#clip_mask=} method sets a clip mask for the {Layout::SketchUpModel}.
|
63
|
+
# clip_mask can be a {Layout::Rectangle}, {Layout::Ellipse}, or {Layout::Path},
|
64
|
+
# and it must not currently exist in a {Layout::Document}.
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
68
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
69
|
+
# rect = Layout::Rectangle.new([[2, 2], [3, 3]]);
|
70
|
+
# model.clip_mask = rect
|
71
|
+
#
|
72
|
+
# @param [Layout::Entity] clip_mask
|
73
|
+
#
|
74
|
+
# @raise [ArgumentError] if clip_mask is already in a {Layout::Document}
|
75
|
+
#
|
76
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
77
|
+
#
|
78
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
79
|
+
# {Layout::Layer}
|
80
|
+
#
|
81
|
+
# @raise [ArgumentError] if clip_mask is not a {Layout::Rectangle},
|
82
|
+
# {Layout::Ellipse}, or {Layout::Path}
|
83
|
+
#
|
84
|
+
# @version LayOut 2018
|
85
|
+
def clip_mask=(clip_mask)
|
86
|
+
end
|
87
|
+
|
88
|
+
# The {#current_scene} method returns the index of the most recently
|
89
|
+
# selected scene of the {Layout::SketchUpModel}.
|
90
|
+
#
|
91
|
+
# @example
|
92
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
93
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
94
|
+
# scene_index = model.current_scene
|
95
|
+
#
|
96
|
+
# @raise [ArgumentError] if the most recently selected scene no longer exists
|
97
|
+
#
|
98
|
+
# @return [Integer]
|
99
|
+
#
|
100
|
+
# @version LayOut 2018
|
101
|
+
def current_scene
|
102
|
+
end
|
103
|
+
|
104
|
+
# The {#current_scene=} method sets the scene of the {Layout::SketchUpModel}.
|
105
|
+
#
|
106
|
+
# @example
|
107
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
108
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
109
|
+
# model.current_scene = 1
|
110
|
+
#
|
111
|
+
# @param [Integer] index
|
112
|
+
# The index into the list of available scenes.
|
113
|
+
#
|
114
|
+
# @raise [IndexError] if index is out of range
|
115
|
+
#
|
116
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
117
|
+
#
|
118
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
119
|
+
# {Layout::Layer}
|
120
|
+
#
|
121
|
+
# @version LayOut 2018
|
122
|
+
def current_scene=(index)
|
123
|
+
end
|
124
|
+
|
125
|
+
# The {#current_scene_modified?} method returns whether the most recently
|
126
|
+
# selected scene of the {Layout::SketchUpModel} has been modified.
|
127
|
+
#
|
128
|
+
# @example
|
129
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
130
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
131
|
+
# modified = model.current_scene_modified?
|
132
|
+
#
|
133
|
+
# @raise [ArgumentError] if the most recently selected scene no longer exists
|
134
|
+
#
|
135
|
+
# @return [Boolean]
|
136
|
+
#
|
137
|
+
# @return [Boolean]
|
138
|
+
#
|
139
|
+
# @version LayOut 2018
|
140
|
+
def current_scene_modified?
|
141
|
+
end
|
142
|
+
|
143
|
+
# The {#display_background=} method sets whether the background is displayed
|
144
|
+
# for the {Layout::SketchUpModel}.
|
145
|
+
#
|
146
|
+
# @example
|
147
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
148
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
149
|
+
# model.display_background = false
|
150
|
+
#
|
151
|
+
# @param [Boolean] display
|
152
|
+
#
|
153
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
154
|
+
#
|
155
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
156
|
+
# {Layout::Layer}
|
157
|
+
#
|
158
|
+
# @version LayOut 2018
|
159
|
+
def display_background=(display)
|
160
|
+
end
|
161
|
+
|
162
|
+
# The {#display_background?} method returns whether the background is displayed
|
163
|
+
# for the {Layout::SketchUpModel}.
|
164
|
+
#
|
165
|
+
# @example
|
166
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
167
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
168
|
+
# displayed = model.display_background?
|
169
|
+
#
|
170
|
+
# @return [Boolean]
|
171
|
+
#
|
172
|
+
# @return [Boolean]
|
173
|
+
#
|
174
|
+
# @version LayOut 2018
|
175
|
+
def display_background?
|
176
|
+
end
|
177
|
+
|
178
|
+
# The {#entities} method returns the {Layout::Group} that represents the
|
179
|
+
# {Layout::SketchUpModel} in its exploded form. The {Layout::Group} will
|
180
|
+
# contain a {Layout::Image} for raster and hybrid-rendered models, and
|
181
|
+
# will contain a {Layout::Group} of LayOut entities for
|
182
|
+
# vector and hybrid-rendered models.
|
183
|
+
#
|
184
|
+
# @example
|
185
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
186
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
187
|
+
# entities = model.entities
|
188
|
+
#
|
189
|
+
# @return [Layout::Entity]
|
190
|
+
#
|
191
|
+
# @version LayOut 2018
|
192
|
+
def entities
|
193
|
+
end
|
194
|
+
|
195
|
+
# The {#initialize} method creates a new {Layout::SketchUpModel}.
|
196
|
+
#
|
197
|
+
# @example
|
198
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
199
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
200
|
+
#
|
201
|
+
# @param [String] path
|
202
|
+
# The path to a .skp file
|
203
|
+
#
|
204
|
+
# @param [Geom::Bounds2d] bounds
|
205
|
+
#
|
206
|
+
# @raise [ArgumentError] if bounds is zero size
|
207
|
+
#
|
208
|
+
# @raise [ArgumentError] if path does not point to a valid SketchUp Model file
|
209
|
+
#
|
210
|
+
# @return [Layout::SketchUpModel]
|
211
|
+
#
|
212
|
+
# @version LayOut 2018
|
213
|
+
def initialize(path, bounds)
|
214
|
+
end
|
215
|
+
|
216
|
+
# The {#line_weight} method returns the line weight for the
|
217
|
+
# {Layout::SketchUpModel}.
|
218
|
+
#
|
219
|
+
# @example
|
220
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
221
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
222
|
+
# line_weight = model.line_weight
|
223
|
+
#
|
224
|
+
# @return [Float]
|
225
|
+
#
|
226
|
+
# @version LayOut 2018
|
227
|
+
def line_weight
|
228
|
+
end
|
229
|
+
|
230
|
+
# The {#line_weight=} method sets the line weight for the
|
231
|
+
# {Layout::SketchUpModel}. Line weight must be at least 0.01.
|
232
|
+
#
|
233
|
+
# @example
|
234
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
235
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
236
|
+
# model.line_weight = 2.5
|
237
|
+
#
|
238
|
+
# @param [Float] line_weight
|
239
|
+
#
|
240
|
+
# @raise [ArgumentError] if line_weight is less than 0.01
|
241
|
+
#
|
242
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
243
|
+
#
|
244
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
245
|
+
# {Layout::Layer}
|
246
|
+
#
|
247
|
+
# @version LayOut 2018
|
248
|
+
def line_weight=(line_weight)
|
249
|
+
end
|
250
|
+
|
251
|
+
# The {#model_to_paper_point} method converts the {Geom::Point3d} in the
|
252
|
+
# {Layout::SketchUpModel} to a {Geom::Point2d} in paper space.
|
253
|
+
#
|
254
|
+
# @example
|
255
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
256
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
257
|
+
# point_3d = [200, 100, 100]
|
258
|
+
# point_2d = model.model_to_paper_point(point_3d)
|
259
|
+
#
|
260
|
+
# @param [Geom::Point3d] model_point
|
261
|
+
#
|
262
|
+
# @return [Geom::Point2d]
|
263
|
+
#
|
264
|
+
# @version LayOut 2018
|
265
|
+
def model_to_paper_point(model_point)
|
266
|
+
end
|
267
|
+
|
268
|
+
# The {#perspective=} method sets whether the {Layout::SketchUpModel}'s view
|
269
|
+
# is perspective or orthographic.
|
270
|
+
#
|
271
|
+
# @example
|
272
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
273
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
274
|
+
# model.perspective = false
|
275
|
+
#
|
276
|
+
# @param [Boolean] perspective
|
277
|
+
#
|
278
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
279
|
+
#
|
280
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
281
|
+
# {Layout::Layer}
|
282
|
+
#
|
283
|
+
# @version LayOut 2018
|
284
|
+
def perspective=(perspective)
|
285
|
+
end
|
286
|
+
|
287
|
+
# The {#perspective?} method returns whether the {Layout::SketchUpModel}'s view
|
288
|
+
# is perspective or orthographic.
|
289
|
+
#
|
290
|
+
# @example
|
291
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
292
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
293
|
+
# perspective = model.perspective?
|
294
|
+
#
|
295
|
+
# @return [Boolean]
|
296
|
+
#
|
297
|
+
# @return [Boolean]
|
298
|
+
#
|
299
|
+
# @version LayOut 2018
|
300
|
+
def perspective?
|
301
|
+
end
|
302
|
+
|
303
|
+
# The {#preserve_scale_on_resize=} method sets whether the scale is preserved
|
304
|
+
# when the {Layout::SketchUpModel} is resized.
|
305
|
+
#
|
306
|
+
# @example
|
307
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
308
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
309
|
+
# model.preserve_scale_on_resize = true
|
310
|
+
#
|
311
|
+
# @param [Boolean] preserve_scale
|
312
|
+
#
|
313
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
314
|
+
#
|
315
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
316
|
+
# {Layout::Layer}
|
317
|
+
#
|
318
|
+
# @version LayOut 2018
|
319
|
+
def preserve_scale_on_resize=(preserve_scale)
|
320
|
+
end
|
321
|
+
|
322
|
+
# The {#preserve_scale_on_resize?} method returns whether the scale is
|
323
|
+
# preserved when the {Layout::SketchUpModel} is resized.
|
324
|
+
#
|
325
|
+
# @example
|
326
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
327
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
328
|
+
# will_scale = model.preserve_scale_on_resize?
|
329
|
+
#
|
330
|
+
# @return [Boolean]
|
331
|
+
#
|
332
|
+
# @return [Boolean]
|
333
|
+
#
|
334
|
+
# @version LayOut 2018
|
335
|
+
def preserve_scale_on_resize?
|
336
|
+
end
|
337
|
+
|
338
|
+
# The {#render} method renders the {Layout::SketchUpModel}.
|
339
|
+
#
|
340
|
+
# @example
|
341
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
342
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
343
|
+
# model.render if model.render_needed?
|
344
|
+
#
|
345
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
346
|
+
# {Layout::Layer}
|
347
|
+
#
|
348
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
349
|
+
#
|
350
|
+
# @version LayOut 2018
|
351
|
+
def render
|
352
|
+
end
|
353
|
+
|
354
|
+
# The {#render_mode} method returns the render mode of the
|
355
|
+
# {Layout::SketchUpModel}.
|
356
|
+
#
|
357
|
+
# The render mode can be one of the following:
|
358
|
+
# [+Layout::SketchUpModel::RASTER_RENDER+]
|
359
|
+
# [+Layout::SketchUpModel::HYBRID_RENDER+]
|
360
|
+
# [+Layout::SketchUpModel::VECTOR_RENDER+]
|
361
|
+
#
|
362
|
+
# @example
|
363
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
364
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
365
|
+
# render_mode = model.render_mode
|
366
|
+
#
|
367
|
+
# @return [Integer]
|
368
|
+
#
|
369
|
+
# @version LayOut 2018
|
370
|
+
def render_mode
|
371
|
+
end
|
372
|
+
|
373
|
+
# The {#render_mode=} method sets the render mode of the
|
374
|
+
# {Layout::SketchUpModel}.
|
375
|
+
#
|
376
|
+
# The render mode can be one of the following:
|
377
|
+
# [+Layout::SketchUpModel::RASTER_RENDER+]
|
378
|
+
# [+Layout::SketchUpModel::HYBRID_RENDER+]
|
379
|
+
# [+Layout::SketchUpModel::VECTOR_RENDER+]
|
380
|
+
#
|
381
|
+
# @example
|
382
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
383
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
384
|
+
# model.render_mode = Layout::SketchUpModel::RASTER_RENDER
|
385
|
+
#
|
386
|
+
# @param [Integer] render_mode
|
387
|
+
#
|
388
|
+
# @raise [ArgumentError] if render_mode is not a valid render mode
|
389
|
+
#
|
390
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
391
|
+
#
|
392
|
+
# @raise [LockedLayertError] if the {Layout::SketchUpModel} is on a locked
|
393
|
+
# {Layout::Layer}
|
394
|
+
#
|
395
|
+
# @version LayOut 2018
|
396
|
+
def render_mode=(render_mode)
|
397
|
+
end
|
398
|
+
|
399
|
+
# The {#render_needed?} method returns whether the {Layout::SketchUpModel}
|
400
|
+
# needs to be rendered.
|
401
|
+
#
|
402
|
+
# @example
|
403
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
404
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
405
|
+
# model.render if model.render_needed?
|
406
|
+
#
|
407
|
+
# @return [Boolean]
|
408
|
+
#
|
409
|
+
# @return [Boolean]
|
410
|
+
#
|
411
|
+
# @version LayOut 2018
|
412
|
+
def render_needed?
|
413
|
+
end
|
414
|
+
|
415
|
+
# The {#scale} method returns the scale of the {Layout::SketchUpModel}.
|
416
|
+
#
|
417
|
+
# @example
|
418
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
419
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
420
|
+
# scale = model.scale
|
421
|
+
#
|
422
|
+
# @return [Float]
|
423
|
+
#
|
424
|
+
# @version LayOut 2018
|
425
|
+
def scale
|
426
|
+
end
|
427
|
+
|
428
|
+
# The {#scale=} method sets the scale of the {Layout::SketchUpModel}. Scale
|
429
|
+
# must be at least 0.0000001, and the view must be orthographic.
|
430
|
+
#
|
431
|
+
# @example
|
432
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
433
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
434
|
+
# model.scale = 2.0
|
435
|
+
#
|
436
|
+
# @param [Float] scale
|
437
|
+
#
|
438
|
+
# @raise [ArgumentError] if the {Layout::SketchUpModel} view is not orthographic
|
439
|
+
#
|
440
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
441
|
+
#
|
442
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
443
|
+
# {Layout::Layer}
|
444
|
+
#
|
445
|
+
# @raise [ArgumentError] if scale is less than 0.0000001
|
446
|
+
#
|
447
|
+
# @version LayOut 2018
|
448
|
+
def scale=(scale)
|
449
|
+
end
|
450
|
+
|
451
|
+
# The {#scenes} method returns an array of scene names that are available
|
452
|
+
# for the {Layout::SketchUpModel}. The first scene will always be the default
|
453
|
+
# scene, called "Last saved SketchUp View".
|
454
|
+
#
|
455
|
+
# @example
|
456
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
457
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
458
|
+
# scene_names = model.scenes
|
459
|
+
#
|
460
|
+
# @return [Array<String>]
|
461
|
+
#
|
462
|
+
# @version LayOut 2018
|
463
|
+
def scenes
|
464
|
+
end
|
465
|
+
|
466
|
+
# The {#view} method returns the standard view of the {Layout::SketchUpModel}.
|
467
|
+
#
|
468
|
+
# The standard view can be one of the following values:
|
469
|
+
# [+Layout::SketchUpModel::CUSTOM_VIEW+]
|
470
|
+
# [+Layout::SketchUpModel::TOP_VIEW+]
|
471
|
+
# [+Layout::SketchUpModel::TOP_RELATIVE_VIEW+]
|
472
|
+
# [+Layout::SketchUpModel::BOTTOM_VIEW+]
|
473
|
+
# [+Layout::SketchUpModel::BOTTOM_RELATIVE_VIEW+]
|
474
|
+
# [+Layout::SketchUpModel::FRONT_VIEW+]
|
475
|
+
# [+Layout::SketchUpModel::BACK_VIEW+]
|
476
|
+
# [+Layout::SketchUpModel::LEFT_VIEW+]
|
477
|
+
# [+Layout::SketchUpModel::RIGHT_VIEW+]
|
478
|
+
# [+Layout::SketchUpModel::ISO_VIEW+]
|
479
|
+
#
|
480
|
+
# @example
|
481
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
482
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
483
|
+
# view = model.view
|
484
|
+
#
|
485
|
+
# @return [Integer]
|
486
|
+
#
|
487
|
+
# @version LayOut 2018
|
488
|
+
def view
|
489
|
+
end
|
490
|
+
|
491
|
+
# The {#view=} method sets the standard view of the {Layout::SketchUpModel}.
|
492
|
+
#
|
493
|
+
# The standard view can be one of the following values:
|
494
|
+
# [+Layout::SketchUpModel::TOP_VIEW+]
|
495
|
+
# [+Layout::SketchUpModel::TOP_RELATIVE_VIEW+]
|
496
|
+
# [+Layout::SketchUpModel::BOTTOM_VIEW+]
|
497
|
+
# [+Layout::SketchUpModel::BOTTOM_RELATIVE_VIEW+]
|
498
|
+
# [+Layout::SketchUpModel::FRONT_VIEW+]
|
499
|
+
# [+Layout::SketchUpModel::BACK_VIEW+]
|
500
|
+
# [+Layout::SketchUpModel::LEFT_VIEW+]
|
501
|
+
# [+Layout::SketchUpModel::RIGHT_VIEW+]
|
502
|
+
# [+Layout::SketchUpModel::ISO_VIEW+]
|
503
|
+
#
|
504
|
+
# @example
|
505
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
506
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
507
|
+
# model.view = Layout::SketchUpModel::FRONT_VIEW
|
508
|
+
#
|
509
|
+
# @param [Integer] view
|
510
|
+
#
|
511
|
+
# @raise [ArgumentError] if view is not a valid standard view
|
512
|
+
#
|
513
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
514
|
+
#
|
515
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
516
|
+
# {Layout::Layer}
|
517
|
+
#
|
518
|
+
# @version LayOut 2018
|
519
|
+
def view=(view)
|
520
|
+
end
|
521
|
+
|
522
|
+
end
|