scriptup 0.0.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 +7 -0
- data/LICENSE.txt +11 -0
- data/README.md +5 -0
- data/ext/attribute_dictionaries.c +45 -0
- data/ext/attribute_dictionaries.h +3 -0
- data/ext/attribute_dictionary.c +156 -0
- data/ext/attribute_dictionary.h +3 -0
- data/ext/behavior.c +10 -0
- data/ext/behavior.h +3 -0
- data/ext/color.c +211 -0
- data/ext/color.h +3 -0
- data/ext/component_definition.c +188 -0
- data/ext/component_definition.h +3 -0
- data/ext/component_instance.c +10 -0
- data/ext/component_instance.h +3 -0
- data/ext/definition_list.c +145 -0
- data/ext/definition_list.h +3 -0
- data/ext/drawing_element.c +10 -0
- data/ext/drawing_element.h +3 -0
- data/ext/entities.c +11 -0
- data/ext/entities.h +3 -0
- data/ext/entity.c +253 -0
- data/ext/entity.h +3 -0
- data/ext/extconf.rb +38 -0
- data/ext/material.c +242 -0
- data/ext/material.h +3 -0
- data/ext/materials.c +80 -0
- data/ext/materials.h +3 -0
- data/ext/model.c +42 -0
- data/ext/model.h +3 -0
- data/ext/sketchup.c +89 -0
- data/ext/sketchup.h +4 -0
- data/ext/texture.c +9 -0
- data/ext/texture.h +3 -0
- data/ext/typed_value.c +84 -0
- data/ext/typed_value.h +5 -0
- data/ext/utils.h +80 -0
- data/lib/sketchup.rb +12 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/application.h +36 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/model.h +59 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/overlay.h +248 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/ruby_api.h +118 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/color.h +107 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/common.h +178 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/defs.h +19 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/extension_license.h +62 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/bounding_box.h +34 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/plane3d.h +153 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point2d.h +96 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point3d.h +98 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/ray3d.h +64 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation.h +321 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation2d.h +163 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector2d.h +235 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector3d.h +285 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry.h +152 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelexporterplugin.h +165 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelimporterplugin.h +183 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/pluginprogresscallback.h +84 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/initialize.h +43 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/length_formatter.h +424 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arccurve.h +244 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arrow_type.h +17 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/attribute_dictionary.h +161 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/axes.h +242 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/camera.h +398 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_attribute.h +89 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_info.h +125 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classifications.h +86 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition.h +588 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_instance.h +344 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/curve.h +143 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/defs.h +142 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension.h +222 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_linear.h +421 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_radial.h +194 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_style.h +253 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/drawing_element.h +198 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_attribute.h +92 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_info.h +70 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge.h +271 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge_use.h +214 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entities.h +834 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity.h +186 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list.h +80 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list_iterator.h +90 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/face.h +686 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/font.h +138 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry.h +20 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry_input.h +685 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/group.h +244 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_line.h +155 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_point.h +153 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image.h +288 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image_rep.h +275 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/instancepath.h +266 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer.h +265 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer_folder.h +301 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_style.h +211 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_styles.h +81 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/location.h +65 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/loop.h +182 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/material.h +390 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/mesh_helper.h +187 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model.h +1663 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_version.h +49 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/opening.h +72 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_manager.h +79 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_provider.h +166 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/polyline3d.h +140 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/rendering_options.h +179 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/scene.h +836 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema.h +56 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema_type.h +26 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/section_plane.h +212 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/selection.h +156 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/shadow_info.h +147 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/skp.h +45 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/style.h +303 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/styles.h +190 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/text.h +384 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture.h +358 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture_writer.h +280 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/typed_value.h +390 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/uv_helper.h +79 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/vertex.h +154 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup.h +122 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup_info.h +65 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/slapi.h +16 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/transformation.h +16 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/unicodestring.h +239 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/utils/math_helpers.h +124 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeometry.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeoutils.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonImage.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonPreferences.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUnits.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUtils.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonZip.dylib +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Resources/Info.plist +50 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/SketchUpAPI +0 -0
- data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/_CodeSignature/CodeResources +835 -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/SketchUpAPI/application/application.h +36 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/application/model.h +59 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/application/overlay.h +248 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/application/ruby_api.h +118 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/color.h +107 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/common.h +178 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/defs.h +19 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/extension_license.h +62 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/bounding_box.h +34 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/plane3d.h +153 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point2d.h +96 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point3d.h +98 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/ray3d.h +64 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation.h +321 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation2d.h +163 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector2d.h +235 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector3d.h +285 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/geometry.h +152 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelexporterplugin.h +165 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelimporterplugin.h +183 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/import_export/pluginprogresscallback.h +84 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/initialize.h +43 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/length_formatter.h +424 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/arccurve.h +244 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/arrow_type.h +17 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/attribute_dictionary.h +161 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/axes.h +242 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/camera.h +398 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_attribute.h +89 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_info.h +125 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/classifications.h +86 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition.h +588 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/component_instance.h +344 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/curve.h +143 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/defs.h +142 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension.h +222 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_linear.h +421 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_radial.h +194 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_style.h +253 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/drawing_element.h +198 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_attribute.h +92 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_info.h +70 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/edge.h +271 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/edge_use.h +214 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entities.h +834 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entity.h +186 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list.h +80 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list_iterator.h +90 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/face.h +686 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/font.h +138 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry.h +20 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry_input.h +685 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/group.h +244 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_line.h +155 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_point.h +153 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/image.h +288 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/image_rep.h +275 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/instancepath.h +266 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/layer.h +265 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/layer_folder.h +301 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/line_style.h +211 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/line_styles.h +81 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/location.h +65 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/loop.h +182 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/material.h +390 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/mesh_helper.h +187 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/model.h +1663 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/model_version.h +49 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/opening.h +72 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/options_manager.h +79 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/options_provider.h +166 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/polyline3d.h +140 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/rendering_options.h +179 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/scene.h +836 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/schema.h +56 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/schema_type.h +26 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/section_plane.h +212 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/selection.h +156 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/shadow_info.h +147 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/skp.h +45 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/style.h +303 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/styles.h +190 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/text.h +384 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/texture.h +358 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/texture_writer.h +280 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/typed_value.h +390 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/uv_helper.h +79 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/model/vertex.h +154 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/sketchup.h +122 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/sketchup_info.h +65 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/slapi.h +16 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/transformation.h +16 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/unicodestring.h +239 -0
- data/sketchup-sdk-win/headers/SketchUpAPI/utils/math_helpers.h +124 -0
- metadata +313 -0
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,36 @@
|
|
1
|
+
// Copyright 2017-2020 Trimble Inc. All Rights Reserved.
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @brief Interfaces for usage within the SketchUp application.
|
6
|
+
*/
|
7
|
+
#ifndef SKETCHUP_APPLICATION_APPLICATION_H_
|
8
|
+
#define SKETCHUP_APPLICATION_APPLICATION_H_
|
9
|
+
|
10
|
+
#include <SketchUpAPI/common.h>
|
11
|
+
#include <SketchUpAPI/model/defs.h>
|
12
|
+
#pragma pack(push, 8)
|
13
|
+
|
14
|
+
#ifdef __cplusplus
|
15
|
+
extern "C" {
|
16
|
+
#endif
|
17
|
+
|
18
|
+
/**
|
19
|
+
@brief Gets a reference to the active model. The reference is owned by the
|
20
|
+
SketchUp application and should not be released.
|
21
|
+
@since SketchUp 2019.2, API 7.1
|
22
|
+
@param[out] model The model object.
|
23
|
+
@see SUModelRef
|
24
|
+
@return
|
25
|
+
- \ref SU_ERROR_NONE on success
|
26
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if \p model is `NULL`
|
27
|
+
- \ref SU_ERROR_NO_DATA if there is no active model
|
28
|
+
*/
|
29
|
+
SU_RESULT SUApplicationGetActiveModel(SUModelRef* model);
|
30
|
+
|
31
|
+
#ifdef __cplusplus
|
32
|
+
}
|
33
|
+
#endif
|
34
|
+
#pragma pack(pop)
|
35
|
+
|
36
|
+
#endif // SKETCHUP_APPLICATION_APPLICATION_H_
|
@@ -0,0 +1,59 @@
|
|
1
|
+
// Copyright 2023 Trimble Inc. All Rights Reserved.
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @brief Interfaces for SUModelRef for live access
|
6
|
+
*/
|
7
|
+
#ifndef SKETCHUP_APPLICATION_MODEL_H_
|
8
|
+
#define SKETCHUP_APPLICATION_MODEL_H_
|
9
|
+
|
10
|
+
#include <SketchUpAPI/common.h>
|
11
|
+
#include <SketchUpAPI/application/overlay.h>
|
12
|
+
|
13
|
+
#pragma pack(push, 8)
|
14
|
+
|
15
|
+
#ifdef __cplusplus
|
16
|
+
extern "C" {
|
17
|
+
#endif
|
18
|
+
|
19
|
+
/**
|
20
|
+
@brief Creates an overlay and adds it to the model.
|
21
|
+
@since SketchUp 2024, API 12.0
|
22
|
+
@param[in] model The model object
|
23
|
+
@param[in] info The information needed to create the overlay object
|
24
|
+
@param[out] overlay The created overlay object
|
25
|
+
@return
|
26
|
+
- \ref SU_ERROR_NONE on success
|
27
|
+
- \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
|
28
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if \p info is NULL
|
29
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if \p overlay is NULL
|
30
|
+
- \ref SU_ERROR_OVERWRITE_VALID if \p overlay is already a valid object
|
31
|
+
- \ref SU_ERROR_DUPLICATE if the given SUOverlayCreateInfo::id already exists in the model
|
32
|
+
@relatedalso SUModelRef
|
33
|
+
@relatedalso SUOverlayRef
|
34
|
+
*/
|
35
|
+
SU_RESULT SUModelCreateOverlay(
|
36
|
+
SUModelRef model, const struct SUOverlayCreateInfo* info, SUOverlayRef* overlay);
|
37
|
+
|
38
|
+
/**
|
39
|
+
@brief Releases the overlay after removing it from the model.
|
40
|
+
@param[in] model The model object
|
41
|
+
@param[in,out] overlay The overlay object to be released, will be set to NULL on return.
|
42
|
+
@since SketchUp 2024, API 12.0
|
43
|
+
@return
|
44
|
+
- \ref SU_ERROR_NONE on success
|
45
|
+
- \ref SU_ERROR_INVALID_INPUT if \p model or \p overlay is an invalid object
|
46
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if \p overlay is NULL
|
47
|
+
- \ref SU_ERROR_NO_DATA if \p overlay could be found in the model
|
48
|
+
@relatedalso SUModelRef
|
49
|
+
@relatedalso SUOverlayRef
|
50
|
+
*/
|
51
|
+
SU_RESULT SUModelReleaseOverlay(SUModelRef model, SUOverlayRef* overlay);
|
52
|
+
|
53
|
+
#ifdef __cplusplus
|
54
|
+
}
|
55
|
+
#endif
|
56
|
+
|
57
|
+
#pragma pack(pop)
|
58
|
+
|
59
|
+
#endif // SKETCHUP_APPLICATION_MODEL_H_
|
@@ -0,0 +1,248 @@
|
|
1
|
+
// Copyright 2023 Trimble Inc. All Rights Reserved.
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @brief An Overlay provides a way to render an image over the SU rendering.
|
6
|
+
*/
|
7
|
+
#ifndef SKETCHUP_APPLICATION_OVERLAY_H_
|
8
|
+
#define SKETCHUP_APPLICATION_OVERLAY_H_
|
9
|
+
|
10
|
+
#include <SketchUpAPI/model/defs.h>
|
11
|
+
#include <SketchUpAPI/geometry.h>
|
12
|
+
|
13
|
+
#pragma pack(push, 8)
|
14
|
+
|
15
|
+
#ifdef __cplusplus
|
16
|
+
extern "C" {
|
17
|
+
#endif
|
18
|
+
|
19
|
+
/**
|
20
|
+
@struct SUOverlayRef
|
21
|
+
@brief Manages a Overlay object, which is used to blend external images on top of SketchUp
|
22
|
+
rendering.
|
23
|
+
*/
|
24
|
+
|
25
|
+
/**
|
26
|
+
@brief Signature for SUOverlayCreateInfo::get_extents callback
|
27
|
+
@related SUOverlayRef
|
28
|
+
*/
|
29
|
+
typedef struct SUBoundingBox3D (*SUOverlayGetExtentsFuncT)(SUOverlayRef, void*);
|
30
|
+
|
31
|
+
/**
|
32
|
+
@brief Available versions for the SUOverlayCreateInfo::version field.
|
33
|
+
@related SUOverlayRef
|
34
|
+
*/
|
35
|
+
enum SUOverlayBeginFrameInfoVersion : uint32_t {
|
36
|
+
SUOVERLAY_BEGIN_FRAME_INFO_VERSION_1 = 1,
|
37
|
+
};
|
38
|
+
|
39
|
+
/**
|
40
|
+
@brief Current version of the SUBeginFrameInfo struct
|
41
|
+
@related SUOverlayRef
|
42
|
+
*/
|
43
|
+
#define SUOVERLAY_BEGIN_FRAME_INFO_VERSION (SUOVERLAY_BEGIN_FRAME_INFO_VERSION_1)
|
44
|
+
|
45
|
+
/**
|
46
|
+
@struct SUBeginFrameInfo
|
47
|
+
@brief Information about the frame camera and viewport that is passed to
|
48
|
+
SUOverlayCreateInfo::begin_frame
|
49
|
+
@related SUOverlayRef
|
50
|
+
*/
|
51
|
+
struct SUBeginFrameInfo {
|
52
|
+
/// Version of SUBeginFrameInfo struct. This will be set by SketchUp.
|
53
|
+
enum SUOverlayBeginFrameInfoVersion version;
|
54
|
+
|
55
|
+
struct SUPoint3D position; ///< Camera position
|
56
|
+
struct SUPoint3D target; ///< Camera target position
|
57
|
+
struct SUVector3D up; ///< Camera up direction
|
58
|
+
double aspect_ratio; ///< Aspect ratio of the view port
|
59
|
+
double near_clipping_distance; ///< Distance to near clipping plane from the camera
|
60
|
+
double far_clipping_distance; ///< Distance to far clipping plane from the camera
|
61
|
+
double projection_matrix[16]; ///< Projection Matrix.
|
62
|
+
double view_matrix[16]; ///< View Matrix
|
63
|
+
double viewport_width; ///< Viewport width
|
64
|
+
double viewport_height; ///< Viewport height
|
65
|
+
|
66
|
+
double fov; ///< Field of view of the perspective camera (in degrees). Valid only when
|
67
|
+
///< is_perspective is true.
|
68
|
+
double height; ///< Parallel projection frustum height. Valid only when is_perspective is false.
|
69
|
+
bool is_perspective; ///< Whether the camera is perspective or orthographic.
|
70
|
+
|
71
|
+
void* reserved; ///< Reserved for internal use. This will be set to NULL by SketchUp and should
|
72
|
+
///< not be modified.
|
73
|
+
};
|
74
|
+
|
75
|
+
/**
|
76
|
+
@brief Signature for SUOverlayCreateInfo::begin_frame callback
|
77
|
+
@related SUOverlayRef
|
78
|
+
*/
|
79
|
+
typedef void (*SUOverlayBeginFrameFuncT)(SUOverlayRef, const struct SUBeginFrameInfo*, void*);
|
80
|
+
|
81
|
+
/**
|
82
|
+
@brief Available versions for SUOverlayDrawFrameInfo::version
|
83
|
+
@related SUOverlayRef
|
84
|
+
*/
|
85
|
+
enum SUOverlayDrawFrameInfoVersion : uint32_t { SUOVERLAY_DRAW_FRAME_INFO_VERSION_1 = 1 };
|
86
|
+
|
87
|
+
/**
|
88
|
+
@brief Current version of SUOverlayDrawFrameInfo struct
|
89
|
+
@related SUOverlayRef
|
90
|
+
*/
|
91
|
+
#define SUOVERLAY_DRAW_FRAME_INFO_VERSION (SUOVERLAY_DRAW_FRAME_INFO_VERSION_1)
|
92
|
+
|
93
|
+
/**
|
94
|
+
@struct SUDrawFrameMemoryBuffer
|
95
|
+
@brief Memory buffer (for color and depth) info used in SUOverlayDrawFrameInfo
|
96
|
+
@related SUOverlayRef
|
97
|
+
*/
|
98
|
+
struct SUDrawFrameMemoryBuffer {
|
99
|
+
/// Pointer to the buffer
|
100
|
+
void* ptr;
|
101
|
+
/// Size (in bytes) from the beginning of one line of the buffer to the next line
|
102
|
+
uint32_t row_pitch;
|
103
|
+
/// Total size (in bytes) of the buffer
|
104
|
+
uint32_t size;
|
105
|
+
};
|
106
|
+
|
107
|
+
/**
|
108
|
+
@brief Supported image formats
|
109
|
+
@related SUOverlayRef
|
110
|
+
*/
|
111
|
+
enum SUOverlayImageFormat : uint8_t {
|
112
|
+
SUOVERLAY_IMAGE_FORMAT_RGBA = 0,
|
113
|
+
SUOVERLAY_IMAGE_FORMAT_BGRA = 1,
|
114
|
+
};
|
115
|
+
|
116
|
+
/**
|
117
|
+
@brief Supported image orientations
|
118
|
+
@related SUOverlayRef
|
119
|
+
*/
|
120
|
+
enum SUOverlayImageOrientation : uint8_t {
|
121
|
+
SUOVERLAY_IMAGE_ORIENTATION_TOP_DOWN = 0,
|
122
|
+
SUOVERLAY_IMAGE_ORIENTATION_BOTTOM_UP = 1,
|
123
|
+
};
|
124
|
+
|
125
|
+
/**
|
126
|
+
@struct SUOverlayDrawFrameInfo
|
127
|
+
@brief Data that SketchUp will use the to blend the given color/depth buffer onto SketchUp
|
128
|
+
rendering.
|
129
|
+
@related SUOverlayRef
|
130
|
+
*/
|
131
|
+
struct SUOverlayDrawFrameInfo {
|
132
|
+
/// Version of the struct. This will be set by SketchUp.
|
133
|
+
enum SUOverlayDrawFrameInfoVersion version;
|
134
|
+
|
135
|
+
/// Alpha channel of the given color buffer will be multiplied with this value.
|
136
|
+
/// Must be set to 1.0 if an override is not needed.
|
137
|
+
double blending_factor;
|
138
|
+
|
139
|
+
/// Color buffer info. ptr points to a uint8_t buffer with 4 channels.
|
140
|
+
struct SUDrawFrameMemoryBuffer color;
|
141
|
+
|
142
|
+
/// Depth buffer info. ptr points to a float buffer.
|
143
|
+
struct SUDrawFrameMemoryBuffer depth;
|
144
|
+
|
145
|
+
/// Reserved for internal use. This will be set to NULL by SketchUp and should not be modified.
|
146
|
+
void* reserved;
|
147
|
+
};
|
148
|
+
|
149
|
+
/**
|
150
|
+
@brief Signature for SUOverlayCreateInfo::draw_frame callback
|
151
|
+
@related SUOverlayRef
|
152
|
+
*/
|
153
|
+
typedef void (*SUOverlayDrawFrameFuncT)(SUOverlayRef, struct SUOverlayDrawFrameInfo*, void*);
|
154
|
+
|
155
|
+
/**
|
156
|
+
@brief Signature for SUOverlayCreateInfo::end_frame callback
|
157
|
+
@related SUOverlayRef
|
158
|
+
*/
|
159
|
+
typedef void (*SUOverlayEndFrameFuncT)(SUOverlayRef, void*);
|
160
|
+
|
161
|
+
/**
|
162
|
+
@brief Signature for SUOverlayCreateInfo::start callback
|
163
|
+
@related SUOverlayRef
|
164
|
+
*/
|
165
|
+
typedef void (*SUOverlayStartFuncT)(SUOverlayRef, void*);
|
166
|
+
|
167
|
+
/**
|
168
|
+
@brief Signature for SUOverlayCreateInfo::stop callback
|
169
|
+
@related SUOverlayRef
|
170
|
+
*/
|
171
|
+
typedef void (*SUOverlayStopFuncT)(SUOverlayRef, void*);
|
172
|
+
|
173
|
+
/**
|
174
|
+
@brief Available versions for the SUOverlayCreateInfo::version field.
|
175
|
+
@related SUOverlayRef
|
176
|
+
*/
|
177
|
+
enum SUOverlayCreateInfoVersion : uint32_t {
|
178
|
+
SUOVERLAY_CREATE_INFO_VERSION_1 = 1,
|
179
|
+
};
|
180
|
+
|
181
|
+
/**
|
182
|
+
@brief Current version of the SUOverlayCreateInfo struct.
|
183
|
+
@related SUOverlayRef
|
184
|
+
*/
|
185
|
+
#define SUOVERLAY_CREATE_INFO_VERSION (SUOVERLAY_CREATE_INFO_VERSION_1)
|
186
|
+
|
187
|
+
/**
|
188
|
+
@struct SUOverlayCreateInfo
|
189
|
+
@brief Arguments for creating an overlay object.
|
190
|
+
@related SUOverlayRef
|
191
|
+
*/
|
192
|
+
struct SUOverlayCreateInfo {
|
193
|
+
/// Version of the struct. This must always be set to SUOVERLAY_CREATE_INFO_VERSION
|
194
|
+
enum SUOverlayCreateInfoVersion version;
|
195
|
+
|
196
|
+
/// A pointer that will passed directly back into provided callbacks. SketchUp will not access
|
197
|
+
/// this pointer.
|
198
|
+
void* user_data;
|
199
|
+
|
200
|
+
/// Unique id for the overlay
|
201
|
+
const char* id;
|
202
|
+
/// Name of the overlay. This will be displayed to user.
|
203
|
+
const char* name;
|
204
|
+
/// Description of the overlay. This will be displayed to user.
|
205
|
+
const char* desc;
|
206
|
+
/// Source of the overlay. This will be displayed to user.
|
207
|
+
const char* source;
|
208
|
+
|
209
|
+
/// Image format of the overlay color buffer
|
210
|
+
enum SUOverlayImageFormat image_format;
|
211
|
+
/// Image orientation of the overlay color and depth buffer
|
212
|
+
enum SUOverlayImageOrientation image_orientation;
|
213
|
+
|
214
|
+
/// A function that will be called when user enables the overlay.
|
215
|
+
SUOverlayStartFuncT start;
|
216
|
+
/// A function that will be called when user disables the overlay.
|
217
|
+
SUOverlayStopFuncT stop;
|
218
|
+
/// A function that should return bounds of the overlay.
|
219
|
+
SUOverlayGetExtentsFuncT get_extents;
|
220
|
+
|
221
|
+
/// Function that SketchUp will call at the beginning of a frame.
|
222
|
+
SUOverlayBeginFrameFuncT begin_frame;
|
223
|
+
/// Function that SketchUp will call to get overlay buffers and blending information.
|
224
|
+
SUOverlayDrawFrameFuncT draw_frame;
|
225
|
+
/// Function that SketchUp will call to signal the resources passed in draw_frame are no longer
|
226
|
+
/// needed.
|
227
|
+
SUOverlayEndFrameFuncT end_frame;
|
228
|
+
};
|
229
|
+
|
230
|
+
/**
|
231
|
+
@brief Enables or disables an overlay.
|
232
|
+
@related SUOverlayRef
|
233
|
+
@param[in] overlay The overlay object
|
234
|
+
@param[in] enabled Whether to enable or disable
|
235
|
+
@since SketchUp 2024, API 12.0
|
236
|
+
@return
|
237
|
+
- \ref SU_ERROR_NONE on success
|
238
|
+
- \ref SU_ERROR_INVALID_INPUT if overlay is an invalid object
|
239
|
+
*/
|
240
|
+
SU_RESULT SUOverlayEnable(SUOverlayRef overlay, bool enabled);
|
241
|
+
|
242
|
+
#ifdef __cplusplus
|
243
|
+
}
|
244
|
+
#endif
|
245
|
+
|
246
|
+
#pragma pack(pop)
|
247
|
+
|
248
|
+
#endif // SKETCHUP_APPLICATION_OVERLAY_H_
|
@@ -0,0 +1,118 @@
|
|
1
|
+
// Copyright 2020 Trimble Inc. All Rights Reserved.
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @brief Interfaces for exchanging data between SketchUp's Ruby API and C API.
|
6
|
+
*
|
7
|
+
* @note This is for use only within the SketchUp application.
|
8
|
+
*/
|
9
|
+
#ifndef SKETCHUP_APPLICATION_RUBY_API_H_
|
10
|
+
#define SKETCHUP_APPLICATION_RUBY_API_H_
|
11
|
+
|
12
|
+
#include <SketchUpAPI/common.h>
|
13
|
+
#include <SketchUpAPI/model/defs.h>
|
14
|
+
#pragma pack(push, 8)
|
15
|
+
|
16
|
+
#ifdef __cplusplus
|
17
|
+
extern "C" {
|
18
|
+
#endif
|
19
|
+
|
20
|
+
/**
|
21
|
+
@brief This macro is defining a type matching Ruby's own `VALUE` type and
|
22
|
+
can be used interchangeably.
|
23
|
+
*/
|
24
|
+
#ifdef __APPLE__
|
25
|
+
#define RUBY_VALUE unsigned long
|
26
|
+
#elif _WIN32
|
27
|
+
#define RUBY_VALUE unsigned long long
|
28
|
+
#else
|
29
|
+
#warning "Unsupported platform"
|
30
|
+
#define RUBY_VALUE unsigned long
|
31
|
+
#endif
|
32
|
+
|
33
|
+
/**
|
34
|
+
@brief Converts a C API entity to a Ruby API entity.
|
35
|
+
|
36
|
+
@since SketchUp 2020.2, API 8.2
|
37
|
+
|
38
|
+
@param[in] entity The C API entity reference.
|
39
|
+
@param[out] ruby_entity The retrieved Ruby API entity reference.
|
40
|
+
@see SUModelRef
|
41
|
+
@return
|
42
|
+
- \ref SU_ERROR_NONE on success
|
43
|
+
- \ref SU_ERROR_INVALID_INPUT if \p entity is an invalid object
|
44
|
+
- \ref SU_ERROR_INVALID_ARGUMENT if \p entity is not owned by a model
|
45
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if \p ruby_entity is `NULL`
|
46
|
+
- \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp
|
47
|
+
*/
|
48
|
+
SU_RESULT SUEntityToRuby(SUEntityRef entity, RUBY_VALUE* ruby_entity);
|
49
|
+
|
50
|
+
/**
|
51
|
+
@brief Converts a Ruby API entity to a C API entity.
|
52
|
+
|
53
|
+
@since SketchUp 2020.2, API 8.2
|
54
|
+
|
55
|
+
@param[in] ruby_entity The Ruby API entity reference.
|
56
|
+
@param[out] entity The retrieved C API entity reference.
|
57
|
+
@see SUModelRef
|
58
|
+
@return
|
59
|
+
- \ref SU_ERROR_NONE on success
|
60
|
+
- \ref SU_ERROR_INVALID_ARGUMENT if \p ruby_entity refers to a deleted entity
|
61
|
+
- \ref SU_ERROR_INVALID_ARGUMENT if \p ruby_entity is not an entity type
|
62
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if \p entity is `NULL`
|
63
|
+
- \ref SU_ERROR_OVERWRITE_VALID if \p entity is already a valid reference
|
64
|
+
- \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp
|
65
|
+
*/
|
66
|
+
SU_RESULT SUEntityFromRuby(RUBY_VALUE ruby_entity, SUEntityRef* entity);
|
67
|
+
|
68
|
+
/**
|
69
|
+
@brief Converts a C API entity to a Ruby API imagerep.
|
70
|
+
|
71
|
+
@note Ruby takes ownership of the object it should not be released by
|
72
|
+
SUImageRepRelease. It will be released when Ruby garbage collects the
|
73
|
+
Ruby references to it.
|
74
|
+
|
75
|
+
@since SketchUp 2020.2, API 8.2
|
76
|
+
|
77
|
+
@param[in] imagerep The C API imagerep reference.
|
78
|
+
@param[out] ruby_imagerep The retrieved Ruby API imagerep reference.
|
79
|
+
@see SUModelRef
|
80
|
+
@return
|
81
|
+
- \ref SU_ERROR_NONE on success
|
82
|
+
- \ref SU_ERROR_INVALID_INPUT if \p imagerep is an invalid object
|
83
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if \p ruby_imagerep is `NULL`
|
84
|
+
- \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp
|
85
|
+
*/
|
86
|
+
SU_RESULT SUImageRepToRuby(SUImageRepRef imagerep, RUBY_VALUE* ruby_imagerep);
|
87
|
+
|
88
|
+
/**
|
89
|
+
@brief Converts a Ruby API imagerep to a C API imagerep.
|
90
|
+
|
91
|
+
@note Ruby retains the ownership of the object it should not be released by
|
92
|
+
SUImageRepRelease.
|
93
|
+
|
94
|
+
@warning The returned C API reference points to an object that is owned by the
|
95
|
+
Ruby runtime and it may be garbage collected. To avoid this, ensure
|
96
|
+
that the Ruby API reference has a longer lifetime than the C API
|
97
|
+
reference.
|
98
|
+
|
99
|
+
@since SketchUp 2020.2, API 8.2
|
100
|
+
|
101
|
+
@param[in] ruby_imagerep The Ruby API imagerep reference.
|
102
|
+
@param[out] imagerep The retrieved C API imagerep reference.
|
103
|
+
@see SUModelRef
|
104
|
+
@return
|
105
|
+
- \ref SU_ERROR_NONE on success
|
106
|
+
- \ref SU_ERROR_INVALID_ARGUMENT if \p ruby_imagerep is not an imagerep type
|
107
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if \p imagerep is `NULL`
|
108
|
+
- \ref SU_ERROR_OVERWRITE_VALID if \p imagerep is already a valid reference
|
109
|
+
- \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp
|
110
|
+
*/
|
111
|
+
SU_RESULT SUImageRepFromRuby(RUBY_VALUE ruby_imagerep, SUImageRepRef* imagerep);
|
112
|
+
|
113
|
+
#ifdef __cplusplus
|
114
|
+
}
|
115
|
+
#endif
|
116
|
+
#pragma pack(pop)
|
117
|
+
|
118
|
+
#endif // SKETCHUP_APPLICATION_RUBY_API_H_
|
@@ -0,0 +1,107 @@
|
|
1
|
+
// Copyright 2013 Trimble Inc., All rights reserved.
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @file
|
5
|
+
* @brief Interfaces for SUColor.
|
6
|
+
*/
|
7
|
+
#ifndef SKETCHUP_COLOR_H_
|
8
|
+
#define SKETCHUP_COLOR_H_
|
9
|
+
|
10
|
+
#include <SketchUpAPI/unicodestring.h>
|
11
|
+
|
12
|
+
#pragma pack(push, 8)
|
13
|
+
#ifdef __cplusplus
|
14
|
+
extern "C" {
|
15
|
+
#endif // __cplusplus
|
16
|
+
|
17
|
+
/**
|
18
|
+
@typedef SUByte
|
19
|
+
@brief A type that stores a byte.
|
20
|
+
*/
|
21
|
+
typedef unsigned char SUByte;
|
22
|
+
|
23
|
+
/**
|
24
|
+
@struct SUColor
|
25
|
+
@brief Stores a RGBA color with 8 bit channels.
|
26
|
+
*/
|
27
|
+
typedef struct {
|
28
|
+
SUByte red; ///< Red color channel
|
29
|
+
SUByte green; ///< Green color channel
|
30
|
+
SUByte blue; ///< Blue color channel
|
31
|
+
SUByte alpha; ///< Alpha color channel
|
32
|
+
} SUColor;
|
33
|
+
|
34
|
+
/**
|
35
|
+
@brief The blend method is used to blend two colors.
|
36
|
+
The blended color will be the result of taking
|
37
|
+
(1 - weight) * sucolor1 + weight * sucolor2.
|
38
|
+
@since SketchUp 2018, API 6.0
|
39
|
+
@param[in] color1 A \ref SUColor to blend color2 with.
|
40
|
+
@param[in] color2 A \ref SUColor to blend color1 with.
|
41
|
+
@param[in] weight A value that determines the weight
|
42
|
+
@param[out] blended_color The blended \ref SUColor.
|
43
|
+
@related SUColor
|
44
|
+
@return
|
45
|
+
- \ref SU_ERROR_NONE on success
|
46
|
+
- \ref SU_ERROR_OUT_OF_RANGE if weight is out of range
|
47
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if blended_color is NULL
|
48
|
+
*/
|
49
|
+
SU_RESULT SUColorBlend(
|
50
|
+
const SUColor color1, const SUColor color2, const double weight, SUColor* blended_color);
|
51
|
+
|
52
|
+
/**
|
53
|
+
@brief Retrieves the number of color names recognized by SketchUp.
|
54
|
+
@since SketchUp 2018, API 6.0
|
55
|
+
@param[out] size The number of color names.
|
56
|
+
@related SUColor
|
57
|
+
@return
|
58
|
+
- \ref SU_ERROR_NONE on success
|
59
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if size is NULL
|
60
|
+
*/
|
61
|
+
SU_RESULT SUColorGetNumNames(size_t* size);
|
62
|
+
|
63
|
+
/**
|
64
|
+
@brief Retrives all the color names recognized by SketchUp.
|
65
|
+
@since SketchUp 2018, API 6.0
|
66
|
+
@param[out] names An array of all the SketchUp Color names.
|
67
|
+
@param[in] size The size of the array.
|
68
|
+
@related SUColor
|
69
|
+
@return
|
70
|
+
- \ref SU_ERROR_NONE on success
|
71
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if names is NULL
|
72
|
+
*/
|
73
|
+
SU_RESULT SUColorGetNames(SUStringRef names[], const size_t size);
|
74
|
+
|
75
|
+
/**
|
76
|
+
@brief Sets the color represented by the name.
|
77
|
+
@since SketchUp 2018, API 6.0
|
78
|
+
@param[out] color The struct representing the color.
|
79
|
+
@param[in] name The string representing the color.
|
80
|
+
@related SUColor
|
81
|
+
@return
|
82
|
+
- \ref SU_ERROR_NONE on success
|
83
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
|
84
|
+
- \ref SU_ERROR_INVALID_ARGUMENT if name is empty
|
85
|
+
*/
|
86
|
+
SU_RESULT SUColorSetByName(SUColor* color, const char* name);
|
87
|
+
|
88
|
+
/**
|
89
|
+
@brief Sets the color with the provided value. The passed in value can either be
|
90
|
+
integer or hexadecimal. Alpha will always be 255 but RGB. For example:
|
91
|
+
if the value is 0x66ccff, rgb will be (102, 204, 255) respectively.
|
92
|
+
@since SketchUp 2018, API 6.0
|
93
|
+
@param[out] color The struct representing the color.
|
94
|
+
@param[in] value A value that represents the color.
|
95
|
+
@related SUColor
|
96
|
+
@return
|
97
|
+
- \ref SU_ERROR_NONE on success
|
98
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
|
99
|
+
*/
|
100
|
+
SU_RESULT SUColorSetByValue(SUColor* color, const size_t value);
|
101
|
+
|
102
|
+
#ifdef __cplusplus
|
103
|
+
} // end extern "C"
|
104
|
+
#endif // __cplusplus
|
105
|
+
#pragma pack(pop)
|
106
|
+
|
107
|
+
#endif // SKETCHUP_COLOR_H_
|