scriptup 2026.0.1 → 2026.0.2
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/README.md +43 -24
- data/ext/arc_curve.c +50 -0
- data/ext/attribute_dictionaries.c +49 -32
- data/ext/attribute_dictionary.c +54 -127
- data/ext/axes.c +79 -0
- data/ext/behavior.c +100 -9
- data/ext/bounding_box.c +195 -0
- data/ext/camera.c +178 -0
- data/ext/classifications.c +85 -0
- data/ext/color.c +91 -163
- data/ext/component_definition.c +78 -162
- data/ext/component_instance.c +88 -9
- data/ext/construction.c +59 -0
- data/ext/curve.c +87 -0
- data/ext/definition_list.c +89 -109
- data/ext/depend +1 -0
- data/ext/drawing_element.c +96 -117
- data/ext/edge.c +147 -0
- data/ext/edge_use.c +37 -0
- data/ext/entities.c +573 -16
- data/ext/entities_builder.c +145 -0
- data/ext/entity.c +175 -215
- data/ext/environments.c +149 -0
- data/ext/extconf.rb +54 -10
- data/ext/face.c +331 -0
- data/ext/geom.c +172 -0
- data/ext/group.c +86 -0
- data/ext/helpers.c +244 -0
- data/ext/image.c +182 -0
- data/ext/image_rep.c +158 -0
- data/ext/instance_path.c +185 -0
- data/ext/lat_long.c +88 -0
- data/ext/layer.c +98 -0
- data/ext/layer_folder.c +99 -0
- data/ext/layers.c +122 -0
- data/ext/length.c +253 -0
- data/ext/line_styles.c +60 -0
- data/ext/loop.c +24 -0
- data/ext/material.c +144 -197
- data/ext/materials.c +49 -60
- data/ext/model.c +232 -26
- data/ext/options_store.c +188 -0
- data/ext/page.c +168 -0
- data/ext/pages.c +135 -0
- data/ext/point2d.c +195 -0
- data/ext/point3d.c +340 -0
- data/ext/polygon_mesh.c +253 -0
- data/ext/scriptup.h +279 -0
- data/ext/section_plane.c +44 -0
- data/ext/sketchup.c +102 -76
- data/ext/styles.c +91 -0
- data/ext/text.c +135 -0
- data/ext/texture.c +74 -83
- data/ext/texture_writer.c +104 -0
- data/ext/transformation.c +309 -0
- data/ext/transformation2d.c +190 -0
- data/ext/uv_helper.c +41 -0
- data/ext/vector2d.c +238 -0
- data/ext/vector3d.c +294 -0
- data/ext/vertex.c +67 -0
- data/lib/sketchup.rb +2 -2
- data/sig/_top_level.rbs +188 -0
- data/sig/array.rbs +52 -0
- data/sig/geom/bounding_box.rbs +28 -0
- data/sig/geom/bounds2d.rbs +20 -0
- data/sig/geom/lat_long.rbs +13 -0
- data/sig/geom/oriented_bounds2d.rbs +10 -0
- data/sig/geom/point2d.rbs +32 -0
- data/sig/geom/point3d.rbs +46 -0
- data/sig/geom/polygon_mesh.rbs +35 -0
- data/sig/geom/transformation.rbs +44 -0
- data/sig/geom/transformation2d.rbs +26 -0
- data/sig/geom/utm.rbs +14 -0
- data/sig/geom/vector2d.rbs +40 -0
- data/sig/geom/vector3d.rbs +49 -0
- data/sig/geom.rbs +25 -0
- data/sig/language_handler.rbs +8 -0
- data/sig/layout/angular_dimension.rbs +32 -0
- data/sig/layout/auto_text_definition.rbs +73 -0
- data/sig/layout/auto_text_definitions.rbs +15 -0
- data/sig/layout/connection_point.rbs +6 -0
- data/sig/layout/dictionary.rbs +18 -0
- data/sig/layout/document.rbs +61 -0
- data/sig/layout/ellipse.rbs +5 -0
- data/sig/layout/entities.rbs +10 -0
- data/sig/layout/entity.rbs +28 -0
- data/sig/layout/formatted_text.rbs +30 -0
- data/sig/layout/grid.rbs +24 -0
- data/sig/layout/group.rbs +17 -0
- data/sig/layout/image.rbs +7 -0
- data/sig/layout/label.rbs +31 -0
- data/sig/layout/layer.rbs +21 -0
- data/sig/layout/layer_instance.rbs +9 -0
- data/sig/layout/layers.rbs +18 -0
- data/sig/layout/linear_dimension.rbs +39 -0
- data/sig/layout/locked_entity_error.rbs +4 -0
- data/sig/layout/locked_layer_error.rbs +4 -0
- data/sig/layout/page.rbs +20 -0
- data/sig/layout/page_info.rbs +37 -0
- data/sig/layout/pages.rbs +17 -0
- data/sig/layout/path.rbs +34 -0
- data/sig/layout/rectangle.rbs +15 -0
- data/sig/layout/reference_entity.rbs +7 -0
- data/sig/layout/sketch_up_model.rbs +54 -0
- data/sig/layout/style.rbs +150 -0
- data/sig/layout/table.rbs +17 -0
- data/sig/layout/table_cell.rbs +13 -0
- data/sig/layout/table_column.rbs +10 -0
- data/sig/layout/table_row.rbs +10 -0
- data/sig/layout.rbs +4 -0
- data/sig/length.rbs +37 -0
- data/sig/numeric.rbs +23 -0
- data/sig/sketchup/animation.rbs +8 -0
- data/sig/sketchup/app_observer.rbs +11 -0
- data/sig/sketchup/arc_curve.rbs +14 -0
- data/sig/sketchup/attribute_dictionaries.rbs +11 -0
- data/sig/sketchup/attribute_dictionary.rbs +18 -0
- data/sig/sketchup/axes.rbs +13 -0
- data/sig/sketchup/behavior.rbs +19 -0
- data/sig/sketchup/camera.rbs +33 -0
- data/sig/sketchup/classification_schema.rbs +8 -0
- data/sig/sketchup/classifications.rbs +12 -0
- data/sig/sketchup/color.rbs +22 -0
- data/sig/sketchup/component_definition.rbs +43 -0
- data/sig/sketchup/component_instance.rbs +32 -0
- data/sig/sketchup/console.rbs +8 -0
- data/sig/sketchup/construction_line.rbs +17 -0
- data/sig/sketchup/construction_point.rbs +5 -0
- data/sig/sketchup/curve.rbs +13 -0
- data/sig/sketchup/definition_list.rbs +26 -0
- data/sig/sketchup/definition_observer.rbs +6 -0
- data/sig/sketchup/definitions_observer.rbs +8 -0
- data/sig/sketchup/dimension.rbs +18 -0
- data/sig/sketchup/dimension_linear.rbs +24 -0
- data/sig/sketchup/dimension_observer.rbs +5 -0
- data/sig/sketchup/dimension_radial.rbs +9 -0
- data/sig/sketchup/drawingelement.rbs +18 -0
- data/sig/sketchup/edge.rbs +24 -0
- data/sig/sketchup/edge_use.rbs +13 -0
- data/sig/sketchup/entities.rbs +61 -0
- data/sig/sketchup/entities_builder.rbs +15 -0
- data/sig/sketchup/entities_observer.rbs +9 -0
- data/sig/sketchup/entity.rbs +21 -0
- data/sig/sketchup/entity_observer.rbs +6 -0
- data/sig/sketchup/environment.rbs +25 -0
- data/sig/sketchup/environments.rbs +18 -0
- data/sig/sketchup/environments_observer.rbs +8 -0
- data/sig/sketchup/extensions_manager.rbs +11 -0
- data/sig/sketchup/face.rbs +44 -0
- data/sig/sketchup/frame_change_observer.rbs +5 -0
- data/sig/sketchup/group.rbs +38 -0
- data/sig/sketchup/http/request.rbs +17 -0
- data/sig/sketchup/http/response.rbs +7 -0
- data/sig/sketchup/http.rbs +27 -0
- data/sig/sketchup/image.rbs +23 -0
- data/sig/sketchup/image_rep.rbs +17 -0
- data/sig/sketchup/importer.rbs +14 -0
- data/sig/sketchup/input_point.rbs +25 -0
- data/sig/sketchup/instance_observer.rbs +6 -0
- data/sig/sketchup/instance_path.rbs +20 -0
- data/sig/sketchup/layer.rbs +20 -0
- data/sig/sketchup/layer_folder.rbs +26 -0
- data/sig/sketchup/layers.rbs +30 -0
- data/sig/sketchup/layers_observer.rbs +13 -0
- data/sig/sketchup/licensing/extension_license.rbs +8 -0
- data/sig/sketchup/licensing.rbs +15 -0
- data/sig/sketchup/line_style.rbs +5 -0
- data/sig/sketchup/line_styles.rbs +13 -0
- data/sig/sketchup/load_handler.rbs +8 -0
- data/sig/sketchup/loop.rbs +10 -0
- data/sig/sketchup/material.rbs +74 -0
- data/sig/sketchup/materials.rbs +22 -0
- data/sig/sketchup/materials_observer.rbs +10 -0
- data/sig/sketchup/menu.rbs +9 -0
- data/sig/sketchup/model.rbs +105 -0
- data/sig/sketchup/model_observer.rbs +23 -0
- data/sig/sketchup/options_manager.rbs +12 -0
- data/sig/sketchup/options_provider.rbs +23 -0
- data/sig/sketchup/options_provider_observer.rbs +5 -0
- data/sig/sketchup/overlay.rbs +21 -0
- data/sig/sketchup/overlays_manager.rbs +10 -0
- data/sig/sketchup/page.rbs +55 -0
- data/sig/sketchup/pages.rbs +25 -0
- data/sig/sketchup/pages_observer.rbs +7 -0
- data/sig/sketchup/pick_helper.rbs +28 -0
- data/sig/sketchup/regional_settings.rbs +7 -0
- data/sig/sketchup/rendering_options.rbs +89 -0
- data/sig/sketchup/rendering_options_observer.rbs +5 -0
- data/sig/sketchup/section_plane.rbs +12 -0
- data/sig/sketchup/selection.rbs +31 -0
- data/sig/sketchup/selection_observer.rbs +8 -0
- data/sig/sketchup/set.rbs +15 -0
- data/sig/sketchup/shadow_info.rbs +18 -0
- data/sig/sketchup/shadow_info_observer.rbs +5 -0
- data/sig/sketchup/skp.rbs +5 -0
- data/sig/sketchup/snap.rbs +10 -0
- data/sig/sketchup/style.rbs +9 -0
- data/sig/sketchup/styles.rbs +21 -0
- data/sig/sketchup/text.rbs +22 -0
- data/sig/sketchup/texture.rbs +14 -0
- data/sig/sketchup/texture_writer.rbs +14 -0
- data/sig/sketchup/tool.rbs +45 -0
- data/sig/sketchup/tools.rbs +14 -0
- data/sig/sketchup/tools_observer.rbs +6 -0
- data/sig/sketchup/uv_helper.rbs +6 -0
- data/sig/sketchup/vertex.rbs +11 -0
- data/sig/sketchup/view.rbs +87 -0
- data/sig/sketchup/view_observer.rbs +6 -0
- data/sig/sketchup.rbs +137 -0
- data/sig/sketchup_extension.rbs +23 -0
- data/sig/string.rbs +5 -0
- data/sig/ui/command.rbs +20 -0
- data/sig/ui/html_dialog.rbs +29 -0
- data/sig/ui/notification.rbs +16 -0
- data/sig/ui/toolbar.rbs +18 -0
- data/sig/ui/web_dialog.rbs +38 -0
- data/sig/ui.rbs +66 -0
- metadata +204 -287
- data/ext/attribute_dictionaries.h +0 -8
- data/ext/attribute_dictionary.h +0 -8
- data/ext/behavior.h +0 -8
- data/ext/color.h +0 -8
- data/ext/component_definition.h +0 -8
- data/ext/component_instance.h +0 -8
- data/ext/definition_list.h +0 -8
- data/ext/drawing_element.h +0 -8
- data/ext/entities.h +0 -8
- data/ext/entity.h +0 -8
- data/ext/material.h +0 -8
- data/ext/materials.h +0 -8
- data/ext/model.h +0 -8
- data/ext/not_implemented.c +0 -88
- data/ext/not_implemented.h +0 -20
- data/ext/sketchup.h +0 -9
- data/ext/texture.h +0 -8
- data/ext/typed_value.c +0 -84
- data/ext/typed_value.h +0 -11
- data/ext/utils.h +0 -111
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonGeometry.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonGeoutils.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonImage.dylib +0 -4
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonPreferences.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonUnits.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonUtils.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonZip.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/application.h +0 -36
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/model.h +0 -59
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/overlay.h +0 -262
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/ruby_api.h +0 -118
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/color.h +0 -107
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/common.h +0 -178
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/defs.h +0 -19
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/extension_license.h +0 -70
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/bounding_box.h +0 -34
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/plane3d.h +0 -153
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point2d.h +0 -96
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point3d.h +0 -98
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/ray3d.h +0 -64
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation.h +0 -321
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation2d.h +0 -163
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector2d.h +0 -235
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector3d.h +0 -285
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry.h +0 -154
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelexporterplugin.h +0 -165
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelimporterplugin.h +0 -187
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/pluginprogresscallback.h +0 -84
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/initialize.h +0 -43
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/length_formatter.h +0 -424
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arccurve.h +0 -244
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arrow_type.h +0 -17
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/attribute_dictionary.h +0 -161
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/axes.h +0 -242
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/camera.h +0 -398
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_attribute.h +0 -89
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_info.h +0 -125
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classifications.h +0 -86
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition.h +0 -629
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition_snap_to_behavior_private.h +0 -46
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_instance.h +0 -344
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/curve.h +0 -143
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/defs.h +0 -147
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension.h +0 -224
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_linear.h +0 -421
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_radial.h +0 -194
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_style.h +0 -253
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/drawing_element.h +0 -198
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_attribute.h +0 -92
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_info.h +0 -70
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge.h +0 -271
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge_use.h +0 -214
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entities.h +0 -879
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity.h +0 -189
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list.h +0 -80
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list_iterator.h +0 -90
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/environment.h +0 -382
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/environments.h +0 -133
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/face.h +0 -702
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/font.h +0 -138
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry.h +0 -20
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry_input.h +0 -695
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/group.h +0 -245
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_line.h +0 -155
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_point.h +0 -153
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image.h +0 -289
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image_rep.h +0 -275
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/instancepath.h +0 -266
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer.h +0 -265
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer_folder.h +0 -301
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_style.h +0 -211
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_styles.h +0 -81
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/location.h +0 -65
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/loop.h +0 -182
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/material.h +0 -797
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/mesh_helper.h +0 -187
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model.h +0 -1826
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_entity_type_private.h +0 -44
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_version.h +0 -49
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/opening.h +0 -72
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_manager.h +0 -79
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_provider.h +0 -166
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/polyline3d.h +0 -140
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/rendering_options.h +0 -180
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/scene.h +0 -1016
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema.h +0 -56
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema_type.h +0 -26
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/section_plane.h +0 -212
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/selection.h +0 -156
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/shadow_info.h +0 -147
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/skp.h +0 -45
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/snap.h +0 -183
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/space.h +0 -26
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/style.h +0 -303
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/styles.h +0 -192
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/text.h +0 -392
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture.h +0 -380
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture_writer.h +0 -280
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/typed_value.h +0 -390
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/uv_helper.h +0 -79
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/vertex.h +0 -154
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup.h +0 -125
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup_info.h +0 -65
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/slapi.h +0 -16
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/transformation.h +0 -16
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/unicodestring.h +0 -239
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/utils/math_helpers.h +0 -124
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Resources/Info.plist +0 -50
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/SketchUpAPI +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/_CodeSignature/CodeResources +0 -891
- data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.lib +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutControllers.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutModel.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutRTF.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutUtils.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutView.dll +0 -4
- data/sketchup-sdk-win/binaries/layout/x64/SketchUpCommonPreferences.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.lib +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/pdflib.dll +0 -0
- data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.dll +0 -0
- data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.lib +0 -0
- data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpCommonPreferences.dll +0 -0
- data/sketchup-sdk-win/binaries/sketchup/x64/sketchup.lib +0 -0
- data/sketchup-sdk-win/headers/LayOutAPI/application/application.h +0 -117
- data/sketchup-sdk-win/headers/LayOutAPI/common.h +0 -22
- data/sketchup-sdk-win/headers/LayOutAPI/geometry/geometry.h +0 -78
- data/sketchup-sdk-win/headers/LayOutAPI/initialize.h +0 -36
- data/sketchup-sdk-win/headers/LayOutAPI/layout.h +0 -49
- data/sketchup-sdk-win/headers/LayOutAPI/model/angulardimension.h +0 -468
- data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinition.h +0 -569
- data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinitionlist.h +0 -79
- data/sketchup-sdk-win/headers/LayOutAPI/model/connectionpoint.h +0 -107
- data/sketchup-sdk-win/headers/LayOutAPI/model/defs.h +0 -42
- data/sketchup-sdk-win/headers/LayOutAPI/model/dictionary.h +0 -120
- data/sketchup-sdk-win/headers/LayOutAPI/model/document.h +0 -937
- data/sketchup-sdk-win/headers/LayOutAPI/model/documentexportoptions.h +0 -78
- data/sketchup-sdk-win/headers/LayOutAPI/model/ellipse.h +0 -78
- data/sketchup-sdk-win/headers/LayOutAPI/model/entity.h +0 -402
- data/sketchup-sdk-win/headers/LayOutAPI/model/entityiterator.h +0 -49
- data/sketchup-sdk-win/headers/LayOutAPI/model/entitylist.h +0 -114
- data/sketchup-sdk-win/headers/LayOutAPI/model/formattedtext.h +0 -397
- data/sketchup-sdk-win/headers/LayOutAPI/model/grid.h +0 -251
- data/sketchup-sdk-win/headers/LayOutAPI/model/group.h +0 -244
- data/sketchup-sdk-win/headers/LayOutAPI/model/image.h +0 -146
- data/sketchup-sdk-win/headers/LayOutAPI/model/imagerep.h +0 -109
- data/sketchup-sdk-win/headers/LayOutAPI/model/label.h +0 -332
- data/sketchup-sdk-win/headers/LayOutAPI/model/layer.h +0 -207
- data/sketchup-sdk-win/headers/LayOutAPI/model/layerinstance.h +0 -117
- data/sketchup-sdk-win/headers/LayOutAPI/model/layerlist.h +0 -69
- data/sketchup-sdk-win/headers/LayOutAPI/model/lineardimension.h +0 -508
- data/sketchup-sdk-win/headers/LayOutAPI/model/page.h +0 -331
- data/sketchup-sdk-win/headers/LayOutAPI/model/pageinfo.h +0 -372
- data/sketchup-sdk-win/headers/LayOutAPI/model/pagelist.h +0 -81
- data/sketchup-sdk-win/headers/LayOutAPI/model/path.h +0 -464
- data/sketchup-sdk-win/headers/LayOutAPI/model/rectangle.h +0 -240
- data/sketchup-sdk-win/headers/LayOutAPI/model/referenceentity.h +0 -120
- data/sketchup-sdk-win/headers/LayOutAPI/model/sketchupmodel.h +0 -681
- data/sketchup-sdk-win/headers/LayOutAPI/model/style.h +0 -1116
- data/sketchup-sdk-win/headers/LayOutAPI/model/table.h +0 -472
- data/sketchup-sdk-win/headers/LayOutAPI/model/typed_value.h +0 -180
- data/sketchup-sdk-win/headers/SketchUpAPI/application/application.h +0 -36
- data/sketchup-sdk-win/headers/SketchUpAPI/application/model.h +0 -59
- data/sketchup-sdk-win/headers/SketchUpAPI/application/overlay.h +0 -262
- data/sketchup-sdk-win/headers/SketchUpAPI/application/ruby_api.h +0 -118
- data/sketchup-sdk-win/headers/SketchUpAPI/color.h +0 -107
- data/sketchup-sdk-win/headers/SketchUpAPI/common.h +0 -178
- data/sketchup-sdk-win/headers/SketchUpAPI/defs.h +0 -19
- data/sketchup-sdk-win/headers/SketchUpAPI/extension_license.h +0 -70
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/bounding_box.h +0 -34
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/plane3d.h +0 -153
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point2d.h +0 -96
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point3d.h +0 -98
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/ray3d.h +0 -64
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation.h +0 -321
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation2d.h +0 -163
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector2d.h +0 -235
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector3d.h +0 -285
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry.h +0 -154
- data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelexporterplugin.h +0 -165
- data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelimporterplugin.h +0 -187
- data/sketchup-sdk-win/headers/SketchUpAPI/import_export/pluginprogresscallback.h +0 -84
- data/sketchup-sdk-win/headers/SketchUpAPI/initialize.h +0 -43
- data/sketchup-sdk-win/headers/SketchUpAPI/length_formatter.h +0 -424
- data/sketchup-sdk-win/headers/SketchUpAPI/model/arccurve.h +0 -244
- data/sketchup-sdk-win/headers/SketchUpAPI/model/arrow_type.h +0 -17
- data/sketchup-sdk-win/headers/SketchUpAPI/model/attribute_dictionary.h +0 -161
- data/sketchup-sdk-win/headers/SketchUpAPI/model/axes.h +0 -242
- data/sketchup-sdk-win/headers/SketchUpAPI/model/camera.h +0 -398
- data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_attribute.h +0 -89
- data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_info.h +0 -125
- data/sketchup-sdk-win/headers/SketchUpAPI/model/classifications.h +0 -86
- data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition.h +0 -629
- data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition_snap_to_behavior_private.h +0 -46
- data/sketchup-sdk-win/headers/SketchUpAPI/model/component_instance.h +0 -344
- data/sketchup-sdk-win/headers/SketchUpAPI/model/curve.h +0 -143
- data/sketchup-sdk-win/headers/SketchUpAPI/model/defs.h +0 -147
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension.h +0 -224
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_linear.h +0 -421
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_radial.h +0 -194
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_style.h +0 -253
- data/sketchup-sdk-win/headers/SketchUpAPI/model/drawing_element.h +0 -198
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_attribute.h +0 -92
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_info.h +0 -70
- data/sketchup-sdk-win/headers/SketchUpAPI/model/edge.h +0 -271
- data/sketchup-sdk-win/headers/SketchUpAPI/model/edge_use.h +0 -214
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entities.h +0 -879
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entity.h +0 -189
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list.h +0 -80
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list_iterator.h +0 -90
- data/sketchup-sdk-win/headers/SketchUpAPI/model/environment.h +0 -382
- data/sketchup-sdk-win/headers/SketchUpAPI/model/environments.h +0 -133
- data/sketchup-sdk-win/headers/SketchUpAPI/model/face.h +0 -702
- data/sketchup-sdk-win/headers/SketchUpAPI/model/font.h +0 -138
- data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry.h +0 -20
- data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry_input.h +0 -695
- data/sketchup-sdk-win/headers/SketchUpAPI/model/group.h +0 -245
- data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_line.h +0 -155
- data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_point.h +0 -153
- data/sketchup-sdk-win/headers/SketchUpAPI/model/image.h +0 -289
- data/sketchup-sdk-win/headers/SketchUpAPI/model/image_rep.h +0 -275
- data/sketchup-sdk-win/headers/SketchUpAPI/model/instancepath.h +0 -266
- data/sketchup-sdk-win/headers/SketchUpAPI/model/layer.h +0 -265
- data/sketchup-sdk-win/headers/SketchUpAPI/model/layer_folder.h +0 -301
- data/sketchup-sdk-win/headers/SketchUpAPI/model/line_style.h +0 -211
- data/sketchup-sdk-win/headers/SketchUpAPI/model/line_styles.h +0 -81
- data/sketchup-sdk-win/headers/SketchUpAPI/model/location.h +0 -65
- data/sketchup-sdk-win/headers/SketchUpAPI/model/loop.h +0 -182
- data/sketchup-sdk-win/headers/SketchUpAPI/model/material.h +0 -797
- data/sketchup-sdk-win/headers/SketchUpAPI/model/mesh_helper.h +0 -187
- data/sketchup-sdk-win/headers/SketchUpAPI/model/model.h +0 -1826
- data/sketchup-sdk-win/headers/SketchUpAPI/model/model_entity_type_private.h +0 -44
- data/sketchup-sdk-win/headers/SketchUpAPI/model/model_version.h +0 -49
- data/sketchup-sdk-win/headers/SketchUpAPI/model/opening.h +0 -72
- data/sketchup-sdk-win/headers/SketchUpAPI/model/options_manager.h +0 -79
- data/sketchup-sdk-win/headers/SketchUpAPI/model/options_provider.h +0 -166
- data/sketchup-sdk-win/headers/SketchUpAPI/model/polyline3d.h +0 -140
- data/sketchup-sdk-win/headers/SketchUpAPI/model/rendering_options.h +0 -180
- data/sketchup-sdk-win/headers/SketchUpAPI/model/scene.h +0 -1016
- data/sketchup-sdk-win/headers/SketchUpAPI/model/schema.h +0 -56
- data/sketchup-sdk-win/headers/SketchUpAPI/model/schema_type.h +0 -26
- data/sketchup-sdk-win/headers/SketchUpAPI/model/section_plane.h +0 -212
- data/sketchup-sdk-win/headers/SketchUpAPI/model/selection.h +0 -156
- data/sketchup-sdk-win/headers/SketchUpAPI/model/shadow_info.h +0 -147
- data/sketchup-sdk-win/headers/SketchUpAPI/model/skp.h +0 -45
- data/sketchup-sdk-win/headers/SketchUpAPI/model/snap.h +0 -183
- data/sketchup-sdk-win/headers/SketchUpAPI/model/space.h +0 -26
- data/sketchup-sdk-win/headers/SketchUpAPI/model/style.h +0 -303
- data/sketchup-sdk-win/headers/SketchUpAPI/model/styles.h +0 -192
- data/sketchup-sdk-win/headers/SketchUpAPI/model/text.h +0 -392
- data/sketchup-sdk-win/headers/SketchUpAPI/model/texture.h +0 -380
- data/sketchup-sdk-win/headers/SketchUpAPI/model/texture_writer.h +0 -280
- data/sketchup-sdk-win/headers/SketchUpAPI/model/typed_value.h +0 -390
- data/sketchup-sdk-win/headers/SketchUpAPI/model/uv_helper.h +0 -79
- data/sketchup-sdk-win/headers/SketchUpAPI/model/vertex.h +0 -154
- data/sketchup-sdk-win/headers/SketchUpAPI/sketchup.h +0 -125
- data/sketchup-sdk-win/headers/SketchUpAPI/sketchup_info.h +0 -65
- data/sketchup-sdk-win/headers/SketchUpAPI/slapi.h +0 -16
- data/sketchup-sdk-win/headers/SketchUpAPI/transformation.h +0 -16
- data/sketchup-sdk-win/headers/SketchUpAPI/unicodestring.h +0 -239
- data/sketchup-sdk-win/headers/SketchUpAPI/utils/math_helpers.h +0 -124
data/ext/construction.c
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#include <scriptup.h>
|
|
2
|
+
|
|
3
|
+
static VALUE constructionpoint_position(VALUE self)
|
|
4
|
+
{
|
|
5
|
+
struct SUPoint3D p = {0, 0, 0};
|
|
6
|
+
SUGuidePointGetPosition(SU_REF(SUGuidePointRef, self), &p);
|
|
7
|
+
return su_point3d_new(p);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
struct guide_line
|
|
11
|
+
{
|
|
12
|
+
struct SUPoint3D start;
|
|
13
|
+
struct SUVector3D direction;
|
|
14
|
+
bool infinite;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
static struct guide_line guide_line_data(VALUE self)
|
|
18
|
+
{
|
|
19
|
+
struct guide_line data = {{0, 0, 0}, {0, 0, 0}, false};
|
|
20
|
+
SUGuideLineGetData(SU_REF(SUGuideLineRef, self), &data.start, &data.direction, &data.infinite);
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static VALUE constructionline_position(VALUE self)
|
|
25
|
+
{
|
|
26
|
+
return su_point3d_new(guide_line_data(self).start);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static VALUE constructionline_direction(VALUE self)
|
|
30
|
+
{
|
|
31
|
+
struct SUVector3D v = guide_line_data(self).direction;
|
|
32
|
+
SUVector3DNormalize(&v);
|
|
33
|
+
return su_vector3d_new(v);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static VALUE constructionline_start(VALUE self)
|
|
37
|
+
{
|
|
38
|
+
struct guide_line data = guide_line_data(self);
|
|
39
|
+
return data.infinite ? Qnil : su_point3d_new(data.start);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static VALUE constructionline_end(VALUE self)
|
|
43
|
+
{
|
|
44
|
+
struct guide_line data = guide_line_data(self);
|
|
45
|
+
if (data.infinite)
|
|
46
|
+
return Qnil;
|
|
47
|
+
struct SUPoint3D end;
|
|
48
|
+
SUPoint3DOffset(&data.start, &data.direction, &end);
|
|
49
|
+
return su_point3d_new(end);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void Init_construction(void)
|
|
53
|
+
{
|
|
54
|
+
rb_define_method(cConstructionPoint, "position", constructionpoint_position, 0);
|
|
55
|
+
rb_define_method(cConstructionLine, "position", constructionline_position, 0);
|
|
56
|
+
rb_define_method(cConstructionLine, "direction", constructionline_direction, 0);
|
|
57
|
+
rb_define_method(cConstructionLine, "start", constructionline_start, 0);
|
|
58
|
+
rb_define_method(cConstructionLine, "end", constructionline_end, 0);
|
|
59
|
+
}
|
data/ext/curve.c
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#include <scriptup.h>
|
|
2
|
+
|
|
3
|
+
#define CURVE(self) SU_REF(SUCurveRef, self)
|
|
4
|
+
|
|
5
|
+
DEFINE_REF_LIST(curve_edge_list, SUCurveRef, SUCurveGetNumEdges, SUCurveGetEdges, SUEdgeRef, cEdge)
|
|
6
|
+
DEFINE_SIZE_GETTER(curve_count_edges, SUCurveRef, SUCurveGetNumEdges)
|
|
7
|
+
DEFINE_BOOL_GETTER(curve_is_polygon_p, SUCurveRef, SUCurveIsPolygon)
|
|
8
|
+
|
|
9
|
+
static VALUE curve_edges(VALUE self)
|
|
10
|
+
{
|
|
11
|
+
return curve_edge_list(CURVE(self));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static VALUE curve_each_edge(VALUE self)
|
|
15
|
+
{
|
|
16
|
+
su_yield_each(self, curve_edges(self));
|
|
17
|
+
return Qnil;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static VALUE curve_first_edge(VALUE self)
|
|
21
|
+
{
|
|
22
|
+
return rb_ary_entry(curve_edges(self), 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static VALUE curve_last_edge(VALUE self)
|
|
26
|
+
{
|
|
27
|
+
return rb_ary_entry(curve_edges(self), -1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static VALUE curve_length(VALUE self)
|
|
31
|
+
{
|
|
32
|
+
VALUE edges = curve_edges(self);
|
|
33
|
+
double total = 0.0;
|
|
34
|
+
for (long i = 0; i < RARRAY_LEN(edges); i++)
|
|
35
|
+
total += NUM2DBL(rb_funcall(RARRAY_AREF(edges, i), (rb_intern)("length"), 0));
|
|
36
|
+
return su_length_new(total);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Ordered vertices: the start of each edge, plus the end of the last unless the curve is closed.
|
|
40
|
+
static VALUE curve_vertices(VALUE self)
|
|
41
|
+
{
|
|
42
|
+
VALUE edges = curve_edges(self);
|
|
43
|
+
VALUE vertices = rb_ary_new();
|
|
44
|
+
for (long i = 0; i < RARRAY_LEN(edges); i++)
|
|
45
|
+
{
|
|
46
|
+
SUVertexRef start = SU_INVALID;
|
|
47
|
+
SUEdgeGetStartVertex(SU_REF(SUEdgeRef, RARRAY_AREF(edges, i)), &start);
|
|
48
|
+
rb_ary_push(vertices, su_wrap(cVertex, start.ptr));
|
|
49
|
+
}
|
|
50
|
+
if (RARRAY_LEN(edges) > 0)
|
|
51
|
+
{
|
|
52
|
+
SUVertexRef end = SU_INVALID;
|
|
53
|
+
SUEdgeGetEndVertex(SU_REF(SUEdgeRef, RARRAY_AREF(edges, RARRAY_LEN(edges) - 1)), &end);
|
|
54
|
+
VALUE last = su_wrap(cVertex, end.ptr);
|
|
55
|
+
if (!RTEST(rb_ary_includes(vertices, last)))
|
|
56
|
+
rb_ary_push(vertices, last);
|
|
57
|
+
}
|
|
58
|
+
return vertices;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static VALUE curve_move_vertices(VALUE self, VALUE points)
|
|
62
|
+
{
|
|
63
|
+
Check_Type(points, T_ARRAY);
|
|
64
|
+
VALUE vertices = curve_vertices(self);
|
|
65
|
+
if (RARRAY_LEN(points) != RARRAY_LEN(vertices))
|
|
66
|
+
rb_raise(rb_eArgError, "expected %ld points, got %ld", RARRAY_LEN(vertices), RARRAY_LEN(points));
|
|
67
|
+
for (long i = 0; i < RARRAY_LEN(points); i++)
|
|
68
|
+
{
|
|
69
|
+
struct SUPoint3D p = su_to_point3d(RARRAY_AREF(points, i));
|
|
70
|
+
if (SUVertexSetPosition(SU_REF(SUVertexRef, RARRAY_AREF(vertices, i)), &p) != SU_ERROR_NONE)
|
|
71
|
+
return Qfalse;
|
|
72
|
+
}
|
|
73
|
+
return Qtrue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
void Init_curve(void)
|
|
77
|
+
{
|
|
78
|
+
rb_define_method(cCurve, "edges", curve_edges, 0);
|
|
79
|
+
rb_define_method(cCurve, "each_edge", curve_each_edge, 0);
|
|
80
|
+
rb_define_method(cCurve, "count_edges", curve_count_edges, 0);
|
|
81
|
+
rb_define_method(cCurve, "first_edge", curve_first_edge, 0);
|
|
82
|
+
rb_define_method(cCurve, "last_edge", curve_last_edge, 0);
|
|
83
|
+
rb_define_method(cCurve, "is_polygon?", curve_is_polygon_p, 0);
|
|
84
|
+
rb_define_method(cCurve, "length", curve_length, 0);
|
|
85
|
+
rb_define_method(cCurve, "vertices", curve_vertices, 0);
|
|
86
|
+
rb_define_method(cCurve, "move_vertices", curve_move_vertices, 1);
|
|
87
|
+
}
|
data/ext/definition_list.c
CHANGED
|
@@ -1,146 +1,126 @@
|
|
|
1
|
-
#include <
|
|
2
|
-
#include <definition_list.h>
|
|
3
|
-
#include <utils.h>
|
|
4
|
-
#include <SketchUpAPI/sketchup.h>
|
|
1
|
+
#include <scriptup.h>
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
DEFINE_REF_LIST(component_definitions, SUModelRef, SUModelGetNumComponentDefinitions,
|
|
4
|
+
SUModelGetComponentDefinitions, SUComponentDefinitionRef, cComponentDefinition)
|
|
5
|
+
DEFINE_REF_LIST(group_definitions, SUModelRef, SUModelGetNumGroupDefinitions,
|
|
6
|
+
SUModelGetGroupDefinitions, SUComponentDefinitionRef, cComponentDefinition)
|
|
7
|
+
|
|
8
|
+
static VALUE definitionlist_to_a(VALUE self)
|
|
7
9
|
{
|
|
8
|
-
|
|
10
|
+
SUModelRef model = SU_REF(SUModelRef, self);
|
|
11
|
+
return rb_ary_concat(component_definitions(model), group_definitions(model));
|
|
9
12
|
}
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
static VALUE definitionlist_each(VALUE self)
|
|
12
15
|
{
|
|
13
|
-
|
|
16
|
+
return su_yield_each(self, definitionlist_to_a(self));
|
|
14
17
|
}
|
|
15
18
|
|
|
16
|
-
static VALUE
|
|
19
|
+
static VALUE definitionlist_length(VALUE self)
|
|
17
20
|
{
|
|
18
|
-
SUModelRef model =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
SUModelRef model = SU_REF(SUModelRef, self);
|
|
22
|
+
size_t components = 0;
|
|
23
|
+
size_t groups = 0;
|
|
24
|
+
SUModelGetNumComponentDefinitions(model, &components);
|
|
25
|
+
SUModelGetNumGroupDefinitions(model, &groups);
|
|
26
|
+
return SIZET2NUM(components + groups);
|
|
22
27
|
}
|
|
23
28
|
|
|
24
|
-
static VALUE
|
|
29
|
+
static VALUE definitionlist_aref(VALUE self, VALUE key)
|
|
25
30
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return ULL2NUM(cd_count + gd_count);
|
|
31
|
+
VALUE definitions = definitionlist_to_a(self);
|
|
32
|
+
if (!RB_TYPE_P(key, T_STRING))
|
|
33
|
+
return su_fetch(definitions, key);
|
|
34
|
+
VALUE found = su_find_by(definitions, "name", key);
|
|
35
|
+
return NIL_P(found) ? su_find_by(definitions, "guid", key) : found;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
static VALUE
|
|
38
|
+
static VALUE definitionlist_load(int argc, VALUE* argv, VALUE self)
|
|
35
39
|
{
|
|
36
|
-
|
|
40
|
+
VALUE path;
|
|
41
|
+
VALUE options;
|
|
42
|
+
rb_scan_args(argc, argv, "1:", &path, &options);
|
|
43
|
+
bool allow_newer = false;
|
|
44
|
+
if (!NIL_P(options))
|
|
45
|
+
{
|
|
46
|
+
ID ids[1] = {(rb_intern)("allow_newer")};
|
|
47
|
+
VALUE values[1];
|
|
48
|
+
rb_get_kwargs(options, ids, 0, 1, values);
|
|
49
|
+
allow_newer = values[0] != Qundef && RTEST(values[0]);
|
|
50
|
+
}
|
|
37
51
|
SUComponentDefinitionRef definition = SU_INVALID;
|
|
38
|
-
enum SUModelLoadStatus status;
|
|
39
|
-
|
|
40
|
-
if (result != SU_ERROR_NONE)
|
|
52
|
+
enum SUModelLoadStatus status = SUModelLoadStatus_Success;
|
|
53
|
+
if (SUModelLoadDefinitionWithStatus(SU_REF(SUModelRef, self), StringValueCStr(path), &definition, &status) != SU_ERROR_NONE)
|
|
41
54
|
rb_raise(rb_eStandardError, "Unsuccessful loading of the definition!");
|
|
42
|
-
|
|
55
|
+
if (status == SUModelLoadStatus_Success_MoreRecent && !allow_newer)
|
|
56
|
+
rb_raise(rb_eStandardError, "The file was saved with a newer version of SketchUp");
|
|
57
|
+
return su_wrap(cComponentDefinition, definition.ptr);
|
|
43
58
|
}
|
|
44
59
|
|
|
45
|
-
|
|
60
|
+
// Only SketchUp files can be imported through the C API.
|
|
61
|
+
static VALUE definitionlist_import(int argc, VALUE* argv, VALUE self)
|
|
46
62
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{
|
|
53
|
-
VALUE definition_name;
|
|
54
|
-
VALUE definition_guid;
|
|
55
|
-
GETSTRING(SUComponentDefinitionGetName, definition, definition_name);
|
|
56
|
-
GETSTRING(SUComponentDefinitionGetGuid, definition, definition_guid);
|
|
57
|
-
if (strcmp(StringValuePtr(definition_name), StringValuePtr(definition_struct->key)) == 0 ||
|
|
58
|
-
strcmp(StringValuePtr(definition_guid), StringValuePtr(definition_struct->key)) == 0)
|
|
59
|
-
definition_struct->definition = definition;
|
|
63
|
+
rb_check_arity(argc, 1, 2);
|
|
64
|
+
VALUE extension = rb_funcall(rb_funcall(rb_cFile, (rb_intern)("extname"), 1, argv[0]), (rb_intern)("downcase"), 0);
|
|
65
|
+
if (!RTEST(rb_str_equal(extension, rb_str_new_cstr(".skp"))))
|
|
66
|
+
rb_raise(rb_eNotImpError, "the C API can only import .skp files");
|
|
67
|
+
return definitionlist_load(1, argv, self);
|
|
60
68
|
}
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
int targetIndex;
|
|
65
|
-
int currentIndex;
|
|
66
|
-
SUComponentDefinitionRef definition;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
void Sketchup_DefinitionList_Get_By_Index_Iterator(SUComponentDefinitionRef definition, struct DefinitionIndexIterationContext* definition_struct)
|
|
70
|
+
static VALUE definitionlist_purge_unused(VALUE self)
|
|
70
71
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
VALUE definitions = component_definitions(SU_REF(SUModelRef, self));
|
|
73
|
+
for (long i = 0; i < RARRAY_LEN(definitions); i++)
|
|
74
|
+
{
|
|
75
|
+
SUComponentDefinitionRef definition = SU_REF(SUComponentDefinitionRef, RARRAY_AREF(definitions, i));
|
|
76
|
+
size_t count = 0;
|
|
77
|
+
SUComponentDefinitionGetNumInstances(definition, &count);
|
|
78
|
+
if (count == 0)
|
|
79
|
+
SUModelRemoveComponentDefinitions(SU_REF(SUModelRef, self), 1, &definition);
|
|
80
|
+
}
|
|
81
|
+
return self;
|
|
74
82
|
}
|
|
75
83
|
|
|
76
|
-
static VALUE
|
|
84
|
+
static VALUE definitionlist_unique_name(VALUE self, VALUE base)
|
|
77
85
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
SUModelGetComponentDefinitions,
|
|
85
|
-
SUComponentDefinitionRef,
|
|
86
|
-
model,
|
|
87
|
-
Sketchup_DefinitionList_Get_By_String_Iterator,
|
|
88
|
-
&definition_struct);
|
|
89
|
-
if (SUIsInvalid(definition_struct.definition))
|
|
90
|
-
return Qnil;
|
|
91
|
-
return Data_Wrap_Struct(rb_path2class(SKETCHUP_COMPONENTDEFINITION), 0, 0, definition_struct.definition.ptr);
|
|
92
|
-
}
|
|
93
|
-
else
|
|
94
|
-
{
|
|
95
|
-
struct DefinitionIndexIterationContext definition_struct = {NUM2INT(key), 0, SU_INVALID};
|
|
96
|
-
FOREACH(
|
|
97
|
-
SUModelGetNumComponentDefinitions,
|
|
98
|
-
SUModelGetComponentDefinitions,
|
|
99
|
-
SUComponentDefinitionRef,
|
|
100
|
-
model,
|
|
101
|
-
Sketchup_DefinitionList_Get_By_Index_Iterator,
|
|
102
|
-
&definition_struct);
|
|
103
|
-
if (SUIsInvalid(definition_struct.definition))
|
|
104
|
-
{
|
|
105
|
-
if (definition_struct.targetIndex >= definition_struct.currentIndex)
|
|
106
|
-
rb_raise(rb_eIndexError, "index %d out of range [0, %d)", definition_struct.targetIndex, definition_struct.currentIndex);
|
|
107
|
-
}
|
|
108
|
-
return Data_Wrap_Struct(rb_path2class(SKETCHUP_COMPONENTDEFINITION), 0, 0, definition_struct.definition.ptr);
|
|
109
|
-
}
|
|
86
|
+
StringValue(base);
|
|
87
|
+
VALUE definitions = definitionlist_to_a(self);
|
|
88
|
+
VALUE candidate = base;
|
|
89
|
+
for (long n = 1; !NIL_P(su_find_by(definitions, "name", candidate)); n++)
|
|
90
|
+
candidate = rb_sprintf("%"PRIsVALUE"#%ld", base, n);
|
|
91
|
+
return candidate;
|
|
110
92
|
}
|
|
111
93
|
|
|
112
|
-
static VALUE
|
|
94
|
+
static VALUE definitionlist_add(VALUE self, VALUE name)
|
|
113
95
|
{
|
|
114
|
-
|
|
96
|
+
const char* name_ptr = StringValueCStr(name);
|
|
115
97
|
SUComponentDefinitionRef definition = SU_INVALID;
|
|
116
98
|
SUComponentDefinitionCreate(&definition);
|
|
117
|
-
SUComponentDefinitionSetName(definition,
|
|
118
|
-
SUModelAddComponentDefinitions(
|
|
119
|
-
return
|
|
99
|
+
SUComponentDefinitionSetName(definition, name_ptr);
|
|
100
|
+
SUModelAddComponentDefinitions(SU_REF(SUModelRef, self), 1, &definition);
|
|
101
|
+
return su_wrap(cComponentDefinition, definition.ptr);
|
|
120
102
|
}
|
|
121
103
|
|
|
122
|
-
static VALUE
|
|
104
|
+
static VALUE definitionlist_remove(VALUE self, VALUE definition)
|
|
123
105
|
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
SUModelRef model = {DATA_PTR(self)};
|
|
127
|
-
SUComponentDefinitionRef definition = {DATA_PTR(rb_definition)};
|
|
128
|
-
SUModelRemoveComponentDefinitions(model, 1, &definition);
|
|
106
|
+
SUComponentDefinitionRef ref = {su_unwrap(definition, cComponentDefinition)};
|
|
107
|
+
SUModelRemoveComponentDefinitions(SU_REF(SUModelRef, self), 1, &ref);
|
|
129
108
|
return Qtrue;
|
|
130
109
|
}
|
|
131
110
|
|
|
132
|
-
|
|
111
|
+
void Init_definition_list(void)
|
|
133
112
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
rb_define_method(
|
|
138
|
-
rb_define_method(
|
|
139
|
-
rb_define_method(
|
|
140
|
-
rb_define_method(
|
|
141
|
-
rb_define_method(
|
|
142
|
-
rb_define_method(
|
|
143
|
-
rb_define_method(
|
|
144
|
-
rb_define_method(
|
|
145
|
-
|
|
146
|
-
|
|
113
|
+
rb_include_module(cDefinitionList, rb_mEnumerable);
|
|
114
|
+
rb_define_method(cDefinitionList, "each", definitionlist_each, 0);
|
|
115
|
+
rb_define_method(cDefinitionList, "count", definitionlist_length, 0);
|
|
116
|
+
rb_define_method(cDefinitionList, "size", definitionlist_length, 0);
|
|
117
|
+
rb_define_method(cDefinitionList, "length", definitionlist_length, 0);
|
|
118
|
+
rb_define_method(cDefinitionList, "load", definitionlist_load, -1);
|
|
119
|
+
rb_define_method(cDefinitionList, "import", definitionlist_import, -1);
|
|
120
|
+
rb_define_method(cDefinitionList, "purge_unused", definitionlist_purge_unused, 0);
|
|
121
|
+
rb_define_method(cDefinitionList, "unique_name", definitionlist_unique_name, 1);
|
|
122
|
+
rb_define_method(cDefinitionList, "[]", definitionlist_aref, 1);
|
|
123
|
+
rb_define_method(cDefinitionList, "at", definitionlist_aref, 1);
|
|
124
|
+
rb_define_method(cDefinitionList, "add", definitionlist_add, 1);
|
|
125
|
+
rb_define_method(cDefinitionList, "remove", definitionlist_remove, 1);
|
|
126
|
+
}
|
data/ext/depend
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$(OBJS): $(srcdir)/scriptup.h
|
data/ext/drawing_element.c
CHANGED
|
@@ -1,146 +1,125 @@
|
|
|
1
|
-
#include <
|
|
2
|
-
#include <drawing_element.h>
|
|
3
|
-
#include <not_implemented.h>
|
|
4
|
-
#include <utils.h>
|
|
5
|
-
#include <SketchUpAPI/sketchup.h>
|
|
1
|
+
#include <scriptup.h>
|
|
6
2
|
|
|
7
|
-
static
|
|
3
|
+
static bool not_rtest(VALUE value)
|
|
8
4
|
{
|
|
9
|
-
|
|
10
|
-
struct SUBoundingBox3D* bbox = 0;
|
|
11
|
-
SUDrawingElementGetBoundingBox(drawing_element, bbox);
|
|
12
|
-
return Data_Make_Struct(rb_path2class(GEOM_BOUNDINGBOX), struct SUBoundingBox3D, 0, RUBY_DEFAULT_FREE, bbox);
|
|
5
|
+
return !RTEST(value);
|
|
13
6
|
}
|
|
14
7
|
|
|
15
|
-
|
|
8
|
+
DEFINE_BOOL_GETTER(drawingelement_casts_shadows_p, SUDrawingElementRef, SUDrawingElementGetCastsShadows)
|
|
9
|
+
DEFINE_BOOL_SETTER(drawingelement_set_casts_shadows, SUDrawingElementRef, SUDrawingElementSetCastsShadows)
|
|
10
|
+
DEFINE_BOOL_GETTER(drawingelement_receives_shadows_p, SUDrawingElementRef, SUDrawingElementGetReceivesShadows)
|
|
11
|
+
DEFINE_BOOL_SETTER(drawingelement_set_receives_shadows, SUDrawingElementRef, SUDrawingElementSetReceivesShadows)
|
|
12
|
+
DEFINE_BOOL_GETTER(drawingelement_hidden_p, SUDrawingElementRef, SUDrawingElementGetHidden)
|
|
13
|
+
DEFINE_BOOL_SETTER(drawingelement_set_hidden, SUDrawingElementRef, SUDrawingElementSetHidden)
|
|
14
|
+
DEFINE_SETTER(drawingelement_set_visible, SUDrawingElementRef, SUDrawingElementSetHidden, not_rtest)
|
|
15
|
+
DEFINE_REF_GETTER(drawingelement_material, SUDrawingElementRef, SUDrawingElementGetMaterial, SUMaterialRef, cMaterial)
|
|
16
|
+
DEFINE_REF_GETTER(drawingelement_layer, SUDrawingElementRef, SUDrawingElementGetLayer, SULayerRef, cLayer)
|
|
17
|
+
|
|
18
|
+
static VALUE drawingelement_visible_p(VALUE self)
|
|
16
19
|
{
|
|
17
|
-
|
|
18
|
-
bool casts_shadows_flag = false;
|
|
19
|
-
SUDrawingElementGetCastsShadows(drawing_element, &casts_shadows_flag);
|
|
20
|
-
return casts_shadows_flag ? Qtrue : Qfalse;
|
|
20
|
+
return RTEST(drawingelement_hidden_p(self)) ? Qfalse : Qtrue;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
static VALUE
|
|
23
|
+
static VALUE drawingelement_bounds(VALUE self)
|
|
24
24
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
25
|
+
struct SUBoundingBox3D bbox;
|
|
26
|
+
SUDrawingElementGetBoundingBox(SU_REF(SUDrawingElementRef, self), &bbox);
|
|
27
|
+
return su_bounding_box_new(bbox);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
static VALUE
|
|
30
|
+
static VALUE drawingelement_model(VALUE self)
|
|
31
31
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return receives_shadows_flag ? Qtrue : Qfalse;
|
|
32
|
+
SUModelRef model = SU_INVALID;
|
|
33
|
+
SUEntityGetModel(SU_REF(SUEntityRef, self), &model);
|
|
34
|
+
return su_wrap_or_nil(cModel, model.ptr);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
// Material, material name or Color (a new material is added to the model).
|
|
38
|
+
SUMaterialRef su_material_from_arg(VALUE entity, VALUE material)
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static VALUE Sketchup_DrawingElement_Get_visible(VALUE self)
|
|
61
|
-
{
|
|
62
|
-
SUDrawingElementRef drawing_element = {DATA_PTR(self)};
|
|
63
|
-
bool hide_flag = false;
|
|
64
|
-
SUDrawingElementGetHidden(drawing_element, &hide_flag);
|
|
65
|
-
return hide_flag ? Qfalse : Qtrue;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
static VALUE Sketchup_DrawingElement_Set_visible(VALUE self, VALUE visible_flag)
|
|
69
|
-
{
|
|
70
|
-
SUDrawingElementRef drawing_element = {DATA_PTR(self)};
|
|
71
|
-
SUDrawingElementSetHidden(drawing_element, RTEST(visible_flag));
|
|
72
|
-
return visible_flag;
|
|
40
|
+
SUMaterialRef ref = SU_INVALID;
|
|
41
|
+
if (RB_TYPE_P(material, T_STRING))
|
|
42
|
+
{
|
|
43
|
+
VALUE found = rb_funcall(rb_funcall(drawingelement_model(entity), (rb_intern)("materials"), 0), (rb_intern)("[]"), 1, material);
|
|
44
|
+
if (NIL_P(found))
|
|
45
|
+
rb_raise(rb_eArgError, "material not found: %"PRIsVALUE, material);
|
|
46
|
+
ref.ptr = DATA_PTR(found);
|
|
47
|
+
}
|
|
48
|
+
else if (rb_obj_is_kind_of(material, cColor))
|
|
49
|
+
{
|
|
50
|
+
SUMaterialCreate(&ref);
|
|
51
|
+
SUMaterialSetColor(ref, DATA_PTR(material));
|
|
52
|
+
SUModelRef model = SU_REF(SUModelRef, drawingelement_model(entity));
|
|
53
|
+
SUModelAddMaterials(model, 1, &ref);
|
|
54
|
+
}
|
|
55
|
+
else if (!NIL_P(material))
|
|
56
|
+
ref.ptr = su_unwrap(material, cMaterial);
|
|
57
|
+
return ref;
|
|
73
58
|
}
|
|
74
59
|
|
|
75
|
-
static VALUE
|
|
60
|
+
static VALUE drawingelement_set_material(VALUE self, VALUE material)
|
|
76
61
|
{
|
|
77
|
-
SUDrawingElementRef
|
|
78
|
-
|
|
79
|
-
SUDrawingElementGetMaterial(drawing_element, &material);
|
|
80
|
-
if (SUIsInvalid(material))
|
|
81
|
-
return Qnil;
|
|
82
|
-
return Data_Wrap_Struct(rb_path2class(SKETCHUP_MATERIAL), 0, 0, material.ptr);
|
|
62
|
+
SUDrawingElementSetMaterial(SU_REF(SUDrawingElementRef, self), su_material_from_arg(self, material));
|
|
63
|
+
return material;
|
|
83
64
|
}
|
|
84
65
|
|
|
85
|
-
|
|
66
|
+
// Layer or layer name.
|
|
67
|
+
static VALUE drawingelement_set_layer(VALUE self, VALUE layer)
|
|
86
68
|
{
|
|
87
|
-
|
|
88
|
-
if (
|
|
69
|
+
SULayerRef ref = SU_INVALID;
|
|
70
|
+
if (RB_TYPE_P(layer, T_STRING))
|
|
89
71
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
SUModelRef model = SU_REF(SUModelRef, drawingelement_model(self));
|
|
73
|
+
size_t count = 0;
|
|
74
|
+
SUModelGetNumLayers(model, &count);
|
|
75
|
+
SULayerRef* layers = ZALLOC_N(SULayerRef, count > 0 ? count : 1);
|
|
76
|
+
SUModelGetLayers(model, count, layers, &count);
|
|
77
|
+
for (size_t i = 0; i < count && SUIsInvalid(ref); i++)
|
|
78
|
+
{
|
|
79
|
+
SUStringRef name = SU_INVALID;
|
|
80
|
+
SUStringCreate(&name);
|
|
81
|
+
SULayerGetName(layers[i], &name);
|
|
82
|
+
if (rb_str_equal(su_string_to_rb(name), layer) == Qtrue)
|
|
83
|
+
ref = layers[i];
|
|
84
|
+
SUStringRelease(&name);
|
|
85
|
+
}
|
|
86
|
+
xfree(layers);
|
|
87
|
+
if (SUIsInvalid(ref))
|
|
88
|
+
rb_raise(rb_eArgError, "layer not found: %"PRIsVALUE, layer);
|
|
93
89
|
}
|
|
94
|
-
if (!
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
else if (!NIL_P(layer))
|
|
91
|
+
{
|
|
92
|
+
if (!rb_obj_is_kind_of(layer, cLayer))
|
|
93
|
+
rb_raise(rb_eArgError, "Wrong type of object given");
|
|
94
|
+
ref.ptr = DATA_PTR(layer);
|
|
95
|
+
}
|
|
96
|
+
SUDrawingElementSetLayer(SU_REF(SUDrawingElementRef, self), ref);
|
|
97
|
+
return layer;
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
static VALUE
|
|
100
|
+
static VALUE drawingelement_erase_bang(VALUE self)
|
|
103
101
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
SUEntityRef entity = SU_REF(SUEntityRef, self);
|
|
103
|
+
SUEntitiesRef parent = SU_INVALID;
|
|
104
|
+
if (SUEntityGetParentEntities(entity, &parent) != SU_ERROR_NONE || SUEntitiesErase(parent, 1, &entity) != SU_ERROR_NONE)
|
|
105
|
+
rb_raise(rb_eTypeError, "cannot erase this entity");
|
|
106
|
+
return Qnil;
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
|
|
109
|
+
void Init_drawing_element(void)
|
|
111
110
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
rb_define_method(cDrawingelement, "bounds", drawingelement_bounds, 0);
|
|
112
|
+
rb_define_method(cDrawingelement, "casts_shadows?", drawingelement_casts_shadows_p, 0);
|
|
113
|
+
rb_define_method(cDrawingelement, "casts_shadows=", drawingelement_set_casts_shadows, 1);
|
|
114
|
+
rb_define_method(cDrawingelement, "receives_shadows?", drawingelement_receives_shadows_p, 0);
|
|
115
|
+
rb_define_method(cDrawingelement, "receives_shadows=", drawingelement_set_receives_shadows, 1);
|
|
116
|
+
rb_define_method(cDrawingelement, "hidden?", drawingelement_hidden_p, 0);
|
|
117
|
+
rb_define_method(cDrawingelement, "hidden=", drawingelement_set_hidden, 1);
|
|
118
|
+
rb_define_method(cDrawingelement, "visible?", drawingelement_visible_p, 0);
|
|
119
|
+
rb_define_method(cDrawingelement, "visible=", drawingelement_set_visible, 1);
|
|
120
|
+
rb_define_method(cDrawingelement, "material", drawingelement_material, 0);
|
|
121
|
+
rb_define_method(cDrawingelement, "material=", drawingelement_set_material, 1);
|
|
122
|
+
rb_define_method(cDrawingelement, "layer", drawingelement_layer, 0);
|
|
123
|
+
rb_define_method(cDrawingelement, "layer=", drawingelement_set_layer, 1);
|
|
124
|
+
rb_define_method(cDrawingelement, "erase!", drawingelement_erase_bang, 0);
|
|
126
125
|
}
|
|
127
|
-
|
|
128
|
-
VALUE DrawingElement_Init(VALUE Sketchup, VALUE Sketchup_Entity)
|
|
129
|
-
{
|
|
130
|
-
VALUE Sketchup_DrawingElement = rb_define_class_under(Sketchup, DRAWINGELEMENT, Sketchup_Entity);
|
|
131
|
-
rb_undef_alloc_func(Sketchup_DrawingElement);
|
|
132
|
-
rb_define_method(Sketchup_DrawingElement, "bounds", Sketchup_DrawingElement_bounds, 0);
|
|
133
|
-
rb_define_method(Sketchup_DrawingElement, "casts_shadows?", Sketchup_DrawingElement_Get_casts_shadows, 0);
|
|
134
|
-
rb_define_method(Sketchup_DrawingElement, "casts_shadows=", Sketchup_DrawingElement_Set_casts_shadows, 1);
|
|
135
|
-
rb_define_method(Sketchup_DrawingElement, "receives_shadows?", Sketchup_DrawingElement_Get_receives_shadows, 0);
|
|
136
|
-
rb_define_method(Sketchup_DrawingElement, "receives_shadows=", Sketchup_DrawingElement_Set_receives_shadows, 1);
|
|
137
|
-
rb_define_method(Sketchup_DrawingElement, "hidden?", Sketchup_DrawingElement_Get_hidden, 0);
|
|
138
|
-
rb_define_method(Sketchup_DrawingElement, "hidden=", Sketchup_DrawingElement_Set_hidden, 1);
|
|
139
|
-
rb_define_method(Sketchup_DrawingElement, "visible?", Sketchup_DrawingElement_Get_visible, 0);
|
|
140
|
-
rb_define_method(Sketchup_DrawingElement, "visible=", Sketchup_DrawingElement_Set_visible, 1);
|
|
141
|
-
rb_define_method(Sketchup_DrawingElement, "material", Sketchup_DrawingElement_Get_material, 0);
|
|
142
|
-
rb_define_method(Sketchup_DrawingElement, "material=", Sketchup_DrawingElement_Set_material, 1);
|
|
143
|
-
rb_define_method(Sketchup_DrawingElement, "layer", Sketchup_DrawingElement_Get_layer, 0);
|
|
144
|
-
rb_define_method(Sketchup_DrawingElement, "layer=", Sketchup_DrawingElement_Set_layer, 1);
|
|
145
|
-
return Sketchup_DrawingElement;
|
|
146
|
-
}
|