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.
Files changed (241) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +11 -0
  3. data/README.md +5 -0
  4. data/ext/attribute_dictionaries.c +45 -0
  5. data/ext/attribute_dictionaries.h +3 -0
  6. data/ext/attribute_dictionary.c +156 -0
  7. data/ext/attribute_dictionary.h +3 -0
  8. data/ext/behavior.c +10 -0
  9. data/ext/behavior.h +3 -0
  10. data/ext/color.c +211 -0
  11. data/ext/color.h +3 -0
  12. data/ext/component_definition.c +188 -0
  13. data/ext/component_definition.h +3 -0
  14. data/ext/component_instance.c +10 -0
  15. data/ext/component_instance.h +3 -0
  16. data/ext/definition_list.c +145 -0
  17. data/ext/definition_list.h +3 -0
  18. data/ext/drawing_element.c +10 -0
  19. data/ext/drawing_element.h +3 -0
  20. data/ext/entities.c +11 -0
  21. data/ext/entities.h +3 -0
  22. data/ext/entity.c +253 -0
  23. data/ext/entity.h +3 -0
  24. data/ext/extconf.rb +38 -0
  25. data/ext/material.c +242 -0
  26. data/ext/material.h +3 -0
  27. data/ext/materials.c +80 -0
  28. data/ext/materials.h +3 -0
  29. data/ext/model.c +42 -0
  30. data/ext/model.h +3 -0
  31. data/ext/sketchup.c +89 -0
  32. data/ext/sketchup.h +4 -0
  33. data/ext/texture.c +9 -0
  34. data/ext/texture.h +3 -0
  35. data/ext/typed_value.c +84 -0
  36. data/ext/typed_value.h +5 -0
  37. data/ext/utils.h +80 -0
  38. data/lib/sketchup.rb +12 -0
  39. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/application.h +36 -0
  40. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/model.h +59 -0
  41. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/overlay.h +248 -0
  42. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/ruby_api.h +118 -0
  43. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/color.h +107 -0
  44. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/common.h +178 -0
  45. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/defs.h +19 -0
  46. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/extension_license.h +62 -0
  47. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/bounding_box.h +34 -0
  48. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/plane3d.h +153 -0
  49. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point2d.h +96 -0
  50. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point3d.h +98 -0
  51. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/ray3d.h +64 -0
  52. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation.h +321 -0
  53. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation2d.h +163 -0
  54. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector2d.h +235 -0
  55. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector3d.h +285 -0
  56. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry.h +152 -0
  57. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelexporterplugin.h +165 -0
  58. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelimporterplugin.h +183 -0
  59. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/pluginprogresscallback.h +84 -0
  60. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/initialize.h +43 -0
  61. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/length_formatter.h +424 -0
  62. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arccurve.h +244 -0
  63. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arrow_type.h +17 -0
  64. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/attribute_dictionary.h +161 -0
  65. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/axes.h +242 -0
  66. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/camera.h +398 -0
  67. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_attribute.h +89 -0
  68. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_info.h +125 -0
  69. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classifications.h +86 -0
  70. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition.h +588 -0
  71. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_instance.h +344 -0
  72. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/curve.h +143 -0
  73. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/defs.h +142 -0
  74. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension.h +222 -0
  75. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_linear.h +421 -0
  76. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_radial.h +194 -0
  77. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_style.h +253 -0
  78. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/drawing_element.h +198 -0
  79. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_attribute.h +92 -0
  80. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_info.h +70 -0
  81. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge.h +271 -0
  82. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge_use.h +214 -0
  83. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entities.h +834 -0
  84. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity.h +186 -0
  85. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list.h +80 -0
  86. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list_iterator.h +90 -0
  87. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/face.h +686 -0
  88. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/font.h +138 -0
  89. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry.h +20 -0
  90. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry_input.h +685 -0
  91. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/group.h +244 -0
  92. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_line.h +155 -0
  93. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_point.h +153 -0
  94. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image.h +288 -0
  95. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image_rep.h +275 -0
  96. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/instancepath.h +266 -0
  97. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer.h +265 -0
  98. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer_folder.h +301 -0
  99. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_style.h +211 -0
  100. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_styles.h +81 -0
  101. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/location.h +65 -0
  102. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/loop.h +182 -0
  103. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/material.h +390 -0
  104. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/mesh_helper.h +187 -0
  105. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model.h +1663 -0
  106. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_version.h +49 -0
  107. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/opening.h +72 -0
  108. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_manager.h +79 -0
  109. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_provider.h +166 -0
  110. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/polyline3d.h +140 -0
  111. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/rendering_options.h +179 -0
  112. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/scene.h +836 -0
  113. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema.h +56 -0
  114. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema_type.h +26 -0
  115. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/section_plane.h +212 -0
  116. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/selection.h +156 -0
  117. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/shadow_info.h +147 -0
  118. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/skp.h +45 -0
  119. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/style.h +303 -0
  120. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/styles.h +190 -0
  121. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/text.h +384 -0
  122. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture.h +358 -0
  123. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture_writer.h +280 -0
  124. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/typed_value.h +390 -0
  125. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/uv_helper.h +79 -0
  126. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/vertex.h +154 -0
  127. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup.h +122 -0
  128. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup_info.h +65 -0
  129. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/slapi.h +16 -0
  130. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/transformation.h +16 -0
  131. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/unicodestring.h +239 -0
  132. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/utils/math_helpers.h +124 -0
  133. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeometry.dylib +0 -0
  134. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeoutils.dylib +0 -0
  135. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonImage.dylib +0 -0
  136. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonPreferences.dylib +0 -0
  137. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUnits.dylib +0 -0
  138. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUtils.dylib +0 -0
  139. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonZip.dylib +0 -0
  140. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Resources/Info.plist +50 -0
  141. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/SketchUpAPI +0 -0
  142. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/_CodeSignature/CodeResources +835 -0
  143. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.dll +0 -0
  144. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.lib +0 -0
  145. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpCommonPreferences.dll +0 -0
  146. data/sketchup-sdk-win/binaries/sketchup/x64/sketchup.lib +0 -0
  147. data/sketchup-sdk-win/headers/SketchUpAPI/application/application.h +36 -0
  148. data/sketchup-sdk-win/headers/SketchUpAPI/application/model.h +59 -0
  149. data/sketchup-sdk-win/headers/SketchUpAPI/application/overlay.h +248 -0
  150. data/sketchup-sdk-win/headers/SketchUpAPI/application/ruby_api.h +118 -0
  151. data/sketchup-sdk-win/headers/SketchUpAPI/color.h +107 -0
  152. data/sketchup-sdk-win/headers/SketchUpAPI/common.h +178 -0
  153. data/sketchup-sdk-win/headers/SketchUpAPI/defs.h +19 -0
  154. data/sketchup-sdk-win/headers/SketchUpAPI/extension_license.h +62 -0
  155. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/bounding_box.h +34 -0
  156. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/plane3d.h +153 -0
  157. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point2d.h +96 -0
  158. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point3d.h +98 -0
  159. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/ray3d.h +64 -0
  160. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation.h +321 -0
  161. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation2d.h +163 -0
  162. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector2d.h +235 -0
  163. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector3d.h +285 -0
  164. data/sketchup-sdk-win/headers/SketchUpAPI/geometry.h +152 -0
  165. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelexporterplugin.h +165 -0
  166. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelimporterplugin.h +183 -0
  167. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/pluginprogresscallback.h +84 -0
  168. data/sketchup-sdk-win/headers/SketchUpAPI/initialize.h +43 -0
  169. data/sketchup-sdk-win/headers/SketchUpAPI/length_formatter.h +424 -0
  170. data/sketchup-sdk-win/headers/SketchUpAPI/model/arccurve.h +244 -0
  171. data/sketchup-sdk-win/headers/SketchUpAPI/model/arrow_type.h +17 -0
  172. data/sketchup-sdk-win/headers/SketchUpAPI/model/attribute_dictionary.h +161 -0
  173. data/sketchup-sdk-win/headers/SketchUpAPI/model/axes.h +242 -0
  174. data/sketchup-sdk-win/headers/SketchUpAPI/model/camera.h +398 -0
  175. data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_attribute.h +89 -0
  176. data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_info.h +125 -0
  177. data/sketchup-sdk-win/headers/SketchUpAPI/model/classifications.h +86 -0
  178. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition.h +588 -0
  179. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_instance.h +344 -0
  180. data/sketchup-sdk-win/headers/SketchUpAPI/model/curve.h +143 -0
  181. data/sketchup-sdk-win/headers/SketchUpAPI/model/defs.h +142 -0
  182. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension.h +222 -0
  183. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_linear.h +421 -0
  184. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_radial.h +194 -0
  185. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_style.h +253 -0
  186. data/sketchup-sdk-win/headers/SketchUpAPI/model/drawing_element.h +198 -0
  187. data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_attribute.h +92 -0
  188. data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_info.h +70 -0
  189. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge.h +271 -0
  190. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge_use.h +214 -0
  191. data/sketchup-sdk-win/headers/SketchUpAPI/model/entities.h +834 -0
  192. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity.h +186 -0
  193. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list.h +80 -0
  194. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list_iterator.h +90 -0
  195. data/sketchup-sdk-win/headers/SketchUpAPI/model/face.h +686 -0
  196. data/sketchup-sdk-win/headers/SketchUpAPI/model/font.h +138 -0
  197. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry.h +20 -0
  198. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry_input.h +685 -0
  199. data/sketchup-sdk-win/headers/SketchUpAPI/model/group.h +244 -0
  200. data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_line.h +155 -0
  201. data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_point.h +153 -0
  202. data/sketchup-sdk-win/headers/SketchUpAPI/model/image.h +288 -0
  203. data/sketchup-sdk-win/headers/SketchUpAPI/model/image_rep.h +275 -0
  204. data/sketchup-sdk-win/headers/SketchUpAPI/model/instancepath.h +266 -0
  205. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer.h +265 -0
  206. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer_folder.h +301 -0
  207. data/sketchup-sdk-win/headers/SketchUpAPI/model/line_style.h +211 -0
  208. data/sketchup-sdk-win/headers/SketchUpAPI/model/line_styles.h +81 -0
  209. data/sketchup-sdk-win/headers/SketchUpAPI/model/location.h +65 -0
  210. data/sketchup-sdk-win/headers/SketchUpAPI/model/loop.h +182 -0
  211. data/sketchup-sdk-win/headers/SketchUpAPI/model/material.h +390 -0
  212. data/sketchup-sdk-win/headers/SketchUpAPI/model/mesh_helper.h +187 -0
  213. data/sketchup-sdk-win/headers/SketchUpAPI/model/model.h +1663 -0
  214. data/sketchup-sdk-win/headers/SketchUpAPI/model/model_version.h +49 -0
  215. data/sketchup-sdk-win/headers/SketchUpAPI/model/opening.h +72 -0
  216. data/sketchup-sdk-win/headers/SketchUpAPI/model/options_manager.h +79 -0
  217. data/sketchup-sdk-win/headers/SketchUpAPI/model/options_provider.h +166 -0
  218. data/sketchup-sdk-win/headers/SketchUpAPI/model/polyline3d.h +140 -0
  219. data/sketchup-sdk-win/headers/SketchUpAPI/model/rendering_options.h +179 -0
  220. data/sketchup-sdk-win/headers/SketchUpAPI/model/scene.h +836 -0
  221. data/sketchup-sdk-win/headers/SketchUpAPI/model/schema.h +56 -0
  222. data/sketchup-sdk-win/headers/SketchUpAPI/model/schema_type.h +26 -0
  223. data/sketchup-sdk-win/headers/SketchUpAPI/model/section_plane.h +212 -0
  224. data/sketchup-sdk-win/headers/SketchUpAPI/model/selection.h +156 -0
  225. data/sketchup-sdk-win/headers/SketchUpAPI/model/shadow_info.h +147 -0
  226. data/sketchup-sdk-win/headers/SketchUpAPI/model/skp.h +45 -0
  227. data/sketchup-sdk-win/headers/SketchUpAPI/model/style.h +303 -0
  228. data/sketchup-sdk-win/headers/SketchUpAPI/model/styles.h +190 -0
  229. data/sketchup-sdk-win/headers/SketchUpAPI/model/text.h +384 -0
  230. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture.h +358 -0
  231. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture_writer.h +280 -0
  232. data/sketchup-sdk-win/headers/SketchUpAPI/model/typed_value.h +390 -0
  233. data/sketchup-sdk-win/headers/SketchUpAPI/model/uv_helper.h +79 -0
  234. data/sketchup-sdk-win/headers/SketchUpAPI/model/vertex.h +154 -0
  235. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup.h +122 -0
  236. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup_info.h +65 -0
  237. data/sketchup-sdk-win/headers/SketchUpAPI/slapi.h +16 -0
  238. data/sketchup-sdk-win/headers/SketchUpAPI/transformation.h +16 -0
  239. data/sketchup-sdk-win/headers/SketchUpAPI/unicodestring.h +239 -0
  240. data/sketchup-sdk-win/headers/SketchUpAPI/utils/math_helpers.h +124 -0
  241. metadata +313 -0
@@ -0,0 +1,358 @@
1
+ // Copyright 2013 Trimble Inc. All Rights Reserved.
2
+
3
+ /**
4
+ * @file
5
+ * @brief Interfaces for SUTextureRef.
6
+ */
7
+ #ifndef SKETCHUP_MODEL_TEXTURE_H_
8
+ #define SKETCHUP_MODEL_TEXTURE_H_
9
+
10
+ #include <stddef.h>
11
+ #include <SketchUpAPI/color.h>
12
+ #include <SketchUpAPI/unicodestring.h>
13
+ #include <SketchUpAPI/model/defs.h>
14
+
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+
19
+ /**
20
+ @struct SUTextureRef
21
+ @extends SUEntityRef
22
+ @brief Used to manage image data that can be associated with any \ref
23
+ SUEntityRef.
24
+ */
25
+
26
+ /**
27
+ @brief Converts from an \ref SUTextureRef to an \ref SUEntityRef. This is
28
+ essentially an upcast operation.
29
+ @param[in] texture The texture reference.
30
+ @related SUTextureRef
31
+ @return
32
+ - The converted \ref SUEntityRef if texture is a valid object. If not, the
33
+ returned reference will be invalid.
34
+ */
35
+ SU_EXPORT SUEntityRef SUTextureToEntity(SUTextureRef texture);
36
+
37
+ /**
38
+ @brief Converts from an \ref SUEntityRef to an \ref SUTextureRef. This is
39
+ essentially a downcast operation so the given \ref SUEntityRef must be
40
+ convertible to an \ref SUTextureRef.
41
+ @param[in] entity The entity reference.
42
+ @related SUTextureRef
43
+ @return
44
+ - The converted \ref SUTextureRef if the downcast operation succeeds. If
45
+ not, the returned reference will be invalid.
46
+ */
47
+ SU_EXPORT SUTextureRef SUTextureFromEntity(SUEntityRef entity);
48
+
49
+ /**
50
+ @brief Creates a new texture object with the specified image data. If the
51
+ texture object is not subsequently associated with a parent object (e.g.
52
+ material), then the texture object must be deallocated with \ref
53
+ SUTextureRelease.
54
+ @deprecated Will be removed in the next version of the SketchUp API. The
55
+ functionality is replaced by SUImageRepSetData() followed by
56
+ SUTextureCreateFromImageRep().
57
+ @param[out] texture The texture object created.
58
+ @param[in] width The width in pixels of the texture data.
59
+ @param[in] height The height in pixels of the texture data.
60
+ @param[in] bits_per_pixel The number of bits per pixel of the image data.
61
+ @param[in] pixel_data The source of the pixel data.
62
+ @related SUTextureRef
63
+ @return
64
+ - \ref SU_ERROR_NONE on success
65
+ - \ref SU_ERROR_NULL_POINTER_INPUT if pixels is NULL
66
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT texture is NULL
67
+ - \ref SU_ERROR_OVERWRITE_VALID if texture already references a valid object
68
+ */
69
+ SU_DEPRECATED_FUNCTION("SketchUp API 5.0")
70
+ SU_RESULT SUTextureCreateFromImageData(
71
+ SUTextureRef* texture, size_t width, size_t height, size_t bits_per_pixel,
72
+ const SUByte pixel_data[]);
73
+
74
+ /**
75
+ @brief Creates a new texture object from an image representation object.
76
+ @since SketchUp 2017, API 5.0
77
+ @param[out] texture The texture object created.
78
+ @param[in] image The image retrieved.
79
+ @related SUTextureRef
80
+ @return
81
+ - \ref SU_ERROR_NONE on success
82
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if texture is NULL
83
+ - \ref SU_ERROR_OVERWRITE_VALID if texture already references a valid object
84
+ - \ref SU_ERROR_INVALID_INPUT if image is not a valid object
85
+ - \ref SU_ERROR_NO_DATA if the image contains no data
86
+ */
87
+ SU_RESULT SUTextureCreateFromImageRep(SUTextureRef* texture, SUImageRepRef image);
88
+
89
+ /**
90
+ @brief Creates a new texture object from an image file specified by a path.
91
+ If the texture object is not subsequently associated with a parent
92
+ object (e.g. material), then the texture object must be deallocated with
93
+ SUTextureRelease.
94
+ @param[out] texture The texture object created.
95
+ @param[in] file_path The file path of the source image file. Assumed to be
96
+ UTF-8 encoded.
97
+ @param[in] s_scale The scale factor for s coordinate value.
98
+ @param[in] t_scale The scale factor for t coordinate value.
99
+ @related SUTextureRef
100
+ @return
101
+ - \ref SU_ERROR_NONE on success
102
+ - \ref SU_ERROR_NULL_POINTER_INPUT if file_path is NULL
103
+ - \ref SU_ERROR_SERIALIZATION if the image file could not be opened
104
+ - \ref SU_ERROR_GENERIC if a texture could not be created from the image file
105
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if texture is NULL
106
+ - \ref SU_ERROR_OVERWRITE_VALID is texture already references a valid object
107
+ */
108
+ SU_RESULT SUTextureCreateFromFile(
109
+ SUTextureRef* texture, const char* file_path, double s_scale, double t_scale);
110
+
111
+ /**
112
+ @brief Deallocates a texture object and its resources. If the texture object
113
+ is associated with a parent object (e.g. material) the parent object
114
+ handles the deallocation of the resources of the texture object and the
115
+ texture object must not be explicitly deallocated.
116
+ @param[in] texture The texture object to deallocate.
117
+ @related SUTextureRef
118
+ @return
119
+ - \ref SU_ERROR_NONE on success
120
+ - \ref SU_ERROR_NULL_POINTER_INPUT if texture is NULL
121
+ - \ref SU_ERROR_INVALID_INPUT if texture does not refer to a valid object
122
+ */
123
+ SU_RESULT SUTextureRelease(SUTextureRef* texture);
124
+
125
+ /**
126
+ @brief Retrieves the pixel width, height, and scale factors of the texture.
127
+ The s_scale and t_scale values are useful when a face doesn't have a
128
+ material applied directly, but instead inherit from a parent group or
129
+ component instance. Then you want use these values to multiply the
130
+ result of SUMeshHelperGetFrontSTQCoords() or SUUVHelperGetFrontUVQ().
131
+ If the material is applied directly then this would not be needed.
132
+ @param[in] texture The texture object whose dimensions are retrieved.
133
+ @param[out] width The width in pixels.
134
+ @param[out] height The height in pixels.
135
+ @param[out] s_scale The s coordinate scale factor to map a pixel into model
136
+ coordinates.
137
+ @param[out] t_scale The t coordinate scale factor to map a pixel into model
138
+ coordinates.
139
+ @related SUTextureRef
140
+ @return
141
+ - \ref SU_ERROR_NONE on success
142
+ - \ref SU_ERROR_INVALID_INPUT if texture is an invalid object
143
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if width, height, s_scale, or t_scale is
144
+ NULL
145
+ */
146
+ SU_RESULT SUTextureGetDimensions(
147
+ SUTextureRef texture, size_t* width, size_t* height, double* s_scale, double* t_scale);
148
+
149
+ /**
150
+ @brief Returns the total size and bits-per-pixel value of a texture's image
151
+ data. This function is useful to determine the size of the buffer
152
+ necessary to be passed into \ref SUTextureGetImageData(). The returned
153
+ data can be used along with the returned bits-per-pixel value and the
154
+ texture dimensions to compute RGBA values at individual pixels of the
155
+ texture image.
156
+ @deprecated Will be removed in the next version of the SketchUp API. The
157
+ functionality is replaced by SUTextureGetImageRep followed by
158
+ SUImageRepGetImageDataSize.
159
+ @param[in] texture The texture object.
160
+ @param[out] data_size The total size of the image data in bytes.
161
+ @param[out] bits_per_pixel The number of bits per pixel of the image data.
162
+ @related SUTextureRef
163
+ @return
164
+ - \ref SU_ERROR_NONE on success
165
+ - \ref SU_ERROR_INVALID_INPUT if texture is an invalid object
166
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if data_size or bits_per_pixel is NULL
167
+ */
168
+ SU_DEPRECATED_FUNCTION("SketchUp API 5.0")
169
+ SU_RESULT SUTextureGetImageDataSize(
170
+ SUTextureRef texture, size_t* data_size, size_t* bits_per_pixel);
171
+
172
+ /**
173
+ @brief Returns the texture's image data. The given array must be large enough
174
+ to hold the texture's image data. This size can be obtained by calling
175
+ \ref SUTextureGetImageDataSize().
176
+ @deprecated Will be removed in the next version of the SketchUp API. The
177
+ functionality is replaced by SUTextureGetImageRep followed by
178
+ SUImageRepGetImageData.
179
+ @param[in] texture The texture object.
180
+ @param[in] data_size The size of the byte array.
181
+ @param[out] pixel_data The image data retrieved.
182
+ @related SUTextureRef
183
+ @return
184
+ - \ref SU_ERROR_NONE on success
185
+ - \ref SU_ERROR_INVALID_INPUT if texture is an invalid object
186
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if pixel_data is NULL
187
+ - \ref SU_ERROR_INSUFFICIENT_SIZE if data_size is insufficient for the image
188
+ data
189
+ */
190
+ SU_DEPRECATED_FUNCTION("SketchUp API 5.0")
191
+ SU_RESULT SUTextureGetImageData(SUTextureRef texture, size_t data_size, SUByte pixel_data[]);
192
+
193
+ /**
194
+ @brief Retrieves a texture's image. The given image object must have been
195
+ constructed using one of the SUImageRepCreate* functions. It must be
196
+ released using SUImageRepRelease(). The difference between this
197
+ function and SUTextureGetColorizedImageRep() is that
198
+ SUTextureGetColorizedImageRep() will retrieve the colorized image
199
+ rep, if the material has been colorized.
200
+ @since SketchUp 2017, API 5.0
201
+ @param[in] texture The texture object.
202
+ @param[out] image The image object retrieved.
203
+ @related SUTextureRef
204
+ @return
205
+ - \ref SU_ERROR_NONE on success
206
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
207
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if image is NULL
208
+ - \ref SU_ERROR_INVALID_OUTPUT if image does not point to a valid \ref
209
+ SUImageRepRef object
210
+ - \ref SU_ERROR_NO_DATA if no image was created
211
+ */
212
+ SU_RESULT SUTextureGetImageRep(SUTextureRef texture, SUImageRepRef* image);
213
+
214
+ /**
215
+ @brief Writes a texture object as an image to disk. If the material has been
216
+ colorized this will write out a colorized texture.
217
+ Use \ref SUTextureWriteOriginalToFile() to obtain the original texture
218
+ without colorization.
219
+ @param[in] texture The texture object.
220
+ @param[in] file_path The file path destination of the texture image. Assumed to
221
+ be UTF-8 encoded.
222
+ @related SUTextureRef
223
+ @return
224
+ - \ref SU_ERROR_NONE on success
225
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
226
+ - \ref SU_ERROR_NULL_POINTER_INPUT if file_path is NULL
227
+ - \ref SU_ERROR_SERIALIZATION if image file could not be written to disk
228
+ */
229
+ SU_RESULT SUTextureWriteToFile(SUTextureRef texture, const char* file_path);
230
+
231
+ /**
232
+ @brief Sets the image file name string associated with the texture object. If
233
+ the input texture was constructed using \ref SUTextureCreateFromFile the
234
+ name will already be set, so calling this function will override the
235
+ texture's file name string.
236
+ @since SketchUp 2017, API 5.0
237
+ @param[in] texture The texture object.
238
+ @param[in] name The name string to set as the file name.
239
+ Assumed to be UTF-8 encoded.
240
+ @related SUTextureRef
241
+ @return
242
+ - \ref SU_ERROR_NONE on success
243
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
244
+ - \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL
245
+ */
246
+ SU_RESULT SUTextureSetFileName(SUTextureRef texture, const char* name);
247
+
248
+ /**
249
+ @brief Retrieves the image file basename of a texture object. A full path may be
250
+ stored with the texture, but this method will always return a file name
251
+ string with no path. If the texture was created from an
252
+ \ref SUImageRepRef created with SUImageRepLoadFile() then this will
253
+ return only the file extension representing the file format of the image
254
+ data (e.g. ".png").
255
+ @param[in] texture The texture object.
256
+ @param[out] file_name The file name retrieved.
257
+ @related SUTextureRef
258
+ @see SUTextureGetFilePath
259
+ @return
260
+ - \ref SU_ERROR_NONE on success
261
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
262
+ - \ref SU_ERROR_GENERIC if the texture is an unknown file type
263
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if file_name is NULL
264
+ - \ref SU_ERROR_INVALID_OUTPUT if file_name does not point to a valid \ref
265
+ SUStringRef object
266
+ */
267
+ SU_RESULT SUTextureGetFileName(SUTextureRef texture, SUStringRef* file_name);
268
+
269
+ /**
270
+ @brief Retrieves the image file path of a texture object.
271
+
272
+ If the texture was created from an \ref SUImageRepRef created with SUImageRepLoadFile()
273
+ then this will return only the file extension representing the file format of the image
274
+ data (e.g. ".png").
275
+
276
+ @param[in] texture The texture object.
277
+ @param[out] file_path The file path retrieved.
278
+ @related SUTextureRef
279
+ @since SketchUp 2023.1, API 11.1
280
+ @return
281
+ - \ref SU_ERROR_NONE on success
282
+ - \ref SU_ERROR_INVALID_INPUT if \p texture is not a valid object
283
+ - \ref SU_ERROR_GENERIC if the \p texture is an unknown file type
284
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p file_path is NULL
285
+ - \ref SU_ERROR_INVALID_OUTPUT if \p file_path does not point to a valid \ref
286
+ SUStringRef object
287
+ */
288
+ SU_RESULT SUTextureGetFilePath(SUTextureRef texture, SUStringRef* file_path);
289
+
290
+ /**
291
+ @brief Retrieves the value of the flag that indicates whether a texture object
292
+ uses the alpha channel.
293
+ @param[in] texture The texture object.
294
+ @param[out] alpha_channel_used The destination of the retrieved value.
295
+ @related SUTextureRef
296
+ @return
297
+ - \ref SU_ERROR_NONE on success
298
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
299
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if alpha_channel_used is NULL
300
+ - \ref SU_ERROR_NO_DATA if the flag value could not be retrieved
301
+ */
302
+ SU_RESULT SUTextureGetUseAlphaChannel(SUTextureRef texture, bool* alpha_channel_used);
303
+
304
+ /**
305
+ @brief Retrieves the average color for the texture.
306
+ @param[in] texture The texture object
307
+ @param[out] color_val The color object
308
+ @related SUTextureRef
309
+ @return
310
+ - \ref SU_ERROR_NONE on success
311
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
312
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if color_val is NULL
313
+ */
314
+ SU_RESULT SUTextureGetAverageColor(SUTextureRef texture, SUColor* color_val);
315
+
316
+ /**
317
+ @brief Retrieves the image rep object of a colorized texture. If a
318
+ non-colorized texture is used, then the original image rep will be
319
+ retrieved. The difference between this function and
320
+ \ref SUTextureGetImageRep is that \ref SUTextureGetImageRep() will always
321
+ retrieve the original image rep.
322
+ @since SketchUp 2018, API 6.0
323
+ @param[in] texture The texture object.
324
+ @param[out] image_rep The retrieved image rep.
325
+ @related SUTextureRef
326
+ @return
327
+ - \ref SU_ERROR_NONE on success
328
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
329
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if image_rep is NULL
330
+ - \ref SU_ERROR_NO_DATA if no data was retrieved from the texture
331
+ - \ref SU_ERROR_OUT_OF_RANGE if the pixel data is out of range
332
+ */
333
+ SU_RESULT SUTextureGetColorizedImageRep(SUTextureRef texture, SUImageRepRef* image_rep);
334
+
335
+ /**
336
+ @brief Writes a texture object as an image to disk without any colorization.
337
+ If the texture was created from a file on disk this will write out the
338
+ original file data if the provided file extension matches. This will be
339
+ the fastest way to extract the original texture from the model.
340
+ Use SUTextureGetFilename() to obtain the original file format.
341
+ @since SketchUp 2019.2, API 7.1
342
+ @param[in] texture The texture object.
343
+ @param[in] file_path The file path destination of the texture image. Assumed to
344
+ be UTF-8 encoded.
345
+ @related SUTextureRef
346
+ @return
347
+ - \ref SU_ERROR_NONE on success
348
+ - \ref SU_ERROR_INVALID_INPUT if texture is not a valid object
349
+ - \ref SU_ERROR_NULL_POINTER_INPUT if file_path is NULL
350
+ - \ref SU_ERROR_SERIALIZATION if image file could not be written to disk
351
+ */
352
+ SU_RESULT SUTextureWriteOriginalToFile(SUTextureRef texture, const char* file_path);
353
+
354
+ #ifdef __cplusplus
355
+ } // extern "C"
356
+ #endif
357
+
358
+ #endif // SKETCHUP_MODEL_TEXTURE_H_
@@ -0,0 +1,280 @@
1
+ // Copyright 2013 Trimble Inc. All Rights Reserved.
2
+
3
+ /**
4
+ * @file
5
+ * @brief Interfaces for SUTextureWriterRef.
6
+ */
7
+ #ifndef SKETCHUP_MODEL_TEXTURE_WRITER_H_
8
+ #define SKETCHUP_MODEL_TEXTURE_WRITER_H_
9
+
10
+ #include <SketchUpAPI/geometry.h>
11
+ #include <SketchUpAPI/unicodestring.h>
12
+ #include <SketchUpAPI/model/defs.h>
13
+ #include <SketchUpAPI/model/face.h>
14
+
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+
19
+ /**
20
+ @struct SUTextureWriterRef
21
+ @brief Used to write out textures of various SketchUp model elements to local
22
+ disk. For face objects texture writer modifies non-affine textures on
23
+ write so that the resulting texture image can be mapped with
24
+ 2-dimensional texture coordinates. The modified UV coordinates are
25
+ retrieved from a mesh object created with
26
+ SUMeshHelperCreateWithTextureWriter().
27
+ */
28
+
29
+ /**
30
+ @brief Creates a new texture writer object. The texture writer must be
31
+ subsequently deallocated with SUTextureWriterRelease().
32
+ @param[out] writer The created texture writer object.
33
+ @related SUTextureWriterRef
34
+ @return
35
+ - \ref SU_ERROR_NONE on success
36
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if writer is NULL
37
+ */
38
+ SU_RESULT SUTextureWriterCreate(SUTextureWriterRef* writer);
39
+
40
+ /**
41
+ @brief Deallocates a texture writer object.
42
+ @param[in] writer The texture writer object.
43
+ @related SUTextureWriterRef
44
+ @return
45
+ - \ref SU_ERROR_NONE on return
46
+ - \ref SU_ERROR_INVALID_INPUT if writer does not reference a valid object
47
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if writer is NULL
48
+ */
49
+ SU_RESULT SUTextureWriterRelease(SUTextureWriterRef* writer);
50
+
51
+ /**
52
+ @brief Loads an entity to a texture writer object in order to have its texture
53
+ written to disk. Acceptable entity types are:
54
+ \ref SUComponentInstanceRef, \ref SUImageRef, \ref SUGroupRef and
55
+ \ref SULayerRef.
56
+ @param[in] writer The texture writer object.
57
+ @param[in] entity The entity object.
58
+ @param[out] texture_id The id of the texture.
59
+ @related SUTextureWriterRef
60
+ @return
61
+ - \ref SU_ERROR_NONE on success
62
+ - \ref SU_ERROR_INVALID_INPUT if writer or entity is not a valid object
63
+ - \ref SU_ERROR_GENERIC if entity is not one of the acceptable types or there is
64
+ no texture to write
65
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if texture_id is NULL
66
+ */
67
+ SU_RESULT SUTextureWriterLoadEntity(
68
+ SUTextureWriterRef writer, SUEntityRef entity, long* texture_id);
69
+
70
+ /**
71
+ @brief Loads a face object to a texture writer object in order to have its
72
+ front and/or back texture written to local disk.
73
+ @param[in] writer The texture writer object.
74
+ @param[in] face The face object.
75
+ @param[out] front_texture_id The texture ID of the front texture.
76
+ @param[out] back_texture_id The texture ID of the back texture.
77
+ @related SUTextureWriterRef
78
+ @return
79
+ - \ref SU_ERROR_NONE on success
80
+ - \ref SU_ERROR_INVALID_INPUT if writer or face is not a valid object
81
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if the face object has a front face texture
82
+ to write, and front_texture_id is NULL
83
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if the face object has a back face texture
84
+ to write, and back_texture_id is NULL
85
+ - \ref SU_ERROR_GENERIC if the face object does not a texture to write
86
+ */
87
+ SU_RESULT SUTextureWriterLoadFace(
88
+ SUTextureWriterRef writer, SUFaceRef face, long* front_texture_id, long* back_texture_id);
89
+
90
+ /**
91
+ @brief Retrieves the total number of textures that are loaded into the texture
92
+ writer object.
93
+ @param[in] writer The texture writer object.
94
+ @param[out] count The number of textures.
95
+ @related SUTextureWriterRef
96
+ @return
97
+ - \ref SU_ERROR_NONE on success
98
+ - \ref SU_ERROR_INVALID_INPUT if writer is not a valid object
99
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
100
+ */
101
+ SU_RESULT SUTextureWriterGetNumTextures(SUTextureWriterRef writer, size_t* count);
102
+
103
+ /**
104
+ @brief Writes a texture to a file on disk.
105
+ @param[in] writer The texture writer object.
106
+ @param[in] texture_id The id of the texture.
107
+ @param[in] path The file location on disk to write the texture. If a file
108
+ is present at the location it is overwritten. The file
109
+ extension of the file path is indicates the file format.
110
+ The extension must be one of "jpg", "bmp", "tif", or
111
+ "png". Assumed to be UTF-8 encoded.
112
+ @param[in] reduce_size Indicates whether the texture image should be reduced in
113
+ size through scaling.
114
+ @related SUTextureWriterRef
115
+ @return
116
+ - \ref SU_ERROR_NONE on success
117
+ - \ref SU_ERROR_INVALID_INPUT if writer is not a valid object
118
+ - \ref SU_ERROR_NULL_POINTER_INPUT if path is NULL
119
+ - \ref SU_ERROR_SERIALIZATION if a file could not be written to the specified
120
+ location, or if an invalid file format was specified
121
+ */
122
+ SU_RESULT SUTextureWriterWriteTexture(
123
+ SUTextureWriterRef writer, long texture_id, const char* path, bool reduce_size);
124
+
125
+ /**
126
+ @brief Retrieves an image from the given texture_id. The given image
127
+ representation object must have been constructed using one of the
128
+ SUImageRepCreate* functions. It must be released using
129
+ SUImageRepRelease().
130
+ @since SketchUp 2017 M2, API 5.2
131
+ @param[in] writer The texture writer object.
132
+ @param[in] texture_id The id of the texture.
133
+ @param[out] image The image object retrieved.
134
+ @related SUTextureWriterRef
135
+ @return
136
+ - \ref SU_ERROR_NONE on success
137
+ - \ref SU_ERROR_INVALID_INPUT if writer is not a valid object
138
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if image is NULL
139
+ - \ref SU_ERROR_INVALID_OUTPUT if image is not a valid object.
140
+ - \ref SU_ERROR_NO_DATA if there is no texture in the given texture_id.
141
+ */
142
+ SU_RESULT SUTextureWriterGetImageRep(
143
+ SUTextureWriterRef writer, long texture_id, SUImageRepRef* image);
144
+
145
+ /**
146
+ @brief Writes out all the textures loaded into a texture writer object. The
147
+ file names and formats are those of the image file used to create the
148
+ texture. Preexisting files are overwritten.
149
+ @param[in] writer The texture writer object.
150
+ @param[in] directory The directory on disk to write the textures. Assumed to be
151
+ UTF-8 encoded.
152
+ @related SUTextureWriterRef
153
+ @return
154
+ - \ref SU_ERROR_NONE on success
155
+ - \ref SU_ERROR_INVALID_INPUT if writer is not a valid object
156
+ - \ref SU_ERROR_NULL_POINTER_INPUT if directory is NULL
157
+ - \ref SU_ERROR_INVALID_INPUT if directory is not a object
158
+ - \ref SU_ERROR_SERIALIZATION if the textures could not be written to disk
159
+ */
160
+ SU_RESULT SUTextureWriterWriteAllTextures(SUTextureWriterRef writer, const char* directory);
161
+
162
+ /**
163
+ @brief Retrieves a flag indicating whether a texture object loaded into a
164
+ texture writer object is linearly interpolated (affine) or perspective
165
+ corrected.
166
+ @param[in] writer The texture writer object.
167
+ @param[in] texture_id The id of the texture.
168
+ @param[out] is_affine The affine flag retrieved.
169
+ @related SUTextureWriterRef
170
+ @return
171
+ - \ref SU_ERROR_NONE on success
172
+ - \ref SU_ERROR_INVALID_INPUT if writer is not a valid object
173
+ - \ref SU_ERROR_NO_DATA if texture_id is not a handle to a loaded texture object
174
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_affine is NULL
175
+ */
176
+ SU_RESULT SUTextureWriterIsTextureAffine(
177
+ SUTextureWriterRef writer, long texture_id, bool* is_affine);
178
+
179
+ /**
180
+ @brief Retrieves the file path from a texture image written using \ref
181
+ SUTextureWriterWriteAllTextures.
182
+ @param[in] writer The texture writer object.
183
+ @param[in] texture_id The id of the texture.
184
+ @param[out] file_path The file path retrieved.
185
+ @related SUTextureWriterRef
186
+ @return
187
+ - \ref SU_ERROR_NONE on success
188
+ - \ref SU_ERROR_INVALID_INPUT if writer is not a valid object
189
+ - \ref SU_ERROR_NO_DATA if texture_id is not a handle to a loaded and written
190
+ texture object
191
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if file_path is NULL
192
+ - \ref SU_ERROR_INVALID_OUTPUT if file_path does not point to a valid \ref
193
+ SUStringRef object
194
+ */
195
+ SU_RESULT SUTextureWriterGetTextureFilePath(
196
+ SUTextureWriterRef writer, long texture_id, SUStringRef* file_path);
197
+
198
+ /**
199
+ @brief Given an array of vertex positions, retrieves the corresponding UV
200
+ coordinates of the front face texture of a face object that has been
201
+ loaded into the given texture writer object.
202
+ @param[in] writer The texture writer object.
203
+ @param[in] face The face object.
204
+ @param[in] len The number of vertex positions.
205
+ @param[in] points The vertex positions.
206
+ @param[out] uv_coords The UV coordinates retrieved.
207
+ @related SUTextureWriterRef
208
+ @return
209
+ - \ref SU_ERROR_NONE on success
210
+ - \ref SU_ERROR_INVALID_INPUT if writer or face is not a valid object
211
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if uv_coords is NULL
212
+ - \ref SU_ERROR_NO_DATA if the face object does not have a front face texture
213
+ */
214
+ SU_RESULT SUTextureWriterGetFrontFaceUVCoords(
215
+ SUTextureWriterRef writer, SUFaceRef face, size_t len, const struct SUPoint3D points[],
216
+ struct SUPoint2D uv_coords[]);
217
+
218
+ /**
219
+ @brief Given an array of vertex positions, retrieves the corresponding UV
220
+ coordinates of the back face texture of a face object that has been
221
+ loaded into the given texture writer object.
222
+ @param[in] writer The texture writer object.
223
+ @param[in] face The face object.
224
+ @param[in] len The number of vertex positions.
225
+ @param[in] points The vertex positions.
226
+ @param[out] uv_coords The UV coordinates retrieved.
227
+ @related SUTextureWriterRef
228
+ @return
229
+ - \ref SU_ERROR_NONE on success
230
+ - \ref SU_ERROR_INVALID_INPUT if writer or face is not a valid object
231
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if uv_coords is NULL
232
+ - \ref SU_ERROR_NO_DATA if the face object does not have a back face texture
233
+ */
234
+ SU_RESULT SUTextureWriterGetBackFaceUVCoords(
235
+ SUTextureWriterRef writer, SUFaceRef face, size_t len, const struct SUPoint3D points[],
236
+ struct SUPoint2D uv_coords[]);
237
+
238
+ /**
239
+ @brief Gets the texture id of a previously loaded entity. Acceptable entity
240
+ types are: \ref SUComponentInstanceRef, \ref SUImageRef, \ref SUGroupRef
241
+ and \ref SULayerRef.
242
+ @param[in] writer The texture writer object.
243
+ @param[in] entity The entity object.
244
+ @param[out] texture_id The texture id retrieved.
245
+ @related SUTextureWriterRef
246
+ @return
247
+ - \ref SU_ERROR_NONE on success
248
+ - \ref SU_ERROR_INVALID_INPUT if writer or entity is not a valid object
249
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if texture_id is NULL
250
+ - \ref SU_ERROR_GENERIC if the entity is not one of the acceptable types or it
251
+ does not have a previously written texture_id
252
+ */
253
+ SU_RESULT SUTextureWriterGetTextureIdForEntity(
254
+ SUTextureWriterRef writer, SUEntityRef entity, long* texture_id);
255
+
256
+ /**
257
+ @brief Gets the texture id of a previously loaded face.
258
+ @param[in] writer The texture writer object.
259
+ @param[in] face The face object.
260
+ @param[in] front The side of the face we are interested in. True if we want
261
+ texture for the front face, false if we want the texture for
262
+ the back face.
263
+ @param[out] texture_id The texture id retrieved.
264
+ @related SUTextureWriterRef
265
+ @return
266
+ - \ref SU_ERROR_NONE on success
267
+ - \ref SU_ERROR_INVALID_INPUT if writer or face is not a valid object
268
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if the face object has a texture, and
269
+ texture_id is NULL
270
+ - \ref SU_ERROR_GENERIC if the face object does not have a previously written
271
+ texture_id
272
+ */
273
+ SU_RESULT SUTextureWriterGetTextureIdForFace(
274
+ SUTextureWriterRef writer, SUFaceRef face, bool front, long* texture_id);
275
+
276
+ #ifdef __cplusplus
277
+ } // #ifdef __cplusplus
278
+ #endif
279
+
280
+ #endif // SKETCHUP_MODEL_TEXTURE_WRITER_H_